/* ============================================================================
   PETTY CASH MANAGEMENT SYSTEM - style.css
   Design system: modern accounting / business SaaS
   Brand: #B7D93D · White background · Charcoal text · Light grey borders
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. DESIGN TOKENS
--------------------------------------------------------------------------- */
:root {
  --brand:        #B7D93D;
  --brand-dark:   #9BBF2F;
  --brand-deep:   #7E9E22;
  --brand-soft:   #F2F9DE;
  --brand-tint:   #FAFDF2;
  --brand-border: #DCEBAA;

  --ink:        #23262E;
  --ink-2:      #3C4150;
  --muted:      #6B7280;
  --muted-2:    #9AA1AE;

  --line:       #E6E8EC;
  --line-2:     #F0F1F4;
  --bg:         #FFFFFF;
  --bg-soft:    #F7F8F6;
  --bg-soft-2:  #FBFBFA;

  --danger:     #D64550;
  --danger-soft:#FDEDEE;
  --success:    #2E9E5B;
  --success-soft:#E9F7EF;
  --warn:       #C98A0A;
  --warn-soft:  #FDF5E3;
  --info:       #2E6FBF;
  --info-soft:  #ECF3FC;

  --shadow-sm: 0 1px 2px rgba(23, 26, 33, .06);
  --shadow:    0 1px 3px rgba(23, 26, 33, .07), 0 6px 18px rgba(23, 26, 33, .05);
  --shadow-lg: 0 12px 40px rgba(23, 26, 33, .14);

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --sidebar-w: 258px;
  --topbar-h:  66px;

  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto",
          "Helvetica Neue", Arial, sans-serif;
}

/* ---------------------------------------------------------------------------
   2. RESET / BASE
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
button { font-family: inherit; }

::selection { background: var(--brand); color: var(--ink); }

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #D7DADF; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #BEC3CB; background-clip: content-box; border: 2px solid transparent; }

/* Utilities */
.text-muted   { color: var(--muted) !important; }
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-brand   { color: var(--brand-deep) !important; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-sm      { font-size: 12.5px; }
.text-lg      { font-size: 17px; }
.font-medium  { font-weight: 600; }
.font-bold    { font-weight: 700; }
.nowrap       { white-space: nowrap; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 6px } .mt-2 { margin-top: 12px }
.mt-3 { margin-top: 18px } .mt-4 { margin-top: 26px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 6px } .mb-2 { margin-bottom: 12px }
.mb-3 { margin-bottom: 18px } .mb-4 { margin-bottom: 26px }
.d-none { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center  { display: flex; align-items: center; gap: 10px; }
.gap-2 { gap: 8px } .gap-3 { gap: 14px }
.num { font-variant-numeric: tabular-nums; }
.w-100 { width: 100%; }
.muted-link { color: var(--muted); font-size: 13px; cursor: pointer; }
.muted-link:hover { color: var(--ink); text-decoration: underline; }

/* ---------------------------------------------------------------------------
   3. APP SHELL  (index.html)
--------------------------------------------------------------------------- */
.app-shell { min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: #171A21;
  color: #C9CDD6;
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform .28s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 22px 16px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--brand);
  color: #171A21;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.03em;
  box-shadow: 0 4px 14px rgba(183, 217, 61, .35);
  flex: none;
}
.brand-text .bt-title { font-size: 14.5px; font-weight: 700; color: #FFF; line-height: 1.2; }
.brand-text .bt-sub   { font-size: 10.5px; color: #8A90A0; letter-spacing: .14em; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-label {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #767C8C;
  padding: 16px 12px 7px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin-bottom: 3px;
  border-radius: 10px;
  color: #C9CDD6;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #FFF; }
.nav-item.active {
  background: var(--brand);
  color: #171A21;
  font-weight: 650;
  box-shadow: 0 6px 16px rgba(183, 217, 61, .28);
}
.nav-item.active svg { opacity: 1; }
.nav-item .nav-count {
  margin-left: auto;
  background: var(--danger);
  color: #FFF;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.nav-item.active .nav-count { background: #171A21; }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.logout-btn {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: #C9CDD6;
  font-size: 14px;
  border-radius: 10px;
  cursor: pointer;
}
.logout-btn:hover { background: rgba(214, 69, 80, .16); color: #FF8A93; }
.logout-btn svg { width: 18px; height: 18px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 22, .5);
  backdrop-filter: blur(2px);
  z-index: 55;
}

/* ---- Main column ---- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.hamburger {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: #FFF;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.hamburger svg { width: 20px; height: 20px; }
.topbar-title { font-size: 16.5px; font-weight: 700; }
.topbar-sub { font-size: 12px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #171A21;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.user-meta { line-height: 1.15; }
.user-meta .um-name { font-size: 13px; font-weight: 650; }
.user-meta .um-role { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---- Content ---- */
.content {
  flex: 1;
  padding: 26px 26px 44px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.view { display: none; animation: fadeIn .25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 23px; }
.page-header .page-sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------------
   4. CARDS / GRIDS
--------------------------------------------------------------------------- */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.card-header h3 { font-size: 15.5px; }
.card-header .card-sub { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 18px 22px; }
.card-body.tight { padding: 0; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--line-2); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -34px; top: -34px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--brand-soft);
  opacity: .8;
}
.stat-card.is-neutral::after { background: var(--line-2); }
.stat-card.is-danger::after  { background: var(--danger-soft); }
.stat-head { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.stat-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  display: grid;
  place-items: center;
}
.stat-icon svg { width: 19px; height: 19px; }
.stat-card.is-neutral .stat-icon { background: var(--bg-soft); color: var(--muted); }
.stat-card.is-danger .stat-icon  { background: var(--danger-soft); color: var(--danger); }
.stat-value {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -.02em;
  margin-top: 10px;
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 3px; position: relative; z-index: 1; }
.stat-value.positive { color: var(--brand-deep); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-23 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-32 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.mb-grid { display: grid; gap: 16px; margin-bottom: 16px; }

/* ---------------------------------------------------------------------------
   5. BUTTONS
--------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.3;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 3px solid rgba(183,217,61,.5); outline-offset: 1px; }

.btn-primary {
  background: var(--brand);
  color: #171A21;
  border-color: var(--brand);
  box-shadow: 0 6px 16px rgba(183, 217, 61, .32);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-1px); }

.btn-outline { background: #FFF; border-color: var(--line); color: var(--ink-2); }
.btn-outline:hover { border-color: #C9CDD6; background: var(--bg-soft); }

.btn-dark { background: #171A21; color: #FFF; }
.btn-dark:hover { background: #2A2F3A; }

.btn-danger { background: var(--danger); color: #FFF; }
.btn-danger:hover { background: #BE3944; }

.btn-success { background: var(--success); color: #FFF; }
.btn-success:hover { background: #26884E; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 6px; }

.btn-group { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------------
   6. TABLES
--------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 640px;
}
.data-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-soft-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--brand-tint); }
.data-table tbody tr.row-click { cursor: pointer; }
.data-table .col-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .amount { font-weight: 650; }
.data-table .amount.out { color: var(--danger); }
.data-table .amount.in  { color: var(--success); }
.table-empty td { padding: 42px 16px; }
.td-main { font-weight: 600; }
.td-sub  { font-size: 12px; color: var(--muted); }

/* Row highlight for pending approvals */
tr.row-pending { background: #FFFDF4; }
tr.row-pending:hover { background: #FDF9E7; }

/* ---------------------------------------------------------------------------
   7. BADGES / STATUS
--------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-pending  { background: var(--warn-soft);  color: var(--warn); }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }
.badge-opening  { background: var(--info-soft);  color: var(--info); }
.badge-cash-in  { background: var(--success-soft); color: var(--success); }
.badge-expense  { background: var(--danger-soft); color: var(--danger); }
.badge-role     { background: var(--brand-soft); color: var(--brand-deep); }
.badge-neutral  { background: var(--line-2); color: var(--muted); }
.badge-sm { padding: 3px 9px; font-size: 10.5px; }

/* ---------------------------------------------------------------------------
   8. FORMS
--------------------------------------------------------------------------- */
.form-group { margin-bottom: 17px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.form-label .req { color: var(--danger); margin-left: 3px; }
.form-control {
  width: 100%;
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #FFF;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3.5px rgba(183, 217, 61, .28);
}
.form-control::placeholder { color: var(--muted-2); }
.form-control:disabled { background: var(--bg-soft); color: var(--muted); cursor: not-allowed; }
textarea.form-control { min-height: 92px; resize: vertical; }
select.form-control {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
.form-control.invalid { border-color: var(--danger); background: #FFFBFB; }
.form-control.invalid:focus { box-shadow: 0 0 0 3.5px rgba(214, 69, 80, .18); }
.form-error { display: none; color: var(--danger); font-size: 12.5px; margin-top: 5px; font-weight: 550; }
.form-error.show { display: block; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin: 4px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.input-group { position: relative; }
.input-group .ig-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  width: 16px; height: 16px;
  pointer-events: none;
}
.input-group .form-control { padding-left: 38px; }

/* Switch (settings) */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-2);
}
.switch-row:last-child { border-bottom: 0; }
.switch-label .sl-title { font-weight: 650; font-size: 14px; }
.switch-label .sl-sub { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: #D4D7DD;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #FFF;
  border-radius: 50%;
  transition: .2s;
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Checkbox / radio inline */
.check-line { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.check-line input { accent-color: var(--brand-deep); width: 16px; height: 16px; }

/* ---------------------------------------------------------------------------
   9. DROPZONE / FILE UPLOAD
--------------------------------------------------------------------------- */
.dropzone {
  border: 2px dashed #D3D8C8;
  border-radius: var(--radius);
  background: var(--brand-tint);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .18s ease;
}
.dropzone:hover { border-color: var(--brand-dark); background: var(--brand-soft); }
.dropzone.dragover {
  border-color: var(--brand-deep);
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px rgba(183, 217, 61, .25);
}
.dropzone .dz-icon {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  border-radius: 15px;
  background: #FFF;
  border: 1px solid var(--brand-border);
  display: grid;
  place-items: center;
  color: var(--brand-deep);
  box-shadow: var(--shadow-sm);
}
.dropzone .dz-icon svg { width: 24px; height: 24px; }
.dz-title { font-weight: 650; font-size: 14.5px; }
.dz-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.dz-or {
  display: inline-block;
  margin: 9px 0;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: .1em;
}
.dz-browse { color: var(--brand-deep); font-weight: 700; text-decoration: underline; }
.dz-formats {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  background: #FFF;
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--brand-border);
  background: var(--brand-tint);
  border-radius: var(--radius-sm);
}
.file-thumb {
  width: 54px; height: 54px;
  border-radius: 9px;
  overflow: hidden;
  flex: none;
  background: #FFF;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb svg { width: 22px; height: 22px; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info { font-size: 12px; color: var(--muted); display: flex; gap: 10px; margin-top: 2px; }
.file-actions { display: flex; gap: 6px; flex: none; }
.upload-progress {
  height: 5px;
  background: var(--line-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.upload-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--brand);
  border-radius: 999px;
  transition: width .2s;
}

/* ---------------------------------------------------------------------------
   10. MODALS
--------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 26, .55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 100;
}
.modal-backdrop.open { display: flex; animation: fadeIn .18s ease; }
.modal {
  background: #FFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  animation: modalIn .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-md  { max-width: 620px; }
.modal-lg  { max-width: 860px; }
.modal-xl  { max-width: 1040px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 24px;
  border-bottom: 1px solid var(--line-2);
}
.modal-header h3 { font-size: 16.5px; }
.modal-close {
  width: 34px; height: 34px;
  border: 0;
  background: var(--bg-soft);
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.modal-close:hover { background: var(--line-2); color: var(--ink); }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.modal-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.modal-icon.warn  { background: var(--warn-soft);  color: var(--warn); }
.modal-icon.danger{ background: var(--danger-soft); color: var(--danger); }
.modal-icon.ok    { background: var(--success-soft); color: var(--success); }
.modal-icon.brand { background: var(--brand-soft);  color: var(--brand-deep); }
.modal-icon svg { width: 22px; height: 22px; }

/* Confirmation summary rows (approve dialog) */
.confirm-rows { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-top: 16px; }
.confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 15px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line-2);
  background: #FFF;
}
.confirm-row:last-child { border-bottom: 0; }
.confirm-row .cr-label { color: var(--muted); }
.confirm-row .cr-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.confirm-row.total { background: var(--brand-tint); }
.confirm-row.total .cr-value { color: var(--brand-deep); font-size: 15px; }
.confirm-row.danger-row { background: var(--danger-soft); }
.confirm-row.danger-row .cr-value { color: var(--danger); }

/* ---------------------------------------------------------------------------
   11. ALERTS
--------------------------------------------------------------------------- */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: 1px solid;
  align-items: flex-start;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-danger  { background: var(--danger-soft);  border-color: #F5C9CD; color: #8E2A33; }
.alert-warning { background: var(--warn-soft);   border-color: #F0DEB4; color: #7A5406; }
.alert-info    { background: var(--info-soft);    border-color: #C9DEF6; color: #1D4E8C; }
.alert-success { background: var(--success-soft); border-color: #C3E6D1; color: #1C6B3F; }
.alert strong { font-weight: 750; }

/* ---------------------------------------------------------------------------
   12. TOASTS
--------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: #FFF;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 12px;
  padding: 13px 15px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast-success { border-left-color: var(--success); }
.toast-success svg { color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-error svg { color: var(--danger); }
.toast-warning { border-left-color: var(--warn); }
.toast-warning svg { color: var(--warn); }
.toast-info    { border-left-color: var(--info); }
.toast-info svg { color: var(--info); }
.toast .toast-msg { flex: 1; font-weight: 550; }
.toast .toast-x { border: 0; background: none; cursor: pointer; color: var(--muted-2); padding: 0; line-height: 1; }

/* ---------------------------------------------------------------------------
   13. FILTER BAR / TABS / SEARCH
--------------------------------------------------------------------------- */
.filters-bar {
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.filters-bar .fb-field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.filters-bar .fb-field label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.filters-bar .form-control { padding: 8px 11px; font-size: 13.5px; }
.filters-bar .fb-grow { flex: 1; min-width: 210px; }
.filters-bar .fb-actions { display: flex; gap: 9px; margin-left: auto; }

.search-box { position: relative; }
.search-box .form-control { padding-left: 37px; }
.search-box svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted-2);
  pointer-events: none;
}

.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-soft);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--line);
  width: fit-content;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab-btn {
  border: 0;
  background: transparent;
  padding: 8px 17px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--muted);
  border-radius: 9px;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  background: var(--brand);
  color: #171A21;
  box-shadow: 0 4px 10px rgba(183, 217, 61, .35);
}
.tab-btn .tab-count {
  background: rgba(0,0,0,.12);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
}
.tab-btn.active .tab-count { background: rgba(0,0,0,.16); }

/* ---------------------------------------------------------------------------
   14. CHARTS / EMPTY / SKELETON / SPINNER
--------------------------------------------------------------------------- */
.chart-box { position: relative; height: 280px; padding: 6px 4px 0; }
.chart-box.sm { height: 235px; }

.empty-state {
  text-align: center;
  padding: 52px 22px;
  color: var(--muted);
}
.empty-state .es-icon {
  width: 64px; height: 64px;
  margin: 0 auto 15px;
  border-radius: 20px;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  color: var(--muted-2);
}
.empty-state .es-icon svg { width: 28px; height: 28px; }
.empty-state h4 { font-size: 15.5px; margin-bottom: 5px; color: var(--ink); }
.empty-state p { font-size: 13.5px; max-width: 420px; margin: 0 auto 16px; }

.spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-pad { padding: 46px 16px; }

.skeleton {
  background: linear-gradient(90deg, var(--line-2) 25%, #FFF 50%, var(--line-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 7px;
  height: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------------------
   15. RECEIPT / DETAIL VIEWS
--------------------------------------------------------------------------- */
.receipt-view {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.receipt-view img { max-height: 460px; width: auto; object-fit: contain; }
.receipt-view iframe { width: 100%; height: 520px; border: 0; background: #FFF; }

.kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.kv {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-2);
}
.kv .kv-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 650;
}
.kv .kv-value { font-size: 14.5px; font-weight: 650; margin-top: 3px; word-break: break-word; }
.kv.full { grid-column: 1 / -1; }

.detail-amount {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* Pending approval cards (mobile friendly) */
.approval-list { display: flex; flex-direction: column; gap: 14px; }
.approval-card {
  background: #FFF;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  padding: 17px 19px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.approval-card:hover { box-shadow: var(--shadow); }
.approval-card .ac-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 7px; }
.approval-card .ac-amount { font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; }
.approval-card .ac-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.approval-card .ac-desc { font-size: 13.5px; margin-top: 5px; color: var(--ink-2); }
.approval-card .ac-actions { display: flex; flex-direction: column; gap: 8px; justify-content: center; min-width: 118px; }

/* Summary rows (daily / monthly reports) */
.sum-list { display: flex; flex-direction: column; }
.sum-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.sum-row:last-child { border-bottom: 0; }
.sum-row .sr-label { color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 8px; }
.sum-row .sr-value { font-weight: 750; font-variant-numeric: tabular-nums; }
.sum-row.total { border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; padding-top: 14px; }
.sum-row.total .sr-label { color: var(--ink); font-weight: 700; }
.sum-row.total .sr-value { font-size: 19px; }
.sum-row .sr-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--brand); }
.sum-row .sr-dot.out { background: var(--danger); }
.sum-row .sr-dot.in  { background: var(--success); }

.dot-mark { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.dot-mark.in  { background: var(--success); }
.dot-mark.out { background: var(--danger); }

/* Audit JSON block */
.json-block {
  background: #171A21;
  color: #D6E2B8;
  font-family: "SF Mono", Consolas, "Cascadia Code", monospace;
  font-size: 12.5px;
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}

/* Step/wizard indicator */
.wizard-steps { display: flex; gap: 0; margin-bottom: 24px; }
.wizard-step {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  position: relative;
  padding-top: 30px;
}
.wizard-step::before {
  content: attr(data-step);
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--line-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  z-index: 1;
}
.wizard-step::after {
  content: "";
  position: absolute;
  top: 11px; left: 0; right: 0;
  height: 2px;
  background: var(--line-2);
  z-index: 0;
}
.wizard-step:first-child::after { left: 50%; }
.wizard-step:last-child::after { right: 50%; }
.wizard-step.active { color: var(--ink); }
.wizard-step.active::before { background: var(--brand); color: #171A21; }
.wizard-step.done::before { background: var(--success); color: #FFF; }

/* ---------------------------------------------------------------------------
   16. LOGIN PAGE  (login.html)
--------------------------------------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: #FFF;
}
.auth-side {
  background:
    radial-gradient(1000px 500px at -10% -10%, rgba(183,217,61,.28), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(183,217,61,.16), transparent 55%),
    #171A21;
  color: #FFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 52px;
  position: relative;
  overflow: hidden;
}
.auth-side::after {
  content: "";
  position: absolute;
  right: -120px; bottom: -120px;
  width: 380px; height: 380px;
  border: 1.5px dashed rgba(183,217,61,.35);
  border-radius: 50%;
}
.auth-side .brand-row { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.auth-side .brand-row .brand-mark { width: 46px; height: 46px; font-size: 17px; }
.auth-side .brand-row .bt-title { font-size: 17px; }
.auth-side .brand-row .bt-sub { color: #8A90A0; }
.auth-pitch { position: relative; z-index: 1; max-width: 460px; }
.auth-pitch h2 { font-size: 34px; line-height: 1.2; letter-spacing: -.02em; }
.auth-pitch h2 span { color: var(--brand); }
.auth-pitch p { color: #A7ADBC; margin-top: 14px; font-size: 15px; }
.auth-points { margin-top: 26px; display: flex; flex-direction: column; gap: 13px; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; color: #D3D7E0; }
.auth-point .ap-check {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: rgba(183,217,61,.16);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
}
.auth-point .ap-check svg { width: 13px; height: 13px; }
.auth-foot { font-size: 12.5px; color: #767C8C; position: relative; z-index: 1; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 34px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h1 { font-size: 26px; letter-spacing: -.02em; }
.auth-card .auth-sub { color: var(--muted); font-size: 14px; margin-top: 6px; margin-bottom: 26px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 24px;
}
.auth-tab {
  border: 0;
  background: transparent;
  padding: 10px;
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
  border-radius: 9px;
  cursor: pointer;
  transition: all .15s;
}
.auth-tab.active { background: #FFF; color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-note {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin-top: 20px;
  line-height: 1.6;
}
.auth-row-end { text-align: right; margin: -8px 0 16px; }
.auth-link { color: var(--brand-deep); font-size: 13px; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.config-warning {
  background: var(--warn-soft);
  border: 1px solid #F0DEB4;
  color: #7A5406;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12.5px;
  margin-bottom: 18px;
  display: none;
}
.config-warning.show { display: block; }

/* ---------------------------------------------------------------------------
   17. PRINT
--------------------------------------------------------------------------- */
.print-only { display: none; }

@media print {
  @page { margin: 14mm; }

  body { background: #FFF; font-size: 12px; }

  .sidebar, .topbar, .sidebar-overlay, .toast-container,
  .page-actions, .filters-bar, .tabs, .btn, .no-print,
  .modal-backdrop, .hamburger { display: none !important; }

  .main { margin-left: 0; }
  .content { padding: 0; max-width: none; }

  .print-only { display: block; }
  .print-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2.5px solid var(--brand-deep);
    padding-bottom: 10px;
    margin-bottom: 16px;
  }
  .print-header .ph-title { font-size: 18px; font-weight: 800; }
  .print-header .ph-meta { font-size: 11px; color: #555; text-align: right; }

  .view { display: none !important; }
  .view.active { display: block !important; }

  .card { border: 1px solid #BBB; box-shadow: none; break-inside: avoid; }
  .card-header { border-bottom: 1px solid #CCC; }

  .data-table { min-width: 0; font-size: 11px; }
  .data-table thead th { background: #F1F1F1 !important; color: #000; border-bottom: 1.5px solid #666; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .data-table tbody td { border-bottom: 1px solid #DDD; padding: 7px 9px; }
  .data-table tbody tr:hover { background: transparent; }
  .table-wrap { overflow: visible; }

  .badge { border: 1px solid #999; background: #FFF !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge::before { display: none; }

  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .stat-card { box-shadow: none; }
  .stat-value { font-size: 18px; }

  .chart-box { height: 220px; break-inside: avoid; }
  .grid-2, .grid-3, .grid-23, .grid-32 { grid-template-columns: 1fr 1fr; }

  a[href]::after { content: ""; }
}
