/* ================================================================
   E-Procurement BNI — Design System CSS
   Design tokens, components, utilities
   Font: Inter (body/headings) + Arial (buttons)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─────────────────────────────────────────────
   1. DESIGN TOKENS
───────────────────────────────────────────── */
:root {
  /* Brand */
  --color-primary:          #F15A22;
  --color-primary-active:   #C94A1A;
  --color-primary-disabled: #F9C4AD;
  --color-primary-soft:     #FDE8DC;

  --color-secondary:          #006885;
  --color-secondary-active:   #004F65;
  --color-secondary-disabled: #99C4D2;
  --color-secondary-soft:     #E0EFF3;

  /* Neutral */
  --color-trout:       #494E5C;
  --color-trout-soft:  #6B7080;
  --color-trout-muted: #9396A0;

  /* Canvas */
  --color-canvas:           #FFFFFF;
  --color-surface-soft:     #F7F8FA;
  --color-surface-card:     #F0F2F5;
  --color-surface-sidebar:  #006885;
  --color-sidebar-active:   #004F65;
  --color-sidebar-hover:    #005A72;

  /* Ink */
  --color-ink:        #1A1C23;
  --color-body:       #3D4150;
  --color-body-strong:#252833;
  --color-muted:      #6B7080;
  --color-muted-soft: #9396A0;

  /* Borders */
  --color-hairline:      #E2E5EA;
  --color-hairline-soft: #EDF0F3;

  /* Semantic */
  --color-success:      #34C759;
  --color-success-soft: #E8F9ED;
  --color-success-text: #1A7A36;

  --color-warning:      #FFCC00;
  --color-warning-soft: #FFF9D6;
  --color-warning-text: #7A6000;

  --color-error:      #FF383C;
  --color-error-soft: #FFE8E8;
  --color-error-text: #B00004;

  --color-info:      #0088FF;
  --color-info-soft: #E0F0FF;
  --color-info-text: #0055CC;

  /* Spacing */
  --space-xxs: 4px;
  --space-xs:  8px;
  --space-sm:  12px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-xxl: 48px;

  /* Radii */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-xxl: 24px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

  /* Layout */
  --sidebar-width: 240px;
  --topbar-height: 64px;
}

/* ─────────────────────────────────────────────
   2. RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;  /* KRITIS: cegah horizontal scroll */
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-body);
  background: var(--color-surface-soft);
  max-width: 100vw;
}

/* Lock body scroll saat sidebar mobile terbuka */
body.sidebar-open {
  overflow: hidden;
}

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

img, svg { display: block; }

/* ─────────────────────────────────────────────
   3. TYPOGRAPHY UTILITIES
───────────────────────────────────────────── */
.heading-xl { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.5px; color: var(--color-ink); }
.heading-lg { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -0.3px; color: var(--color-ink); }
.heading-md { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -0.2px; color: var(--color-ink); }
.heading-sm { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--color-ink); }
.body-lg    { font-size: 16px; font-weight: 400; line-height: 1.6; }
.body-md    { font-size: 14px; font-weight: 400; line-height: 1.55; }
.body-sm    { font-size: 13px; font-weight: 400; line-height: 1.5; }
.label-lg   { font-size: 14px; font-weight: 500; line-height: 1.4; }
.label-md   { font-size: 13px; font-weight: 500; line-height: 1.4; }
.label-sm   { font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0.2px; }
.caption    { font-size: 12px; font-weight: 400; line-height: 1.4; }
.caption-upper { font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.data-number { font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -0.5px; color: var(--color-ink); }
.text-muted  { color: var(--color-muted); }
.text-ink    { color: var(--color-ink); }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }

/* ─────────────────────────────────────────────
   4. APP SHELL LAYOUT
───────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────
   5. SIDEBAR
───────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-surface-sidebar);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0,0,0,0.10);
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: var(--topbar-height);
  padding: 0 var(--space-md);
  border-bottom: 1px solid var(--color-secondary-active);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-canvas);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-secondary);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  color: var(--color-canvas);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.7;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  padding: 0 var(--space-md);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}

.sidebar-section-label:first-child { margin-top: var(--space-xs); }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: 44px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
  border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
  background: var(--color-sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.sidebar-nav-item.active {
  background: var(--color-sidebar-active);
  color: #fff;
  border-left-color: var(--color-primary);
}

.sidebar-nav-item svg { flex-shrink: 0; }

.sidebar-user {
  border-top: 1px solid var(--color-secondary-active);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-canvas);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  color: rgba(255,255,255,0.65);
  font-size: 11px;
}

/* ─────────────────────────────────────────────
   6. MAIN CONTENT AREA
───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;           /* KRITIS: cegah flex child overflow */
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─────────────────────────────────────────────
   7. TOPBAR
───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-hairline);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: 50;
  width: 100%;
  max-width: 100%;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 14px;
}

.breadcrumb-item { color: var(--color-muted); }
.breadcrumb-sep  { color: var(--color-muted-soft); }
.breadcrumb-active { color: var(--color-ink); font-weight: 500; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-bell {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-trout);
  border: 1px solid var(--color-hairline);
  background: var(--color-canvas);
  transition: background 0.15s ease;
}
.topbar-bell:hover { background: var(--color-surface-soft); }

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.topbar-avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
  display: none;
}

.topbar-avatar-menu.open { display: block; }

.topbar-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--color-body);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.topbar-menu-item:hover { background: var(--color-surface-soft); }
.topbar-menu-divider { border: none; border-top: 1px solid var(--color-hairline); }

/* ─────────────────────────────────────────────
   8. PAGE WRAPPER & HEADER
───────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: var(--space-xl);
  min-width: 0;           /* cegah overflow */
  width: 100%;
  max-width: 100%;
}

.page-header {
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-hairline);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-header-left h1 { font-size: 24px; font-weight: 700; color: var(--color-ink); letter-spacing: -0.3px; }
.page-header-left p  { font-size: 14px; color: var(--color-muted); margin-top: 2px; }

/* ─────────────────────────────────────────────
   9. BUTTONS
───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { cursor: not-allowed; opacity: 0.6; }

.btn-primary  { background: var(--color-primary);   color: #fff; }
.btn-primary:hover  { background: var(--color-primary-active); color: #fff; text-decoration: none; }

.btn-secondary { background: var(--color-canvas); color: var(--color-trout); border: 1px solid var(--color-hairline); }
.btn-secondary:hover { background: var(--color-surface-card); color: var(--color-trout); text-decoration: none; }

.btn-orient  { background: var(--color-secondary); color: #fff; }
.btn-orient:hover  { background: var(--color-secondary-active); color: #fff; text-decoration: none; }

.btn-danger  { background: var(--color-error); color: #fff; }
.btn-danger:hover  { background: #CC2428; color: #fff; text-decoration: none; }

.btn-ghost   { background: transparent; color: var(--color-secondary); }
.btn-ghost:hover   { background: var(--color-secondary-soft); color: var(--color-secondary); text-decoration: none; }

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  color: var(--color-trout);
}
.btn-icon:hover { background: var(--color-surface-card); color: var(--color-trout); }

/* ─────────────────────────────────────────────
   10. BADGES
───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Status badges */
.badge-pending-review, .badge-need-to-validate,
.badge-pending-dept-head, .badge-pending-div-head {
  background: var(--color-info-soft);
  color: var(--color-info-text);
}
.badge-revision   { background: var(--color-warning-soft); color: var(--color-warning-text); }
.badge-declined   { background: var(--color-error-soft);   color: var(--color-error-text); }
.badge-approved, .badge-po-generated { background: var(--color-success-soft); color: var(--color-success-text); }

/* Expenditure badges */
.badge-capex { background: var(--color-secondary-soft); color: var(--color-secondary-active); }
.badge-opex  { background: var(--color-surface-card);   color: var(--color-trout); }

/* Category badge */
.badge-category { background: var(--color-surface-card); color: var(--color-trout); }

/* Cross-fund badge */
.badge-cross-fund {
  background: var(--color-primary-soft);
  color: var(--color-primary-active);
  border: 1px solid var(--color-primary-disabled);
}

/* ─────────────────────────────────────────────
   11. CARDS
───────────────────────────────────────────── */
.card {
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-body { padding: var(--space-xl); }
.card-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--color-hairline-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─────────────────────────────────────────────
   12. STAT CARDS
───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-label { font-size: 13px; font-weight: 500; color: var(--color-muted); margin-top: var(--space-xs); }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--color-ink); line-height: 1.1; letter-spacing: -0.5px; }
.stat-card-sub   { font-size: 12px; color: var(--color-muted-soft); }

/* ─────────────────────────────────────────────
   13. FORMS
───────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-md); }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-ink);
  margin-bottom: 6px;
}

.form-label .required { color: var(--color-error); margin-left: 2px; }

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--color-ink);
  transition: border 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  appearance: none;
}
.form-control::placeholder { color: var(--color-muted-soft); }
.form-control:focus {
  border-color: var(--color-primary);
  border-width: 2px;
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.form-control.is-invalid { border-color: var(--color-error); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--color-error-soft); }

textarea.form-control {
  height: auto;
  min-height: 120px;
  padding: 10px 14px;
  resize: vertical;
  line-height: 1.55;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23F15A22' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.form-error {
  font-size: 12px;
  color: var(--color-error-text);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ─────────────────────────────────────────────
   14. FILE UPLOAD ZONE
───────────────────────────────────────────── */
.file-upload-zone {
  border: 2px dashed var(--color-hairline);
  border-radius: var(--radius-lg);
  background: var(--color-surface-soft);
  padding: var(--space-xxl) var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.file-upload-zone input[type="file"] { display: none; }

.file-upload-icon {
  color: var(--color-muted);
  margin: 0 auto var(--space-sm);
  display: flex;
  justify-content: center;
  align-items: center;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--color-surface-card);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-ink);
  margin-top: var(--space-sm);
}
.file-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  padding: 0;
  line-height: 1;
}
.file-chip-remove:hover { color: var(--color-error); }

/* ─────────────────────────────────────────────
   15. TABLE
───────────────────────────────────────────── */
.table-wrapper {
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;               /* scroll horizontal di dalam wrapper */
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

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

.data-table th {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-hairline);
  background: var(--color-surface-soft);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-md) var(--space-lg);
  font-size: 14px;
  color: var(--color-body);
  border-bottom: 1px solid var(--color-hairline-soft);
  vertical-align: middle;
}

.data-table tbody tr { transition: background 0.1s ease; }
.data-table tbody tr:hover { background: var(--color-surface-soft); }
.data-table tbody tr:last-child td { border-bottom: none; }

.table-ticket-id { font-size: 12px; font-weight: 600; color: var(--color-secondary); font-family: monospace; }
.table-title { font-weight: 500; color: var(--color-ink); }
.table-amount { font-weight: 600; color: var(--color-ink); }

/* ─────────────────────────────────────────────
   16. FILTER ROW
───────────────────────────────────────────── */
.filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-hairline);
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.filter-tab {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--color-hairline);
  background: var(--color-canvas);
  color: var(--color-muted);
  transition: all 0.15s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.filter-tab:hover { border-color: var(--color-secondary); color: var(--color-secondary); text-decoration: none; }
.filter-tab.active { background: var(--color-secondary); color: #fff; border-color: var(--color-secondary); }

.search-input-wrap {
  margin-left: auto;
  position: relative;
}
.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted-soft);
  pointer-events: none;
}
.search-input {
  height: 36px;
  padding: 0 14px 0 34px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--color-ink);
  outline: none;
  width: 220px;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* ─────────────────────────────────────────────
   17. APPROVAL LOG TIMELINE
───────────────────────────────────────────── */
.approval-timeline { display: flex; flex-direction: column; }

.approval-item {
  display: flex;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  position: relative;
}

.approval-item:last-child { padding-bottom: 0; }

.approval-line-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 20px;
}

.approval-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-secondary);
  border: 2px solid var(--color-canvas);
  box-shadow: 0 0 0 2px var(--color-secondary);
  flex-shrink: 0;
  margin-top: 4px;
}

.approval-dot.dot-success { background: var(--color-success); box-shadow: 0 0 0 2px var(--color-success); }
.approval-dot.dot-warning { background: var(--color-warning); box-shadow: 0 0 0 2px var(--color-warning); }
.approval-dot.dot-error   { background: var(--color-error);   box-shadow: 0 0 0 2px var(--color-error); }

.approval-connector {
  width: 2px;
  flex: 1;
  background: var(--color-hairline);
  margin-top: 4px;
  min-height: 20px;
}

.approval-item:last-child .approval-connector { display: none; }

.approval-content { flex: 1; }
.approval-actor { font-size: 13px; font-weight: 500; color: var(--color-ink); }
.approval-role-tag { font-size: 11px; color: var(--color-muted); margin-left: 4px; }
.approval-action { font-size: 14px; color: var(--color-body); margin-top: 2px; }
.approval-notes { font-size: 13px; color: var(--color-muted); margin-top: 4px; font-style: italic; }
.approval-time { font-size: 12px; color: var(--color-muted-soft); margin-top: 4px; }

/* ─────────────────────────────────────────────
   18. ACTION PANEL
───────────────────────────────────────────── */
.action-panel {
  background: var(--color-canvas);
  border-top: 1px solid var(--color-hairline);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.action-panel-info { font-size: 13px; color: var(--color-muted); }
.action-panel-buttons { display: flex; gap: var(--space-sm); }

/* ─────────────────────────────────────────────
   19. PROGRESS BAR
───────────────────────────────────────────── */
.progress-bar-track {
  height: 8px;
  background: var(--color-surface-card);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-success);
  transition: width 0.6s ease;
}

.progress-bar-fill.warn { background: var(--color-warning); }
.progress-bar-fill.critical { background: var(--color-error); }

/* ─────────────────────────────────────────────
   20. MODALS
───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--color-canvas);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  padding: var(--space-xxl);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal-card { transform: scale(1); }

.modal-header { margin-bottom: var(--space-lg); }
.modal-title { font-size: 20px; font-weight: 600; color: var(--color-ink); }
.modal-body   { font-size: 14px; color: var(--color-body); margin-bottom: var(--space-xl); line-height: 1.6; }
.modal-footer { display: flex; gap: var(--space-sm); justify-content: flex-end; }
.modal-icon   { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-md); }
.modal-icon.warning { background: var(--color-warning-soft); color: var(--color-warning-text); }
.modal-icon.danger  { background: var(--color-error-soft);   color: var(--color-error-text); }
.modal-icon.success { background: var(--color-success-soft); color: var(--color-success-text); }

/* ─────────────────────────────────────────────
   21. TOAST NOTIFICATIONS
───────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 360px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border-left: 4px solid;
  animation: toastIn 0.3s ease;
  position: relative;
}

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

.toast.toast-success { background: var(--color-success-soft); border-color: var(--color-success); }
.toast.toast-error   { background: var(--color-error-soft);   border-color: var(--color-error); }
.toast.toast-warning { background: var(--color-warning-soft); border-color: var(--color-warning); }
.toast.toast-info    { background: var(--color-info-soft);    border-color: var(--color-info); }

.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-icon.success { color: var(--color-success); }
.toast-icon.error   { color: var(--color-error); }
.toast-icon.warning { color: var(--color-warning); }
.toast-icon.info    { color: var(--color-info); }

.toast-title { font-size: 13px; font-weight: 500; color: var(--color-ink); }
.toast-message { font-size: 13px; color: var(--color-muted); margin-top: 2px; }

.toast-close {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1;
}

/* ─────────────────────────────────────────────
   22. AUTH LAYOUT
───────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-brand-panel {
  background: var(--color-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xxl);
  gap: var(--space-xl);
}

.auth-brand-logo {
  width: 72px;
  height: 72px;
  background: #fff;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--color-secondary);
  letter-spacing: -1px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.auth-brand-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: -0.5px;
}

.auth-brand-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.72);
  text-align: center;
  max-width: 300px;
  line-height: 1.6;
}

.auth-brand-feature {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255,255,255,0.85);
  font-size: 14px;
}

.auth-brand-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-form-panel {
  background: var(--color-canvas);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xxl);
}

.auth-form-card {
  width: 100%;
  max-width: 400px;
}

.auth-form-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-ink);
  letter-spacing: -0.3px;
  margin-bottom: var(--space-xs);
}

.auth-form-subtitle {
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

/* OTP Input */
.otp-grid {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin: var(--space-xl) 0;
}

.otp-box {
  width: 52px;
  height: 60px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-ink);
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}
.otp-box:focus {
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* ─────────────────────────────────────────────
   23. PAGINATION
───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-lg);
}

.page-link {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-hairline);
  background: var(--color-canvas);
  font-size: 14px;
  color: var(--color-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  padding: 0 var(--space-xs);
}
.page-link:hover { background: var(--color-surface-soft); color: var(--color-ink); text-decoration: none; }
.page-link.active { background: var(--color-secondary); color: #fff; border-color: var(--color-secondary); }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ─────────────────────────────────────────────
   24. EMPTY STATE
───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xxl) var(--space-xl);
  text-align: center;
  color: var(--color-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: var(--space-md); opacity: 0.4; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--color-ink); margin-bottom: var(--space-xs); }
.empty-state p  { font-size: 14px; color: var(--color-muted); }

/* ─────────────────────────────────────────────
   25. DETAIL PAGE GRID
───────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.detail-field { margin-bottom: var(--space-md); }
.detail-field-label { font-size: 12px; font-weight: 500; color: var(--color-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-field-value { font-size: 14px; color: var(--color-ink); line-height: 1.5; }
.detail-field-value.large { font-size: 18px; font-weight: 600; color: var(--color-primary); }

.detail-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-trout);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-hairline-soft);
  margin-bottom: var(--space-md);
  margin-top: var(--space-lg);
}
.detail-section-title:first-child { margin-top: 0; }

/* ─────────────────────────────────────────────
   25a. DASHBOARD GRIDS
───────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  gap: var(--space-xl);
}
.dashboard-grid-2-1 {
  grid-template-columns: 2fr 1fr;
  margin-bottom: var(--space-xl);
}
.dashboard-grid-1-1 {
  grid-template-columns: 1fr 1fr;
}

/* ─────────────────────────────────────────────
   26. ALERT BANNER
───────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: var(--space-lg);
}
.alert-success { background: var(--color-success-soft); color: var(--color-success-text); border-left: 4px solid var(--color-success); }
.alert-error   { background: var(--color-error-soft);   color: var(--color-error-text);   border-left: 4px solid var(--color-error); }
.alert-warning { background: var(--color-warning-soft); color: var(--color-warning-text); border-left: 4px solid var(--color-warning); }
.alert-info    { background: var(--color-info-soft);    color: var(--color-info-text);    border-left: 4px solid var(--color-info); }

/* ─────────────────────────────────────────────
   27. BUDGET TABS
───────────────────────────────────────────── */
.tab-group {
  display: flex;
  border-bottom: 1px solid var(--color-hairline);
  margin-bottom: var(--space-lg);
}
.tab-btn {
  padding: var(--space-sm) var(--space-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn.active { color: var(--color-secondary); border-bottom-color: var(--color-secondary); }
.tab-btn:hover  { color: var(--color-ink); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.budget-row { margin-bottom: var(--space-md); }
.budget-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.budget-category-name { font-size: 13px; font-weight: 500; color: var(--color-ink); }
.budget-pct { font-size: 12px; color: var(--color-muted); }
.budget-amounts { display: flex; justify-content: space-between; font-size: 11px; color: var(--color-muted-soft); margin-top: 4px; }

/* ─────────────────────────────────────────────
   28. HAMBURGER (mobile)
───────────────────────────────────────────── */
.hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  background: var(--color-canvas);
  cursor: pointer;
  color: var(--color-trout);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

/* ─────────────────────────────────────────────
   29. MISCELLANEOUS UTILITIES
───────────────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.min-h-screen   { min-height: 100vh; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.divider { border: none; border-top: 1px solid var(--color-hairline-soft); margin: var(--space-xl) 0; }

/* ─────────────────────────────────────────────
   30. RESPONSIVE
───────────────────────────────────────────── */

/* ── Tablet & below (≤ 1024px) ── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;  /* di atas topbar */
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-backdrop {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 199;
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: all; }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .hamburger-btn { display: flex; }

  .detail-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: var(--space-md); }
  .form-row { grid-template-columns: 1fr; }
  .dashboard-grid-2-1,
  .dashboard-grid-1-1 {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }

  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }

  .topbar { padding: 0 var(--space-md); }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-md) var(--space-lg);
  }

  .page-content { padding: var(--space-md); }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-md);
  }
  .search-input-wrap { margin-left: 0; width: 100%; }
  .search-input { width: 100%; }
  .filter-tabs { flex-wrap: wrap; }

  .data-table { min-width: 600px; }  /* force scroll di dalam wrapper */

  .action-panel {
    flex-direction: column;
    padding: var(--space-md);
  }
  .action-panel-buttons {
    width: 100%;
    flex-direction: column;
  }
  .action-panel-buttons .btn { width: 100%; }

  .sidebar-nav-item { height: 48px; }  /* bigger touch target */
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-content { padding: var(--space-sm); }
  .action-panel { padding: var(--space-sm); }
  .card-body { padding: var(--space-md); }
  .card-header { padding: var(--space-md); }
  .stat-card { padding: var(--space-md); }
  .stat-card-value { font-size: 22px; }
  .otp-grid { gap: var(--space-xs); }
  .otp-box { width: 44px; height: 52px; font-size: 18px; }
}
