/* Vidyalaya — Attendance Management System
 * Design tokens at the top, layout below, components last.
 * No build step — variables resolve at runtime in modern browsers.
 */

:root {
  /* palette */
  --primary: #4338ca;
  --primary-hover: #3730a3;
  --primary-soft: #eef2ff;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  /* typography */
  --font-body: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* shape */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 8px 28px rgba(15, 23, 42, 0.12);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

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

/* ── Boot spinner shown until app.js mounts ─────────────────────────────── */
.loading {
  display: grid;
  place-items: center;
  min-height: 100vh;
}
.boot-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Login screen ───────────────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 20% -10%, #e0e7ff 0%, transparent 60%),
    radial-gradient(1000px 500px at 110% 110%, #fce7f3 0%, transparent 50%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 28px;
}

.brand {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.brand-sub {
  margin: 4px 0 28px;
  font-size: 14px;
  color: var(--text-muted);
}
.brand-small {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--primary);
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form label > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.form input,
.form select,
.form textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 120ms, box-shadow 120ms;
}
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.18);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: var(--danger);
}

.hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 15px;
  margin-top: 4px;
  transition: background 120ms, transform 120ms;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 7px 13px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: background 120ms;
}
.btn-ghost:hover {
  background: var(--surface-2);
}

/* ── App shell (post-login) ────────────────────────────────────────────── */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-name {
  font-weight: 500;
  font-size: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}
.badge-ok   { background: #dcfce7; color: #14532d; }
.badge-warn { background: #fef3c7; color: #78350f; }
.badge-err  { background: #fee2e2; color: #7f1d1d; }

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

.display {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.muted {
  color: var(--text-muted);
}

/* ── Top nav (tabs in the header) ───────────────────────────────────────── */
.topnav {
  display: flex;
  gap: 4px;
  flex: 1;
  margin: 0 24px;
  overflow-x: auto;
}
.topnav-link {
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background 120ms, color 120ms;
}
.topnav-link:hover {
  background: var(--surface-2);
  text-decoration: none;
  color: var(--text);
}
.topnav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* ── Skeleton loading state ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, #e8eef5 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Page header with month picker ──────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}
.month-picker {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.month-picker > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.month-picker input,
.month-picker select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.card.empty {
  background: var(--surface-2);
  box-shadow: none;
}
.card-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 4px 0 3px;
  letter-spacing: -0.01em;
}
.card-value-suffix {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.card-h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -0.005em;
}
.card-h-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.card-h-row .card-h3 {
  margin: 0;
}

.lock-pill {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.lock-pill-permanent {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* Comprehensive employee profile modal — sectioned layout */
.modal:has(.emp-form) { max-width: 640px; }
.emp-form { gap: 18px; }
.emp-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.emp-fieldset legend {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 6px;
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
}
.emp-name-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted #cbd5e1;
}
.emp-name-link:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.alert-pending {
  margin-top: 12px;
  padding: 10px 12px;
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: var(--radius-sm);
  color: #6b21a8;
  font-size: 13px;
}

.alert-positive {
  margin-top: 10px;
  padding: 8px 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  color: #065f46;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}
.alert-positive .muted {
  font-size: 10.5px;
}

.excused-pill {
  display: inline-block;
  background: #d1fae5;
  color: #065f46;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
  vertical-align: middle;
}

.excused-inline {
  color: #065f46;
  font-size: 12px;
  font-weight: 500;
  background: #ecfdf5;
  padding: 1px 6px;
  border-radius: 4px;
}

.missing-pill {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  font-style: italic;
}

/* ── Bulk edit (spreadsheet-style) ──────────────────────────────────────── */
#bulk-edit.active {
  background: #4338ca;
  color: #ffffff;
}
.bulk-edit-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.bulk-edit-status {
  font-size: 14px;
  color: #78350f;
}
.bulk-edit-status #dirty-count {
  font-weight: 700;
  color: #b91c1c;
}
.bulk-edit-table {
  font-size: 13px;
}
.bulk-edit-table th,
.bulk-edit-table td {
  padding: 4px 6px !important;
  vertical-align: middle;
}
.bulk-edit-table input[type="text"],
.bulk-edit-table input[type="tel"],
.bulk-edit-table input[type="date"],
.bulk-edit-table input[type="number"],
.bulk-edit-table select {
  width: 100%;
  padding: 4px 6px;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  box-sizing: border-box;
}
.bulk-edit-table input[type="number"] { text-align: right; }
.bulk-edit-table input:focus,
.bulk-edit-table select:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}
.bulk-edit-table tr.row-dirty {
  background: #fef9c3;
}
.bulk-edit-table tr.row-dirty input,
.bulk-edit-table tr.row-dirty select {
  border-color: #f59e0b;
  background: #fffbeb;
}
.bulk-edit-table tr.row-dirty td:first-child::before {
  content: '●';
  color: #f59e0b;
  margin-right: 6px;
  font-size: 14px;
}

/* ── Stat row (P/L/A counts) ────────────────────────────────────────────── */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.stat-row-summary {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.stat b {
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
}
.stat.warn b {
  color: var(--warning);
}

/* ── Status badges ──────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-present { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.status-late    { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.status-absent  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.status-half-day{ background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.status-holiday { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.status-cl      { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }
.status-hpl     { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.status-pending { background: #faf5ff; color: #6b21a8; border-color: #e9d5ff; }
.status-outage  { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.status-default { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }

.row-pending { background: #faf5ff66; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  /* Scroll wide tables (e.g. payroll) horizontally instead of clipping the
     last columns; keep corners rounded via clip on the y-axis. */
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th,
.data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table thead th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-2);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: #fafbfd;
}
.date-cell {
  display: flex;
  flex-direction: column;
}
.date-cell .muted {
  font-size: 12px;
}

/* ── Salary breakdown ───────────────────────────────────────────────────── */
.salary-hero {
  background: linear-gradient(135deg, #eef2ff 0%, #fdf4ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.salary-hero-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.salary-hero-value {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  margin: 6px 0 8px;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.salary-hero-meta {
  font-size: 14px;
}

.breakdown-table tr td:first-child {
  width: 60%;
}
.breakdown-table tr td:last-child {
  text-align: right;
}
.breakdown-table .row-divider td {
  border-top: 2px solid var(--border-strong);
  padding-top: 14px;
}
.breakdown-table .row-total td {
  background: var(--primary-soft);
  font-size: 16px;
  padding: 14px;
}

/* ── Profile page ───────────────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.profile-photo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-photo-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
}
.photo-form {
  width: 100%;
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 14px;
  margin: 0;
  font-size: 14px;
}
.kv dt {
  color: var(--text-muted);
  font-weight: 500;
}
.kv dd {
  margin: 0;
}

/* Side-by-side inputs in the Contact / Bank forms. */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Document upload rows on the Profile page. */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.doc-row-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.doc-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.doc-row-status {
  font-size: 12px;
}

.form-msg {
  margin: 0;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.form-msg-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.form-msg-err {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* ── Filter row + inline form + small button ────────────────────────────── */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  min-width: 0; /* lets flex shrink + wrap inside .page-header */
}
.filter-row .btn-primary,
.filter-row .btn-ghost {
  height: 38px;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.form-inline input,
.form-inline select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.btn-small {
  padding: 4px 9px;
  font-size: 12px;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: 1px solid var(--danger);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
}
.btn-danger:hover {
  background: #b91c1c;
}

/* Warn variant of card */
.card-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.row-inactive {
  opacity: 0.55;
}

.checkbox-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.checkbox-row input {
  width: auto;
  margin: 0;
}

.bullet-list {
  margin: 8px 0 16px 18px;
  padding: 0;
  font-size: 14px;
}
.bullet-list li {
  margin-bottom: 4px;
}

/* ── File input ─────────────────────────────────────────────────────────── */
input[type="file"] {
  font-family: inherit;
  font-size: 14px;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  width: 100%;
}

/* ── Month-pick list (import preview) ───────────────────────────────────── */
.month-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}
.month-pick-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px !important;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}
.month-pick-row:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.month-pick-info {
  display: flex;
  flex-direction: column;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  z-index: 1000;
  animation: fade-in 120ms ease;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  animation: pop-in 140ms ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 26px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover {
  color: var(--text);
}
.modal-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  animation: slide-in 180ms ease;
  pointer-events: auto;
  transition: opacity 300ms, transform 300ms;
}
.toast-ok { background: #047857; }
.toast-err { background: var(--danger); }
.toast-fade { opacity: 0; transform: translateX(40px); }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Attendance calendar grid (Google Calendar–style chips) ─────────────── */
/* ── Calendar grid (refined visual treatment) ──────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.cal-head {
  background: transparent;
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 0 4px;
  border-bottom: none;
}
.cal-cell {
  min-height: 56px;
  padding: 4px 6px 5px 7px;
  background: #ffffff;
  border-radius: 6px;
  border-left: 3px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  transition: box-shadow 120ms ease, transform 120ms ease;
}
.cal-cell.cal-clickable { cursor: pointer; }
.cal-cell.cal-clickable:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  z-index: 1;
}
.cal-blank {
  background: transparent;
  border-left-color: transparent;
  box-shadow: none;
}
.cal-norecord {
  background: #fafbfd;
}
.cal-sunday {
  background: #fdf2f8;
}
.cal-sunday .cal-date { color: #be185d; }
.cal-dim { opacity: 0.3; }

/* Status accent bar on the left of each cell — at-a-glance scannable. */
.cal-cell.cal-status-present              { border-left-color: #22c55e; }
.cal-cell.cal-status-late                 { border-left-color: #f59e0b; }
.cal-cell.cal-status-absent               { border-left-color: #ef4444; }
.cal-cell.cal-status-half_day             { border-left-color: #fb923c; }
.cal-cell.cal-status-holiday              { border-left-color: #3b82f6; }
.cal-cell.cal-status-casual_leave         { border-left-color: #a855f7; }
.cal-cell.cal-status-half_paid_leave      { border-left-color: #06b6d4; }
.cal-cell.cal-status-single_punch_pending { border-left-color: #d946ef; }
.cal-cell.cal-status-system_outage        { border-left-color: #64748b; }

.cal-date {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  margin: 0 0 1px 0;
  padding: 0;
  height: 16px;
}
.cal-date.cal-today {
  background: var(--primary);
  color: #ffffff;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  justify-content: center;
  font-size: 10px;
}

.cal-chip {
  display: block;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.35;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

/* Status chips: soft tinted background with dark text — softer than solid
   color blocks, easier on the eye when there are many cells in view. */
.cal-chip-present              { background: #dcfce7; color: #166534; }
.cal-chip-late                 { background: #fef3c7; color: #854d0e; }
.cal-chip-absent               { background: #fee2e2; color: #991b1b; }
.cal-chip-half_day             { background: #ffedd5; color: #9a3412; }
.cal-chip-holiday              { background: #dbeafe; color: #1e40af; }
.cal-chip-casual_leave         { background: #f3e8ff; color: #6b21a8; }
.cal-chip-half_paid_leave      { background: #cffafe; color: #155e75; }
.cal-chip-single_punch_pending { background: #fae8ff; color: #86198f; }
.cal-chip-system_outage        { background: #e2e8f0; color: #334155; }

.cal-chip-time {
  background: transparent;
  color: #475569;
  font-weight: 500;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 9px;
  padding: 0 1px;
}
.cal-chip-school {
  background: transparent;
  color: #94a3b8;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 8.5px;
  font-weight: 500;
  padding: 0 1px;
  letter-spacing: 0;
}
.cal-chip-grace {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
  font-weight: 600;
  font-size: 8.5px;
}

/* ── CL card Total/Used/Left layout + usage list ───────────────────────── */
.cl-stat-row {
  display: flex;
  gap: 18px;
  margin: 6px 0 12px;
}
.cl-stat {
  flex: 1;
  text-align: left;
}
.cl-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}
.cl-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-top: 2px;
}
.cl-stat-used .cl-stat-num { color: #b45309; }
.cl-stat-left .cl-stat-num { color: #15803d; }
.cl-usage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
}
.cl-usage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}
.cl-usage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cl-usage-dot-absence { background: #a855f7; }
.cl-usage-dot-trade { background: #f59e0b; }

/* ── Rich calendar (employee screenshot-style "Calendar mode") ─────────── */
.view-toggle {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.view-toggle-btn {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 13px;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.view-toggle-btn:hover { color: #1e293b; }
.view-toggle-btn.is-active {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.rc-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
  flex-wrap: wrap;
}
.rc-header-title {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 14px;
  color: #334155;
}
.rc-header-sep { margin: 0 4px; color: #94a3b8; }
.rc-header-month { color: #4f46e5; }
.rc-header-shifts {
  font-size: 12.5px;
  color: #64748b;
}

.rc-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.rc-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
}
.rc-card-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.rc-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #475569;
}
.rc-card-count {
  font-size: 11px;
  color: #64748b;
}
.rc-card-count b {
  font-size: 15px;
  color: #0f172a;
  margin-right: 3px;
}
/* Status palette — kept in lockstep with calendar cell fills */
.rc-card-present { border-left-color: #15803d; }
.rc-card-present .rc-card-icon { background: #dcfce7; color: #15803d; }
.rc-card-late    { border-left-color: #a16207; }
.rc-card-late    .rc-card-icon { background: #fef3c7; color: #a16207; }
.rc-card-absent  { border-left-color: #b91c1c; }
.rc-card-absent  .rc-card-icon { background: #fee2e2; color: #b91c1c; }
.rc-card-half    { border-left-color: #c2410c; }
.rc-card-half    .rc-card-icon { background: #ffedd5; color: #c2410c; }
.rc-card-cl      { border-left-color: #6b21a8; }
.rc-card-cl      .rc-card-icon { background: #f3e8ff; color: #6b21a8; }
.rc-card-leave   { border-left-color: #1d4ed8; }
.rc-card-leave   .rc-card-icon { background: #dbeafe; color: #1d4ed8; }
.rc-card-single  { border-left-color: #a16207; }
.rc-card-single  .rc-card-icon { background: #fef9c3; color: #a16207; }

.rc-excused-note {
  margin-bottom: 12px;
  font-size: 12.5px;
  color: #475569;
  padding: 6px 10px;
  background: #f1f5f9;
  border-radius: 6px;
  display: inline-block;
}

.rc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  background: #fff;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
}
.rc-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #94a3b8;
  padding: 4px 6px;
  text-align: left;
}
.rc-cell {
  position: relative;
  min-height: 92px;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  font-size: 11px;
  color: #475569;
  overflow: hidden;
}
.rc-blank { background: transparent; }
.rc-empty { background: #f8fafc; }
.rc-sunday { background: #fdf2f8; }
.rc-sunday .rc-date { color: #be185d; }
.rc-clickable { cursor: pointer; transition: transform 0.1s, box-shadow 0.1s; }
.rc-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,23,42,0.10);
}
.rc-code {
  position: absolute;
  top: 3px;
  left: 5px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.3px;
  line-height: 1;
}
.rc-cell-times {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  margin-top: 12px;
}
.rc-cell-times-key {
  font-size: 8.5px;
  font-weight: 700;
  opacity: 0.7;
  margin-right: 2px;
}
.rc-cell-school {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  margin-top: 3px;
  opacity: 0.7;
  padding-top: 3px;
  border-top: 1px dashed currentColor;
  width: 80%;
}
.rc-cell-school-key {
  font-size: 8px;
  font-weight: 700;
  margin-right: 2px;
  opacity: 0.85;
}
.rc-date {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  opacity: 0.75;
}
.rc-empty .rc-date,
.rc-sunday .rc-date {
  position: static;
  align-self: flex-start;
  padding: 5px 6px;
  opacity: 1;
}
.rc-today {
  outline: 2px solid #4f46e5;
  outline-offset: -2px;
}

/* Per-status fills — mirror the summary-card palette */
.rc-cell.rc-status-present     { background: #dcfce7; color: #14532d; }
.rc-cell.rc-status-present     .rc-date { color: #15803d; }
.rc-cell.rc-status-late        { background: #fef3c7; color: #713f12; }
.rc-cell.rc-status-late        .rc-date { color: #a16207; }
.rc-cell.rc-status-late-excused { background: #ccfbf1; color: #134e4a; }
.rc-cell.rc-status-late-excused .rc-date { color: #0f766e; }
.rc-cell.rc-status-late-traded { background: #ede9fe; color: #3730a3; }
.rc-cell.rc-status-late-traded .rc-date { color: #4f46e5; }
.rc-cell.rc-status-absent      { background: #fee2e2; color: #7f1d1d; }
.rc-cell.rc-status-absent      .rc-date { color: #b91c1c; }
.rc-cell.rc-status-half        { background: #ffedd5; color: #7c2d12; }
.rc-cell.rc-status-half        .rc-date { color: #c2410c; }
.rc-cell.rc-status-phd         { background: #cffafe; color: #134e4a; }
.rc-cell.rc-status-phd         .rc-date { color: #0e7490; }
.rc-cell.rc-status-cl          { background: #f3e8ff; color: #581c87; }
.rc-cell.rc-status-cl          .rc-date { color: #6b21a8; }
.rc-cell.rc-status-leave       { background: #dbeafe; color: #1e3a8a; }
.rc-cell.rc-status-leave       .rc-date { color: #1d4ed8; }
.rc-cell.rc-status-single      { background: #fef9c3; color: #713f12; }
.rc-cell.rc-status-single      .rc-date { color: #a16207; }
.rc-cell.rc-status-outage      { background: #e2e8f0; color: #334155; }

/* Day-detail modal */
.rc-modal-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.rc-modal-status.rc-status-present       { background: #dcfce7; color: #15803d; }
.rc-modal-status.rc-status-late          { background: #fef3c7; color: #a16207; }
.rc-modal-status.rc-status-late-excused  { background: #ccfbf1; color: #0f766e; }
.rc-modal-status.rc-status-late-traded   { background: #ede9fe; color: #4f46e5; }
.rc-modal-status.rc-status-absent        { background: #fee2e2; color: #b91c1c; }
.rc-modal-status.rc-status-half          { background: #ffedd5; color: #c2410c; }
.rc-modal-status.rc-status-phd           { background: #cffafe; color: #0e7490; }
.rc-modal-status.rc-status-cl            { background: #f3e8ff; color: #6b21a8; }
.rc-modal-status.rc-status-leave         { background: #dbeafe; color: #1d4ed8; }
.rc-modal-status.rc-status-single  { background: #fef9c3; color: #a16207; }
.rc-modal-status.rc-status-outage  { background: #e2e8f0; color: #334155; }
.rc-modal-section {
  margin-bottom: 12px;
  font-size: 13px;
  color: #334155;
}
.rc-modal-section-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: #475569;
}
.rc-modal-punches {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.rc-late-tag { color: #b91c1c; font-size: 11.5px; font-weight: 600; }
.rc-modal-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rc-modal-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.rc-modal-dot-green { background: #15803d; }
.rc-modal-time { margin-left: auto; font-weight: 700; color: #0f172a; }
.rc-modal-note {
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #cbd5e1;
  font-size: 13px;
  color: #334155;
}

@media (max-width: 760px) {
  .rc-cards { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .rc-card { padding: 6px 8px; gap: 6px; }
  .rc-card-icon { width: 24px; height: 24px; font-size: 12px; }
  .rc-card-label { font-size: 9px; letter-spacing: 0.3px; }
  .rc-card-count { font-size: 10px; }
  .rc-card-count b { font-size: 13px; }
  .rc-grid { padding: 4px; gap: 3px; }
  .rc-cell {
    border-radius: 6px;
    padding: 3px;
    aspect-ratio: 1 / 1;
    min-height: 0;
  }
  .rc-code { font-size: 9px; top: 2px; left: 3px; }
  .rc-cell-times { font-size: 8.5px; margin-top: 8px; }
  .rc-cell-times-key { display: none; }
  .rc-cell-school { display: none; }
  .rc-head { font-size: 9px; padding: 2px 3px; }
  .rc-date { font-size: 9px; right: 3px; bottom: 2px; }
}
@media (max-width: 420px) {
  .rc-code { font-size: 8px; }
  .rc-cell-times { font-size: 7.5px; }
  .rc-date { font-size: 8.5px; }
}

/* ── Grace-time summary strip on the employee attendance page ──────────── */
.grace-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 8px 0;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
}
.grace-summary-label {
  font-size: 13px;
  color: #78350f;
  font-weight: 600;
  margin-right: 4px;
}
.grace-pill {
  background: #ffffff;
  border: 1px solid #fde68a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #78350f;
}
.grace-pill strong { font-weight: 700; }

/* ── View toggle (Calendar / Grid) ──────────────────────────────────────── */
.view-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.view-toggle-btn {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
}
.view-toggle-btn.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ── Attendance grid (multi-employee × all-days table) ──────────────────── */
.grid-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: 75vh;
}
/* When the grid is unfiltered, the body holds three sections (Teacher /
   Housekeeping / Driver) stacked top-to-bottom. */
.grid-section { margin-top: 22px; }
.grid-section:first-child { margin-top: 0; }
.grid-section-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.grid-section-empty {
  padding: 16px;
  background: #ffffff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
}

/* "Apply to" multi-checkbox group inside the school-time modal. */
.apply-types {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0;
}
.apply-types legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 4px;
}
.apply-type-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  cursor: pointer;
  font-size: 14px;
}
.apply-type-check input { margin: 0; }
.att-grid {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  width: max-content;
  min-width: 100%;
}
.att-grid th,
.att-grid td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
}
.att-grid thead th {
  background: var(--surface-2);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}
.att-grid thead tr:nth-child(2) th {
  top: 30px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.grid-emp-head,
.grid-emp-name {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 3;
  text-align: left;
  min-width: 160px;
  border-right: 2px solid var(--border);
}
.grid-emp-head {
  background: var(--surface-2);
  z-index: 4;
}
.grid-emp-name .muted {
  font-size: 10px;
  color: var(--text-muted);
}
.grid-date {
  font-size: 12px;
  font-weight: 600;
}
.grid-day {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.grid-time-cell {
  font-family: 'Menlo', 'Consolas', monospace;
  cursor: pointer;
}
.grid-time-cell:hover {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  position: relative;
}
.grid-status-cell {
  font-size: 11px;
  font-weight: 500;
}
.grid-empty {
  background: #fafbfd;
}
/* Pre-join cells: employee hadn't joined yet, so show a muted diagonal
   stripe pattern + "Not joined" label so it's clearly distinct from an
   absence or a missing punch. */
.grid-prejoin {
  background:
    repeating-linear-gradient(
      45deg,
      #f1f5f9 0,
      #f1f5f9 6px,
      #e2e8f0 6px,
      #e2e8f0 12px
    ) !important;
  color: #64748b;
  font-style: italic;
  font-size: 11px;
}

/* Paid-half-day quarterly strip on the employee Overview. Compact 4-cell
   row showing Q1..Q4 status with the date when used. */
.phq-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.phq-cell {
  text-align: center;
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.phq-cell.phq-current {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.phq-cell.phq-used {
  background: #cffafe;
  border-color: #67e8f9;
}
.phq-q {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.phq-cell.phq-used .phq-q { color: #155e75; }
.phq-date {
  font-size: 11px;
  font-weight: 600;
  color: #155e75;
  font-family: 'Menlo', 'Consolas', monospace;
}
.phq-left-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

/* Inline grace input on the day-level overrides table. */
.grace-inline {
  width: 64px;
  padding: 4px 6px;
  font-size: 13px;
  font-family: 'Menlo', 'Consolas', monospace;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.grace-inline:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

/* "Joined DD MMM" pill on the Payroll table for mid-month joiners. */
.join-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.grid-sunday {
  background: #fef3f3;
}
/* Strong divider between employees — both rows of an employee block end
   here, so a thick dark line cleanly separates them visually. */
.grid-emp-status-row td,
.grid-emp-status-row th {
  border-bottom: 3px solid #475569;
}
.grid-emp-row td,
.grid-emp-row th {
  border-top: 1px solid var(--border);
}
/* Zebra-stripe the employee NAME column so the eye can track rows even when
   the colored status cells visually dominate. */
.att-grid tbody tr.grid-emp-row:nth-of-type(4n+1) .grid-emp-name {
  background: #f8fafc;
}

/* School-time header row — sits below date+day headers, above employee rows. */
.att-grid .grid-school-row th,
.att-grid .grid-school-row td {
  background: #fff8e1;
  border-bottom: 2px solid #fcd34d;
  /* Stick the entire school-time row below the two stacked header rows so it
     stays visible while the body scrolls vertically. The TDs need explicit
     sticky too — the generic `thead th` rule only catches the THs. */
  position: sticky;
  top: 56px;
  z-index: 2;
}
.att-grid .grid-school-row th {
  left: 0;
  z-index: 4; /* above the school-time TDs when both directions scroll */
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  color: #78350f;
  border-right: 2px solid var(--border);
  background: #fef3c7;
}
.grid-school-cell {
  cursor: pointer;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 11px;
  white-space: nowrap;
  user-select: none;
}
.grid-school-cell:hover {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  position: relative;
}
.grid-school-overridden {
  background: #fde68a !important;
  font-weight: 600;
}
.grid-school-times .muted {
  color: #92400e;
}

/* Summary columns at the right edge — Late / CL / Absent / Paid½ / Unpaid½ */
.grid-summary-head {
  background: #1e293b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  min-width: 56px;
  border-left: 2px solid var(--border);
}
.grid-summary-head.grid-summary-late    { background: #d97706; }
.grid-summary-head.grid-summary-cl      { background: #7c3aed; }
.grid-summary-head.grid-summary-absent  { background: #b91c1c; }
.grid-summary-head.grid-summary-paid    { background: #0e7490; }
.grid-summary-head.grid-summary-unpaid  { background: #c2410c; }
.grid-summary-cell {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  border-left: 2px solid var(--border);
  background: #ffffff;
  font-family: 'Menlo', 'Consolas', monospace;
}
.grid-summary-cell.zero {
  color: #cbd5e1;
  font-weight: 500;
}
.grid-summary-cell.grid-summary-late.has-count   { color: #b45309; background: #fef3c7; }
.grid-summary-cell.grid-summary-cl.has-count     { color: #6b21a8; background: #ede9fe; }
.grid-summary-cell.grid-summary-absent.has-count { color: #991b1b; background: #fee2e2; }
.grid-summary-cell.grid-summary-paid.has-count   { color: #155e75; background: #cffafe; }
.grid-summary-cell.grid-summary-unpaid.has-count { color: #9a3412; background: #ffedd5; }

/* ── Import progress (shown while the commit POST is in flight) ─────────── */
.import-progress-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 22px 26px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.18);
}
.import-progress-spinner {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 4px solid #c7d2fe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.import-progress-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.import-progress-sub {
  font-size: 13px;
  color: #4338ca;
}

/* ── Import error banner (shown when /api/import/commit throws) ─────────── */
.import-error-banner {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 22px 26px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 2px solid var(--danger);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.18);
}
.import-error-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.import-error-title {
  margin: 0 0 6px 0;
  font-size: 18px;
  color: #7f1d1d;
}
.import-error-msg {
  margin: 0;
  font-size: 14px;
  color: #7f1d1d;
  word-break: break-word;
}

/* ── Import success banner ──────────────────────────────────────────────── */
.import-success-banner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 28px 32px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #10b981;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.18);
  animation: import-success-pop 0.32s ease-out;
}
@keyframes import-success-pop {
  0%   { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1);    opacity: 1; }
}
.import-success-icon {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 32px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.import-success-body { flex: 1; min-width: 0; }
.import-success-title {
  margin: 0 0 14px 0;
  font-size: 22px;
  font-weight: 700;
  color: #064e3b;
  letter-spacing: -0.01em;
}
.import-success-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.stat-pill {
  background: #ffffff;
  border: 1px solid #a7f3d0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: #065f46;
}
.stat-pill strong { color: #064e3b; font-weight: 700; margin-right: 4px; }
.stat-pill.warn   { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
.stat-pill.warn strong { color: #78350f; }
.import-success-note {
  margin: 6px 0 0 0;
  font-size: 13px;
  color: #065f46;
}
.import-success-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Excused late — admin marked the late as no-deduction ──────────────── */
/* Calendar chip: keep the orange "Late" tone but add a green check ring */
.cal-chip-late-excused {
  background: #f59e0b !important;
  color: #ffffff !important;
  position: relative;
  padding-right: 22px;
}
.cal-chip-late-excused::after {
  content: '✓';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: #16a34a;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid #ffffff;
}
.cal-cell-excused {
  border: 2px solid #16a34a !important;
}

/* Late traded for CL — orange chip with a purple "↔CL" badge */
.cal-chip-late-cl {
  background: #f59e0b !important;
  color: #ffffff !important;
  position: relative;
  padding-right: 28px;
}
.cal-chip-late-cl::after {
  content: 'CL';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: #9333ea;
  color: #ffffff;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
}
.cal-chip-excuse-note {
  background: #ecfdf5;
  color: #065f46;
  font-size: 10px;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #a7f3d0;
}

/* Grid: show a green left border on excused-late time cells */
.att-grid .grid-time-cell.grid-late-excused,
.att-grid .grid-status-cell.grid-late-excused {
  box-shadow: inset 3px 0 0 #16a34a;
}
.att-grid .grid-status-cell.grid-late-excused {
  background: #fde68a;
  color: #14532d;
  font-weight: 600;
}

/* Grid: purple left border + label tint for lates traded for CL */
.att-grid .grid-time-cell.grid-late-cl,
.att-grid .grid-status-cell.grid-late-cl {
  box-shadow: inset 3px 0 0 #9333ea;
}
.att-grid .grid-status-cell.grid-late-cl {
  background: #fde68a;
  color: #6b21a8;
  font-weight: 600;
}

/* Payroll table — small "↔CL" pill next to the Present column when any
   lates have been traded. */
.trade-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: #ede9fe;
  color: #5b21b6;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Summary cell: small parenthetical for excused count */
.grid-summary-sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: #92400e;
  font-family: var(--font-sans);
  margin-top: 2px;
}

/* ── Excuse-late block in the override modal ────────────────────────────── */
.excuse-block {
  border: 1px dashed #fcd34d;
  background: #fffbeb;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 4px 0;
}
.excuse-block[hidden] { display: none; }
.checkbox-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 10px !important;
  cursor: pointer;
  margin-bottom: 8px;
}
.checkbox-row input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.checkbox-row span {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

/* Status colors — light backgrounds so the time digits stay legible. */
.att-grid .grid-status-present              { background: #dcfce7; }
.att-grid .grid-status-late                 { background: #fef3c7; }
.att-grid .grid-status-absent               { background: #fee2e2; }
.att-grid .grid-status-half_day             { background: #ffedd5; }
.att-grid .grid-status-holiday              { background: #dbeafe; }
.att-grid .grid-status-casual_leave         { background: #f3e8ff; }
.att-grid .grid-status-half_paid_leave      { background: #cffafe; }
.att-grid .grid-status-single_punch_pending { background: #fae8ff; }
.att-grid .grid-status-system_outage        { background: #e2e8f0; }

/* Status row gets a slightly bolder tint than the time row. */
.att-grid .grid-status-cell.grid-status-present              { background: #bbf7d0; color: #14532d; }
.att-grid .grid-status-cell.grid-status-late                 { background: #fde68a; color: #78350f; }
.att-grid .grid-status-cell.grid-status-absent               { background: #fecaca; color: #7f1d1d; }
.att-grid .grid-status-cell.grid-status-half_day             { background: #fed7aa; color: #7c2d12; }
.att-grid .grid-status-cell.grid-status-holiday              { background: #bfdbfe; color: #1e3a8a; }
.att-grid .grid-status-cell.grid-status-casual_leave         { background: #e9d5ff; color: #581c87; }
.att-grid .grid-status-cell.grid-status-half_paid_leave      { background: #a5f3fc; color: #164e63; }
.att-grid .grid-status-cell.grid-status-single_punch_pending { background: #f5d0fe; color: #701a75; }
.att-grid .grid-status-cell.grid-status-system_outage        { background: #cbd5e1; color: #1e293b; }

/* Mobile: collapse to single-column list */
@media (max-width: 600px) {
  .cal-grid {
    grid-template-columns: 1fr;
  }
  .cal-head {
    display: none;
  }
  .cal-blank {
    display: none;
  }
  .cal-cell {
    min-height: auto;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
  }
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state p {
  margin: 6px 0;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
/* Phone + small tablet: switch the topbar to an explicit 2-row grid so the
   nav strip always sits on its own line and can scroll horizontally without
   competing with brand / user actions for space on row 1. */
@media (max-width: 720px) {
  .topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 6px;
    padding: 10px 14px;
    align-items: center;
  }
  .brand-small {
    font-size: 18px;
    grid-column: 1;
    grid-row: 1;
    margin: 0;
  }
  .topbar-right {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
  }
  .user-name {
    font-size: 13px;
    max-width: 36vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .badge { padding: 2px 7px; font-size: 10px; }
  .topbar-right .btn-ghost { height: 32px; padding: 0 12px; font-size: 13px; }
  .topnav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin: 0;
    padding: 4px 2px 2px;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-top: 1px solid var(--border);
  }
  .topnav-link {
    padding: 7px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 22px 22px;
  }
  .brand {
    font-size: 32px;
  }
  .content {
    padding: 24px 16px;
  }
  .display {
    font-size: 26px;
  }
  .salary-hero-value {
    font-size: 36px;
  }
}

/* ── Admin dashboard ────────────────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 6px;
}
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.kpi-card .card-meta { margin-top: 8px; }
.kpi-card .card-value { margin-top: 8px; font-size: 30px; }
.kpi-card.kpi-accent {
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  border-color: #c7d2fe;
}
.kpi-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kpi-mini-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

.dash-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.chart-card { padding: 18px 20px 22px; }
.chart-wrap {
  position: relative;
  height: 260px;
  margin-top: 6px;
}
.chart-wrap-donut { height: 240px; }

.dash-tables {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
@media (max-width: 880px) {
  .dash-tables { grid-template-columns: 1fr; }
}

.compact-table { font-size: 13px; }
.compact-table th, .compact-table td { padding: 8px 10px; }
.type-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.action-item:last-child { margin-bottom: 0; }
.action-warn { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.action-info { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.action-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

/* Segmented toggle inside chart cards */
.seg-toggle {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:hover { color: #1e293b; }
.seg-btn-active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.seg-count {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 0 5px;
  margin-left: 3px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}
.seg-btn-active .seg-count { background: #eef2ff; color: #4338ca; }

/* ── Payroll: type-grouped sections ─────────────────────────────────────── */
.payroll-group {
  margin-top: 22px;
}
.payroll-group-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #4f46e5);
}
.payroll-group-header .muted {
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-muted);
}
.payroll-subtotal td {
  background: #faf9ff;
  font-weight: 600;
}
.payroll-grand-total {
  margin: 18px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #f5f3ff;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
}
.payroll-grand-total b {
  margin-right: 4px;
}

/* Screen defaults for the print-split wrappers around each grid section.
   Declared BEFORE the @media print block so the print rules below override
   them rather than the other way around. */
.grid-print-only { display: none; }
.grid-screen-only { display: block; }

/* ── Print stylesheet (Export PDF) ──────────────────────────────────────── */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 0; }
  .no-print { display: none !important; }
  .data-table { font-size: 11px; }
  .data-table th, .data-table td { padding: 4px 6px; }
  .data-table thead { display: table-header-group; } /* repeat header per page */
  .data-table tr { page-break-inside: avoid; }
  .payroll-group { margin-top: 12px; }
  .payroll-group-header { page-break-after: avoid; }
  .payroll-subtotal { page-break-before: avoid; }
  .stat-row, .payroll-grand-total {
    border: 1px solid #ddd; background: #fff !important;
  }

  /* Attendance grid print layout. The grid is 60+ columns wide so for print
     we split each section into two half-month tables (1–15 and 16–end) and
     hide the on-screen full-width table. We also drop sticky positioning
     (which breaks print pagination) and force status-cell background colors. */
  .grid-screen-only { display: none !important; }
  .grid-print-only { display: block; }
  .grid-print-pagebreak { page-break-before: always; }
  .grid-print-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    margin: 8px 0 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .grid-print-header { margin: 0 0 8px; }
  .grid-print-header h2 { margin: 0; font-size: 16px; }
  .grid-print-meta { font-size: 12px; color: #475569; margin-top: 2px; }
  .grid-wrap {
    overflow: visible !important;
    max-height: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  .grid-section { margin-top: 12px; }
  .grid-section-title { font-size: 13px; margin-bottom: 4px; }
  .att-grid {
    font-size: 11px;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto;
    border-collapse: collapse;
  }
  .att-grid th, .att-grid td {
    padding: 3px 5px;
    border: 1px solid #cbd5e1;
  }
  .att-grid thead th,
  .att-grid .grid-school-row th,
  .att-grid .grid-school-row td,
  .grid-emp-head,
  .grid-emp-name {
    position: static !important;
  }
  .att-grid thead { display: table-header-group; }
  .att-grid tr.grid-emp-row,
  .att-grid tr.grid-emp-status-row { page-break-inside: avoid; }
  .grid-emp-head,
  .grid-emp-name {
    min-width: 110px !important;
    width: 110px;
    text-align: left;
  }
  .grid-emp-name { font-size: 11px; }
  .grid-emp-name .muted { font-size: 9px; }
  .grid-date { font-size: 11px; font-weight: 600; }
  .grid-day, .att-grid thead tr:nth-child(2) th { font-size: 10px; }
  .grid-status-cell { font-size: 10px; }
  .grid-school-cell { font-size: 10px; }
  /* Force browsers to print the colored status backgrounds rather than
     stripping them as ink-saving. */
  .att-grid, .att-grid * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page { margin: 12mm; size: A4 landscape; }
}
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* ── Salary advances ─────────────────────────────────────────────────────── */
.advance-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.advance-list { display: flex; flex-direction: column; gap: 14px; }
.advance-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-2);
}
.advance-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.advance-item-status { text-align: right; font-size: 13px; }
.advance-override-input {
  width: 96px;
  padding: 4px 6px;
  font-size: 13px;
  font-family: 'Menlo', 'Consolas', monospace;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: right;
}
.advance-override-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

/* Form helpers used by the advance modal — generic enough to reuse later. */
.form-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-vertical > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.form-vertical > label > span:first-child {
  color: var(--text-muted);
  font-weight: 600;
}
.form-vertical input[type="number"],
.form-vertical input[type="date"],
.form-vertical select,
.form-vertical textarea {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0;
}
.form-fieldset legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 4px;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 6px 0;
}
.radio-row > span { flex: 1; }
.radio-row input[type="number"] {
  width: 100px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: right;
}
.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
