html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #243042;
}

.app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #10263f;
  color: #fff;
  padding: 22px 16px;
  box-shadow: 12px 0 30px rgba(16, 38, 63, 0.12);
  z-index: 10;
}

.sidebar-brand {
  display: block;
  text-decoration: none;
  padding: 4px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 14px;
}

.sidebar-brand img {
  display: block;
  width: 100%;
  max-height: 48px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.14));
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-nav a,
.sidebar-user a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.2;
}

.sidebar-nav a:hover,
.sidebar-user a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-user {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  gap: 6px;
}

.sidebar-user span {
  color: rgba(255, 255, 255, 0.72);
  padding: 0 12px;
  font-size: 0.92rem;
}

.main-panel {
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e3e7ef;
  backdrop-filter: blur(10px);
}

.app-topbar strong,
.app-topbar span {
  display: block;
  line-height: 1.2;
}

.app-topbar span {
  color: #64748b;
  font-size: 0.9rem;
}

.hamburger-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-content: center;
  gap: 5px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #fff;
  padding: 0;
}

.hamburger-button span {
  width: 20px;
  height: 2px;
  background: #10263f;
  border-radius: 999px;
}

.authenticated-layout {
  display: block;
}

.authenticated-layout .sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 290px;
  transform: translateX(-102%);
  transition: transform 180ms ease;
}

.authenticated-layout.menu-open .sidebar {
  transform: translateX(0);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: none;
  border: 0;
  background: rgba(15, 23, 42, 0.42);
  padding: 0;
}

.authenticated-layout.menu-open .menu-backdrop {
  display: block;
}

.authenticated-layout .content-shell {
  padding-top: 24px;
}

.content-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

.visual-screen,
.visual-dashboard {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background-image:
    linear-gradient(110deg, rgba(8, 34, 57, 0.78), rgba(13, 110, 253, 0.38), rgba(255, 255, 255, 0.52)),
    url("/images/medical-field-bg.png");
  background-size: cover;
  background-position: center;
  color: #fff;
}

.visual-screen {
  min-height: calc(100vh - 190px);
  display: grid;
  align-items: center;
  padding: clamp(28px, 6vw, 72px);
}

.visual-dashboard {
  min-height: 260px;
  padding: clamp(24px, 4vw, 48px);
  margin-bottom: 24px;
}

.visual-screen h1,
.visual-dashboard h1,
.visual-screen p,
.visual-dashboard p {
  color: #fff;
  text-shadow: 0 1px 16px rgba(8, 34, 57, 0.25);
}

.visual-panel {
  max-width: 560px;
  background: rgba(255, 255, 255, 0.92);
  color: #243042;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 34px);
  box-shadow: 0 18px 45px rgba(8, 34, 57, 0.2);
  backdrop-filter: blur(8px);
}

.visual-panel h1,
.visual-panel p {
  color: #243042;
  text-shadow: none;
}

.panel-logo {
  display: block;
  width: min(100%, 260px);
  max-height: 54px;
  object-fit: contain;
  margin-bottom: 20px;
}

.chooser-panel {
  margin: 0 auto;
  text-align: center;
}

.chooser-panel .panel-logo {
  margin-left: auto;
  margin-right: auto;
}

.login-panel .panel-logo {
  margin-left: auto;
  margin-right: auto;
}

.chooser-panel .action-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.chooser-panel .btn-primary {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.chooser-panel .btn-primary:hover {
  background: #115e59;
  border-color: #115e59;
}

.chooser-panel .btn-outline-primary {
  color: #10263f;
  border-color: #8bb9b3;
  background: rgba(255, 255, 255, 0.68);
}

.chooser-panel .btn-outline-primary:hover {
  color: #fff;
  background: #10263f;
  border-color: #10263f;
}

.login-panel {
  margin: 0 auto;
  width: min(100%, 640px);
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-shell {
  background: #fff;
  border: 1px solid #e3e7ef;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 8px 22px rgba(36, 48, 66, 0.06);
}

.action-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric {
  background: #fff;
  border: 1px solid #e3e7ef;
  border-radius: 8px;
  padding: 18px;
}

.metric strong {
  display: block;
  font-size: 1.7rem;
  color: #0d6efd;
}

.table {
  background: #fff;
}

@media (max-width: 767.98px) {
  .app-frame:not(.authenticated-layout) {
    display: block;
  }

  .app-frame:not(.authenticated-layout) .sidebar {
    position: relative;
    height: auto;
    padding: 16px;
  }

  .app-frame:not(.authenticated-layout) .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    overflow: visible;
  }

  .sidebar-user {
    margin-top: 14px;
  }

  .app-topbar {
    padding: 10px 16px;
  }

  .authenticated-layout .sidebar {
    width: min(86vw, 290px);
  }

  .content-shell {
    padding: 16px;
  }

  .visual-screen {
    min-height: calc(100vh - 150px);
    padding: 20px;
  }

  .login-panel {
    margin: 0;
  }
}
