@font-face {
  font-family: "Cairo";
  src: url("/static/fonts/Cairo.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --muted: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --subtle: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0891b2;
  --primary-soft: #dbeafe;
  --success-soft: #dcfce7;
  --danger-soft: #fee2e2;
  --warning-soft: #fef3c7;
  --info-soft: #cffafe;
  --sidebar: #0f172a;
  --sidebar-text: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.55), rgba(246, 247, 251, 0) 280px),
    var(--bg);
  color: var(--text);
  font-family: "Cairo", system-ui, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}
.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.14) 0 28%, transparent 28% 100%),
    linear-gradient(315deg, rgba(8, 145, 178, 0.12) 0 24%, transparent 24% 100%),
    #f8fafc;
}
.auth-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 22px;
  align-items: stretch;
}
.auth-hero {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 34px;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 245, 249, 0.9)),
    var(--surface);
  box-shadow: var(--shadow-md);
}
.auth-logo-card {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}
.auth-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.auth-hero h1 {
  max-width: 560px;
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 48px);
}
.auth-copy {
  max-width: 560px;
  margin: 0;
  color: var(--subtle);
  font-size: 17px;
}
.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.auth-points span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 8px 13px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 900;
}
.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  align-self: center;
}
.auth-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-card-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}
.auth-card h2 {
  margin: 0;
  font-size: 28px;
}
.auth-form {
  gap: 16px;
}
.auth-form button {
  margin-top: 4px;
}
.single { grid-template-columns: 1fr; }

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: 264px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 900;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
}
.sidebar nav { display: grid; gap: 8px; }
.sidebar a {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 800;
  transition: background-color 160ms ease, color 160ms ease;
}
.sidebar a.active, .sidebar a:hover { background: #1e293b; }
.mobile-nav {
  display: none;
}

.page {
  margin-inline-start: 264px;
  padding: 22px 28px 32px;
  max-width: calc(100vw - 264px);
  min-width: 0;
  overflow-x: hidden;
}
.stack { display: grid; gap: 20px; min-width: 0; }
.topbar {
  min-height: 62px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}
.topbar div:first-child { display: grid; gap: 2px; }
.topbar span { color: var(--subtle); font-size: 12px; font-weight: 800; }
.topbar strong { font-size: 16px; }
.page-header, .row, .header-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-actions { justify-content: flex-start; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 13px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 32px; line-height: 1.2; }
h2 { margin-bottom: 6px; font-size: 20px; }
p { color: var(--subtle); }
.lead { margin: 8px 0 0; max-width: 680px; }

.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.metric-card {
  --metric-accent: var(--primary);
  --metric-soft: var(--primary-soft);
  --metric-border: #bfdbfe;
  --metric-bg: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  background: var(--metric-bg);
  border: 1px solid var(--metric-border);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  display: grid;
  gap: 8px;
  min-height: 132px;
  position: relative;
  overflow: hidden;
}
.metric-card::after {
  content: "";
  position: absolute;
  inset-inline-end: 18px;
  inset-block-start: 18px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, var(--metric-accent) 0 32%, transparent 33%),
    var(--metric-soft);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.72);
}
.metric-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--metric-accent);
}
.metric-card span { color: var(--subtle); font-weight: 800; font-size: 13px; }
.metric-card strong {
  color: var(--metric-accent);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.metric-card small { color: #64748b; }
.metric-card.total {
  --metric-accent: #2563eb;
  --metric-soft: #dbeafe;
  --metric-border: #bfdbfe;
  --metric-bg: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}
.metric-card.success {
  --metric-accent: #15803d;
  --metric-soft: #dcfce7;
  --metric-border: #bbf7d0;
  --metric-bg: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}
.metric-card.danger {
  --metric-accent: #dc2626;
  --metric-soft: #fee2e2;
  --metric-border: #fecaca;
  --metric-bg: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%);
}
.metric-card.warning {
  --metric-accent: #b45309;
  --metric-soft: #fef3c7;
  --metric-border: #fde68a;
  --metric-bg: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
}
.metric-card.info {
  --metric-accent: #0891b2;
  --metric-soft: #cffafe;
  --metric-border: #a5f3fc;
  --metric-bg: linear-gradient(180deg, #ffffff 0%, #ecfeff 100%);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.panel-title { margin-bottom: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .panel-title, .wide { grid-column: 1 / -1; }
.dashboard-period {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}
.dashboard-period-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
label { display: grid; gap: 7px; font-weight: 700; color: var(--text); }
input, select {
  width: 100%;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #f8fafc);
  border-radius: 8px;
  padding: 12px 13px;
  font: inherit;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
select {
  cursor: pointer;
}
input::placeholder { color: #94a3b8; }
input:hover, select:hover {
  border-color: #cbd5e1;
  background: #fff;
}
input:focus, select:focus {
  outline: 0;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px #dbeafe, 0 6px 14px rgba(37, 99, 235, 0.08);
}
button:focus { outline: 3px solid #dbeafe; outline-offset: 2px; }
input:invalid:not(:placeholder-shown) {
  border-color: #fca5a5;
}
.governorate-picker {
  position: relative;
  display: block;
}
.governorate-menu {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(100% + 6px);
  z-index: 20;
  display: none;
  max-height: 230px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.governorate-picker.open .governorate-menu {
  display: grid;
  gap: 4px;
}
.governorate-menu button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: right;
  box-shadow: none;
}
.governorate-menu button:hover,
.governorate-menu button:focus {
  background: #eff6ff;
  color: var(--primary);
}
.governorate-menu button[hidden] {
  display: none;
}
.check, .mini-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--subtle);
  cursor: pointer;
  user-select: none;
}
.check input,
.mini-check input,
input[type="checkbox"],
input[type="radio"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
  background: #fff;
  box-shadow: none;
  transition: none;
}
.commission-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
button {
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 11px 14px;
  cursor: pointer;
  min-height: 42px;
  transition: transform 120ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
button:hover { background: var(--primary-hover); }
button:active, .button:active { transform: translateY(1px); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
}
.button.link {
  background: #dbeafe;
  color: var(--primary);
}
.button.ghost {
  background: #f1f5f9;
  color: var(--text);
}
.button.link:hover { background: #bfdbfe; }
.button.ghost:hover { background: #e2e8f0; }
.logout-button {
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #991b1b;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.08);
}
.logout-button:hover,
.logout-button:focus {
  background: #fecaca;
  color: #7f1d1d;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-inline: contain;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: middle; }
th { position: sticky; top: 0; background: #f8fafc; color: var(--subtle); font-size: 12px; font-weight: 900; }
tbody tr { background: #fff; transition: background-color 140ms ease; }
tbody tr:hover { background: #f8fafc; }
.money-cell { font-variant-numeric: tabular-nums; font-weight: 900; white-space: nowrap; }
.success-text { color: #15803d; }
.danger-text { color: #b91c1c; }
.empty { text-align: center; color: var(--subtle); padding: 24px; }
.data-panel { padding-bottom: 12px; }
.data-grid {
  max-height: 520px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.data-grid table { min-width: 980px; }
.data-grid th { top: 0; z-index: 1; }
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -4px 0 12px;
  color: var(--subtle);
  font-size: 13px;
}
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--subtle);
  font-weight: 800;
}
.collect-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 260px;
}
.collect-form input:not([type="radio"]) {
  width: 145px;
  padding: 7px 9px;
}
.collect-form .check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}
.collect-form button {
  padding: 8px 10px;
}
.inline-form {
  display: grid;
  grid-template-columns: 120px 150px minmax(140px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 560px;
}
.inline-form input {
  padding: 7px 9px;
}
.inline-form button {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}
.compact-action {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}
.compact-action span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.action-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--primary);
  color: #fff;
  line-height: 1.2;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.14);
  transition: transform 120ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.action-trigger:hover,
.action-trigger:focus {
  background: var(--primary-hover);
}
.action-trigger:focus {
  outline: 3px solid #dbeafe;
  outline-offset: 2px;
}
.action-trigger:active {
  transform: translateY(1px);
}
.mobile-card-actions {
  display: none;
}
.mobile-salary-form {
  display: none;
}
.mobile-record-list {
  display: none;
}
.attendance-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.attendance-filter {
  align-items: end;
}
.attendance-sheet {
  display: grid;
  gap: 14px;
}
.attendance-sheet .row {
  align-items: flex-start;
}
.attendance-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.attendance-card {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.attendance-card:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.attendance-card.present {
  border-color: #bbf7d0;
  background: #f0fdf4;
  box-shadow: inset 4px 0 0 #16a34a;
}
.attendance-card input {
  width: 20px;
  height: 20px;
}
.attendance-card span {
  display: grid;
  gap: 2px;
}
.attendance-card strong {
  font-size: 15px;
}
.attendance-card small,
.attendance-table small {
  display: block;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}
.attendance-table {
  min-width: 1120px;
}
.attendance-count {
  display: inline-block;
  min-width: 26px;
  font-size: 20px;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
}
.attendance-total {
  display: inline-block;
  margin-inline-start: 4px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}
.modal-sheet {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--text);
}
.modal-sheet::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}
.confirm-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
}
.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(4px);
}
.confirm-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}
.confirm-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.confirm-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 900;
}
.confirm-header h2 {
  margin: 0;
  font-size: 20px;
}
.confirm-header p,
.confirm-note {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 14px;
  font-weight: 700;
}
.confirm-details {
  display: grid;
  gap: 8px;
  margin: 0;
}
.confirm-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.confirm-details dt {
  color: var(--subtle);
  font-weight: 800;
}
.confirm-details dd {
  margin: 0;
  color: var(--text);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.danger-confirm {
  background: var(--danger);
  color: #fff;
}
.danger-confirm:hover {
  background: #b91c1c;
}
.modal-card {
  display: grid;
  gap: 14px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-md);
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.modal-header h2 { margin-bottom: 0; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}
.icon-button:hover { background: #e2e8f0; }
.payment-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.payment-form .modal-header,
.payment-form .payment-summary,
.payment-form .check,
.payment-form .wide,
.payment-form .modal-actions {
  grid-column: 1 / -1;
}
.payment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.payment-summary span { color: var(--subtle); font-weight: 800; }
.payment-summary strong { color: var(--primary); font-variant-numeric: tabular-nums; }
.payment-summary.danger-summary {
  border-color: #fecaca;
  background: #fef2f2;
}
.payment-summary.danger-summary span,
.payment-summary.danger-summary strong {
  color: #991b1b;
}
.payment-summary.warning-summary {
  border-color: #fde68a;
  background: #fffbeb;
}
.payment-summary.warning-summary span,
.payment-summary.warning-summary strong {
  color: #92400e;
}
.date-choice {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.date-choice legend {
  padding: 0 6px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.compact-list { display: grid; gap: 10px; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.list-item div { display: grid; gap: 4px; }
.list-item span { color: var(--subtle); font-size: 13px; }
.list-item b { white-space: nowrap; }
.status-dot, .toast {
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 800;
}
.status-dot { background: #fee2e2; color: var(--danger); }
.status-dot.connected { background: #dcfce7; color: var(--success); }
.toast {
  position: fixed;
  inset-block-start: 18px;
  inset-inline: 18px auto;
  z-index: 1000;
  max-width: min(420px, calc(100vw - 36px));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  animation: toast-in 180ms ease-out;
}
.toast.success { background: #dcfce7; color: #166534; }
.toast.danger { background: #fee2e2; color: #991b1b; }
.toast.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.inline-success {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}
.action-complete input,
.action-complete button {
  opacity: 0.72;
}
.action-complete button {
  cursor: not-allowed;
}
.money-out { color: var(--danger); }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.success { background: #dcfce7; color: #166534; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.muted { background: #f1f5f9; color: #475569; }
.badge.info { background: #cffafe; color: #155e75; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.primary { background: #dbeafe; color: #1d4ed8; }

.activity-section {
  display: grid;
  gap: 14px;
}
.activity-timeline,
.customer-activity-list {
  display: grid;
  gap: 12px;
}
.activity-entry {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.activity-marker {
  width: 12px;
  height: 12px;
  margin-top: 8px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px #f1f5f9;
}
.activity-entry.success .activity-marker { background: var(--success); box-shadow: 0 0 0 4px #dcfce7; }
.activity-entry.info .activity-marker { background: var(--info); box-shadow: 0 0 0 4px #cffafe; }
.activity-entry.warning .activity-marker { background: var(--warning); box-shadow: 0 0 0 4px #fef3c7; }
.activity-entry.danger .activity-marker { background: var(--danger); box-shadow: 0 0 0 4px #fee2e2; }
.activity-entry.primary .activity-marker { background: var(--primary); box-shadow: 0 0 0 4px #dbeafe; }
.activity-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.activity-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.activity-heading strong {
  font-size: 16px;
}
.activity-heading time,
.customer-activity-card time {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 800;
}
.activity-details {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.activity-details strong {
  font-size: 13px;
}
.activity-details ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.activity-details li {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}
.activity-details p {
  margin: 0;
  font-size: 13px;
}
.customer-activity-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.customer-activity-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.customer-activity-card header div {
  display: grid;
  gap: 3px;
}
.customer-activity-card header span,
.customer-activity-grid span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}
.customer-activity-card header strong {
  font-size: 18px;
}
.customer-activity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.customer-activity-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  background: #f8fafc;
}
.customer-activity-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.flow-summary {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.8fr);
  gap: 14px;
  align-items: stretch;
}
.flow-total-card,
.flow-chip,
.flow-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.flow-total-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  min-height: 130px;
}
.flow-total-card span,
.flow-card-amount span,
.flow-kind {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}
.flow-total-card strong {
  color: var(--text);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.flow-total-card small {
  color: var(--subtle);
  font-weight: 800;
}
.flow-summary.income .flow-total-card {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.flow-summary.outgoing .flow-total-card {
  border-color: #fecaca;
  background: #fff7f7;
}
.flow-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.flow-chip {
  display: grid;
  gap: 6px;
  padding: 14px;
  min-height: 94px;
  border-inline-start-width: 5px;
}
.flow-chip span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}
.flow-chip strong {
  color: var(--text);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.flow-chip.success,
.flow-card.success { border-inline-start-color: var(--success); background: #f0fdf4; }
.flow-chip.info,
.flow-card.info { border-inline-start-color: var(--info); background: #ecfeff; }
.flow-chip.warning,
.flow-card.warning { border-inline-start-color: var(--warning); background: #fffbeb; }
.flow-chip.danger,
.flow-card.danger { border-inline-start-color: var(--danger); background: #fff7f7; }
.flow-chip.primary,
.flow-card.primary { border-inline-start-color: var(--primary); background: #eff6ff; }
.flow-section {
  display: grid;
  gap: 14px;
}
.flow-list {
  display: grid;
  gap: 12px;
}
.flow-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(130px, 0.45fr) minmax(240px, 1.4fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-inline-start-width: 5px;
}
.flow-card-main,
.flow-card-amount {
  display: grid;
  gap: 5px;
}
.flow-card-main strong {
  color: var(--text);
  font-size: 18px;
  overflow-wrap: anywhere;
}
.flow-card-main time {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 800;
}
.flow-card-amount strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.flow-details {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.flow-details li {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.flow-details-heading {
  color: var(--subtle) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.report-search-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(150px, 0.7fr)) auto;
  gap: 14px;
  align-items: end;
}
.report-search-form .panel-title {
  grid-column: 1 / -1;
}
.pending-search-form {
  grid-template-columns: minmax(220px, 1fr) auto auto;
}
.customer-search-form {
  grid-template-columns: minmax(220px, 1fr) auto;
}
.report-results {
  display: grid;
  gap: 16px;
}
.person-report-card {
  display: grid;
  gap: 16px;
}
.person-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.person-report-head > div {
  display: grid;
  gap: 4px;
}
.person-report-head span,
.metric-mini span,
.money-event span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}
.person-report-head strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}
.person-report-head small {
  color: var(--subtle);
  font-weight: 800;
}
.report-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.report-head-actions .action-trigger {
  color: #fff;
  font-size: 14px;
}
.quick-pay-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  width: min(680px, 100%);
}
.person-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.metric-mini {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  border-inline-start-width: 5px;
}
.metric-mini strong {
  color: var(--text);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.metric-mini small {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}
.metric-mini.success { border-inline-start-color: var(--success); background: #f0fdf4; }
.metric-mini.info { border-inline-start-color: var(--info); background: #ecfeff; }
.metric-mini.warning { border-inline-start-color: var(--warning); background: #fffbeb; }
.metric-mini.danger { border-inline-start-color: var(--danger); background: #fff7f7; }
.metric-mini.primary { border-inline-start-color: var(--primary); background: #eff6ff; }
.money-event-list {
  display: grid;
  gap: 10px;
}
.money-event {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1.3fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  border-inline-start-width: 5px;
}
.money-event > div {
  display: grid;
  gap: 4px;
}
.money-event strong {
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.money-event time {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 800;
}
.money-event ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.money-event li {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.money-event.success { border-inline-start-color: var(--success); background: #f0fdf4; }
.money-event.info { border-inline-start-color: var(--info); background: #ecfeff; }
.money-event.warning { border-inline-start-color: var(--warning); background: #fffbeb; }
.money-event.danger { border-inline-start-color: var(--danger); background: #fff7f7; }
.money-event.primary { border-inline-start-color: var(--primary); background: #eff6ff; }

.report-grid { align-items: stretch; }
.report-highlight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.report-highlight {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  border-inline-start-width: 5px;
  box-shadow: var(--shadow-sm);
}
.report-highlight span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}
.report-highlight strong {
  color: var(--text);
  font-size: 20px;
}
.report-highlight b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.report-highlight.success { border-inline-start-color: var(--success); background: #f0fdf4; }
.report-highlight.danger { border-inline-start-color: var(--danger); background: #fff7f7; }
.report-highlight.info { border-inline-start-color: var(--info); background: #ecfeff; }
.report-highlight.warning { border-inline-start-color: var(--warning); background: #fffbeb; }
.chart-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 800;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.legend-dot.income { background: var(--success); }
.legend-dot.outgoing { background: var(--danger); }
.bar-chart {
  min-height: 290px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  padding: 18px 12px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(to top, rgba(226, 232, 240, 0.8) 1px, transparent 1px) 0 0 / 100% 42px,
    #f8fafc;
}
.bar-group {
  min-width: 0;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.bar-values {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 44px;
  align-content: end;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}
.bar-values span {
  overflow-wrap: anywhere;
}
.income-value { color: #15803d; }
.outgoing-value { color: #b91c1c; }
.bars {
  height: 160px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 6px;
}
.bar {
  width: 16px;
  min-height: 4px;
  border-radius: 999px 999px 4px 4px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.bar.income { background: linear-gradient(180deg, #22c55e, #15803d); }
.bar.outgoing { background: linear-gradient(180deg, #ef4444, #b91c1c); }
.bar-group strong {
  max-width: 100%;
  color: var(--subtle);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-group em {
  max-width: 100%;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-align: center;
}
.line-chart {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}
.line-chart svg {
  display: block;
  width: 100%;
  height: 220px;
}
.zero-line {
  stroke: #cbd5e1;
  stroke-width: 1.4;
  stroke-dasharray: 5 5;
}
.net-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 12px rgba(37, 99, 235, 0.18));
}
.trend-list,
.report-list {
  display: grid;
  gap: 8px;
}
.trend-list div,
.report-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.trend-list span,
.report-row span {
  color: var(--subtle);
  font-size: 13px;
}
.trend-list strong,
.report-row b {
  font-variant-numeric: tabular-nums;
}
.donut-wrap {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 18px;
}
.donut {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--success) calc(var(--rate) * 1%), #e2e8f0 0);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), var(--shadow-sm);
}
.donut strong {
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.donut span {
  margin-top: 40px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}
.donut-copy {
  display: grid;
  gap: 6px;
}
.donut-copy strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.donut-copy span {
  color: var(--subtle);
  font-weight: 800;
}
.report-row {
  grid-template-columns: minmax(80px, 1fr) repeat(3, auto);
}
.breakdown-list {
  display: grid;
  gap: 10px;
}
.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  border-inline-start-width: 5px;
}
.breakdown-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.breakdown-row strong {
  color: var(--text);
  overflow-wrap: anywhere;
}
.breakdown-row span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}
.breakdown-row b {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.breakdown-row.success { border-inline-start-color: var(--success); background: #f0fdf4; }
.breakdown-row.info { border-inline-start-color: var(--info); background: #ecfeff; }
.breakdown-row.warning { border-inline-start-color: var(--warning); background: #fffbeb; }
.breakdown-row.danger { border-inline-start-color: var(--danger); background: #fff7f7; }
.breakdown-row.primary { border-inline-start-color: var(--primary); background: #eff6ff; }

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .auth-page { padding: 18px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero {
    min-height: 0;
    padding: 24px;
  }
  .auth-card { align-self: stretch; }
  .sidebar { position: static; width: auto; padding: 16px; }
  .page { margin: 0; padding: 18px; max-width: 100vw; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .grid.two, .form-grid, .metric-grid { grid-template-columns: 1fr; }
  .flow-summary,
  .flow-card,
  .report-search-form,
  .money-event,
  .attendance-list {
    grid-template-columns: 1fr;
  }
  .flow-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .person-report-head {
    align-items: stretch;
    flex-direction: column;
  }
  .quick-pay-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .person-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .payment-form { grid-template-columns: 1fr; }
  .bar-chart { gap: 8px; overflow-x: auto; }
  .bar-group { min-width: 64px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .report-row { grid-template-columns: 1fr; }
  .page-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 760px) {
  body {
    background: var(--bg);
  }

  .auth-page {
    padding: 12px;
    background:
      linear-gradient(180deg, rgba(219, 234, 254, 0.72), rgba(248, 250, 252, 0) 260px),
      #f8fafc;
  }

  .auth-shell {
    gap: 12px;
  }

  .auth-hero {
    gap: 18px;
    padding: 18px;
  }

  .auth-logo-card {
    width: 86px;
    height: 86px;
  }

  .auth-logo {
    width: 68px;
    height: 68px;
  }

  .auth-hero h1 {
    font-size: 28px;
  }

  .auth-copy {
    font-size: 15px;
  }

  .auth-points span {
    flex: 1 1 auto;
    justify-content: center;
  }

  .auth-card {
    padding: 18px;
  }

  .auth-card h2 {
    font-size: 23px;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: block;
    padding: 10px 12px;
    background: rgba(248, 250, 252, 0.94);
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
  }

  .mobile-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
    color: var(--text);
    text-decoration: none;
    font-size: 17px;
    font-weight: 900;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 96px;
    min-height: 44px;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: var(--primary);
    box-shadow: none;
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-menu-icon,
  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-menu-icon {
    position: relative;
  }

  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
  }

  .mobile-menu-icon::before {
    top: -6px;
  }

  .mobile-menu-icon::after {
    top: 6px;
  }

  .mobile-menu-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .mobile-menu-panel[hidden] {
    display: none;
  }

  .mobile-menu-panel a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-menu-panel a.active {
    background: var(--primary);
    color: #fff;
  }

  .mobile-menu-panel a:not(.active) {
    background: #f8fafc;
  }

  .mobile-menu-panel a:not(.active):hover,
  .mobile-menu-panel a:not(.active):focus {
    background: #eff6ff;
    color: var(--primary);
  }

  .page {
    padding: 12px;
  }

  .topbar {
    min-height: 0;
    margin-bottom: 14px;
    padding: 10px 12px;
  }

  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 18px;
  }

  .lead,
  .panel-title p,
  .table-toolbar {
    font-size: 14px;
  }

  .panel {
    padding: 14px;
  }

  .flow-breakdown {
    grid-template-columns: 1fr;
  }

  .report-highlight-grid {
    grid-template-columns: 1fr;
  }

  .flow-total-card,
  .flow-chip,
  .flow-card {
    padding: 14px;
  }

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

  .flow-card {
    gap: 12px;
    align-items: stretch;
  }

  .flow-card-amount {
    padding: 10px 0;
    border-block: 1px solid rgba(226, 232, 240, 0.9);
  }

  .quick-pay-form,
  .person-metrics {
    grid-template-columns: 1fr;
  }

  .person-report-head strong {
    font-size: 19px;
  }

  .money-event {
    gap: 10px;
  }

  .form-grid,
  .payment-form {
    gap: 12px;
  }

  input,
  select,
  button,
  .button {
    min-height: 46px;
  }

  .page-header .button,
  form > button[type="submit"],
  .attendance-sheet .panel-title button {
    width: 100%;
  }

  .row,
  .panel-title.row {
    align-items: stretch;
    flex-direction: column;
  }

  .pager {
    width: 100%;
  }

  .pager .button {
    flex: 1;
  }

  .data-grid,
  .table-wrap {
    max-height: none;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .desktop-table-wrap {
    display: none;
  }

  .mobile-record-list {
    display: grid;
    gap: 12px;
  }

  .mobile-record-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .mobile-record-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
  }

  .mobile-record-header div {
    display: grid;
    gap: 3px;
  }

  .mobile-record-header span {
    color: var(--subtle);
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-record-header strong {
    color: var(--text);
    font-size: 18px;
    line-height: 1.3;
  }

  .mobile-record-grid {
    display: grid;
    gap: 0;
    margin: 0;
  }

  .mobile-record-grid div {
    display: grid;
    gap: 4px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
  }

  .mobile-record-grid div:last-child {
    border-bottom: 0;
  }

  .mobile-record-grid dt {
    color: var(--subtle);
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-record-grid dd {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    overflow-wrap: anywhere;
  }

  .mobile-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 2px;
  }

  .mobile-action-row.single-action {
    grid-template-columns: 1fr;
  }

  .mobile-action {
    width: 100%;
    min-height: 44px;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: none;
  }

  .mobile-action.primary {
    background: var(--primary);
    color: #fff;
  }

  .mobile-action.secondary {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: var(--primary);
  }

  table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
    width: 100%;
  }

  tbody tr {
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  tbody tr:hover {
    background: #fff;
  }

  th,
  td {
    border-bottom: 0;
  }

  td {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 0;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
    overflow-wrap: anywhere;
    color: var(--text);
    font-weight: 800;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--subtle);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
  }

  tbody tr td:first-child {
    padding-top: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
  }

  .mobile-card-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
  }

  .mobile-card-actions .action-trigger {
    width: 100%;
    min-height: 44px;
    box-shadow: none;
  }

  .mobile-card-actions .action-trigger.secondary {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
  }

  .mobile-card-actions .action-trigger.secondary:hover,
  .mobile-card-actions .action-trigger.secondary:focus {
    background: #dbeafe;
  }

  .mobile-salary-form {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
  }

  .mobile-salary-form input,
  .mobile-salary-form button {
    width: 100%;
  }

  .desktop-action-cell {
    display: contents;
  }

  .desktop-action-cell::before,
  .desktop-action-cell > .desktop-only-action,
  .desktop-action-cell > .inline-form {
    display: none;
  }

  td.empty {
    display: block;
    border-bottom: 0;
  }

  td.empty::before {
    content: "";
  }

  .money-cell {
    white-space: normal;
  }

  .action-cell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 8px;
    padding: 10px 0;
    overflow: hidden;
  }

  .action-cell::before {
    display: none;
  }

  .action-cell > .action-trigger,
  .collect-form button {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    color: #fff !important;
    text-align: center;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
  }

  .action-cell > .action-trigger {
    display: flex;
    box-sizing: border-box;
    inline-size: 100%;
    max-inline-size: 100%;
    background: var(--primary);
    border: 1px solid rgba(29, 78, 216, 0.2);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.14);
    padding: 10px 12px;
  }

  .action-cell > .action-trigger:hover,
  .action-cell > .action-trigger:focus {
    background: var(--primary-hover);
  }

  .collect-form,
  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }

  .collect-form input:not([type="radio"]),
  .inline-form input {
    width: 100%;
    padding: 11px 12px;
  }

  .modal-sheet {
    width: 100vw;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
  }

  .modal-card {
    max-height: 92dvh;
    border-radius: 14px 14px 0 0;
    padding: 16px;
  }

  .modal-header {
    position: sticky;
    top: -16px;
    z-index: 2;
    margin: -16px -16px 0;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
  }

  .modal-actions {
    position: sticky;
    bottom: -16px;
    margin: 0 -16px -16px;
    padding: 12px 16px 16px;
    background: #fff;
    border-top: 1px solid var(--border);
  }

  .modal-actions button,
  .modal-actions .button {
    flex: 1 1 100%;
  }

  .payment-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-entry {
    grid-template-columns: 10px 1fr;
    padding: 12px;
  }

  .activity-heading,
  .customer-activity-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-heading time,
  .customer-activity-card time {
    white-space: normal;
  }

  .customer-activity-grid {
    grid-template-columns: 1fr;
  }

  .governorate-menu {
    max-height: 190px;
  }

  .metric-card {
    min-height: 112px;
  }
}
