/* ==========================================================================
   Domina Polyclinic Management System — Design System
   Primary: #0b1f3a | Accent: #d4a017 | Background: #f7f8fa
   ========================================================================== */

:root {
  --primary: #0b1f3a;
  --primary-600: #0e2748;
  --primary-700: #071628;
  --primary-rgb: 11, 31, 58;
  --secondary: #d4a017;
  --secondary-600: #b8870f;
  --secondary-rgb: 212, 160, 23;
  --background: #f7f8fa;
  --surface: #ffffff;
  --text: #1d2733;
  --text-muted: #6b7785;
  --border: #e4e8ee;
  --border-strong: #d0d7e0;
  --success: #1f8a4c;
  --success-bg: #e8f7ee;
  --warning: #c47f00;
  --warning-bg: #fff6e5;
  --danger: #c62828;
  --danger-bg: #fdecea;
  --info: #1565c0;
  --info-bg: #e8f1fb;
  --sidebar-width: 260px;
  --sidebar-collapsed: 76px;
  --topbar-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 31, 58, 0.04), 0 4px 16px rgba(11, 31, 58, 0.06);
  --shadow-lg: 0 8px 30px rgba(11, 31, 58, 0.12);
  --font: "Plus Jakarta Sans", Arial, sans-serif;
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--secondary-600);
}

img {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--background);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-700) 100%);
  color: #fff;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: width var(--transition), transform var(--transition);
  box-shadow: 4px 0 24px rgba(11, 31, 58, 0.18);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: var(--topbar-height);
}

.sidebar-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--secondary);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  overflow: hidden;
}
.sidebar-brand-text strong {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}
.sidebar-brand-text span {
  font-size: 0.72rem;
  opacity: 0.7;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem 1.5rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}
.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none; /* Chrome, Safari, Edge */
}

.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  padding: 0.75rem 0.85rem 0.35rem;
  font-weight: 600;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.78);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.2rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.sidebar-nav .nav-link i {
  font-size: 1.15rem;
  width: 1.35rem;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.sidebar-nav .nav-link.active {
  background: rgba(212, 160, 23, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--secondary);
}
.sidebar-nav .nav-link .nav-label {
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-footer {
  padding: 0.85rem 1rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-sidebar-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.btn-sidebar-toggle:hover {
  border-color: var(--secondary);
  color: var(--secondary-600);
}

.topbar-search {
  position: relative;
  min-width: 220px;
  max-width: 380px;
  width: 100%;
}
.topbar-search i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.topbar-search input {
  width: 100%;
  padding: 0.55rem 0.9rem 0.55rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--background);
  font-size: 0.9rem;
}
.topbar-search input:focus {
  outline: none;
  border-color: rgba(var(--secondary-rgb), 0.7);
  box-shadow: 0 0 0 3px rgba(var(--secondary-rgb), 0.15);
  background: #fff;
}

.content-area {
  padding: 1.35rem 1.35rem 2rem;
  flex: 1;
}

/* Collapsed sidebar (desktop) */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-footer {
  display: none;
}
body.sidebar-collapsed .sidebar-nav .nav-link {
  justify-content: center;
  padding: 0.75rem;
}
body.sidebar-collapsed .app-main {
  margin-left: var(--sidebar-collapsed);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.45);
  z-index: 1035;
}

/* --------------------------------------------------------------------------
   Page headers & cards
   -------------------------------------------------------------------------- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-header h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.page-header .page-subtitle {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card-header {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-header h2,
.card-header h3,
.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}
.card-body {
  padding: 1.15rem;
}
.card-footer {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  height: 100%;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -12px;
  top: -12px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(var(--secondary-rgb), 0.12);
}
.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.stat-card .stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-card .stat-meta {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
.stat-card.accent .stat-icon {
  background: rgba(var(--secondary-rgb), 0.15);
  color: var(--secondary-600);
}

.report-card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  height: 100%;
  color: inherit;
}
.report-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--secondary-rgb), 0.5);
  box-shadow: var(--shadow-lg);
  color: inherit;
}
.report-card i {
  font-size: 1.5rem;
  color: var(--secondary);
  margin-bottom: 0.65rem;
  display: block;
}
.report-card h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  color: var(--primary);
}
.report-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  font-family: var(--font);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn-sm {
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}
.btn-lg {
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  font-size: 0.95rem;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #fff;
}
.btn-secondary,
.btn-accent {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--primary);
}
.btn-secondary:hover,
.btn-accent:hover {
  background: var(--secondary-600);
  border-color: var(--secondary-600);
  color: #fff;
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--border-strong);
  background: #fff;
}
.btn-outline-primary:hover {
  background: rgba(var(--primary-rgb), 0.05);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-secondary {
  color: var(--secondary-600);
  border-color: rgba(var(--secondary-rgb), 0.45);
  background: #fff;
}
.btn-outline-secondary:hover {
  background: rgba(var(--secondary-rgb), 0.1);
  color: var(--secondary-600);
}
.btn-success {
  background: var(--success);
  border-color: var(--success);
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
}
.btn-warning {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--primary);
}
.btn-light {
  background: var(--background);
  border-color: var(--border);
  color: var(--text);
}
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}
.btn .spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.form-control,
.form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 42px;
  font-size: 0.9rem;
  color: var(--text);
  background: #fff;
  padding: 0.5rem 0.85rem;
}
.form-control:focus,
.form-select:focus {
  border-color: rgba(var(--secondary-rgb), 0.7);
  box-shadow: 0 0 0 3px rgba(var(--secondary-rgb), 0.15);
}
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--danger);
}
.form-text {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.input-group-text {
  background: var(--background);
  border-color: var(--border);
  color: var(--text-muted);
}
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}
.required::after {
  content: " *";
  color: var(--danger);
}

.form-section {
  margin-bottom: 1.5rem;
}
.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  margin-bottom: 0;
  font-size: 0.875rem;
  vertical-align: middle;
}
.table thead th {
  background: #f3f5f8;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding: 0.75rem 1rem;
}
.table tbody td {
  padding: 0.8rem 1rem;
  border-color: var(--border);
  color: var(--text);
}
.table-hover tbody tr:hover {
  background: rgba(var(--primary-rgb), 0.03);
}
.table-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 2.2rem;
  color: rgba(var(--primary-rgb), 0.25);
  display: block;
  margin-bottom: 0.75rem;
}
.empty-state h4 {
  color: var(--primary);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   Badges & status
   -------------------------------------------------------------------------- */
.badge {
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.35em 0.65em;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.badge-primary { background: rgba(var(--primary-rgb), 0.12); color: var(--primary); }
.badge-secondary { background: #eef1f5; color: #526070; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-dark { background: #2c3a4a; color: #fff; }

.priority-emergency,
.priority-urgent {
  color: var(--danger);
  font-weight: 700;
}
.priority-normal {
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Allergy alert
   -------------------------------------------------------------------------- */
.allergy-banner {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: linear-gradient(90deg, #fdecea 0%, #fff5f4 100%);
  border: 1px solid #f5c2c0;
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  color: #7a1c1c;
}
.allergy-banner i {
  font-size: 1.35rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.allergy-banner strong {
  display: block;
  margin-bottom: 0.15rem;
}
.allergy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.allergy-chip {
  background: #fff;
  border: 1px solid #f0b4b2;
  color: #9a1f1f;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Queue
   -------------------------------------------------------------------------- */
.queue-board {
  display: grid;
  gap: 0.75rem;
}
.queue-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.queue-item:hover {
  border-color: rgba(var(--secondary-rgb), 0.45);
  box-shadow: var(--shadow);
}
.queue-item.priority-emergency {
  border-left: 4px solid var(--danger);
}
.queue-item.priority-urgent {
  border-left: 4px solid var(--warning);
}
.queue-number {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}
.queue-meta {
  flex: 1;
  min-width: 0;
}
.queue-meta .name {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.1rem;
}
.queue-meta .sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.queue-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Tabs / patient profile
   -------------------------------------------------------------------------- */
.profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #16365f 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.profile-hero .patient-code {
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.profile-hero h1 {
  margin: 0.2rem 0 0.45rem;
  font-size: 1.5rem;
  font-weight: 800;
}
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  font-size: 0.85rem;
  opacity: 0.9;
}
.profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-tabs-domina {
  border-bottom: 1px solid var(--border);
  gap: 0.25rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.nav-tabs-domina .nav-link {
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  border-radius: 0;
  background: transparent;
}
.nav-tabs-domina .nav-link:hover {
  color: var(--primary);
}
.nav-tabs-domina .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--secondary);
  background: transparent;
}

/* Consultation workspace */
.consult-layout {
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  gap: 1rem;
  align-items: start;
}
.consult-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 1rem);
  max-height: calc(100vh - var(--topbar-height) - 2rem);
  overflow-y: auto;
}
.vital-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.vital-pill {
  background: var(--background);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
}
.vital-pill .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.vital-pill .value {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

/* Filters bar */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
}
.filters-bar .form-group {
  min-width: 140px;
  flex: 1;
}
.filters-bar .form-control,
.filters-bar .form-select {
  min-height: 40px;
}

/* Notifications dropdown */
.notif-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.notif-badge.show {
  display: inline-flex;
}
.dropdown-menu-notifications {
  width: min(360px, 92vw);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dropdown-menu-notifications .dropdown-header {
  background: var(--primary);
  color: #fff;
  padding: 0.85rem 1rem;
  font-weight: 700;
}
.notif-list {
  max-height: 360px;
  overflow-y: auto;
}
.notif-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.notif-item:hover {
  background: var(--background);
}
.notif-item.unread {
  background: rgba(var(--secondary-rgb), 0.08);
}
.notif-item .title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
}
.notif-item .msg {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.notif-item .time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.65rem 0.25rem 0.3rem;
  color: var(--text);
  min-height: 40px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--secondary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
}
.user-menu-btn .user-name {
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toast */
.toast-container-domina {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(380px, calc(100vw - 2rem));
}
.toast-domina {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  animation: toastIn 0.25s ease;
}
.toast-domina.success { border-left-color: var(--success); }
.toast-domina.error { border-left-color: var(--danger); }
.toast-domina.warning { border-left-color: var(--warning); }
.toast-domina.info { border-left-color: var(--info); }
.toast-domina .toast-body-text {
  flex: 1;
  font-size: 0.875rem;
}
.toast-domina .toast-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Auth layout */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at top right, rgba(212, 160, 23, 0.18), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(11, 31, 58, 0.12), transparent 45%),
    linear-gradient(160deg, #f7f8fa 0%, #eef2f7 100%);
}
.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem;
}
.auth-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-brand-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  border-radius: 14px;
  background: var(--primary);
  color: var(--secondary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
}
.auth-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--primary);
  font-weight: 800;
}
.auth-brand p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Print layout */
.print-shell {
  background: #fff;
  color: #000;
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  font-family: var(--font);
}
.print-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
}
.print-header h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--primary);
}
.print-meta {
  font-size: 0.85rem;
  color: #444;
}
.print-title {
  text-align: center;
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.print-actions {
  margin-bottom: 1rem;
}
@media print {
  .no-print,
  .print-actions,
  .sidebar,
  .topbar,
  .sidebar-backdrop {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .print-shell,
  .app-main,
  .content-area {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
  .card {
    box-shadow: none;
    border: none;
  }
}

/* Mobile cards for tables */
.mobile-card-list {
  display: none;
}
.mobile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 0.65rem;
}
.mobile-card .mc-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
}
.mobile-card .mc-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  padding: 0.2rem 0;
  color: var(--text-muted);
}
.mobile-card .mc-row strong {
  color: var(--text);
  font-weight: 600;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  z-index: 20;
  margin: 0 -1.15rem -1.15rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.text-muted-domina { color: var(--text-muted) !important; }
.text-primary-domina { color: var(--primary) !important; }
.text-accent { color: var(--secondary-600) !important; }
.bg-soft-primary { background: rgba(var(--primary-rgb), 0.06); }
.bg-soft-accent { background: rgba(var(--secondary-rgb), 0.12); }

.duplicate-alert {
  display: none;
  margin-top: 0.75rem;
}
.duplicate-alert.show {
  display: block;
}

.pagination .page-link {
  color: var(--primary);
  border-color: var(--border);
  border-radius: var(--radius-sm) !important;
  margin: 0 0.15rem;
  min-width: 36px;
  text-align: center;
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

.modal-content {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom-color: var(--border);
  padding: 1rem 1.25rem;
}
.modal-title {
  font-weight: 700;
  color: var(--primary);
}
.modal-footer {
  border-top-color: var(--border);
}

.list-group-item-action:hover {
  background: rgba(var(--primary-rgb), 0.04);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .consult-layout {
    grid-template-columns: 1fr;
  }
  .consult-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    width: var(--sidebar-width);
  }
  body.sidebar-open .sidebar-brand-text,
  body.sidebar-open .nav-section-label,
  body.sidebar-open .nav-label,
  body.sidebar-open .sidebar-footer {
    display: flex;
  }
  body.sidebar-open .sidebar-nav .nav-link {
    justify-content: flex-start;
    padding: 0.7rem 0.85rem;
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
  .app-main,
  body.sidebar-collapsed .app-main {
    margin-left: 0;
  }
  .topbar-search {
    display: none;
  }
  .user-menu-btn .user-name {
    display: none;
  }
  .content-area {
    padding: 1rem;
  }
  .table-desktop {
    display: none;
  }
  .mobile-card-list {
    display: block;
  }
}

@media (max-width: 575.98px) {
  .page-header h1 {
    font-size: 1.25rem;
  }
  .stat-card .stat-value {
    font-size: 1.35rem;
  }
  .auth-card {
    padding: 1.5rem 1.15rem;
  }
  .profile-hero h1 {
    font-size: 1.25rem;
  }
}
