:root {
  --bg: #eef3fb;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --ink: #172033;
  --muted: #728094;
  --line: #dce4ef;
  --primary: #1f8f8a;
  --primary-2: #10b8a6;
  --accent: #c79a47;
  --danger: #df4c5d;
  --warn: #e5a91f;
  --shadow: 0 20px 50px rgba(24, 34, 56, 0.12);
  --soft-shadow: 0 12px 32px rgba(24, 34, 56, 0.08);
  --radius: 8px;
  --sidebar: 276px;
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 17% 8%, rgba(31, 143, 138, 0.13), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(199, 154, 71, 0.15), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(199, 154, 71, 0.46);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(520px, 100%);
  padding: 44px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-row,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 0;
  text-align: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #0f766e, #22c5b7 54%, #d4a84d);
  box-shadow: 0 14px 26px rgba(15, 118, 110, 0.28);
}

.brand-row h1,
.sidebar-brand h2,
.login-card h2 {
  margin: 0;
}

.brand-row h1,
.sidebar-brand h2 {
  color: var(--primary);
  font-size: 21px;
}

.brand-row p,
.sidebar-brand p,
.muted {
  margin: 4px 0 0;
  color: var(--muted);
}

.login-card h2 {
  margin-top: 38px;
  font-size: 30px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #556174;
  font-size: 14px;
}

input,
select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(16, 184, 166, 0.12);
}

.primary-btn,
.ghost-btn,
.action-btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-btn,
.action-btn.primary {
  color: white;
  background: linear-gradient(135deg, #0f766e, #10b8a6);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.24);
}

.ghost-btn,
.action-btn {
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--ink);
}

.test-account {
  display: grid;
  gap: 7px;
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8fc;
  color: #536074;
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

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

.nav-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5e6a7d;
  text-align: left;
  font-weight: 750;
}

.nav-item:hover {
  background: rgba(31, 143, 138, 0.09);
  color: var(--primary);
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, #0f766e, #10b8a6);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24);
}

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

.admin-card {
  display: grid;
  grid-template-columns: 42px 1fr 32px;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #11837d, #2cbfd1);
}

.admin-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.admin-card button,
.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--ink);
}

.theme-switch {
  width: 58px;
  height: 34px;
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  border: 1px solid rgba(190, 206, 224, 0.95);
  border-radius: 999px;
  padding: 0 7px;
  background: linear-gradient(135deg, #ffffff, #edf6ff);
  color: #64748b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 22px rgba(21, 39, 63, 0.1);
}

.theme-switch::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-switch span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

.theme-switch .sun-icon {
  color: #ffffff;
}

.theme-switch .moon-icon {
  color: #64748b;
}

.theme-switch.is-dark {
  border-color: #314763;
  background: linear-gradient(135deg, #101c2f, #182a45);
}

.theme-switch.is-dark::after {
  transform: translateX(25px);
  background: linear-gradient(135deg, #60a5fa, #20d7f5);
  box-shadow: 0 6px 14px rgba(32, 215, 245, 0.24);
}

.theme-switch.is-dark .sun-icon {
  color: #8fa3bb;
}

.theme-switch.is-dark .moon-icon {
  color: #06111f;
}

.login-theme {
  margin: 22px auto 0;
  display: grid;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 16px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.topbar p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.topbar h1 {
  margin: 0;
  font-size: 25px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#dateLabel {
  color: #556174;
  font-weight: 700;
  white-space: nowrap;
}

.content {
  padding: 26px 34px 56px;
}

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

.stat-card,
.panel,
.employee-card,
.table-wrap,
.calendar-card,
.hero-strip {
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.stat-card {
  min-height: 106px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -36px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(16, 184, 166, 0.12);
}

.stat-card span,
.panel-subtitle,
.small {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

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

.panel {
  padding: 22px;
}

.panel h3,
.employee-card h3 {
  margin: 0 0 16px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 12px;
  height: 190px;
  padding: 20px 0 6px;
  border-bottom: 1px solid var(--line);
}

.bar {
  display: grid;
  align-items: end;
  height: 100%;
  color: #607086;
  font-size: 12px;
  text-align: center;
}

.bar i {
  display: block;
  min-height: 12px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #10b8a6, #0f766e);
}

.donut {
  width: 220px;
  height: 220px;
  margin: 10px auto;
  border-radius: 50%;
  background: conic-gradient(#0f766e 0 16%, #2cbfd1 16% 30%, #d4a84d 30% 46%, #ef595f 46% 61%, #7b61d1 61% 78%, #15a79a 78% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 58px;
  border-radius: 50%;
  background: var(--panel-solid);
}

.notice-list,
.mini-list {
  display: grid;
  gap: 12px;
}

.notice {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.tool-left,
.tool-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.search-box {
  min-width: 290px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  color: white;
  background: var(--primary);
}

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

.employee-card {
  padding: 20px;
}

.employee-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.employee-head h3 {
  margin: 0 0 4px;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #0f766e;
  background: rgba(16, 184, 166, 0.12);
  font-size: 12px;
  font-weight: 850;
}

.badge.warn {
  color: #976d00;
  background: rgba(229, 169, 31, 0.16);
}

.badge.danger {
  color: #b11d32;
  background: rgba(223, 76, 93, 0.14);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.detail-list span:first-child {
  color: var(--muted);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mini-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.table-wrap {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #667386;
  background: rgba(247, 249, 252, 0.82);
  font-size: 13px;
}

td strong {
  display: block;
}

.hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(16, 184, 166, 0.13), rgba(255, 255, 255, 0.88));
}

.calendar-card {
  padding: 20px;
}

.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-name {
  color: #687589;
  font-weight: 800;
  text-align: center;
  font-size: 13px;
}

.day {
  min-height: 104px;
  border: 1px solid #e6edf6;
  border-radius: 8px;
  padding: 10px;
  background: #f5f8fc;
}

.day.today {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.event-pill {
  display: block;
  margin-top: 8px;
  padding: 5px 7px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(16, 184, 166, 0.12);
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

.kanban-col {
  min-height: 420px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.kanban-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

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

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #10b8a6);
}

.dark {
  --bg: #121826;
  --panel: rgba(27, 36, 53, 0.88);
  --panel-solid: #1b2435;
  --ink: #edf3fb;
  --muted: #9eacc0;
  --line: #2c3950;
  color-scheme: dark;
}

.dark body,
body.dark {
  background:
    radial-gradient(circle at 18% 8%, rgba(16, 184, 166, 0.16), transparent 28%),
    radial-gradient(circle at 84% 14%, rgba(199, 154, 71, 0.14), transparent 26%),
    linear-gradient(180deg, #101624 0%, #121826 100%);
}

.dark .sidebar,
.dark .topbar,
body.dark .sidebar,
body.dark .topbar {
  background: rgba(20, 28, 42, 0.88);
}

.dark input,
.dark select,
.dark .test-account,
.dark .notice,
.dark .admin-card,
.dark th,
.dark .day,
body.dark input,
body.dark select,
body.dark .test-account,
body.dark .notice,
body.dark .admin-card,
body.dark th,
body.dark .day {
  background: #202b3e;
}

.mobile-only {
  display: none;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .dashboard-grid,
  .two-col,
  .kanban {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    width: min(312px, 90vw);
    transform: translateX(-110%);
    transition: transform 0.22s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-grid;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px;
  }

  .top-actions {
    gap: 7px;
  }

  #dateLabel {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .card-grid,
  .stats-grid,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .hero-strip,
  .calendar-head {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 0;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 720px;
  }

  .calendar-grid {
    min-width: 760px;
  }

  .calendar-card {
    overflow-x: auto;
  }
}

/* NexusHR visual refresh */
:root {
  --bg: #f3f7fb;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --ink: #102033;
  --muted: #5f6f83;
  --line: #d9e3ee;
  --primary: #0478d6;
  --primary-2: #12b7e8;
  --accent: #10b981;
  --gold: #b88a2f;
  --shadow: 0 24px 70px rgba(21, 39, 63, 0.11);
  --soft-shadow: 0 14px 36px rgba(21, 39, 63, 0.075);
}

body {
  background:
    linear-gradient(120deg, rgba(5, 120, 214, 0.12), transparent 35%),
    linear-gradient(240deg, rgba(16, 185, 129, 0.12), transparent 32%),
    #f3f7fb;
}

.login-card,
.sidebar,
.topbar,
.panel,
.stat-card,
.employee-card,
.table-wrap,
.calendar-card,
.hero-strip {
  border-color: rgba(190, 206, 224, 0.82);
}

.login-card {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 34px 90px rgba(14, 35, 58, 0.14);
}

.brand-logo-card {
  width: 124px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(37, 137, 202, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, #071c31, #0c4c7a 58%, #058fe8);
  box-shadow: 0 16px 34px rgba(4, 120, 214, 0.24);
  overflow: hidden;
}

.login-logo-card {
  width: min(360px, 100%);
  height: 142px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37, 137, 202, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 18%, rgba(32, 215, 245, 0.22), transparent 34%),
    linear-gradient(135deg, #071c31, #0b3760 55%, #0478d6);
  box-shadow: 0 22px 48px rgba(4, 120, 214, 0.14);
  overflow: hidden;
}

.login-logo-card img {
  width: 90%;
  height: 82%;
  object-fit: contain;
}

.brand-logo-card.compact {
  width: 48px;
  height: 48px;
}

.brand-logo-card img {
  width: 96%;
  height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.18));
}

.brand-logo-card.compact img {
  width: 36px;
  height: 36px;
  max-width: none;
  transform: none;
}

.brand-mark {
  background: linear-gradient(135deg, #0478d6, #12b7e8 58%, #10b981);
}

.brand-row h1,
.sidebar-brand h2 {
  color: #0478d6;
  letter-spacing: 0;
}

.sidebar {
  background: rgba(255, 255, 255, 0.95);
}

.side-nav {
  gap: 6px;
}

.nav-item {
  color: #42546a;
  font-weight: 800;
}

.nav-item:hover {
  background: rgba(4, 120, 214, 0.09);
  color: #0369bd;
}

.nav-item.active {
  background: linear-gradient(135deg, #0478d6, #12b7e8);
  box-shadow: 0 14px 28px rgba(4, 120, 214, 0.26);
}

.topbar {
  background: rgba(255, 255, 255, 0.88);
}

.topbar h1,
.login-card h2,
.panel h3,
.employee-card h3 {
  color: #102033;
}

.stat-card,
.panel,
.employee-card,
.table-wrap,
.calendar-card,
.hero-strip {
  background: rgba(255, 255, 255, 0.92);
}

.stat-card::after {
  background: linear-gradient(135deg, rgba(18, 183, 232, 0.16), rgba(16, 185, 129, 0.15));
}

.stat-card strong {
  color: #0b1627;
}

.primary-btn,
.action-btn.primary {
  background: linear-gradient(135deg, #0478d6, #12b7e8);
  box-shadow: 0 16px 34px rgba(4, 120, 214, 0.26);
}

.badge,
.event-pill {
  color: #0369bd;
  background: rgba(4, 120, 214, 0.11);
}

.progress i,
.bar i {
  background: linear-gradient(180deg, #12b7e8, #0478d6);
}

.hero-strip {
  background:
    linear-gradient(135deg, rgba(4, 120, 214, 0.13), rgba(16, 185, 129, 0.1)),
    rgba(255, 255, 255, 0.92);
}

body.dark {
  --bg: #08111f;
  --panel: rgba(17, 29, 48, 0.92);
  --panel-solid: #111d30;
  --ink: #f5f8ff;
  --muted: #b9c7d8;
  --line: #2a3f58;
  --primary: #4db8ff;
  --primary-2: #20d7f5;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(18, 183, 232, 0.22), transparent 30%),
    radial-gradient(circle at 82% 4%, rgba(16, 185, 129, 0.16), transparent 28%),
    linear-gradient(180deg, #07101c 0%, #0b1422 100%);
}

body.dark .login-card,
body.dark .sidebar,
body.dark .topbar,
body.dark .panel,
body.dark .stat-card,
body.dark .employee-card,
body.dark .table-wrap,
body.dark .calendar-card,
body.dark .hero-strip,
body.dark .kanban-col,
body.dark .kanban-card {
  border-color: rgba(88, 114, 145, 0.58);
  background: rgba(17, 29, 48, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

body.dark .login-logo-card,
body.dark .brand-logo-card {
  border-color: rgba(77, 184, 255, 0.3);
  background:
    linear-gradient(135deg, rgba(32, 215, 245, 0.12), rgba(77, 184, 255, 0.08)),
    #101c2f;
}

body.dark .topbar h1,
body.dark .login-card h2,
body.dark .panel h3,
body.dark .employee-card h3,
body.dark .stat-card strong,
body.dark td,
body.dark td strong,
body.dark .admin-card strong,
body.dark .brand-row h1,
body.dark .sidebar-brand h2 {
  color: #f8fbff;
}

body.dark .brand-row p,
body.dark .sidebar-brand p,
body.dark .muted,
body.dark .small,
body.dark .topbar p,
body.dark #dateLabel,
body.dark .detail-list span:first-child,
body.dark .stat-card span,
body.dark .admin-card span,
body.dark th,
body.dark .day-name {
  color: #b9c7d8;
}

body.dark input,
body.dark select,
body.dark .test-account,
body.dark .notice,
body.dark .admin-card,
body.dark th,
body.dark .day,
body.dark .segmented,
body.dark .ghost-btn,
body.dark .action-btn,
body.dark .mini-btn,
body.dark .icon-btn {
  background: #142237;
  color: #f5f8ff;
  border-color: #314763;
}

body.dark .nav-item {
  color: #cfdaea;
}

body.dark .nav-item:hover {
  background: rgba(77, 184, 255, 0.13);
  color: #ffffff;
}

body.dark .nav-item.active {
  color: #04101d;
  background: linear-gradient(135deg, #20d7f5, #4db8ff);
}

body.dark .badge,
body.dark .event-pill {
  color: #9be8ff;
  background: rgba(32, 215, 245, 0.15);
}

body.dark .day.today {
  border-color: #20d7f5;
  box-shadow: inset 0 0 0 1px #20d7f5;
}

body.dark .donut::after {
  background: #111d30;
}

@media (max-width: 560px) {
  .login-card {
    padding: 28px;
  }

  .login-logo-card {
    height: 112px;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 16, 28, 0.48);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.modal-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-solid);
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.entity-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.entity-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
}

.empty-state strong {
  color: var(--ink);
}

.event-pill {
  border: 0;
  width: 100%;
  text-align: left;
}

body.dark .modal-card,
body.dark .modal-head {
  background: #111d30;
}

body.dark .empty-state {
  background: rgba(20, 34, 55, 0.72);
}

@media print {
  .sidebar,
  .topbar,
  .toolbar,
  .row-actions,
  .toast,
  .modal-backdrop {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  body {
    background: #fff;
  }
}
