/* ============================
   HK Invoice System 2026 — Light Modern + Left Sidebar
   ============================ */

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

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

:root {
  /* Brand */
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --primary-muted: rgba(79, 70, 229, 0.08);
  
  /* Semantic */
  --success: #059669;
  --success-light: #D1FAE5;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --info: #0284C7;
  --info-light: #E0F2FE;
  
  /* Neutrals */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface2: #F1F5F9;
  --border: #E2E8F0;
  --border-dark: #CBD5E1;
  
  /* Text */
  --text: #0F172A;
  --text2: #334155;
  --text3: #64748B;
  --text4: #94A3B8;
  
  /* Sidebar */
  --sidebar-bg: #FFFFFF;
  --sidebar-border: #E2E8F0;
  --sidebar-text: #64748B;
  --sidebar-active: rgba(79,70,229,0.08);
  --sidebar-active-text: #4F46E5;
  
  /* Sizes */
  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* LAYOUT */
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ============================
   SIDEBAR
   ============================ */
.navbar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.brand {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.brand-name {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}

.brand-sub {
  color: var(--sidebar-text);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

#sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text3);
}

/* NAV TABS = sidebar menu items */
.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  flex: 1;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text3);
  border: none;
  background: transparent;
  transition: all 0.18s ease;
  text-align: left;
  width: 100%;
  white-space: nowrap;
}

.nav-tab:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-tab.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  box-shadow: none;
}

/* Sidebar bottom user section */
.user-profile-topbar {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-info-text {
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout-topbar {
  width: 100%;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.15);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}

.btn-logout-topbar:hover {
  background: #FECACA;
  color: var(--danger);
}

/* BUAT TAGIHAN in sidebar */
.btn-sidebar-create {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
  margin-bottom: 4px;
}

.btn-sidebar-create:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79,70,229,0.4);
}

/* ============================
   MAIN CONTENT AREA
   ============================ */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px;
  max-width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
}

.page {
  display: none;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page.active { display: block; }

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

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text3);
  margin-top: 2px;
  font-weight: 400;
}

/* ============================
   STAT CARDS
   ============================ */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(79,70,229,0.2);
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat.s1::before { background: linear-gradient(90deg, var(--danger), #F87171); }
.stat.s2::before { background: linear-gradient(90deg, var(--warning), #FCD34D); }
.stat.s3::before { background: linear-gradient(90deg, var(--success), #34D399); }
.stat.s4::before { background: linear-gradient(90deg, var(--primary), #818CF8); }
.stat.s5::before { background: linear-gradient(90deg, var(--info), #38BDF8); }

.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
  margin-bottom: 8px;
}

.stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text4);
  margin-top: 6px;
  font-weight: 500;
}

/* ============================
   TABLE BOX
   ============================ */
.tbox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.tbox-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface);
}

.tbox-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  text-align: left;
  padding: 11px 16px;
  color: var(--text3);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

tbody td {
  padding: 14px 16px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td {
  background: var(--primary-muted);
}

td:first-child { border-left: none; border-radius: 0; }
td:last-child { border-right: none; border-radius: 0; }

/* ============================
   BADGES
   ============================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.b-danger  { background: var(--danger-light); color: var(--danger); }
.b-warning { background: var(--warning-light); color: var(--warning); }
.b-success { background: var(--success-light); color: var(--success); }
.b-info    { background: var(--info-light); color: var(--info); }
.b-purple  { background: var(--primary-light); color: var(--primary); }

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
  transform: translateY(-1px);
}

.btn-success { background: var(--success-light); color: var(--success); border-color: rgba(5,150,105,0.15); }
.btn-success:hover { background: #A7F3D0; }

.btn-danger { background: var(--danger-light); color: var(--danger); border-color: rgba(220,38,38,0.15); }
.btn-danger:hover { background: #FECACA; }

.btn-warning { background: var(--warning-light); color: var(--warning); border-color: rgba(217,119,6,0.15); }
.btn-warning:hover { background: #FDE68A; }

.btn-ghost { background: transparent; color: var(--text3); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #128C7E; transform: translateY(-1px); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-xs { padding: 4px 10px; font-size: 0.74rem; }

/* ============================
   FILTER BAR
   ============================ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}

.finput-sm {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  transition: all 0.18s;
}

.finput-sm:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

/* ============================
   AGEN CARDS
   ============================ */
.agen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.agen-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px 20px 20px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.agen-card:hover {
  border-color: rgba(79,70,229,0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.agen-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.agen-card.aktif::before { background: linear-gradient(90deg, var(--success), #34D399); }
.agen-card.nonaktif::before { background: linear-gradient(90deg, var(--text4), #CBD5E1); }

.agen-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agen-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.agen-card-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 16px;
}

.profile-details { display: flex; flex-direction: column; gap: 5px; }
.profile-row { display: flex; justify-content: space-between; align-items: flex-start; font-size: 0.8rem; }
.profile-label { color: var(--text3); flex-shrink: 0; }
.profile-value { color: var(--text2); font-weight: 500; text-align: right; word-break: break-all; }

.pendapatan-box {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid rgba(79,70,229,0.12);
  text-align: center;
}

.pendapatan-item { display: flex; flex-direction: column; }
.pendapatan-label { font-size: 0.65rem; text-transform: uppercase; font-weight: 700; color: var(--primary-dark); margin-bottom: 2px; letter-spacing: 0.5px; }
.pendapatan-val { font-size: 0.9rem; font-weight: 800; color: var(--text); }

.agen-actions {
  padding: 10px 4px !important;
  border-top: 1px solid var(--border);
  display: flex !important;
  gap: 3px !important;
  flex-wrap: nowrap !important; /* Paksa 1 baris lurus */
  justify-content: center !important;
  align-items: center !important;
  background: var(--surface2);
}

.jejak-list { display: flex; flex-direction: column; gap: 5px; }
.jejak-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  padding: 8px 12px; font-size: 0.8rem;
  background: var(--surface2);
  border-radius: 0 6px 6px 0;
  border-left: 3px solid var(--success);
}

/* ============================
   MODAL
   ============================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.overlay.show { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.mhead {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.mtitle { font-size: 1rem; font-weight: 700; color: var(--text); }

.mclose {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.mclose:hover { background: var(--danger-light); color: var(--danger); }

.mbody { padding: 24px; }
.mfoot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================
   FORMS
   ============================ */
.fg { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.flabel {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.2px;
}

.finput, .fselect, .ftextarea {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  transition: all 0.18s ease;
}

.finput:focus, .fselect:focus, .ftextarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fgrid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ============================
   MISC
   ============================ */
.notif-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #ffffff;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  margin-left: 4px;
  min-width: 18px;
}

.empty { text-align: center; padding: 48px 24px; color: var(--text4); font-size: 0.88rem; }
.empty-icon { font-size: 2.8rem; margin-bottom: 12px; opacity: 0.5; display: block; }

.tagihan-urgent { border-left: 3px solid var(--danger) !important; }
.tagihan-warning { border-left: 3px solid var(--warning) !important; }
.tagihan-ok { border-left: 3px solid var(--success) !important; }

.deposit-bar {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.deposit-val { font-size: 1.1rem; font-weight: 700; color: var(--success); }

/* ============================
   INVOICE SHEET
   ============================ */
.invoice-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 4px;
}

.inv-tab-btn {
  padding: 9px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text3);
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
}

.inv-tab-btn:hover { color: var(--text); background: var(--surface2); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.inv-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

#invoice-print-area {
  background: #ffffff;
  color: #1f1f1f;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.invoice-logo-title { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.invoice-company-info { text-align: right; font-size: 0.76rem; color: var(--text3); line-height: 1.5; }

.invoice-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.invoice-meta-col h4 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text3); margin-bottom: 6px; letter-spacing: 0.5px; }
.invoice-meta-col p { font-size: 0.85rem; line-height: 1.4; }

.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.invoice-table th { background: var(--surface2); padding: 10px 12px; font-size: 0.72rem; font-weight: 700; color: var(--text3); text-transform: uppercase; border-bottom: 2px solid var(--border); text-align: left; }
.invoice-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 0.84rem; color: var(--text2); }

.invoice-total-row { display: flex; justify-content: flex-end; font-size: 0.95rem; margin-bottom: 12px; padding: 0 12px; }
.invoice-total-label { font-weight: 500; color: var(--text3); margin-right: 20px; }
.invoice-total-val { font-weight: 800; color: var(--text); font-size: 1.1rem; }

.invoice-badge-status {
  position: absolute;
  top: 100px;
  right: 28px;
  transform: rotate(-10deg);
  border: 3px double;
  padding: 6px 14px;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 6px;
  opacity: 0.85;
  letter-spacing: 1px;
  pointer-events: none;
}

.invoice-badge-status.lunas { color: var(--success); border-color: var(--success); background: var(--success-light); }
.invoice-badge-status.belum-bayar { color: var(--danger); border-color: var(--danger); background: var(--danger-light); }
.invoice-badge-status.sebagian { color: var(--warning); border-color: var(--warning); background: var(--warning-light); }

#invoice-text-container { display: none; }
#invoice-text-content {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  color: var(--text);
  line-height: 1.4;
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
}

/* ============================
   BULK ACTION BAR
   ============================ */
.bulk-action-bar {
  position: fixed;
  bottom: 24px;
  left: calc(var(--sidebar-w) + 50%);
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  border: none;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  border-radius: 40px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  pointer-events: none;
}

.bulk-action-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.bulk-action-text { font-size: 0.88rem; font-weight: 700; color: #fff; }
.bulk-action-buttons { display: flex; gap: 8px; align-items: center; }

/* ============================
   LOGIN SCREEN
   ============================ */
#login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #312E81 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
}

.login-box {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  color: #ffffff;
}

.stat-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 36px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
  text-align: center;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.stat-card h2 { color: #fff !important; }

.login-header { margin-bottom: 28px; }
.login-logo { font-size: 3.5rem; margin-bottom: 12px; display: block; }
.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #A5B4FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.login-subtitle { font-size: 0.82rem; color: rgba(255,255,255,0.45); }

.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }

.login-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.18s;
  width: 100%;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.25);
}

.login-input::placeholder { color: rgba(255,255,255,0.3); }

.login-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
  margin-top: 6px;
  width: 100%;
}

.login-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,70,229,0.45);
}

.login-error { color: #FCA5A5; font-size: 0.78rem; margin-top: 4px; display: none; }

/* ============================
   SECTION TITLES
   ============================ */
.section-title-new {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text3);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================
   ROLE HIDING
   ============================ */
body.role-pjtagihan .role-only-admin { display: none !important; }
body.role-keuangan .role-only-admin { display: none !important; }
body.role-pjtagihan .role-only-keuangan { display: none !important; }

/* ============================
   PRINT
   ============================ */
@media print {
  body > :not(.print-active-modal) { display: none !important; }
  .print-active-modal {
    position: absolute !important;
    inset: 0 !important;
    background: #ffffff !important;
    display: block !important;
    padding: 0 !important;
  }
  .print-active-modal .modal { max-width: 100% !important; width: 100% !important; box-shadow: none !important; border: none !important; }
  .print-active-modal .mhead, .print-active-modal .mfoot,
  .print-active-modal .invoice-tabs, .print-active-modal #invoice-text-container { display: none !important; }
  .print-active-modal #invoice-print-area, .print-active-modal #spk-print-area { display: block !important; border: none !important; padding: 0 !important; }
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .navbar { position: relative; width: 100%; height: auto; flex-direction: row; bottom: auto; flex-wrap: wrap; padding: 12px; }
  .nav-tabs { flex-direction: row; overflow-x: auto; padding: 0; gap: 4px; }
  .nav-tab .label { display: none; }
  .content { margin-left: 0; max-width: 100%; padding: 16px; }
  .user-profile-topbar { flex-direction: row; align-items: center; padding: 8px 0; border-top: none; }
  .btn-sidebar-create { width: auto; }
  .fgrid, .fgrid3 { grid-template-columns: 1fr; }
  .agen-grid { grid-template-columns: 1fr; }
}
