:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e9f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --green: #047857;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -18px rgba(15, 23, 42, 0.22);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  font-weight: 700;
}

h2 {
  font-size: 16px;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin-bottom: 0;
}

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

a:hover {
  color: var(--primary-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  flex-shrink: 0;
}

::selection {
  background: #c7d2fe;
  color: #1e1b4b;
}

:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-danger { color: #b91c1c; }

/* Shell */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  background: linear-gradient(180deg, #121a2b 0%, #0b1220 100%);
  color: #e2e8f0;
  transition: transform 0.22s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand:hover { color: var(--text); }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, 0.9);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-name {
  display: inline-flex;
  flex-direction: column;
  font-weight: 700;
  line-height: 1.15;
}

.brand-tag {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar .brand {
  color: #fff;
  gap: 11px;
  padding: 2px 10px 24px;
}

.sidebar .brand:hover { color: #fff; }

.sidebar .brand-name {
  font-size: 14px;
  letter-spacing: -0.015em;
}

.sidebar .brand-tag {
  color: #a5b4fc;
  font-size: 7.5px;
}

.nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 2px;
}

.nav-label {
  padding: 0 10px;
  margin: 4px 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.nav-group {
  margin: 0;
}

.nav-group + .nav-group {
  margin-top: 18px;
}

.nav-group > .nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 10px;
  list-style: none;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-group > .nav-label::-webkit-details-marker { display: none; }

.nav-group > .nav-label::marker { content: ""; }

.nav-group > .nav-label:hover {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
}

.nav-group > .nav-label:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.nav-chevron {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: #64748b;
  transition: transform 0.18s ease, color 0.15s ease;
}

.nav-group > .nav-label:hover .nav-chevron { color: #cbd5e1; }

.nav-group[open] > .nav-label .nav-chevron { transform: rotate(180deg); }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  margin-bottom: 3px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  color: #94a3b8;
  transition: color 0.15s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-link:hover svg { color: #e2e8f0; }

.nav-link.active {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.nav-link.active svg { color: #a5b4fc; }

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  min-width: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  margin-left: 264px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 70px;
  padding: 0 32px;
  background: rgba(244, 246, 250, 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.topbar .menu-toggle {
  display: none;
}

.content {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
  flex: 1;
}

.app-footer {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 22px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

/* Avatars */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: hsl(var(--h, 240) 78% 93%);
  color: hsl(var(--h, 240) 52% 34%);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 11.5px;
}

.avatar-xs {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.06s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(79, 70, 229, 0.85);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-subtle {
  background: #fff;
  border-color: var(--border);
  color: #334155;
}

.btn-subtle:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: #d5dce7;
}

.btn-dark {
  background: #111827;
  color: #fff;
}

.btn-dark:hover {
  background: #1f2937;
  color: #fff;
}

.btn-danger-ghost {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
}

.btn-danger-ghost:hover {
  background: #fef2f2;
  color: #991b1b;
}

.btn-sidebar {
  width: 100%;
  justify-content: flex-start;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
}

.btn-sidebar svg {
  width: 16px;
  height: 16px;
  color: #94a3b8;
}

.btn-sidebar:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-sm {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
}

.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475569;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn.bordered {
  background: #fff;
  border-color: var(--border);
}

.icon-btn:hover { background: var(--surface-2); }

.link {
  font-size: 12.5px;
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.back-link:hover { color: var(--primary); }

/* Flash */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
}

.flash-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.flash-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.flash-info {
  background: var(--primary-soft);
  border-color: #c7d2fe;
  color: #3730a3;
}

.flash-close {
  padding: 2px 6px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  opacity: 0.55;
}

.flash-close:hover { opacity: 1; }

/* Headings */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.page-head h1 { margin-bottom: 6px; }

.eyebrow {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.eyebrow-light { color: #c7d2fe; }

.page-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* Cards and layout */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

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

.card-head h2 { margin: 0; }

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.requests-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.8fr);
  gap: 20px;
  align-items: start;
}

/* Balance cards */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.balance-card {
  position: relative;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.balance-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--c, var(--primary));
}

.balance-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.type-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, var(--primary));
}

.balance-name {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.balance-chip {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.balance-chip-low {
  background: #fff7ed;
  color: #c2410c;
}

.balance-number {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 14px;
}

.balance-number strong {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.balance-number span {
  color: var(--muted);
  font-size: 12px;
}

.progress {
  display: flex;
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.progress-approved {
  height: 100%;
  background: var(--c, var(--primary));
}

.progress-pending {
  height: 100%;
  background: var(--c, var(--primary));
  opacity: 0.32;
}

.balance-unlimited {
  height: 6px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #e2e8f0 0 8px, #f1f5f9 8px 16px);
}

.balance-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.balance-meta strong {
  color: #334155;
  font-weight: 600;
}

/* Leave lists */
.leave-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leave-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f7;
}

.leave-list li:first-child { padding-top: 2px; }
.leave-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.type-bar {
  width: 3px;
  min-height: 34px;
  align-self: stretch;
  border-radius: 99px;
  background: var(--c, var(--primary));
}

.leave-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
}

.leave-info strong {
  font-size: 13px;
  font-weight: 600;
}

.leave-info span {
  color: var(--muted);
  font-size: 11.5px;
}

.days-pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Status and type badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-approved { background: #ecfdf5; color: #047857; }
.status-pending { background: #fffbeb; color: #b45309; }
.status-rejected { background: #fef2f2; color: #b91c1c; }
.status-cancelled { background: #f1f5f9; color: #64748b; }

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f8fafc;
  background: color-mix(in srgb, var(--c, var(--primary)) 10%, #fff);
  color: var(--c, var(--primary));
  color: color-mix(in srgb, var(--c, var(--primary)) 78%, #0f172a);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.type-badge > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c, var(--primary));
}

.role-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.role-employee { background: #f1f5f9; color: #475569; }
.role-manager { background: #eef2ff; color: #4338ca; }
.role-hr { background: #f5f3ff; color: #6d28d9; }

/* Tables */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--border);
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}

.table th:first-child,
.table td:first-child { padding-left: 4px; }

.table th:last-child,
.table td:last-child { padding-right: 4px; }

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbff; }

.table-compact th,
.table-compact td { padding: 9px 8px; }

@media (max-width: 760px) {
  .table-wide { min-width: 700px; }
  .table-wide th,
  .table-wide td { white-space: nowrap; }
}

.cell-main {
  display: block;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 600;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.cell-note {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.cell-actions form { display: inline; }
.cell-actions a + form,
.cell-actions form + form { margin-left: 6px; }

.person-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

/* Empty states */
.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.empty-state p { margin-bottom: 4px; }
.empty-state span { display: block; font-size: 12px; }
.empty-state a { font-weight: 600; }

.empty-state-lg {
  padding: 52px 24px;
}

.empty-state-lg h2 {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
}

.empty-state-lg p { margin-bottom: 0; }

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-icon svg {
  width: 24px;
  height: 24px;
}

/* Dashboard extras */
.approvals-card {
  background: linear-gradient(150deg, #fff 20%, #f5f3ff 100%);
}

.approvals-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: #e0e7ff;
  color: #4338ca;
}

.approvals-card-icon svg {
  width: 20px;
  height: 20px;
}

.approvals-card h2 { margin-bottom: 10px; }

.big-number {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.approvals-card .muted {
  margin: 4px 0 16px;
  font-size: 12.5px;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.team-info strong {
  font-size: 12.5px;
  font-weight: 600;
}

.team-info span {
  color: var(--muted);
  font-size: 11px;
}

.team-link {
  display: inline-block;
  margin-top: 16px;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

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

.field label {
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.label-hint,
.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea,
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbe2ea;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder { color: #94a3b8; }

input:focus,
select:focus,
textarea:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

input[type="color"] {
  width: 46px;
  height: 40px;
  padding: 3px;
  border: 1px solid #dbe2ea;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.input-sm {
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 12.5px;
}

.input-allowance { width: 82px; }

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.day-counter {
  padding: 9px 12px;
  border: 1px dashed #dbe2ea;
  border-radius: 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12.5px;
}

.day-counter strong {
  color: var(--text);
  font-size: 15px;
}

.form-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.form-error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 12.5px;
}

.form-error ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 9px;
  color: #334155;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* Balances sidebar */
.balance-mini {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

.balance-mini li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
}

.balance-mini li:last-child { border-bottom: none; }

.balance-mini-name {
  margin-right: auto;
  font-size: 12.5px;
  font-weight: 500;
}

.balance-mini-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 15px;
  font-weight: 700;
}

.balance-mini-value small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.card-note {
  background: #fbfcff;
  border-style: dashed;
}

.card-note h3 {
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 600;
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 11.5px;
}

/* Approvals */
.count-pill {
  padding: 7px 13px;
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  font-size: 11.5px;
  font-weight: 600;
}

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

.approval-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.approval-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.approval-person-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
}

.approval-person-info strong {
  font-size: 13px;
  font-weight: 600;
}

.approval-person-info span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-meta {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr 1.05fr;
  gap: 12px;
  margin: 16px 0;
  padding: 13px 0;
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
}

.meta-label {
  display: block;
  margin-bottom: 3px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.approval-meta strong {
  font-size: 12px;
  font-weight: 600;
}

.inline-warning {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11.5px;
}

.approval-reason {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-left: 3px solid #cbd5e1;
  border-radius: 0 8px 8px 0;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

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

.history-card { margin-top: 0; }

/* Calendar */
.calendar-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  flex-wrap: wrap;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-nav h2 {
  min-width: 158px;
  margin: 0 4px;
  font-size: 16px;
}

.dept-filter select {
  width: auto;
  min-width: 170px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px 15px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.calendar { min-width: 760px; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.cal-weekdays span {
  padding: 9px 12px;
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-cell {
  position: relative;
  min-height: 112px;
  padding: 7px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:nth-last-child(-n + 7) { border-bottom: none; }
.cal-cell.outside { background: #fbfcfe; }
.cal-cell.weekend { background: #f8fafc; }
.cal-cell.outside.weekend { background: #f5f7fa; }

.cal-daynum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  border-radius: 50%;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
}

.cal-cell.outside .cal-daynum { color: #b4bfcd; }
.cal-cell.today .cal-daynum { background: var(--primary); color: #fff; }

.cal-event {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  margin-top: 3px;
  padding: 3px 5px;
  overflow: hidden;
  border-radius: 5px;
  background: color-mix(in srgb, var(--c, var(--primary)) 11%, #fff);
  color: color-mix(in srgb, var(--c, var(--primary)) 72%, #0f172a);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-event-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c, var(--primary));
}

.cal-more {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
}

.month-leave-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.month-leave-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f7;
}

.month-leave-list li:first-child { padding-top: 2px; }
.month-leave-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.month-leave-list .leave-info { margin-right: auto; }

/* Admin */
.admin-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.admin-detail-grid-single {
  grid-template-columns: minmax(0, 760px);
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.7fr);
  gap: 20px;
  align-items: start;
}

.type-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
}

.dept-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dept-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #eef2f7;
  flex-wrap: wrap;
}

.dept-row:first-child { padding-top: 2px; }
.dept-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.dept-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.dept-icon svg { width: 18px; height: 18px; }

.dept-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
}

.dept-info strong {
  font-size: 13px;
  font-weight: 600;
}

.dept-info span {
  color: var(--muted);
  font-size: 10.5px;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-form .input { width: 180px; }

.type-list {
  display: flex;
  flex-direction: column;
}

.type-row {
  padding: 14px 0;
  border-bottom: 1px solid #eef2f7;
}

.type-row:first-child { padding-top: 2px; }
.type-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.type-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.type-form .field { gap: 4px; }

.type-form .field label {
  color: #94a3b8;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.type-form input[type="color"] {
  width: 38px;
  height: 34px;
}

.type-form .checkbox { padding-bottom: 8px; }

.type-name-field { width: 210px; }
.type-days-field { width: 120px; }

.type-usage {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.type-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 64px 140px auto auto;
  gap: 12px;
  align-items: end;
}

.type-add-form .checkbox { padding-bottom: 9px; }

/* Login */
.login-body { background: #fff; }

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(430px, 0.88fr);
  min-height: 100vh;
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 34px clamp(30px, 4.2vw, 60px) 26px;
  background:
    radial-gradient(90% 65% at 8% 2%, rgba(99, 102, 241, 0.26), transparent 58%),
    radial-gradient(70% 55% at 96% 94%, rgba(14, 165, 233, 0.16), transparent 62%),
    linear-gradient(150deg, #070c1b 0%, #101a35 46%, #1b1a45 100%);
  color: #fff;
  isolation: isolate;
}

.login-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.scene-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.blob-one {
  top: -150px;
  left: -110px;
  width: 430px;
  height: 430px;
  background: radial-gradient(circle at 38% 38%, rgba(129, 140, 248, 0.55), rgba(79, 70, 229, 0.04) 68%);
  animation: auroraDrift 20s ease-in-out infinite;
}

.blob-two {
  top: 26%;
  right: -130px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.24), transparent 68%);
  animation: auroraDrift 26s ease-in-out infinite reverse;
}

.blob-three {
  bottom: -250px;
  left: 16%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle at 50% 42%, rgba(192, 132, 252, 0.28), transparent 66%);
  animation: auroraDrift 23s ease-in-out -9s infinite;
}

.scene-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 30% 22%, #000 8%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 70% at 30% 22%, #000 8%, transparent 78%);
}

.scene-ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.ring-one {
  top: -170px;
  right: -160px;
  width: 520px;
  height: 520px;
  border-style: dashed;
  border-color: rgba(165, 180, 252, 0.14);
  animation: spinSlow 48s linear infinite;
}

.ring-two {
  bottom: 8%;
  left: -150px;
  width: 320px;
  height: 320px;
  border-color: rgba(103, 232, 249, 0.1);
  animation: spinSlow 36s linear infinite reverse;
}

.brand-light {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  color: #fff;
  font-size: 15px;
  animation: riseIn 0.65s ease both;
}

.brand-light:hover { color: #fff; }

.brand-light .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  animation: markGlow 5s ease-in-out infinite;
}

.brand-light .brand-tag { color: #a5b4fc; }

.login-copy {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: auto 0;
  padding: clamp(34px, 6vh, 68px) 0 26px;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid rgba(165, 180, 252, 0.24);
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.1);
  color: #dbeafe;
  font-size: 9.5px;
  letter-spacing: 0.15em;
  animation: riseIn 0.65s ease 0.06s both;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  animation: livePulse 2.4s ease-out infinite;
}

.login-copy h1 {
  margin: 18px 0;
  font-size: clamp(40px, 4.3vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.048em;
  font-weight: 800;
  animation: riseIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.headline-accent {
  display: inline-block;
  background: linear-gradient(100deg, #c7d2fe 0%, #a5b4fc 26%, #67e8f9 55%, #f0abfc 82%, #c7d2fe 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation:
    riseIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both,
    shimmer 7s linear 1.1s infinite;
}

.login-sub {
  max-width: 470px;
  margin-bottom: 28px;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.7;
  animation: riseIn 0.7s ease 0.2s both;
}

.login-points {
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.login-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 460px;
  padding: 8px 14px 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #e2e8f0;
  font-size: 12.5px;
  backdrop-filter: blur(8px);
  animation: riseIn 0.6s ease both;
}

.login-points li:nth-child(1) { animation-delay: 0.28s; }
.login-points li:nth-child(2) { animation-delay: 0.36s; }
.login-points li:nth-child(3) { animation-delay: 0.44s; }

.point-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(129, 140, 248, 0.16);
  color: #c7d2fe;
}

.point-icon svg {
  width: 15px;
  height: 15px;
}

.login-preview {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 540px;
  margin-top: 4px;
  padding-bottom: 4px;
  animation: riseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

.mini-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 15px 17px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045));
  box-shadow: 0 28px 55px -28px rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(16px);
}

.leave-mini {
  animation: cardFloat 8s ease-in-out infinite;
}

.custody-mini {
  margin: 12px 0 0 clamp(24px, 6vw, 78px);
  animation: cardFloat 9s ease-in-out -3s infinite;
}

.mini-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mini-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(165, 180, 252, 0.16);
  color: #c7d2fe;
}

.mini-icon svg {
  width: 14px;
  height: 14px;
}

.mini-icon-amber {
  background: rgba(251, 191, 36, 0.14);
  color: #fcd34d;
}

.mini-label {
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.mini-status {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid rgba(110, 231, 183, 0.32);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: #d1fae5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.mini-status-blue {
  border-color: rgba(125, 211, 252, 0.32);
  background: rgba(14, 165, 233, 0.2);
  color: #e0f2fe;
}

.mini-dates {
  margin: 11px 0 10px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mini-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #a5b4fc;
  font-size: 9.5px;
}

.mini-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.mini-bar span {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  animation: barGrow 1.2s cubic-bezier(0.22, 1, 0.36, 1) 1s both;
}

.cover-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.cover-person {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.cover-person.is-active {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(16, 185, 129, 0.11);
}

.cover-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cover-avatar-active {
  background: linear-gradient(150deg, #6ee7b7, #10b981);
  color: #052e23;
  animation: avatarPulse 3.2s ease-in-out infinite;
}

.cover-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.cover-copy b {
  color: #f1f5f9;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.cover-copy em {
  color: #94a3b8;
  font-size: 9px;
  font-style: normal;
}

.cover-person.is-active .cover-copy em { color: #6ee7b7; }

.cover-arrow {
  flex-shrink: 0;
  color: #64748b;
}

.cover-arrow svg {
  display: block;
  width: 13px;
  height: 13px;
}

.login-footnote {
  position: relative;
  z-index: 2;
  margin: 22px 0 0;
  color: #94a3b8;
  font-size: 10px;
  letter-spacing: 0.02em;
  animation: fadeIn 0.8s ease 1.1s both;
}

.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 46px clamp(26px, 3.4vw, 52px);
  background: #fbfcff;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(99, 102, 241, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 65% 45% at 100% 0%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 65% 45% at 100% 0%, #000, transparent 75%);
  opacity: 0.55;
}

.panel-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 35% at 100% 0%, rgba(99, 102, 241, 0.12), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(14, 165, 233, 0.08), transparent 72%);
}

.login-form-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 388px;
  animation: formRise 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.mobile-brand { display: none; }

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  color: #4f46e5;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.kicker-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #eef2ff;
  color: #4f46e5;
}

.kicker-icon svg {
  width: 12px;
  height: 12px;
}

.login-form-wrap h2 {
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.login-intro {
  margin-bottom: 26px;
  font-size: 13.5px;
  line-height: 1.6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.login-field { gap: 7px; }

.login-field label {
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.login-input { position: relative; }

.login-input > svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 0.18s ease;
}

.login-input input {
  height: 47px;
  padding-left: 40px;
  border-color: #dfe5ee;
  border-radius: 12px;
  background: #fff;
  font-size: 13.5px;
}

.login-input input:hover { border-color: #cbd5e1; }
.login-input:focus-within > svg { color: var(--primary); }

.login-form .btn { margin-top: 5px; }

.login-flash {
  margin-bottom: 20px;
  animation: riseIn 0.35s ease both;
}

.login-form .login-submit {
  position: relative;
  overflow: hidden;
  padding: 13px 18px;
  margin-top: 6px;
  border-radius: 12px;
  background: linear-gradient(115deg, #4f46e5, #6366f1 48%, #4f46e5);
  box-shadow: 0 14px 30px -14px rgba(79, 70, 229, 0.9);
  font-size: 14px;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-form .login-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: buttonSheen 5.5s ease-in-out 1.4s infinite;
}

.login-form .login-submit:hover {
  background: linear-gradient(115deg, #4338ca, #4f46e5 50%, #4338ca);
  box-shadow: 0 18px 34px -14px rgba(67, 56, 202, 0.95);
  color: #fff;
  transform: translateY(-1px);
}

.login-form .login-submit:active { transform: translateY(1px); }

.login-form .login-submit svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.login-form .login-submit:hover svg { transform: translateX(3px); }

.login-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 500;
}

.login-trust li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login-trust svg {
  width: 13px;
  height: 13px;
  color: #059669;
}

.login-help {
  margin: 0;
  padding-top: 17px;
  border-top: 1px solid #eef2f7;
  color: #94a3b8;
  font-size: 11.5px;
  line-height: 1.6;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes formRise {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes auroraDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(4%, -4%, 0) scale(1.08); }
  66% { transform: translate3d(-3%, 4%, 0) scale(0.95); }
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 200% 50%; }
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes barGrow {
  from { width: 0; }
  to { width: 68%; }
}

@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

@keyframes markGlow {
  0%, 100% { box-shadow: 0 12px 32px -14px rgba(129, 140, 248, 0.9); }
  50% { box-shadow: 0 12px 36px -10px rgba(103, 232, 249, 0.55); }
}

@keyframes buttonSheen {
  0%, 58% { left: -80%; }
  82%, 100% { left: 140%; }
}

@media (min-width: 981px) and (max-height: 860px) {
  .login-visual { padding-top: 24px; padding-bottom: 18px; }
  .login-copy { padding: 18px 0 16px; }
  .login-eyebrow { padding: 5px 10px 5px 8px; font-size: 9px; }
  .login-copy h1 { margin: 12px 0; font-size: clamp(32px, 3.3vw, 44px); }
  .login-sub { margin-bottom: 14px; font-size: 12.5px; line-height: 1.6; }
  .login-points { gap: 6px; }
  .login-points li { padding: 5px 11px 5px 6px; font-size: 12px; }
  .point-icon { width: 22px; height: 22px; border-radius: 7px; }
  .point-icon svg { width: 13px; height: 13px; }
  .mini-card { padding: 10px 14px 11px; }
  .mini-icon { width: 24px; height: 24px; }
  .mini-dates { margin: 7px 0; font-size: 12.5px; }
  .mini-meta { margin-bottom: 6px; font-size: 9px; }
  .cover-flow { margin-top: 9px; }
  .cover-person { padding: 6px 7px; }
  .custody-mini { margin-top: 8px; margin-left: clamp(20px, 5vw, 60px); }
  .login-footnote { margin-top: 12px; }
}

@media (min-width: 981px) and (max-height: 700px) {
  .custody-mini { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .login-visual *,
  .login-visual *::before,
  .login-visual *::after,
  .login-panel *,
  .login-panel *::before,
  .login-panel *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .login-form .login-submit::after { display: none; }
}

/* Error */
.error-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.error-card {
  width: 100%;
  max-width: 450px;
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.brand-dark {
  justify-content: center;
  padding: 0 0 22px;
}

.error-code {
  margin-bottom: 6px;
  color: #e0e7ff;
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}

.error-card h1 { font-size: 22px; }

.error-card p { margin-bottom: 22px; font-size: 13.5px; }

/* Reports */
.report-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-filter-card {
  margin-bottom: 20px;
  padding: 18px 22px;
}

.report-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.report-filters .field { width: 170px; }
.report-filters .field:first-child { width: 110px; }
.report-filters .field.field-date { width: 170px; }

.report-filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.report-stat {
  position: relative;
  padding: 15px 17px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.report-stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--c, var(--primary));
}

.report-stat-label {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.report-stat-value {
  display: block;
  margin-top: 5px;
  color: #1e293b;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.report-stat-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.card-head-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.report-table { min-width: 880px; }

.cell-nowrap { white-space: nowrap; }

.report-note {
  max-width: 240px;
  color: var(--muted);
  font-size: 12px;
}

.report-table tfoot td {
  padding-top: 13px;
  border-top: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
  font-size: 12px;
}

.report-prepared {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
}

.report-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.report-tab {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}

.report-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.report-tab.active,
.report-tab.active:hover {
  background: var(--primary);
  color: #fff;
}

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

.report-breakdown-card { padding-bottom: 12px; }

.report-mini-table { margin-top: 12px; }

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

.report-mini-table tbody td:first-child {
  color: #334155;
  font-weight: 600;
}

.report-mini-table tbody tr.report-row-empty td { color: #cbd5e1; }

.report-mini-table tfoot td {
  padding: 10px;
  border-top: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
  font-size: 12px;
}

.report-balance-table { min-width: 760px; }

.report-custody-table { min-width: 1080px; }

.report-custody-table td { vertical-align: middle; }

.report-balance-table .type-dot {
  margin-right: 6px;
  vertical-align: 1px;
}

.report-negative { color: #b91c1c !important; }

/* Leave import */
.import-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.import-form-actions .btn svg {
  width: 16px;
  height: 16px;
}

.import-templates {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 12px;
}

.import-templates a { font-size: 12px; }

.import-guide {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  margin-top: 18px;
}

.import-guide .card { padding: 20px; }

.import-column-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.import-column {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  font-size: 12px;
  color: #475569;
}

.import-column strong {
  color: var(--text);
  font-size: 12.5px;
}

.import-column small {
  color: var(--muted);
  font-size: 10.5px;
}

.import-column > span:last-child {
  flex-shrink: 0;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.import-rules {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.8;
}

.import-rules li + li { margin-top: 6px; }

.import-preview { margin-top: 18px; }

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

.import-summary-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.import-summary-item strong {
  display: block;
  font-size: 21px;
  line-height: 1.1;
}

.import-summary-item span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.import-summary-ready { border-color: #a7f3d0; background: #ecfdf5; }
.import-summary-ready strong { color: #047857; }
.import-summary-warning { border-color: #fde68a; background: #fffbeb; }
.import-summary-warning strong { color: #b45309; }
.import-summary-skipped { background: #f1f5f9; }
.import-summary-skipped strong { color: #64748b; }
.import-summary-error { border-color: #fecaca; background: #fef2f2; }
.import-summary-error strong { color: #b91c1c; }

.import-warning { margin: 0 0 14px; }

.import-preview .table-wrap {
  max-height: 56vh;
  overflow: auto;
}

.import-table { min-width: 980px; }

.import-table td { vertical-align: top; }

.import-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.import-table .cell-sub,
.import-result-note {
  max-width: 320px;
  white-space: normal;
}

.import-row-error td { background: #fffafa; }

.import-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.import-confirm strong { font-size: 13px; }

.import-confirm form { margin: 0; }

.import-confirm .field-hint { margin-top: 4px; }

button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Responsive */
@media (max-width: 1120px) {
  .dashboard-grid,
  .requests-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .approval-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-detail-grid-single {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-breakdowns {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-guide {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 44px 24px; }
  .login-form-wrap { max-width: 400px; }
  .mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 32px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.015em;
  }
  .mobile-brand:hover { color: var(--text); }
  .mobile-brand .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .mobile-brand .brand-tag { color: var(--muted); }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  }

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

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, 0.42);
  }

  .main { margin-left: 0; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 20px; }
  .content { padding: 26px 20px; }

  .type-add-form {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .type-add-form .field:nth-child(3) { grid-column: 1; }
  .type-add-form .checkbox { padding-bottom: 0; }
}

@media (max-width: 760px) {
  h1 { font-size: 24px; }

  .balance-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .balance-card { padding: 18px; }

  .page-head {
    align-items: flex-start;
  }

  .topbar-date { display: none; }

  .content { padding: 22px 16px 32px; }

  .card { padding: 18px; }

  .approval-meta {
    grid-template-columns: 1fr 1fr;
  }

  .month-nav h2 { min-width: 0; font-size: 15px; }

  .type-form {
    align-items: flex-end;
  }

  .type-name-field { width: 100%; }
  .type-days-field { width: 100%; }

  .report-filter-card { padding: 16px; }
  .report-filters .field,
  .report-filters .field:first-child { width: 100%; }
  .report-filter-actions { width: 100%; margin-left: 0; }
  .report-filter-actions .btn { flex: 1; }
  .report-table { min-width: 980px; }
  .report-custody-table { min-width: 1080px; }
  .report-balance-table { min-width: 760px; }
  .report-downloads { width: 100%; }
  .report-downloads .btn { flex: 1; justify-content: center; }
  .report-tabs { display: flex; width: 100%; }
  .report-tab { flex: 1; text-align: center; }
  .report-breakdown-card { padding: 16px; }

  .inline-form {
    width: 100%;
  }

  .inline-form .input { flex: 1; width: auto; }

  .import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-form-actions .btn { width: 100%; justify-content: center; }
  .import-confirm .btn { width: 100%; justify-content: center; }
  .import-confirm form { width: 100%; }
}

@media (max-width: 520px) {
  .topbar { height: 62px; }
  .page-head { gap: 14px; }
  .page-head .btn { width: 100%; }
  .page-head > .count-pill { align-self: flex-start; }

  .form-foot {
    align-items: stretch;
    flex-direction: column;
  }

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

  .calendar-toolbar { padding: 14px 14px 12px; }
  .legend { padding: 0 14px 13px; }
  .cal-cell { min-height: 100px; }

  .login-panel { padding: 34px 20px; }
  .login-form-wrap h2 { font-size: 30px; }
  .login-intro { margin-bottom: 22px; }
  .login-trust { gap: 7px 12px; }
  .login-help { font-size: 11px; }

  .error-card { padding: 28px 22px; }
  .error-code { font-size: 52px; }
}

/* Custody */
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custody-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 15px 18px;
  flex-wrap: wrap;
}

.custody-day-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.custody-date-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custody-date-form label {
  color: #334155;
  font-size: 11px;
  font-weight: 600;
}

.custody-date-form input[type="date"] {
  width: 158px;
  padding: 7px 9px;
  font-size: 12.5px;
}

.custody-date-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.custody-summary { margin-bottom: 18px; }

.custody-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12.5px;
}

.custody-alert-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #7f1d1d;
}

.custody-alert-info {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.custody-alert-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
}

.custody-alert-icon svg {
  width: 17px;
  height: 17px;
}

.custody-alert strong { font-weight: 700; }
.custody-alert p {
  margin: 3px 0 0;
  font-size: 11.5px;
}
.custody-alert .link {
  display: inline-block;
  margin-top: 6px;
  color: inherit;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: underline;
}
.custody-alert-list { color: inherit; opacity: 0.85; }

.custody-category {
  margin-bottom: 20px;
  padding-bottom: 12px;
}

.custody-category .card-head { padding: 0 10px; }

.custody-table {
  min-width: 790px;
}

.custody-table td { vertical-align: top; }

.custody-table th:first-child,
.custody-table td:first-child { padding-left: 10px; }

.custody-table th:last-child,
.custody-table td:last-child { padding-right: 10px; }

.custody-row-risk td { background: #fffafa; }
.custody-row-risk:hover td { background: #fff5f5 !important; }

.custody-chain {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 440px;
}

.chain-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 150px;
  padding: 3px 6px 3px 4px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-size: 10px;
  line-height: 1.25;
}

.chain-pos {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 8.5px;
  font-weight: 700;
}

.chain-person {
  overflow: hidden;
  max-width: 82px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-state {
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef2f7;
  color: #64748b;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chain-acting {
  border-color: #a7f3d0;
  background: #ecfdf5;
}
.chain-acting .chain-pos { background: #a7f3d0; color: #047857; }
.chain-acting .chain-state { background: #d1fae5; color: #047857; }

.chain-leave {
  border-color: #fed7aa;
  background: #fff7ed;
}
.chain-leave .chain-pos { background: #ffedd5; color: #c2410c; }
.chain-leave .chain-state { background: #ffedd5; color: #c2410c; }

.chain-inactive {
  border-style: dashed;
  color: #94a3b8;
}
.chain-inactive .chain-pos { background: #f1f5f9; color: #94a3b8; }
.chain-inactive .chain-state { background: #f1f5f9; color: #94a3b8; }

.chain-empty {
  border-style: dashed;
  color: #94a3b8;
}
.chain-empty .chain-pos { background: #f1f5f9; color: #94a3b8; }
.chain-empty .chain-state { color: #94a3b8; }

.custody-holder { min-width: 160px; }

.custody-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.custody-badge-covered { background: #ecfdf5; color: #047857; }
.custody-badge-backup { background: #eff6ff; color: #1d4ed8; }
.custody-badge-uncovered { background: #fef2f2; color: #b91c1c; }
.custody-badge-unassigned { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.custody-badge-inactive { background: #f1f5f9; color: #64748b; }

.custody-guide { margin-top: 4px; }

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

.custody-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fafbff;
}

.custody-step-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.custody-step strong {
  display: block;
  margin-bottom: 2px;
  color: #334155;
  font-size: 12px;
}

.custody-step p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.custody-guide-foot {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.custody-dash {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.custody-dash > div {
  padding: 10px;
  border: 1px solid #eef2f7;
  border-radius: 9px;
  background: #fafbff;
  text-align: center;
}

.custody-dash strong {
  display: block;
  color: #1e293b;
  font-size: 22px;
  line-height: 1.1;
}

.custody-dash span {
  color: var(--muted);
  font-size: 9.5px;
}

.custody-dash .custody-dash-risk strong { color: #b91c1c; }
.custody-dash .custody-dash-risk { border-color: #fecaca; background: #fff7f7; }

.custody-dash-note {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.custody-dash-warning {
  margin-bottom: 0;
  font-size: 11px;
}

.custody-dash-warning a {
  display: inline-block;
  margin-left: 4px;
  font-weight: 700;
}

.custody-risk {
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 11.5px;
}

.custody-risk strong { font-size: 12px; }
.custody-risk p { margin: 3px 0 6px; }

.custody-risk-list {
  margin: 0 0 7px;
  padding-left: 16px;
}

.custody-risk-list li { margin-bottom: 5px; }
.custody-risk-list li > span { display: block; }
.custody-risk-list .cell-sub { color: #b91c1c; opacity: 0.8; }
.custody-risk .link { color: #991b1b; font-weight: 700; text-decoration: underline; }

.custody-cover {
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 11.5px;
}

.custody-cover strong { font-size: 12px; }
.custody-cover p { margin: 3px 0 6px; }
.custody-cover .link { color: #1e3a8a; font-weight: 700; text-decoration: underline; }

.custody-cover-details summary {
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.custody-cover-details ul {
  margin: 0 0 7px;
  padding-left: 17px;
}

.custody-cover-details li { margin-bottom: 4px; }
.custody-cover-details li span { display: block; opacity: 0.8; }

/* Custody admin */
.custody-setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.7fr);
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}

.custody-add-form .form-grid { gap: 12px; }

.custody-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.custody-form-foot .checkbox { padding-bottom: 0; }

.custody-category-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.custody-category-form .field { flex: 1; }

.custody-starter-note {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px dashed var(--border);
  line-height: 1.5;
}

.custody-category-head {
  align-items: flex-start;
  padding: 0 10px;
}

.custody-rename-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custody-rename-form .input { width: 180px; }

.custody-admin-table { min-width: 760px; }
.custody-admin-table td { vertical-align: top; }

.custody-admin-inactive { opacity: 0.62; }

.chain-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chain-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid #e5e9f0;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 10px;
}

.chain-summary-item b {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 8.5px;
}

.chain-summary-item span {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-summary-item em {
  color: #c2410c;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.chain-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.custody-active-toggle { margin-top: 18px; }

.custody-current-cover {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.custody-item-actions { margin-top: 20px; }

.custody-remove-card { margin-top: 18px; }
.custody-remove-card .card-head { align-items: center; }
.custody-remove-card .card-head form { margin: 0; }

.custody-setup-foot {
  margin: -4px 0 24px;
  color: var(--muted);
  font-size: 11px;
}

/* Printable custody sheet */
.print-body {
  min-height: 100vh;
  background: #eef2f7;
  color: #0f172a;
}

.print-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px 0;
}

.print-page {
  max-width: 1120px;
  margin: 18px auto 42px;
  padding: 32px 36px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px -30px rgba(15, 23, 42, 0.35);
}

.print-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #0f172a;
}

.print-brand {
  display: block;
  margin-bottom: 6px;
  color: #4f46e5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.print-header h1 {
  margin: 0 0 5px;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.print-header p {
  margin: 0;
  color: #64748b;
  font-size: 11.5px;
}

.print-header-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #eef2ff;
  color: #4f46e5;
}

.print-header-mark svg { width: 24px; height: 24px; }

.print-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid #e5e9f0;
  border-radius: 9px;
  background: #f8fafc;
}

.print-meta span {
  display: block;
  margin-bottom: 3px;
  color: #94a3b8;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.print-meta strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.print-notice {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-radius: 7px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 10.5px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.print-table th {
  padding: 7px 6px;
  border-bottom: 1.5px solid #0f172a;
  color: #475569;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.print-table td {
  padding: 9px 6px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.print-table tbody tr:last-child td { border-bottom: 1.5px solid #0f172a; }

.print-col-item { width: 18%; }
.print-col-chain { width: 24%; }
.print-col-duty { width: 16%; }
.print-col-sign { width: 21%; }

.print-table td strong { font-size: 10.5px; }

.print-sub {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 9px;
}

.print-chain span {
  display: block;
  margin-bottom: 3px;
}

.print-chain b { color: #334155; }

.print-chain em {
  margin-left: 3px;
  color: #c2410c;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.print-muted { color: #64748b; }
.print-danger { color: #b91c1c; }

.signature-line {
  display: block;
  height: 30px;
  border-bottom: 1px solid #64748b;
}

.signature-caption,
.signature-date {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 8px;
}

.signature-date { margin-top: 7px; }

.print-empty {
  padding: 26px 8px !important;
  color: #64748b;
  text-align: center;
}

.print-notes {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfcff;
}

.print-notes strong {
  display: block;
  margin-bottom: 8px;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.print-notes-line {
  display: block;
  height: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.print-footer {
  margin-top: 14px;
  color: #94a3b8;
  font-size: 8.5px;
}

.print-footer p { margin: 0; }

@page {
  size: A4 landscape;
  margin: 10mm;
}

@media print {
  body.print-body {
    background: #fff;
  }

  .no-print { display: none !important; }

  .print-page {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .print-table { font-size: 9.5px; }
  .print-table thead { display: table-header-group; }
  .print-table tbody tr { break-inside: avoid; page-break-inside: avoid; }
  .print-notes { break-inside: avoid; page-break-inside: avoid; }

  .print-body,
  .print-page,
  .print-table,
  .custody-badge,
  .print-notice {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media (max-width: 1120px) {
  .custody-setup-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .custody-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; justify-content: center; }

  .custody-controls { align-items: flex-start; }
  .custody-date-label { width: 100%; }

  .custody-date-form {
    width: 100%;
    flex-wrap: wrap;
  }

  .custody-date-form input[type="date"] { flex: 1; width: auto; }

  .custody-category { padding: 16px 0 8px; }
  .custody-category .card-head { padding: 0 14px; }
  .custody-category-head { flex-direction: column; }
  .custody-rename-form { width: 100%; }
  .custody-rename-form .input { flex: 1; width: auto; }

  .chain-select-grid { grid-template-columns: 1fr; }

  .custody-alert { padding: 12px; }

  .print-toolbar { padding: 14px 16px 0; }
  .print-page { margin: 14px 12px 28px; padding: 20px; }
  .print-header { flex-direction: column; }
  .print-meta { grid-template-columns: 1fr 1fr; }
}

/* Handovers, notifications, and attachments */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #4f46e5;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.bell-btn { position: relative; }

.bell-badge {
  position: absolute;
  top: 1px;
  right: 0;
  display: grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.status-custody { background: #eef2ff; color: #4338ca; }
.status-accepted { background: #ecfdf5; color: #047857; }
.status-declined { background: #fef2f2; color: #b91c1c; }

.page-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop:hover {
  border-color: #a5b4fc;
  background: #f5f7ff;
}

.file-drop:focus-within {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-drop-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #eef2ff;
  color: #4f46e5;
}

.file-drop-icon svg { width: 18px; height: 18px; }

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

.file-drop-copy strong { color: #334155; font-size: 12.5px; }
.file-drop-copy small { color: var(--muted); font-size: 10.5px; }

.cell-docs { min-width: 190px; }

.doc-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 190px;
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 500;
}

.doc-link svg { width: 13px; height: 13px; color: #64748b; }
.doc-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-link small { color: #94a3b8; font-size: 10px; }

.doc-link:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.attach-details summary {
  margin-top: 5px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.attach-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.attach-form input[type="file"] {
  max-width: 220px;
  font-size: 11px;
}

.approval-docs { margin: 0 0 14px; }

.approval-docs .doc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

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

.handover-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.handover-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.handover-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.handover-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: #eef2ff;
  color: #4f46e5;
}

.handover-icon svg { width: 18px; height: 18px; }

.handover-card h2 { margin-bottom: 2px; }

.handover-card-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.handover-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.handover-items li {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fbfcff;
}

.handover-items strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.handover-items span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}

.handover-item-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #eef2ff;
  color: #4f46e5;
}

.handover-item-icon svg { width: 15px; height: 15px; }

.handover-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.handover-form .form-hint { margin-top: 0; }

.handover-form .file-drop {
  padding: 10px 12px;
  border-radius: 10px;
}

.handover-form .file-drop-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.handover-form .file-drop-copy strong { font-size: 11.5px; }
.handover-form .file-drop-copy small { font-size: 10px; }

.handover-docs {
  margin: 0 0 14px;
}

.handover-docs .doc-links {
  margin-top: 6px;
  max-width: none;
}

.doc-group-label {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.notification-item:hover {
  border-color: #c7d2fe;
  background: #fbfcff;
  color: var(--text);
}

.notification-item.is-unread {
  border-color: #c7d2fe;
  background: #f7f8ff;
}

.notification-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #cbd5e1;
}

.notification-item.is-unread .notification-dot {
  background: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.notification-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.notification-copy strong { font-size: 13px; }

.notification-body {
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
}

.notification-date {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 10.5px;
}

.notification-arrow {
  width: 16px;
  height: 16px;
  margin: 3px 0 0 auto;
  color: #94a3b8;
}

@media (max-width: 980px) {
  .handover-list { grid-template-columns: 1fr; }
}

