:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #ffffff;
  --canvas: #f8fafc;
  --teal: #0d9488;
  --blue: #3b82f6;
  --amber: #f59e0b;
  --pink: #ec4899;
  --green: #10b981;
  --purple: #8b5cf6;
  --indigo: #6366f1;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --gradient-primary: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #2dd4bf 100%);
  --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

.btn {
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
}

.btn-outline-secondary {
  background: transparent;
  border: 2px solid var(--line);
  color: var(--ink);
}

.btn-outline-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(13, 148, 136, 0.05);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.form-control,
.form-select {
  border-radius: 12px;
  border: 2px solid var(--line);
  min-height: 48px;
  padding: 12px 16px;
  font-size: 15px;
  transition: all 0.3s ease;
  background: var(--paper);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: var(--muted);
}

.auth-body {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(13, 148, 136, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
    linear-gradient(135deg, #f0fdfa 0%, #f0f9ff 50%, #faf5ff 100%);
  min-height: 100vh;
  position: relative;
  overflow-y: auto;
}

.auth-body::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 30s ease-in-out infinite;
}

.auth-body::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 25s ease-in-out infinite reverse;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-shell {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(400px, 0.8fr);
  gap: 32px;
  align-items: stretch;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4);
  }

  50% {
    box-shadow: 0 0 0 20px rgba(13, 148, 136, 0);
  }
}

.login-hero,
.login-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
}

.login-hero:hover,
.login-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(13, 148, 136, 0.25);
}

.login-hero {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 680px;
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.06) 0%, transparent 50%),
    linear-gradient(225deg, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    linear-gradient(315deg, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
    #ffffff;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
}

.login-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

.brand-mark,
.brand-lockup span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: #ffffff;
  background: var(--gradient-primary);
  border-radius: 16px;
  font-weight: 900;
  font-size: 28px;
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.4);
  animation: pulse-glow 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.brand-mark::before {
  content: '+';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  background: var(--amber);
  border-radius: 50%;
  font-size: 16px;
  display: grid;
  place-items: center;
  animation: none;
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

.login-hero h1 {
  margin: 36px 0 20px;
  font-size: 56px;
  line-height: 1.08;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.login-hero p {
  max-width: 540px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  position: relative;
  z-index: 1;
}

.login-stats span {
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-stats span:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--teal);
}

.login-stats strong {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: var(--teal);
  letter-spacing: -0.01em;
}

.login-stats small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-panel {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel h2 {
  margin: 0 0 32px;
  font-size: 36px;
  font-weight: 900;
  color: var(--ink);
  position: relative;
  letter-spacing: -0.02em;
}

.login-panel h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 48px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.check-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 14px;
}

.check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
  cursor: pointer;
}

.demo-logins {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}

.demo-logins h3 {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-logins h3::before {
  content: '👤';
}

.demo-logins div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.demo-logins div:hover {
  background: rgba(15, 118, 110, 0.04);
  transform: translateX(4px);
}

.demo-logins span {
  color: var(--muted);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
}

/* Enhanced form styling for login */
.login-panel .form-control {
  border-radius: 10px;
  border-color: #e2e8f0;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 15px;
  transition: all 0.2s ease;
}

.login-panel .form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.login-panel .form-label {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  font-size: 14px;
}

.login-panel .btn-primary {
  min-height: 48px;
  font-size: 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal) 0%, #0d9488 100%);
  border: none;
  box-shadow: 0 4px 6px -1px rgba(15, 118, 110, 0.3);
  transition: all 0.2s ease;
}

.login-panel .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -2px rgba(15, 118, 110, 0.4);
}

.login-panel .btn-primary:active {
  transform: translateY(0);
}

.text-danger {
  color: #dc2626 !important;
  font-size: 13px;
  margin-top: 6px;
}

.required-asterisk {
  color: #dc2626 !important;
  font-weight: 700;
  margin-left: 2px;
  font-size: inherit;
}

.field-validation-error,
span.field-validation-error,
.field-error-message {
  display: block;
  color: #dc2626 !important;
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 6px;
  line-height: 1.35;
}

.form-control.is-invalid,
.form-select.is-invalid,
textarea.is-invalid,
input.is-invalid,
select.is-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 0.15rem rgba(220, 38, 38, 0.12);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
textarea.is-invalid:focus,
input.is-invalid:focus,
select.is-invalid:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.18);
}

.validation-summary-errors {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 20px;
}

.validation-summary-errors li {
  color: #dc2626;
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  transition: grid-template-columns 0.3s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 80px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  max-width: 100%;
  padding: 14px 12px 12px;
  background: linear-gradient(165deg, var(--sidebar-bg-start, #0f172a) 0%, var(--sidebar-bg-end, #1e293b) 100%);
  color: var(--sidebar-text, #f8fafc);
  border-right: 1px solid var(--sidebar-border, rgba(255, 255, 255, 0.05));
  transition: padding 0.3s ease, background 0.35s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.brand-lockup strong {
  font-size: 14px;
  line-height: 1.3;
  max-width: 170px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-lockup strong small {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}

.brand-text {
  transition: opacity 0.2s ease;
}

.brand-logo {
  width: auto;
  height: 36px;
  max-width: 148px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background: #fff;
  padding: 2px 4px;
}

.brand-logo-login {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 12px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 12px;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.sidebar-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

.app-sidebar.collapsed .brand-text,
.app-sidebar.collapsed .role-panel,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .nav-arrow,
.app-sidebar.collapsed .sidebar-footer,
.app-sidebar.collapsed .side-nav-section-label {
  display: none;
}

.app-sidebar.collapsed .sidebar-header {
  justify-content: center;
}

.app-sidebar.collapsed .brand-lockup {
  justify-content: center;
}

.app-sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px;
}

.app-sidebar.collapsed .nav-submenu-toggle {
  justify-content: center;
  padding: 12px;
}

.app-sidebar.collapsed .nav-submenu-content {
  display: none !important;
}

.nav-submenu {
  margin-top: 6px;
  margin-bottom: 4px;
  min-width: 0;
  max-width: 100%;
}

.nav-submenu-toggle {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 10px;
  background: transparent;
  border: none;
  color: var(--sidebar-text, #fff);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  font-size: 13px;
  font-weight: 600;
  box-sizing: border-box;
  min-width: 0;
  gap: 8px;
  border-radius: 10px;
}

.nav-submenu-toggle:hover {
  background: var(--sidebar-hover, rgba(255, 255, 255, 0.05));
}

.nav-submenu-toggle .nav-icon {
  font-size: 12px;
  margin-right: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--sidebar-icon-bg, rgba(255, 255, 255, 0.08));
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-arrow {
  font-size: 10px;
  transition: transform 0.25s ease;
  margin-left: auto;
  opacity: 0.7;
}

.nav-submenu-toggle[aria-expanded="true"],
.nav-submenu-toggle.active-parent {
  background: var(--sidebar-accent-soft, rgba(255, 255, 255, 0.08));
  color: var(--sidebar-text, #fff);
}

.nav-submenu-toggle.active-parent .nav-icon {
  background: var(--sidebar-accent-soft, rgba(20, 184, 166, 0.25));
  box-shadow: inset 0 0 0 1px var(--sidebar-accent, #14b8a6);
}

.nav-submenu-toggle[aria-expanded="true"] .nav-arrow {
  transform: rotate(180deg);
}

.nav-submenu-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  padding-left: 12px;
  margin-left: 20px;
  border-left: 2px solid var(--sidebar-accent-soft, rgba(255, 255, 255, 0.12));
}

.nav-submenu-content.expanded {
  max-height: 2000px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  color: var(--sidebar-text-muted, rgba(255, 255, 255, 0.8));
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  font-size: 12.5px;
  font-weight: 600;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  gap: 8px;
  margin: 1px 0;
}

.nav-item:hover {
  background: var(--sidebar-hover, rgba(255, 255, 255, 0.05));
  color: var(--sidebar-text, #fff);
}

.nav-item.active {
  color: #fff;
  background: var(--sidebar-active-gradient, var(--gradient-primary));
  box-shadow: 0 4px 14px var(--sidebar-glow, rgba(13, 148, 136, 0.3));
}

.nav-item .nav-icon {
  font-size: 12px;
  margin-right: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--sidebar-icon-bg, rgba(255, 255, 255, 0.06));
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.2);
}

.role-panel {
  margin: 6px 4px 10px;
  padding: 12px;
  border: 1px solid var(--sidebar-border, rgba(255, 255, 255, 0.1));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  min-width: 0;
}

.role-panel-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.role-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  background: var(--sidebar-active-gradient, var(--gradient-primary));
  box-shadow: 0 4px 12px var(--sidebar-glow, rgba(13, 148, 136, 0.35));
  flex-shrink: 0;
}

.role-panel-text {
  min-width: 0;
}

.role-user-name {
  display: block;
  font-size: 12px;
  color: var(--sidebar-text-muted, #94a3b8);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.side-nav-section-label {
  padding: 10px 12px 8px;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted, #94a3b8);
  flex-shrink: 0;
}

.nav-submenu-section {
  padding: 10px 14px 4px;
  margin-top: 2px;
  font-size: 9px;
}

.report-warning {
  margin-bottom: 16px;
  border-radius: 12px;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 12px 6px 4px;
  border-top: 1px solid var(--sidebar-border, rgba(255, 255, 255, 0.08));
}

.theme-picker-label {
  margin-bottom: 10px;
}

.theme-picker-label span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--sidebar-text, #fff);
}

.theme-picker-label small {
  display: block;
  font-size: 11px;
  color: var(--sidebar-text-muted, #94a3b8);
  margin-top: 2px;
  text-transform: none;
  font-weight: 500;
}

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.theme-swatch:hover {
  transform: scale(1.1);
}

.theme-swatch.is-active {
  box-shadow: 0 0 0 2px var(--sidebar-bg-end, #1e293b), 0 0 0 4px #fff;
  transform: scale(1.08);
}

.theme-swatch[data-theme="teal"] { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.theme-swatch[data-theme="blue"] { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.theme-swatch[data-theme="purple"] { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.theme-swatch[data-theme="emerald"] { background: linear-gradient(135deg, #047857, #34d399); }
.theme-swatch[data-theme="rose"] { background: linear-gradient(135deg, #be123c, #fb7185); }
.theme-swatch[data-theme="midnight"] { background: linear-gradient(135deg, #020617, #38bdf8); }
.theme-swatch[data-theme="light"] { background: linear-gradient(135deg, #f8fafc, #cbd5e1); border-color: #94a3b8; }

.theme-swatch-sm {
  width: 22px;
  height: 22px;
}

.settings-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 4px;
}

.settings-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  flex-shrink: 0;
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.theme-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.theme-card.is-active {
  border-color: var(--role-accent, var(--teal));
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.theme-card-swatch {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.theme-card-swatch.theme-teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.theme-card-swatch.theme-blue { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.theme-card-swatch.theme-purple { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.theme-card-swatch.theme-emerald { background: linear-gradient(135deg, #047857, #34d399); }
.theme-card-swatch.theme-rose { background: linear-gradient(135deg, #be123c, #fb7185); }
.theme-card-swatch.theme-midnight { background: linear-gradient(135deg, #020617, #38bdf8); }
.theme-card-swatch.theme-light { background: linear-gradient(135deg, #f8fafc, #cbd5e1); }

.theme-card-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.theme-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.role-panel small,
.topbar span,
.panel-title span,
.permission-title span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
}

.role-panel strong {
  display: block;
  margin-top: 5px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  padding-bottom: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Primary nav block: Dashboard + Master Setup */
.side-nav-primary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 6px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--sidebar-border, rgba(255, 255, 255, 0.1));
}

.side-nav-primary .nav-item {
  margin: 0;
  padding: 9px 12px;
}

.side-nav > .nav-doctor-portal.nav-item,
.side-nav > .nav-patient-portal.nav-item {
  margin-bottom: 12px;
  padding: 9px 12px;
}

.side-nav::-webkit-scrollbar {
  width: 4px;
}

.side-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.nav-section {
  padding: 16px 14px 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--sidebar-text-muted, #cbd5e1);
  text-decoration: none;
  font-weight: 600;
  font-size: 12.5px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  margin: 1px 0;
}

.side-nav a .nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--sidebar-icon-bg, rgba(255, 255, 255, 0.08));
  font-size: 12px;
  flex-shrink: 0;
}

.side-nav a:hover {
  color: var(--sidebar-text, #ffffff);
  background: var(--sidebar-hover, rgba(255, 255, 255, 0.1));
}

.side-nav a.active {
  color: #ffffff;
  background: var(--sidebar-active-gradient, var(--gradient-primary));
  box-shadow: 0 4px 14px var(--sidebar-glow, rgba(13, 148, 136, 0.3));
}

.side-nav a.active .nav-icon {
  background: rgba(255, 255, 255, 0.2);
}

.nav-icon {
  font-style: normal;
  font-size: 12px;
  width: 16px;
  text-align: center;
}

.nav-icon svg,
.topbar-toggle-icon svg,
.topbar-btn-icon svg,
.dropdown-item-icon svg,
.topbar-profile-chevron svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  flex-shrink: 0;
}

.topbar-toggle-icon svg {
  width: 16px;
  height: 16px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar-leading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
}

.topbar-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.topbar-sidebar-toggle:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: #cbd5e1;
}

.topbar-profile-menu {
  position: relative;
}

.topbar-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-profile-btn:hover,
.topbar-profile-btn.show {
  background: rgba(15, 23, 42, 0.03);
  border-color: #cbd5e1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.topbar-profile-btn::after {
  display: none;
}

.topbar-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.topbar-profile-meta {
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}

.topbar-profile-meta strong {
  font-size: 13px;
  font-weight: 700;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-profile-meta small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.topbar-profile-chevron {
  display: inline-flex;
  color: var(--muted);
  margin-left: 2px;
}

.topbar-profile-dropdown {
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.topbar-profile-dropdown-header {
  padding: 8px 10px 4px;
}

.topbar-profile-dropdown-header strong {
  display: block;
  font-size: 14px;
}

.topbar-profile-dropdown-header span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.topbar-profile-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
}

.topbar-profile-dropdown .dropdown-item:hover {
  background: rgba(15, 23, 42, 0.05);
}

.topbar-logout-item {
  color: #dc2626 !important;
}

.topbar-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar strong {
  display: block;
  margin-top: 2px;
}

.app-container {
  max-width: 1520px;
  padding: 32px;
}

.page-heading,
.dashboard-hero,
.panel,
.kpi-card,
.module-card,
.table-shell,
.form-panel,
.detail-list,
.permission-panel,
.home-actions a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-heading,
.dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  margin-bottom: 28px;
  padding: 32px;
}

.page-heading.compact {
  align-items: center;
}

.page-heading h1,
.dashboard-hero h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 820px;
  margin: 10px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--role-accent, var(--teal));
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.75px;
}

.search-box,
.toolbar,
.actions,
.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hero-ring,
.donut {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(var(--role-accent, var(--teal)) calc(var(--ring, 0) * 1%), #e7edf5 0);
}

.hero-ring span,
.donut span {
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: #ffffff;
  font-size: 26px;
  font-weight: 900;
}

.hero-ring small {
  position: absolute;
  margin-top: 168px;
  color: var(--muted);
  font-weight: 800;
}

/* Dashboard KPI small cards */
.dash-kpi-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dash-kpi-card {
  --kpi-accent: #0d9488;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 14px 14px 14px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dash-kpi-card.tone-blue { --kpi-accent: #3b82f6; }
.dash-kpi-card.tone-green { --kpi-accent: #16a34a; }
.dash-kpi-card.tone-amber { --kpi-accent: #d97706; }
.dash-kpi-card.tone-pink { --kpi-accent: #db2777; }
.dash-kpi-card.tone-teal { --kpi-accent: #0d9488; }
.dash-kpi-card.tone-indigo { --kpi-accent: #4f46e5; }
.dash-kpi-card.tone-purple { --kpi-accent: #7c3aed; }

.dash-kpi-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--kpi-accent) 14%, #fff);
  color: var(--kpi-accent);
  border: 1px solid color-mix(in srgb, var(--kpi-accent) 22%, transparent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.dash-kpi-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-kpi-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-kpi-value {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.dash-kpi-delta {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1200px) {
  .dash-kpi-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dash-kpi-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(var(--kpi-cols, 4), minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: linear-gradient(135deg, var(--paper) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--teal);
  border-radius: 16px 0 0 16px;
}

.kpi-card.blue::before {
  background: var(--blue);
}

.kpi-card.amber::before {
  background: var(--amber);
}

.kpi-card.pink::before {
  background: var(--pink);
}

.kpi-card.green::before {
  background: var(--green);
}

.kpi-card.purple::before {
  background: var(--purple);
}

.kpi-card.indigo::before {
  background: var(--indigo);
}

.kpi-card span,
.kpi-card small {
  color: var(--muted);
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.panel {
  padding: 24px;
  min-height: 300px;
}

.panel-wide {
  grid-column: span 2;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-title strong,
.permission-title strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.line-chart {
  width: 100%;
  height: 180px;
  border-bottom: 1px solid var(--line);
}

.line-chart polyline {
  fill: none;
  stroke: var(--role-accent, var(--teal));
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 6px rgba(13, 148, 136, 0.2));
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.donut-wrap {
  display: grid;
  place-items: center;
  min-height: 150px;
}

.donut {
  --ring: var(--donut);
  background: conic-gradient(var(--amber) calc(var(--donut, 0) * 1%), #e7edf5 0);
}

.status-list,
.work-list,
.shortcut-list,
.rank-bars {
  display: grid;
  gap: 10px;
}

.status-list div {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
}

.status-list i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--segment-color);
}

.status-list span,
.work-item small,
.shortcut-list small,
.shortcut-list span {
  color: var(--muted);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  height: 210px;
}

.bar-chart div {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  height: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bar-chart span {
  align-self: end;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--blue), #7c3aed);
}

.rank-bars div {
  display: grid;
  grid-template-columns: 118px 1fr 36px;
  gap: 10px;
  align-items: center;
}

.rank-bars label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rank-bars span {
  height: 10px;
  border-radius: 99px;
  background: #e7edf5;
  overflow: hidden;
}

.rank-bars i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--role-accent, var(--teal));
}

.work-item,
.shortcut-list a {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid #e7edf5;
  border-radius: 7px;
  text-decoration: none;
}

.work-item:hover,
.shortcut-list a:hover {
  border-color: var(--role-accent, var(--teal));
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  font-size: 30px;
  font-weight: 900;
}

.metric label,
.module-card p,
.row-note {
  color: var(--muted);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.module-card {
  padding: 18px;
  box-shadow: none;
}

.module-card__top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.module-card h2 {
  margin: 14px 0 8px;
  min-height: 52px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 900;
}

.table-shell,
.permission-panel {
  overflow: hidden;
}

.table {
  margin-bottom: 0;
}

.table-shell {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table th {
  color: #475569;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.table td,
.table th {
  padding: 16px 18px;
  vertical-align: middle;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background: rgba(13, 148, 136, 0.03);
}

/* Responsive Table Styles */
@media (max-width: 768px) {
  .table-shell {
    border-radius: 12px;
    border: 1px solid var(--line);
  }

  .table {
    min-width: 600px;
  }

  .table th,
  .table td {
    padding: 12px 14px;
    font-size: 14px;
  }

  .table th {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .table {
    min-width: 500px;
  }

  .table th,
  .table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .table th {
    font-size: 10px;
  }
}

.status-pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 99px;
  color: #075985;
  background: #e0f2fe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25px;
}

.form-panel {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.form-grid-compact {
  gap: 12px 14px;
}

.form-grid-compact .form-label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
}

.opd-booking-form .form-control,
.opd-booking-form .form-select {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.opd-booking-form textarea.form-control {
  min-height: 64px;
}

.doctor-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.doctor-role-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
}

.opd-section-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.opd-section-head {
  margin-bottom: 10px;
}

.opd-section-head span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.opd-section-head strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.opd-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 220px;
}

@media (max-width: 900px) {
  .doctor-role-grid {
    grid-template-columns: 1fr;
  }
}

.full-span {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.danger-actions {
  justify-content: flex-start;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.detail-list div {
  padding: 20px;
  background: var(--paper);
  transition: all 0.2s ease;
}

.detail-list div:hover {
  background: rgba(13, 148, 136, 0.02);
}

.detail-list span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-list strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  font-weight: 700;
}

.module-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.module-tabs a {
  white-space: nowrap;
  text-decoration: none;
  color: #475569;
  border: 2px solid #cbd5e1;
  border-radius: 99px;
  padding: 10px 18px;
  background: var(--paper);
  font-weight: 700;
  transition: all 0.3s ease;
}

.module-tabs a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.module-tabs a.active {
  color: #ffffff;
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-actions a {
  display: block;
  padding: 28px;
  color: inherit;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-actions a:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.home-actions strong,
.home-actions span {
  display: block;
}

.home-actions strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.home-actions span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.permission-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.permission-table {
  max-height: 68vh;
  overflow: auto;
}

.permission-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--role-accent, var(--teal));
  cursor: pointer;
}

.alert {
  border-radius: 12px;
  padding: 16px 20px;
  font-weight: 600;
}

/* Page Actions */
.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.page-actions .dropdown .btn-outline-secondary {
  background: var(--paper);
  border: 2px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  padding: 10px 18px;
}

.page-actions .dropdown .btn-outline-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(13, 148, 136, 0.05);
  transform: translateY(-1px);
}

.page-actions .dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 260px;
}

.page-actions .dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.page-actions .dropdown-item:hover {
  background: rgba(13, 148, 136, 0.08);
  color: var(--teal);
}

.page-actions .dropdown-divider {
  margin: 6px 8px;
  border-color: var(--line);
  opacity: 0.6;
}

/* Quick Actions Grid (legacy + shared) */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.quick-action-card:hover {
  background: rgba(13, 148, 136, 0.06);
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}

.action-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal) 0%, #14b8a6 100%);
  border-radius: 10px;
  flex-shrink: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.action-content {
  min-width: 0;
}

.action-content h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-content p {
  font-size: 12px;
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dashboard — Common daily operations (above bed capacity) */
.dashboard-ops-panel {
  margin-bottom: 16px;
  padding: 18px 20px 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(13, 148, 136, 0.10), transparent 48%),
    radial-gradient(90% 120% at 100% 0%, rgba(59, 130, 246, 0.08), transparent 42%),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.dashboard-ops-title {
  align-items: flex-start;
  margin-bottom: 14px;
}

.dashboard-ops-title strong {
  display: block;
  font-size: 1.15rem;
}

.dashboard-ops-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  max-width: 280px;
}

.daily-ops-primary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.daily-ops-tile {
  --ops-accent: var(--teal);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--ops-accent) 28%, var(--line));
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.daily-ops-tile:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ops-accent) 55%, var(--line));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--ops-accent) 18%, transparent);
}

.daily-ops-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--ops-accent), color-mix(in srgb, var(--ops-accent) 65%, #0f172a));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.daily-ops-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.daily-ops-copy strong {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-ops-copy small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-ops-tile.tone-patient { --ops-accent: #0d9488; }
.daily-ops-tile.tone-appt { --ops-accent: #3b82f6; }
.daily-ops-tile.tone-opd { --ops-accent: #0891b2; }
.daily-ops-tile.tone-ipd { --ops-accent: #6366f1; }
.daily-ops-tile.tone-er { --ops-accent: #e11d48; }
.daily-ops-tile.tone-discharge { --ops-accent: #059669; }

.daily-ops-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.daily-ops-chip {
  --ops-accent: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  background: color-mix(in srgb, var(--ops-accent) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--ops-accent) 22%, var(--line));
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.daily-ops-chip:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--ops-accent) 14%, #fff);
  border-color: color-mix(in srgb, var(--ops-accent) 40%, var(--line));
}

.daily-ops-chip span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ops-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.daily-ops-chip strong {
  font-size: 13px;
  font-weight: 700;
}

.daily-ops-chip.tone-bed { --ops-accent: #0f766e; }
.daily-ops-chip.tone-lab { --ops-accent: #7c3aed; }
.daily-ops-chip.tone-rad { --ops-accent: #2563eb; }
.daily-ops-chip.tone-pharm { --ops-accent: #d97706; }
.daily-ops-chip.tone-bill { --ops-accent: #0d9488; }
.daily-ops-chip.tone-ipd-bill { --ops-accent: #4f46e5; }

@media (max-width: 1200px) {
  .daily-ops-primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-ops-title {
    flex-direction: column;
    gap: 4px;
  }

  .dashboard-ops-hint {
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .daily-ops-primary {
    grid-template-columns: 1fr 1fr;
  }

  .daily-ops-tile {
    min-height: 70px;
    padding: 12px;
  }
}

/* Recent Transactions List */
.recent-transactions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-transactions-list::-webkit-scrollbar {
  width: 6px;
}

.recent-transactions-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.transaction-item:hover {
  background: rgba(13, 148, 136, 0.03);
  border-color: var(--teal);
}

.transaction-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 8px;
  flex-shrink: 0;
}

.transaction-icon.admission {
  background: #ecfdf5;
  color: #047857;
}

.transaction-icon.appointment {
  background: #eff6ff;
  color: #1d4ed8;
}

.transaction-icon.enquiry {
  background: #fef3c7;
  color: #b45309;
}

.transaction-icon.billing {
  background: #fef2f2;
  color: #b91c1c;
}

.transaction-icon.lab {
  background: #f3e8ff;
  color: #7c3aed;
}

.transaction-icon.discharge {
  background: #f0fdf4;
  color: #15803d;
}

.transaction-icon.pharmacy {
  background: #fef3c7;
  color: #b45309;
}

.transaction-icon.surgery {
  background: #fecaca;
  color: #dc2626;
}

.transaction-icon.registration {
  background: #e0f2fe;
  color: #0369a1;
}

.transaction-icon.transfer {
  background: #f3e8ff;
  color: #7c3aed;
}

.transaction-icon.radiology {
  background: #e0f2fe;
  color: #0284c7;
}

.transaction-icon.blood {
  background: #fecaca;
  color: #dc2626;
}

.transaction-icon.emergency {
  background: #fef2f2;
  color: #b91c1c;
}

.transaction-icon.vaccination {
  background: #dbeafe;
  color: #1e40af;
}

.transaction-icon.consultation {
  background: #f0fdf4;
  color: #15803d;
}

.transaction-details {
  flex: 1;
  min-width: 0;
}

.transaction-details strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.transaction-details small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.transaction-time {
  display: inline-block;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

/* Schedule List */
.schedule-list {
  display: grid;
  gap: 10px;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.schedule-item:hover {
  background: rgba(13, 148, 136, 0.03);
  border-color: var(--teal);
}

.schedule-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  min-width: 50px;
}

.schedule-details strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.schedule-details small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

/* Alerts List */
.alerts-list {
  display: grid;
  gap: 10px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.alert-item.critical {
  border-left: 3px solid #dc2626;
  background: #fef2f2;
}

.alert-item.warning {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
}

.alert-item.info {
  border-left: 3px solid #3b82f6;
  background: #eff6ff;
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-details strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.alert-details small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

/* Staff List */
.staff-list {
  display: grid;
  gap: 8px;
}

.staff-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.staff-item:hover {
  background: rgba(13, 148, 136, 0.03);
  border-color: var(--teal);
}

.staff-role {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.staff-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal);
}

.staff-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  background: #dcfce7;
  color: #15803d;
}

/* Doctors List */
.doctors-list {
  display: grid;
  gap: 10px;
}

.doctor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.doctor-item:hover {
  background: rgba(13, 148, 136, 0.03);
  border-color: var(--teal);
}

.doctor-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0f2fe;
  border-radius: 8px;
  flex-shrink: 0;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.doctor-details {
  flex: 1;
  margin-left: 12px;
}

.doctor-details strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.doctor-details small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.doctor-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal);
}

/* Surgeries List */
.surgeries-list {
  display: grid;
  gap: 10px;
}

.surgery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.surgery-item:hover {
  background: rgba(13, 148, 136, 0.03);
  border-color: var(--teal);
}

.surgery-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  min-width: 50px;
}

.surgery-details strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.surgery-details small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

/* Results List */
.results-list {
  display: grid;
  gap: 10px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.result-item:hover {
  background: rgba(13, 148, 136, 0.03);
  border-color: var(--teal);
}

.result-type {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.result-type.lab {
  background: #f3e8ff;
  color: #7c3aed;
}

.result-type.radiology {
  background: #e0f2fe;
  color: #0284c7;
}

.result-details strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.result-details small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

/* Pharmacy Grid */
.pharmacy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 24px;
}

.pharmacy-grid .panel {
  min-height: auto;
}

/* Expiry Badges */
.expiry-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25px;
}

.expiry-badge.critical {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.expiry-badge.warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25px;
}

.status-pill.success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.status-pill.danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Category Pills */
.category-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--muted);
  gap: 12px;
}

.empty-state span {
  font-size: 40px;
  line-height: 1;
}

.empty-state p {
  margin: 0;
  font-weight: 500;
  font-size: 14px;
  max-width: 280px;
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

/* Medicine Name */
.medicine-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

/* Search Box in Panel */
.panel-title .search-box input {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--paper);
  transition: all 0.2s ease;
  width: 220px;
}

.panel-title .search-box input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
  outline: none;
}

@media (max-width: 1100px) {
  .pharmacy-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-wide {
    grid-column: span 2;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
    padding: 40px;
  }

  .login-hero h1 {
    font-size: 42px;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full-span {
    grid-column: span 1;
  }

  .master-setup-grid {
    grid-template-columns: 1fr !important;
  }

  .card-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 720px) {
  html {
    font-size: 14px;
  }

  .app-container,
  .auth-shell {
    padding: 12px;
  }

  .page-heading,
  .dashboard-hero {
    display: grid;
    gap: 16px;
    align-items: start;
    padding: 18px;
  }

  .page-heading h1,
  .dashboard-hero h1 {
    font-size: 1.55rem;
    line-height: 1.25;
  }

  .page-heading .lead,
  .dashboard-hero .lead {
    font-size: 0.92rem;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: rgba(248, 250, 252, 0.92);
  }

  .topbar strong {
    font-size: 0.95rem;
  }

  .topbar-actions {
    gap: 8px;
    flex-shrink: 0;
  }

  .topbar-actions .btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .kpi-grid,
  .dashboard-grid,
  .metric-grid,
  .login-stats,
  .home-actions {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panel-wide {
    grid-column: span 1;
  }

  .panel {
    padding: 16px;
    min-height: auto;
  }

  .panel-title {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .panel-title .toolbar,
  .panel-title .search-box {
    width: 100%;
    flex-wrap: wrap;
  }

  .panel-title .search-box input,
  .panel-title .search-box .form-control,
  .panel-title .search-box .form-select {
    width: 100%;
    min-width: 0;
  }

  .kpi-card {
    padding: 16px 18px;
  }

  .kpi-card strong {
    font-size: 28px;
  }

  .hero-ring {
    width: 88px;
    height: 88px;
    margin: 0 auto;
  }

  .hero-ring span {
    width: 72px;
    height: 72px;
    font-size: 20px;
  }

  .hero-ring small {
    margin-top: 120px;
    font-size: 12px;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quick-action-card {
    padding: 14px;
  }

  .action-icon {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }

  .recent-transactions-list,
  .schedule-list,
  .alerts-list,
  .staff-list,
  .doctors-list,
  .surgeries-list,
  .results-list,
  .work-list {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .module-shortcuts-grid {
    grid-template-columns: 1fr;
  }

  .search-box {
    width: 100%;
  }

  .form-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
  }

  .form-actions .btn {
    width: 100%;
  }

  .btn {
    min-height: 44px;
  }

  .table-shell {
    margin: 0 -4px;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 640px;
  }

  .login-hero {
    min-height: auto;
    padding: 28px 22px;
  }

  .login-hero h1 {
    font-size: 32px;
  }

  .login-panel {
    padding: 24px 18px;
  }

  .demo-logins div {
    padding: 12px;
  }

  /* Mobile Sidebar drawer */
  .app-shell {
    grid-template-columns: 1fr !important;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr !important;
  }

  .app-sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: min(300px, 88vw);
    height: 100vh;
    max-height: 100vh;
    z-index: 1000;
    transition: left 0.28s ease;
    padding: 16px 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
  }

  .app-sidebar.mobile-open {
    left: 0;
  }

  .app-sidebar.collapsed {
    padding: 16px;
  }

  .app-sidebar.collapsed .brand-text,
  .app-sidebar.collapsed .role-panel,
  .app-sidebar.collapsed .nav-label,
  .app-sidebar.collapsed .nav-arrow {
    display: block;
  }

  .app-sidebar.collapsed .sidebar-header {
    justify-content: space-between;
  }

  .app-sidebar.collapsed .brand-lockup {
    justify-content: flex-start;
  }

  .app-sidebar.collapsed .nav-item,
  .app-sidebar.collapsed .nav-submenu-toggle {
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .app-sidebar.collapsed .nav-submenu-content {
    display: block !important;
  }

  .sidebar-toggle {
    display: none;
  }

  .side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .nav-item,
  .nav-submenu-toggle {
    min-height: 44px;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 999;
    backdrop-filter: blur(2px);
  }

  .sidebar-overlay.active {
    display: block;
  }

  body.nav-open {
    overflow: hidden;
  }

  .empty-state {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
  }

  .empty-state strong {
    display: block;
    color: var(--ink);
    margin-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 10px;
  }

  .kpi-card strong {
    font-size: 24px;
  }

  .page-heading h1,
  .dashboard-hero h1 {
    font-size: 1.35rem;
  }

  .table {
    min-width: 520px;
  }

  .table th,
  .table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (min-width: 721px) {
  .sidebar-overlay {
    display: none !important;
  }
}

/* Module shortcuts — row-wise tiles */
.module-shortcuts-panel {
  margin-top: 4px;
}

.module-tile-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.module-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 14px 14px 14px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.module-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 10px 22px rgba(13, 148, 136, 0.12);
}

.module-tile-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #0d9488, #0f766e);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.module-tile-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.module-tile-body small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.module-tile-body strong {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-tile-meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.module-tile-go {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.module-tile:hover .module-tile-go {
  color: var(--teal);
}

/* Legacy class kept for any other views */
.module-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.module-shortcut-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
}

@media (max-width: 1100px) {
  .module-tile-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .module-tile-board {
    grid-template-columns: 1fr;
  }
}

.dashboard-today-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.today-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.today-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.today-chip strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .dashboard-today-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-today-strip {
    grid-template-columns: 1fr 1fr;
  }
}
/* —— Billing filters, actions, forms —— */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.filter-bar-wide {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.filter-field label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-field .form-control,
.filter-field .form-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 14px;
}

.filter-grow {
  grid-column: span 1;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-actions .btn {
  min-height: 44px;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.inline-action-form {
  display: inline;
  margin: 0;
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.btn-outline-primary {
  background: #fff;
  color: var(--teal);
  border: 2px solid rgba(13, 148, 136, 0.35);
}

.btn-outline-primary:hover {
  background: rgba(13, 148, 136, 0.08);
  color: var(--teal);
  border-color: var(--teal);
}

.btn-outline-danger {
  background: #fff;
  color: #b91c1c;
  border: 2px solid #fecaca;
}

.btn-outline-danger:hover {
  background: #fef2f2;
  color: #991b1b;
  border-color: #f87171;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 10px;
}

.status-pill.warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.status-pill.muted {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.billing-items-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.billing-items-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.billing-charge-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(220px, 320px);
  gap: 8px;
  width: min(100%, 560px);
}

.billing-charge-toolbar .form-select {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 14px;
}

.billing-items-list {
  display: grid;
  gap: 10px;
}

.billing-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.4fr) 0.7fr 0.9fr 0.7fr auto;
  gap: 10px;
  align-items: start;
}
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.billing-item-remove {
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

.form-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1100px) {
  .form-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .form-grid-4,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .filter-bar,
  .filter-bar-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
  }

  .billing-item-row {
    grid-template-columns: 1fr 1fr;
  }

  .billing-item-remove {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .filter-bar,
  .filter-bar-wide {
    grid-template-columns: 1fr;
  }

  .billing-charge-toolbar {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .billing-item-row {
    grid-template-columns: 1fr;
  }

  .filter-actions .btn,
  .form-actions .btn {
    width: 100%;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .table-actions .btn {
    width: 100%;
  }
}

/* —— Shared list pagination —— */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid #e7edf5;
  background: #f8fafc;
}

.pagination-meta {
  font-size: 13px;
  color: #64748b;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.page-btn:hover {
  border-color: #1d6fe8;
  color: #1d6fe8;
}

.page-btn.is-current {
  background: #1d6fe8;
  border-color: #1d6fe8;
  color: #fff;
}

.page-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-gap {
  color: #94a3b8;
  padding: 0 2px;
}

.pagination-size {
  display: flex;
  align-items: center;
  margin: 0;
}

.pagination-size label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.pagination-size select {
  height: 34px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
}

.flash-alert {
  margin-bottom: 16px;
}

@media (max-width: 720px) {
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination-controls {
    justify-content: flex-start;
  }
}

/* ===== Reports: toolbar, alignment, print ===== */
.panel.report-filter,
.panel.report-detail {
  min-height: auto;
  margin-bottom: 16px;
}

.report-heading {
  margin-bottom: 12px;
}

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}

.date-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.date-filter-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.date-filter-label .form-control {
  min-width: 150px;
}

.report-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.report-period-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.report-kpi {
  margin-bottom: 16px;
}

.report-kpi .kpi-card strong {
  font-size: clamp(22px, 2.4vw, 32px);
  word-break: break-word;
}

.report-metric-table th,
.report-metric-table td {
  vertical-align: middle;
}

.report-metric-table .report-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.report-grid .panel.report-card {
  min-height: auto;
  margin: 0;
}

.report-card-wide {
  grid-column: span 2;
}

.report-index {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.report-index-group h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
}

.home-actions.report-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-card.red::before {
  background: #dc2626;
}

@media (max-width: 1100px) {
  .home-actions.report-cards,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-card-wide {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .home-actions.report-cards,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-card-wide {
    grid-column: span 1;
  }

  .report-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .date-filter,
  .report-export-actions {
    width: 100%;
  }
}

/* ===== Reports: toolbar, alignment, print ===== */
.panel.report-filter,
.panel.report-detail {
  min-height: auto;
  margin-bottom: 16px;
}

.report-heading {
  margin-bottom: 12px;
}

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}

.date-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.date-filter-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.date-filter-label .form-control {
  min-width: 150px;
}

.report-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.report-period-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.report-kpi {
  margin-bottom: 16px;
}

.report-kpi .kpi-card strong {
  font-size: clamp(22px, 2.4vw, 32px);
  word-break: break-word;
}

.report-metric-table th,
.report-metric-table td {
  vertical-align: middle;
}

.report-metric-table .report-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.report-grid .panel.report-card {
  min-height: auto;
  margin: 0;
}

.report-card-wide {
  grid-column: span 2;
}

.report-index {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.report-index-group h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
}

.home-actions.report-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-card.red::before {
  background: #dc2626;
}

@media (max-width: 1100px) {
  .home-actions.report-cards,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-card-wide {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .home-actions.report-cards,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-card-wide {
    grid-column: span 1;
  }

  .report-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .date-filter,
  .report-export-actions {
    width: 100%;
  }

  .date-filter-label .form-control {
    min-width: 0;
    width: 100%;
  }

  .date-filter .btn,
  .report-export-actions .btn {
    flex: 1;
  }
}

@media print {
  .app-sidebar,
  .topbar,
  .topbar-actions,
  .page-heading,
  .no-print,
  .report-filter,
  .flash-alert,
  .filter-bar,
  .btn,
  .btn-group,
  nav,
  .modal {
    display: none !important;
  }

  .app-shell,
  .app-main,
  .content-area {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  .panel,
  .kpi-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  /* Dedicated print layouts only */
  .final-bill-screen,
  .final-bill-screen * {
    display: none !important;
  }

  .final-bill-print {
    display: block !important;
  }
}

/* ===== Patient search picker ===== */
.patient-search-input-wrap {
  position: relative;
}

.patient-search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  background: var(--paper, #fff);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.patient-search-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: inherit;
}

.patient-search-item:hover,
.patient-search-item.is-active {
  background: rgba(13, 148, 136, 0.1);
}

.patient-search-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

.patient-search-selected.is-empty .patient-uhid-input,
.patient-search-selected.is-empty .patient-name-input,
.patient-search-selected.is-empty .patient-phone-input {
  background: #f8fafc;
}

.patient-search-clear-wrap {
  display: flex;
  flex-direction: column;
}

/* ===== Dashboard bed capacity (vacant / occupied) — full width ===== */
.dashboard-page .bed-capacity-full {
  display: block;
  width: 100%;
  margin: 0 0 16px;
}

.dashboard-page .bed-capacity-full .bed-capacity-panel {
  width: 100%;
  min-height: auto;
}

.dashboard-grid .bed-capacity-panel {
  grid-column: 1 / -1;
  min-height: auto;
}

.bed-capacity-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
}

.bed-capacity-title {
  align-items: center;
}

.dashboard-page .bed-capacity-panel {
  min-height: auto;
}

.dashboard-page .bed-capacity-panel .dash-panel-body,
.dashboard-page .bed-capacity-panel {
  min-height: auto;
}

.bed-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.bed-pill.occupied {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.bed-pill.vacant {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.bed-pill.total {
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink);
}

/* Ward-wise tile board — full-width row (6 wards across on desktop) */
.ward-tile-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.ward-tile {
  --tile-accent: #0d9488;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 148px;
  padding: 16px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.ward-tile:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tile-accent) 45%, var(--line));
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.ward-tile.is-free { --tile-accent: #16a34a; }
.ward-tile.is-partial { --tile-accent: #0d9488; }
.ward-tile.is-busy { --tile-accent: #d97706; }
.ward-tile.is-critical { --tile-accent: #dc2626; }

.ward-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ward-tile-name strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.ward-tile-name small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ward-tile-pct {
  flex-shrink: 0;
  min-width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tile-accent) 12%, #fff);
  color: var(--tile-accent);
  font-size: 14px;
  font-weight: 900;
  border: 1px solid color-mix(in srgb, var(--tile-accent) 22%, transparent);
}

.ward-tile-split {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
}

.ward-tile-split .occ {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  min-width: 0;
}

.ward-tile-split .vac {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  min-width: 0;
}

.ward-tile-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.ward-metric {
  text-align: center;
  padding: 8px 6px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.ward-metric span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.ward-metric strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ward-metric.occ strong { color: #dc2626; }
.ward-metric.vac strong { color: #16a34a; }
.ward-metric.total strong { color: var(--ink); }

.text-occupied { color: #dc2626; }
.text-vacant { color: #16a34a; }

.today-chip-beds strong small {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Legacy selectors */
.bed-capacity-boxes,
.bed-capacity-board,
.bed-capacity-grid { display: none; }

@media (max-width: 1400px) {
  .ward-tile-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ward-tile-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ward-tile-board {
    grid-template-columns: 1fr;
  }
}

/* ===== Bed occupancy board (professional ops UI) ===== */
.occ-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.occ-hero {
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(13, 148, 136, 0.10) 0%, transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow);
}

.occ-hero-main {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.occ-hero h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.occ-hero .lead {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 520px;
}

.occ-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.occ-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.occ-ring {
  --pct: 0;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#dc2626 calc(var(--pct) * 1%), #16a34a 0);
  position: relative;
}

.occ-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fff;
}

.occ-ring strong,
.occ-ring span {
  position: relative;
  z-index: 1;
  text-align: center;
}

.occ-ring strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
}

.occ-ring span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.occ-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  align-items: end;
}

.occ-stat span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.occ-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.occ-stat-occupied strong { color: #dc2626; }
.occ-stat-vacant strong { color: #16a34a; }

.occ-meter {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.18);
  overflow: hidden;
}

.occ-meter-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #dc2626);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.occ-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.occ-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.occ-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.occ-chip:hover {
  border-color: rgba(13, 148, 136, 0.4);
  color: var(--ink);
}

.occ-chip.is-active {
  background: rgba(13, 148, 136, 0.12);
  border-color: rgba(13, 148, 136, 0.45);
  color: #0f766e;
}

.occ-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.occ-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.occ-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.occ-legend-item.vacant i { background: #16a34a; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.occ-legend-item.occupied i { background: #dc2626; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.occ-legend-item.maintenance i { background: #64748b; }

.occ-wards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.occ-ward {
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-sm);
}

.occ-ward-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.occ-ward-title strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.occ-ward-title small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.occ-ward-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.2);
  overflow: hidden;
  margin-bottom: 8px;
}

.occ-ward-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #b91c1c);
  border-radius: 999px;
}

.occ-ward-counts {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.text-occupied { color: #dc2626; }
.text-vacant { color: #16a34a; }

/* Solid green / red bed tiles */
.occ-bed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
}

.occ-bed {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 118px;
  padding: 12px 12px 14px;
  border-radius: 14px;
  border: 2px solid transparent;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  overflow: hidden;
}

.occ-bed::after {
  content: "";
  position: absolute;
  inset: auto -20% -35% auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.occ-bed:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
  filter: brightness(1.03);
}

.occ-bed-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.occ-bed-code {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.occ-bed-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  white-space: nowrap;
}

.occ-bed-no {
  position: relative;
  z-index: 1;
  margin-top: auto;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.occ-bed-patient {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0.95;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.occ-bed.vacant {
  background: linear-gradient(145deg, #22c55e 0%, #16a34a 55%, #15803d 100%);
  border-color: #15803d;
  color: #fff;
}

.occ-bed.occupied {
  background: linear-gradient(145deg, #f87171 0%, #dc2626 55%, #b91c1c 100%);
  border-color: #b91c1c;
  color: #fff;
}

.occ-bed.maintenance {
  background: linear-gradient(145deg, #94a3b8 0%, #64748b 60%, #475569 100%);
  border-color: #475569;
  color: #fff;
}

@media (max-width: 900px) {
  .occ-hero {
    padding: 20px;
  }

  .occ-hero-main,
  .occ-summary,
  .occ-ward-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .occ-hero-main {
    gap: 14px;
  }

  .occ-summary-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .occ-ward-counts {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .occ-hero h1 {
    font-size: 26px;
  }

  .occ-summary-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .occ-stat strong {
    font-size: 22px;
  }

  .occ-bed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* legacy occupancy helpers kept for dashboard pills */
.bed-board-legend { display: none; }
.bed-tile-grid { display: none; }


/* Doctor specialization multi-select */
.specialization-multiselect {
  min-height: 140px;
  padding: 8px;
}

.specialization-multiselect option {
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 2px;
}

.specialization-multiselect option:checked {
  background: linear-gradient(0deg, rgba(13, 148, 136, 0.2), rgba(13, 148, 136, 0.2));
  color: #0f766e;
  font-weight: 700;
}

/* ===== Beginner guide / How it Works ===== */
.login-guide-link {
  text-align: center;
  margin-top: 4px;
}

.login-guide-link a {
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.login-guide-link a:hover {
  text-decoration: underline;
}

.dashboard-guide-hint {
  margin: 12px 0 0;
}

.dashboard-guide-hint a {
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-guide-hint a:hover {
  text-decoration: underline;
}

.guide-page {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px 0 40px;
}

.guide-page-public {
  padding: 24px 16px 48px;
}

.guide-hero {
  padding: 28px 32px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(13, 148, 136, 0.12) 0%, transparent 48%),
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: var(--shadow);
}

.guide-hero h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.guide-hero .lead {
  margin-top: 10px;
  max-width: 640px;
}

.guide-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.guide-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.guide-hero-stats strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
}

.guide-hero-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.guide-kicker {
  display: inline-block;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.guide-demo-card,
.guide-process,
.guide-map,
.guide-seed,
.guide-checklist {
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.guide-demo-card h2,
.guide-section-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
}

.guide-demo-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.guide-demo-meta div {
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.guide-demo-meta dt {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.guide-demo-meta dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.guide-section-head p {
  color: var(--muted);
  margin: 0;
}

.guide-steps {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: none;
}

.guide-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #fff, #fafbfc);
}

.guide-step-num {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
  font-size: 18px;
  font-weight: 900;
}

.guide-step-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.guide-step-top h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.guide-step-body > p {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 14px;
}

.guide-example {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(13, 148, 136, 0.06);
  border: 1px dashed rgba(13, 148, 136, 0.3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-example strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f766e;
}

.guide-example span {
  font-size: 13px;
  font-weight: 600;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.1);
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.guide-link:hover {
  background: rgba(13, 148, 136, 0.18);
}

.guide-link-inline {
  display: inline-block;
  margin-top: 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.guide-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.guide-map-grid article {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.guide-map-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
}

.guide-map-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.guide-map-grid li {
  margin-bottom: 6px;
}

.guide-code {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.guide-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.guide-checks {
  margin: 14px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.guide-checks li {
  position: relative;
  padding: 12px 14px 12px 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}

.guide-checks li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid rgba(13, 148, 136, 0.55);
  background: rgba(13, 148, 136, 0.08);
}

.guide-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 800px) {
  .guide-hero {
    padding: 20px;
  }

  .guide-hero h1 {
    font-size: 26px;
  }

  .guide-hero-stats,
  .guide-demo-meta,
  .guide-map-grid {
    grid-template-columns: 1fr;
  }

  .guide-step {
    grid-template-columns: 40px 1fr;
  }
}
