:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --aol-blue: #1e40af;
  --module-bg: #0f2d6b;
  --module-hover: #1e40af;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app { display: flex; min-height: 100vh; }

/* --- Module icon bar (mirip Accurate Online) --- */
.module-bar {
  width: 56px;
  background: var(--module-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 4px;
  flex-shrink: 0;
  z-index: 20;
}

.mod-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #93c5fd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.mod-btn svg { width: 22px; height: 22px; }
.mod-btn:hover { background: var(--module-hover); color: white; }
.mod-btn.active { background: white; color: var(--aol-blue); }
.mod-btn.active[data-module="settings"] { background: #ec4899; color: white; }
.mod-btn.active[data-module="company"] { background: #ec4899; color: white; }
.mod-btn.active[data-module="ledger"] { background: #ec4899; color: white; }
.mod-btn.active[data-module="cashbank"] { background: #ec4899; color: white; }
.mod-btn.active[data-module="sales"] { background: #ec4899; color: white; }
.mod-btn.active[data-module="purchase"] { background: #ec4899; color: white; }
.mod-btn.active[data-module="inventory"] { background: #ec4899; color: white; }
.mod-btn.active[data-module="assets"] { background: #ec4899; color: white; }
.mod-btn.active[data-module="manufacture"] { background: #ec4899; color: white; }
.mod-btn.active[data-module="reports"] { background: #ec4899; color: white; }

.subnav {
  width: 220px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.subnav.hidden { display: none; }

.subnav-title {
  padding: 16px 16px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--aol-blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}

.subnav nav { padding: 4px 8px 16px; overflow-y: auto; flex: 1; }

.subnav-item {
  display: block;
  padding: 9px 12px;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  margin-bottom: 2px;
  transition: background 0.12s;
  -webkit-font-smoothing: antialiased;
}

.subnav-item:hover { background: #e2e8f0; color: var(--text); }
.subnav-item.active { background: var(--primary); color: white; }

.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* --- Top bar --- */
.aol-topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.brand-logo.lg { width: 48px; height: 48px; font-size: 22px; border-radius: 10px; }

.topbar-brand strong { font-size: 14px; display: block; line-height: 1.2; }
.topbar-brand small { font-size: 11px; color: var(--muted); }

.topbar-search { flex: 1; max-width: 480px; }

.topbar-search input {
  width: 100%;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #f8fafc;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-new {
  background: var(--primary);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-new:hover { background: var(--primary-dark); }

.tb-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
}

.tb-icon:hover { background: #f1f5f9; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 4px 12px 4px 4px;
  background: white;
  cursor: pointer;
  max-width: 220px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { text-align: left; overflow: hidden; }
.user-info strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info small { display: block; font-size: 11px; color: var(--muted); }

.dropdown-wrap { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 50;
  overflow: hidden;
}

.dropdown-menu-right { left: auto; right: 0; }
.dropdown-menu.hidden { display: none; }

.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.dropdown-menu a:hover { background: #f1f5f9; }

.page-header {
  padding: 16px 24px 0;
  background: var(--bg);
}

.page-header h1 { font-size: 22px; font-weight: 600; color: var(--text); }

/* --- Tab bar (mirip Accurate Online) --- */
.tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  background: #dde4ed;
  border-bottom: 1px solid #c5ced8;
  padding: 6px 10px 0;
  overflow-x: auto;
  flex-shrink: 0;
  min-height: 38px;
}

.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12px;
  background: #cfd8e3;
  border: 1px solid #b8c4d0;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  cursor: pointer;
  color: #475569;
  white-space: nowrap;
  max-width: 200px;
  user-select: none;
}

.tab-item:hover { background: #c5d0dc; }

.tab-item.active {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  border-color: #c5ced8;
  padding-bottom: 8px;
  margin-bottom: -1px;
}

.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-close {
  border: none;
  background: none;
  font-size: 15px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}

.tab-close:hover { color: var(--danger); }

/* --- Dashboard widgets --- */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.widget-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.widget-head h3 { font-size: 14px; font-weight: 600; }
.widget-head small { color: var(--muted); font-size: 11px; }
.widget-body { padding: 12px 16px; max-height: 280px; overflow-y: auto; }

.widget-col-4 { grid-column: span 4; }
.widget-col-5 { grid-column: span 5; }
.widget-col-6 { grid-column: span 6; }
.widget-col-7 { grid-column: span 7; }
.widget-col-8 { grid-column: span 8; }
.widget-col-12 { grid-column: span 12; }

@media (max-width: 1200px) {
  .widget-col-4, .widget-col-5, .widget-col-6, .widget-col-7, .widget-col-8 { grid-column: span 12; }
}

.activity-list { list-style: none; }
.activity-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.activity-list li:last-child { border-bottom: none; }
.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.activity-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }

.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.schedule-item:last-child { border-bottom: none; }
.schedule-no { font-family: Consolas, monospace; color: var(--primary); font-weight: 600; }

.sales-widget-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.sales-stat {
  background: #f8fafc;
  border-radius: 6px;
  padding: 12px;
}

.sales-stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.sales-stat .value { font-size: 18px; font-weight: 700; margin-top: 4px; }
.sales-stat .value.positive { color: var(--success); }
.sales-stat .value.negative { color: var(--danger); }

.pl-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.pl-row.total { font-weight: 700; border-top: 2px solid var(--border); margin-top: 4px; }

.cash-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding-top: 8px;
}

.cash-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.cash-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.cash-bar.in { background: #22c55e; }
.cash-bar.out { background: #ef4444; margin-top: 2px; }
.cash-bar-label { font-size: 10px; color: var(--muted); }

/* --- Modul Pengaturan (mirip Accurate Online) --- */
.main-wrap { position: relative; }

.settings-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 40;
  pointer-events: none;
}

.settings-overlay:not(.hidden) {
  pointer-events: auto;
}

.settings-overlay.hidden { display: none; }

.settings-panel {
  position: absolute;
  top: 0;
  left: 0;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  width: auto;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  pointer-events: auto;
  animation: settingsPop 0.15s ease-out;
}

@keyframes settingsPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.settings-panel-header {
  padding: 10px 14px 8px;
  border-bottom: 2px solid #e11d48;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-panel-header h2 {
  font-size: 17px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.settings-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
}

.settings-close:hover { color: #64748b; }

.settings-tiles {
  display: grid;
  grid-template-columns: repeat(3, 104px);
  gap: 10px;
  padding: 14px 14px 18px;
}

.settings-tile {
  width: 104px;
  height: 104px;
  background: #fffaf5;
  border: 1px solid #fb923c;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  padding: 8px 6px;
  color: #ea580c;
  text-decoration: none;
}

.settings-tile:hover {
  background: #ffedd5;
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.15);
}

.settings-tile svg {
  width: 34px;
  height: 34px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.settings-tile span {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.settings-tile.soon {
  opacity: 0.55;
  cursor: default;
}

.settings-tile.soon:hover {
  background: #fffaf5;
  box-shadow: none;
}

@media (max-width: 400px) {
  .settings-tiles { grid-template-columns: repeat(2, 104px); }
  .settings-panel { max-width: 100%; }
}

/* --- Modul Perusahaan --- */
.company-panel { max-width: 580px; }

.company-panel-header { border-bottom-color: #3b82f6; }

.company-tiles {
  display: grid;
  grid-template-columns: repeat(5, 96px);
  gap: 10px;
  padding: 14px 14px 18px;
}

.company-tile {
  width: 96px;
  height: 96px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  padding: 8px 4px;
  color: inherit;
  border: 1px solid;
  background: none;
  font: inherit;
}

.company-tile svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.company-tile span {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.company-tile.tile-blue { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.company-tile.tile-blue:hover { background: #dbeafe; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); }
.company-tile.tile-green { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.company-tile.tile-green:hover { background: #dcfce7; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15); }
.company-tile.tile-purple { background: #faf5ff; border-color: #d8b4fe; color: #9333ea; }
.company-tile.tile-purple:hover { background: #f3e8ff; box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15); }
.company-tile.soon { opacity: 0.55; cursor: default; }
.company-tile.soon:hover { box-shadow: none; }

@media (max-width: 560px) {
  .company-tiles { grid-template-columns: repeat(3, 96px); }
  .company-panel { max-width: 100%; }
}

/* --- Modul Buku Besar --- */
.ledger-panel { max-width: 340px; }

.ledger-panel-header { border-bottom-color: #ec4899; }

.ledger-tiles {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 10px;
  padding: 14px 14px 18px;
}

.ledger-tile {
  width: 96px;
  height: 96px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  padding: 8px 4px;
  border: 1px solid;
  background: none;
  font: inherit;
  color: inherit;
}

.ledger-tile svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.ledger-tile span {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.ledger-tile.tile-blue { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.ledger-tile.tile-blue:hover { background: #dbeafe; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); }
.ledger-tile.tile-green { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.ledger-tile.tile-green:hover { background: #dcfce7; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15); }
.ledger-tile.tile-purple { background: #faf5ff; border-color: #d8b4fe; color: #9333ea; }
.ledger-tile.tile-purple:hover { background: #f3e8ff; box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15); }
.ledger-tile.tile-orange { background: #fff7ed; border-color: #fdba74; color: #ea580c; }
.ledger-tile.tile-orange:hover { background: #ffedd5; box-shadow: 0 2px 8px rgba(234, 88, 12, 0.15); }
.ledger-tile.soon { opacity: 0.55; cursor: default; }
.ledger-tile.soon:hover { box-shadow: none; }

.cashbank-panel { max-width: 340px; }
.cashbank-panel-header { border-bottom-color: #22c55e; }

.sales-panel { max-width: 680px; }
.sales-panel-header { border-bottom-color: #ec4899; }

.sales-tiles {
  display: grid;
  grid-template-columns: repeat(6, 96px);
  gap: 10px;
  padding: 14px 14px 18px;
}

.sales-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 96px;
  min-height: 88px;
  padding: 10px 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
  text-align: center;
}

.sales-tile svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sales-tile span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
  word-break: break-word;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.sales-tile.tile-blue { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.sales-tile.tile-blue:hover { background: #dbeafe; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); }
.sales-tile.tile-green { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.sales-tile.tile-green:hover { background: #dcfce7; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15); }
.sales-tile.tile-purple { background: #faf5ff; border-color: #d8b4fe; color: #9333ea; }
.sales-tile.tile-purple:hover { background: #f3e8ff; box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15); }
.sales-tile.tile-orange { background: #fff7ed; border-color: #fdba74; color: #ea580c; }
.sales-tile.tile-orange:hover { background: #ffedd5; box-shadow: 0 2px 8px rgba(234, 88, 12, 0.15); }
.sales-tile.soon { opacity: 0.55; cursor: default; }
.sales-tile.soon:hover { box-shadow: none; }

@media (max-width: 720px) {
  .sales-tiles { grid-template-columns: repeat(3, 96px); }
  .sales-panel { max-width: 100%; }
}

.purchase-panel { max-width: 460px; }
.purchase-panel-header { border-bottom-color: #ec4899; }

.purchase-tiles {
  display: grid;
  grid-template-columns: repeat(4, 96px);
  gap: 10px;
  padding: 14px 14px 18px;
}

.purchase-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 96px;
  min-height: 88px;
  padding: 10px 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
  text-align: center;
}

.purchase-tile svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.purchase-tile span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
  word-break: break-word;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.purchase-tile.tile-blue { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.purchase-tile.tile-blue:hover { background: #dbeafe; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); }
.purchase-tile.tile-green { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.purchase-tile.tile-green:hover { background: #dcfce7; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15); }
.purchase-tile.tile-purple { background: #faf5ff; border-color: #d8b4fe; color: #9333ea; }
.purchase-tile.tile-purple:hover { background: #f3e8ff; box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15); }
.purchase-tile.tile-orange { background: #fff7ed; border-color: #fdba74; color: #ea580c; }
.purchase-tile.tile-orange:hover { background: #ffedd5; box-shadow: 0 2px 8px rgba(234, 88, 12, 0.15); }
.purchase-tile.soon { opacity: 0.55; cursor: default; }
.purchase-tile.soon:hover { box-shadow: none; }

@media (max-width: 520px) {
  .purchase-tiles { grid-template-columns: repeat(3, 96px); }
  .purchase-panel { max-width: 100%; }
}

.inventory-panel { max-width: 680px; }
.inventory-panel-header { border-bottom-color: #ec4899; }

.inventory-tiles {
  display: grid;
  grid-template-columns: repeat(6, 96px);
  gap: 10px;
  padding: 14px 14px 18px;
}

.inventory-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 96px;
  min-height: 88px;
  padding: 10px 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
  text-align: center;
}

.inventory-tile svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inventory-tile span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
  word-break: break-word;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.inventory-tile.tile-blue { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.inventory-tile.tile-blue:hover { background: #dbeafe; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); }
.inventory-tile.tile-green { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.inventory-tile.tile-green:hover { background: #dcfce7; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15); }
.inventory-tile.tile-purple { background: #faf5ff; border-color: #d8b4fe; color: #9333ea; }
.inventory-tile.tile-purple:hover { background: #f3e8ff; box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15); }
.inventory-tile.soon { opacity: 0.55; cursor: default; }
.inventory-tile.soon:hover { box-shadow: none; }

@media (max-width: 720px) {
  .inventory-tiles { grid-template-columns: repeat(3, 96px); }
  .inventory-panel { max-width: 100%; }
}

.assets-panel { max-width: 340px; }
.assets-panel-header { border-bottom-color: #ec4899; }

.assets-tiles {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 10px;
  padding: 14px 14px 18px;
}

.assets-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 96px;
  min-height: 88px;
  padding: 10px 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
  text-align: center;
}

.assets-tile svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assets-tile span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
  word-break: break-word;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.assets-tile.tile-blue { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.assets-tile.tile-blue:hover { background: #dbeafe; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); }
.assets-tile.tile-green { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.assets-tile.tile-green:hover { background: #dcfce7; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15); }
.assets-tile.tile-purple { background: #faf5ff; border-color: #d8b4fe; color: #9333ea; }
.assets-tile.tile-purple:hover { background: #f3e8ff; box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15); }
.assets-tile.soon { opacity: 0.55; cursor: default; }
.assets-tile.soon:hover { box-shadow: none; }

.manufacture-panel { max-width: 560px; }
.manufacture-panel-header { border-bottom-color: #ec4899; }

.manufacture-tiles {
  display: grid;
  grid-template-columns: repeat(5, 96px);
  gap: 10px;
  padding: 14px 14px 18px;
}

.manufacture-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 96px;
  min-height: 88px;
  padding: 10px 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
  text-align: center;
}

.manufacture-tile svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.manufacture-tile span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
  word-break: break-word;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.manufacture-tile.tile-blue { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.manufacture-tile.tile-blue:hover { background: #dbeafe; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); }
.manufacture-tile.tile-green { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.manufacture-tile.tile-green:hover { background: #dcfce7; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15); }
.manufacture-tile.tile-purple { background: #faf5ff; border-color: #d8b4fe; color: #9333ea; }
.manufacture-tile.tile-purple:hover { background: #f3e8ff; box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15); }
.manufacture-tile.tile-orange { background: #fff7ed; border-color: #fdba74; color: #ea580c; }
.manufacture-tile.tile-orange:hover { background: #ffedd5; box-shadow: 0 2px 8px rgba(234, 88, 12, 0.15); }
.manufacture-tile.soon { opacity: 0.55; cursor: default; }
.manufacture-tile.soon:hover { box-shadow: none; }

@media (max-width: 600px) {
  .manufacture-tiles { grid-template-columns: repeat(3, 96px); }
  .manufacture-panel { max-width: 100%; }
}

.reports-panel { max-width: 340px; }
.reports-panel-header { border-bottom-color: #ec4899; }

.reports-tiles {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 10px;
  padding: 14px 14px 18px;
}

.reports-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 96px;
  min-height: 88px;
  padding: 10px 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
  text-align: center;
}

.reports-tile svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reports-tile span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
  word-break: break-word;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.reports-tile.tile-purple { background: #faf5ff; border-color: #d8b4fe; color: #9333ea; }
.reports-tile.tile-purple:hover { background: #f3e8ff; box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15); }
.reports-tile.soon { opacity: 0.55; cursor: default; }
.reports-tile.soon:hover { box-shadow: none; }

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* legacy sidebar - kept for compatibility */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid #334155;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: white;
}

.logo small { display: block; color: #94a3b8; font-size: 11px; }

nav { padding: 12px 0; flex: 1; overflow-y: auto; }

.nav-section {
  padding: 16px 20px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.nav-item {
  display: block;
  padding: 10px 20px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
}

.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active { background: var(--primary); color: white; }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  background: #dbeafe;
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.badge-user { background: #f1f5f9; color: var(--muted); margin-left: 8px; }

.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1e293b 0%, #1a56db 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.login-screen.hidden { display: none; }

.login-card {
  background: white;
  padding: 32px;
  border-radius: 12px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.login-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }
.login-hint { color: var(--muted); font-size: 12px; margin-top: 12px; text-align: center; }

.report-section { margin-bottom: 24px; }
.report-section h3 { font-size: 15px; margin-bottom: 8px; color: var(--primary); }
.report-total { font-weight: 700; background: #f8fafc; }
.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* Form dokumen — mirip Accurate Online */
.doc-form { display: flex; flex-direction: column; gap: 16px; }
.doc-form-header, .doc-form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.doc-form-section-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .form-grid-4 { grid-template-columns: 1fr 1fr; } }

.line-grid { width: 100%; font-size: 13px; }
.line-grid input, .line-grid select { padding: 6px 8px; font-size: 13px; }
.line-grid th { font-size: 11px; padding: 8px; }
.line-grid td { padding: 6px 8px; vertical-align: middle; }
.line-grid .line-desc { min-width: 160px; }

.doc-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.doc-totals { display: flex; gap: 32px; font-size: 15px; }
.doc-totals span { color: var(--muted); margin-right: 8px; }
.doc-actions { display: flex; gap: 8px; }

tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #eff6ff !important; }

.page-content { padding: 24px; flex: 1; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.stat-card .label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.stat-card .value { font-size: 28px; font-weight: 700; }
.stat-card .value.money { font-size: 20px; color: var(--primary); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 { font-size: 16px; font-weight: 600; }

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-success { background: var(--success); color: white; }
.btn-icon { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); }

input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.search-input { max-width: 300px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td { padding: 12px 16px; border-bottom: 1px solid var(--border); }

tr:hover td { background: #f8fafc; }

.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-mono { font-family: "Consolas", monospace; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.tag-inventory { background: #dbeafe; color: #1d4ed8; }
.tag-service { background: #dcfce7; color: #15803d; }
.tag-draft { background: #fef3c7; color: #b45309; }
.tag-approved { background: #dcfce7; color: #15803d; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--muted); }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-box {
  position: relative;
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.empty-state { text-align: center; padding: 48px; color: var(--muted); }
.loading { text-align: center; padding: 48px; color: var(--muted); }

.import-results { margin-top: 16px; }
.import-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-info { background: #dbeafe; color: #1e40af; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

/* --- Halaman list AOL (Akun Perkiraan, dll.) --- */
.aol-list-page {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  min-height: calc(100vh - 120px);
}

.aol-list-nav {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.aol-list-menu-btn {
  width: 42px;
  border: none;
  border-right: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aol-list-menu-btn:hover { background: #f1f5f9; color: #1e40af; }

.aol-list-menu-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.aol-list-subtab {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  border-right: 1px solid #e2e8f0;
  background: #f1f5f9;
}

.aol-list-subtab.active {
  background: #fff;
  color: #1e40af;
  font-weight: 600;
  border-bottom: 2px solid #fff;
  margin-bottom: -1px;
}

.aol-list-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  flex-wrap: wrap;
}

.aol-list-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
}

.aol-list-filters select {
  width: auto;
  min-width: 120px;
  padding: 4px 8px;
  font-size: 13px;
}

.aol-filter-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aol-filter-btn:hover { background: #eff6ff; }

.aol-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  gap: 12px;
  flex-wrap: wrap;
}

.aol-list-toolbar-left,
.aol-list-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.aol-btn-square {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.aol-btn-square.btn-primary { background: #2563eb; border: none; color: #fff; }
.aol-btn-square.btn-primary:hover { background: #1d4ed8; }

.aol-btn-square.btn-ghost {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
}

.aol-btn-square.btn-ghost:hover { background: #f8fafc; }

.aol-search-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.aol-search-wrap input {
  border: none;
  width: 160px;
  padding: 6px 10px;
  font-size: 13px;
}

.aol-search-wrap input:focus { outline: none; }

.aol-search-btn {
  border: none;
  border-left: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 6px 10px;
  cursor: pointer;
  color: #64748b;
}

.aol-record-count {
  font-size: 13px;
  color: #64748b;
  min-width: 36px;
  text-align: right;
  padding-left: 8px;
}

.aol-table-wrap { overflow-x: auto; }

table.aol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.aol-table thead th {
  background: #4b5563;
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
  border-right: 1px solid #6b7280;
}

table.aol-table thead th:last-child { border-right: none; }

table.aol-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

table.aol-table tbody tr:hover { background: #f8fafc; }

table.aol-table tbody tr.coa-header td { font-weight: 600; background: #fafafa; }

table.aol-table .coa-name { color: #1e293b; }

table.aol-table .coa-code { font-family: ui-monospace, monospace; color: #334155; }

table.aol-table .coa-type { color: #475569; }

table.aol-table .coa-saldo { font-family: ui-monospace, monospace; color: #1e293b; }

/* --- Form AOL (Data Baru) --- */
.aol-list-menu-btn.menu-green {
  background: #16a34a;
  color: #fff;
  border-right-color: #15803d;
}

.aol-list-menu-btn.menu-green:hover {
  background: #15803d;
  color: #fff;
}

.aol-subtab-close {
  margin-left: 8px;
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.aol-subtab-close:hover { color: #475569; }

.aol-form-page .aol-list-subtab {
  display: flex;
  align-items: center;
}

.aol-form-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 0 12px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.aol-form-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-top: 6px;
}

.aol-form-tab:hover { color: #334155; }

.aol-form-tab.active {
  background: #fff;
  color: #1e293b;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  border-bottom-color: #fff;
}

.aol-form-body {
  padding: 20px 24px 8px;
  background: #fff;
  max-width: 720px;
}

.aol-form-panel.hidden { display: none; }

.aol-field-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 20px;
  align-items: start;
  margin-bottom: 16px;
}

.aol-field-row > label:first-child {
  font-size: 13px;
  color: #334155;
  padding-top: 8px;
  text-align: right;
}

.aol-field-row input[type="text"],
.aol-field-row input[type="number"],
.aol-field-row input[type="date"],
.aol-field-row select,
.aol-field-row textarea {
  max-width: 420px;
}

.aol-required { color: #dc2626; }

.aol-field-hint {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
  margin-top: 4px;
}

.aol-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding-top: 8px;
  text-align: left !important;
}

.aol-currency-field select {
  max-width: 280px;
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
  font-weight: 500;
}

.aol-currency-picker {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 420px;
  min-height: 36px;
}

.aol-currency-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  color: #1e40af;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  max-width: 100%;
}

.aol-currency-tag.hidden,
.aol-currency-select.hidden {
  display: none;
}

.aol-tag-remove {
  border: none;
  background: none;
  color: #64748b;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.aol-tag-remove:hover { color: #1e293b; }

.aol-currency-select {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  padding-right: 36px;
}

.aol-currency-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

.aol-currency-picker:has(.aol-currency-tag:not(.hidden)) .aol-currency-search {
  right: 10px;
}

.aol-form-footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px 20px;
  background: #fff;
  border-top: 1px solid #f1f5f9;
  max-width: 720px;
}

.coa-parent-row.hidden { display: none; }

/* --- Pencatatan Beban --- */
.expense-form-page .expense-doc-layout {
  display: flex;
  align-items: flex-start;
  gap: 0;
  background: #fff;
}

.expense-form-page .expense-form {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: #fff;
}

.expense-form-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 16px 0;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.expense-form-tab {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.expense-form-tab.active {
  background: #fff;
  color: #1e293b;
  font-weight: 600;
  border-color: #e2e8f0;
}

.expense-form-panel { padding: 16px 20px 20px; }
.expense-form-panel.hidden { display: none; }

.expense-form-header {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 20px 24px;
  margin-bottom: 16px;
  align-items: end;
}

.expense-header-col {
  display: grid;
  gap: 14px;
}

.expense-header-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 2px;
}

.expense-action-btn {
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.expense-action-ambil {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
}

.expense-action-proses {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

.expense-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.expense-field label {
  display: block;
  font-size: 13px;
  color: #334155;
  margin-bottom: 6px;
}

.expense-field input,
.expense-field select,
.expense-field textarea,
.account-picker-input {
  width: 100%;
  padding: 8px 34px 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
}

.account-picker { position: relative; }

.account-search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

.expense-number-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.expense-number-display {
  flex: 1;
  background: #f8fafc;
  padding-right: 10px;
}

.expense-doc-type {
  min-width: 160px;
  background: #f8fafc;
}

.expense-info-section {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  background: #fafbfc;
}

.expense-info-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.expense-info-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}

.expense-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.expense-info-table th,
.expense-info-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  background: #fff;
}

.expense-info-table th {
  background: #f1f5f9;
  text-align: left;
  font-weight: 600;
}

.expense-payment-panel {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.expense-payment-list-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.expense-payment-box {
  flex: 1;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 8px 12px;
  font-size: 13px;
}

.expense-payment-box.hidden { display: none; }

.expense-payment-item {
  display: grid;
  grid-template-columns: 100px 100px 1fr auto;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

.expense-payment-item:last-child { border-bottom: none; }

.expense-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
}

.expense-status-process { background: #fef3c7; color: #92400e; }
.expense-status-partial { background: #dbeafe; color: #1e40af; }
.expense-status-paid { background: #e2e8f0; color: #334155; }

.expense-lines-section {
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  background: #fff;
}

.expense-lines-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.expense-lines-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  text-align: right;
}

.expense-line-search {
  min-width: 280px;
  max-width: 360px;
  justify-self: end;
}

.account-suggest {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.account-suggest.hidden { display: none; }

.account-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.account-suggest-item:hover { background: #f1f5f9; }

.account-suggest-empty {
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 13px;
}

.expense-lines-table .expense-col-drag,
.expense-line-drag {
  width: 36px;
  color: #94a3b8;
  text-align: center;
}

.expense-lines-table .line-amount {
  width: 120px;
  text-align: right;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.expense-line-amount {
  display: inline-block;
  min-width: 100px;
  font-family: ui-monospace, monospace;
}

.expense-total-box {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 0 16px 12px;
  padding: 8px 12px;
  border: 2px solid #93c5fd;
  border-radius: 4px;
  width: fit-content;
  margin-left: auto;
  font-size: 14px;
}

.expense-other-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px 24px;
  max-width: 720px;
}

.expense-field.full { grid-column: 1 / -1; }

.expense-sidebar {
  width: 56px;
  flex-shrink: 0;
  border-left: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 420px;
}

.expense-side-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.expense-side-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.expense-side-save {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

.expense-side-print,
.expense-side-attach {
  background: #fff7ed;
  border-color: #fdba74;
}

.expense-side-history {
  background: #f0fdf4;
  border-color: #86efac;
}

.expense-side-delete {
  background: #fef2f2;
  border-color: #fca5a5;
}

.expense-side-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.expense-row { cursor: pointer; }
.expense-row:hover { background: #f8fafc; }

@media (max-width: 900px) {
  .expense-form-header { grid-template-columns: 1fr; }
  .expense-info-grid { grid-template-columns: 1fr; }
  .expense-lines-head { grid-template-columns: 1fr; }
  .expense-other-grid { grid-template-columns: 1fr; }
  .expense-doc-layout { flex-direction: column; }
  .expense-sidebar {
    width: 100%;
    flex-direction: row;
    min-height: auto;
    border-left: none;
    border-top: 1px solid #e2e8f0;
  }
  .expense-side-stack { flex-direction: row; margin-top: 0; }
}

/* --- Jurnal Umum --- */
.jv-form-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  margin-bottom: 16px;
  align-items: end;
}

.jv-header-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.jv-doc-type,
.jv-source-number {
  background: #f8fafc;
}

.jv-source-field { grid-column: span 1; }

.jv-description-row,
.jv-notes-row {
  margin-bottom: 16px;
  max-width: 640px;
}

.jv-description-row label,
.jv-notes-row label {
  display: block;
  font-size: 13px;
  color: #334155;
  margin-bottom: 6px;
}

.jv-notes-row input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
}

.jv-lines-table .line-debit,
.jv-lines-table .line-credit {
  width: 120px;
  text-align: right;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.jv-line-amount {
  display: inline-block;
  min-width: 100px;
  font-family: ui-monospace, monospace;
}

.jv-totals-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
}

.jv-total-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 14px;
  border: 2px solid #93c5fd;
  border-radius: 4px;
  min-width: 140px;
  font-size: 13px;
}

.jv-total-box strong {
  font-family: ui-monospace, monospace;
  font-size: 14px;
}

.jv-total-box strong.jv-balanced,
.jv-total-box .jv-balanced {
  color: #16a34a;
}

.jv-row { cursor: pointer; }
.jv-row:hover { background: #f8fafc; }

@media (max-width: 900px) {
  .jv-header-fields { grid-template-columns: 1fr; }
  .jv-form-header { grid-template-columns: 1fr; }
  .jv-totals-row { flex-direction: column; align-items: stretch; }
}
