:root {
  color-scheme: light;
  --navy: #102a43;
  --navy-2: #213c55;
  --teal: #0f6573;
  --teal-2: #128096;
  --cyan: #e4f5f7;
  --bg: #f3f6f9;
  --card: #fff;
  --text: #1d3448;
  --muted: #718397;
  --line: #dce5ec;
  --red: #b63c32;
  --red-bg: #fff0ee;
  --amber: #9b6813;
  --amber-bg: #fff7e5;
  --green: #1b7447;
  --green-bg: #eaf7ef;
  --blue: #315f9e;
  --blue-bg: #edf4ff;
  --shadow: 0 14px 36px rgba(16, 42, 67, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted, .field small, .help-text { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .11em; }
.eyebrow.light { color: #b9d9df; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; color: #fff; background: linear-gradient(135deg, var(--teal), #26a2b0); font-size: 20px; font-weight: 950; box-shadow: 0 12px 24px rgba(15,101,115,.21); }
.brand-mark.small { width: 41px; height: 41px; border-radius: 13px; font-size: 15px; }
.login-screen { display: grid; place-items: center; min-height: 100vh; padding: 25px; background: radial-gradient(circle at 15% 15%, rgba(35,153,167,.3), transparent 34%), linear-gradient(140deg,#0b2339,#102a43 55%,#0e5362); }
.login-card { width: min(100%, 430px); padding: 34px; border-radius: 26px; background: rgba(255,255,255,.98); box-shadow: 0 30px 90px rgba(0,0,0,.24); }
.login-card h1 { margin: 0; color: var(--navy); font-size: 29px; letter-spacing: -.04em; }
.login-card .eyebrow { margin-top: 24px; }
.login-copy { margin: 7px 0 25px; line-height: 1.6; }
.field { display: grid; gap: 7px; margin-bottom: 15px; font-size: 12px; font-weight: 750; color: var(--navy-2); }
.field input, .field select, .field textarea, .filters select, .search-box input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; color: var(--text); background: #fff; outline: none; }
.field input, .field select, .filters select { min-height: 43px; }
.field input:focus, .field select:focus, .field textarea:focus, .filters select:focus, .search-box input:focus { border-color: #5d9ca7; box-shadow: 0 0 0 3px rgba(18,128,150,.12); }
.field small, .help-text { display: block; font-size: 10px; font-weight: 500; line-height: 1.5; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 41px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--navy-2); background: #fff; font-size: 12px; font-weight: 800; transition: .15s ease; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button.primary { border-color: transparent; color: #fff; background: linear-gradient(135deg,var(--teal),var(--teal-2)); box-shadow: 0 8px 18px rgba(15,101,115,.18); }
.button.secondary { background: #fff; }
.button.full { width: 100%; min-height: 47px; margin-top: 4px; }
.link-button, .text-button { border: 0; color: var(--teal); background: transparent; font-size: 11px; font-weight: 800; }
.link-button { display: block; margin: 11px auto 0; padding: 5px; }
.error-text { min-height: 18px; margin: 8px 0 0; color: var(--red); font-size: 11px; text-align: center; }
.login-footnote { margin: 17px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 245px; padding: 23px 16px; color: #fff; background: linear-gradient(180deg,#102a43,#0d3b4a); }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 2px 7px 27px; }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 13px; }
.brand-lockup span { margin-top: 4px; color: #a9c7d2; font-size: 10px; }
.side-nav { display: grid; gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 10px 12px; border: 0; border-radius: 11px; color: #c7d8e1; background: transparent; text-align: left; font-size: 12px; font-weight: 750; }
.nav-link span { width: 18px; font-size: 17px; text-align: center; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-link.active { box-shadow: inset 3px 0 #48cfdb; }
.sidebar-bottom { margin-top: auto; }
.account { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 13px; background: rgba(255,255,255,.08); }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; color: #073841; background: #a4e7ed; font-size: 13px; font-weight: 900; }
.account strong { display: block; max-width: 150px; overflow: hidden; color: #fff; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account small { display: block; margin-top: 3px; color: #aecad3; font-size: 10px; }
.logout-button { width: 100%; margin-top: 7px; padding: 9px; border: 0; border-radius: 10px; color: #d1dfe5; background: transparent; font-size: 11px; font-weight: 750; text-align: left; }
.logout-button:hover { background: rgba(255,255,255,.08); color: #fff; }
.main-area { min-height: 100vh; margin-left: 245px; }
.topbar { position: sticky; z-index: 8; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 77px; padding: 12px 29px; border-bottom: 1px solid rgba(220,229,236,.9); background: rgba(243,246,249,.92); backdrop-filter: blur(14px); }
.topbar .eyebrow { margin-bottom: 2px; font-size: 9px; }
.topbar h1 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.sync-status { color: var(--muted); font-size: 10px; }
.content { max-width: 1580px; margin: auto; padding: 25px 29px 80px; }
.page { display: none; animation: fade-in .18s ease; }
.page.active { display: block; }
@keyframes fade-in { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 155px; margin-bottom: 17px; padding: 25px 27px; border-radius: 20px; color: white; background: radial-gradient(circle at 85% 5%,rgba(87,210,221,.22),transparent 28%),linear-gradient(110deg,#102a43,#0f6573); box-shadow: var(--shadow); }
.welcome h2 { margin: 0 0 7px; font-size: clamp(22px,3vw,30px); letter-spacing: -.04em; }
.welcome p:not(.eyebrow) { margin: 0; color: #c6e2e8; font-size: 12px; line-height: 1.55; }
.today-card { min-width: 160px; padding: 14px; border: 1px solid rgba(255,255,255,.15); border-radius: 14px; background: rgba(255,255,255,.08); }
.today-card small, .today-card strong { display: block; }
.today-card small { color: #c3dce1; font-size: 10px; }
.today-card strong { margin-top: 6px; font-size: 14px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 17px; }
.kpi { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); box-shadow: 0 6px 20px rgba(16,42,67,.035); }
.kpi-label { color: var(--muted); font-size: 10px; font-weight: 800; }
.kpi-value { margin-top: 8px; overflow: hidden; font-size: clamp(16px,2vw,24px); font-weight: 900; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.kpi-note { margin-top: 5px; color: var(--muted); font-size: 9px; }
.kpi.danger .kpi-value { color: var(--red); }
.kpi.warning .kpi-value { color: var(--amber); }
.kpi.success .kpi-value { color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(280px,.7fr); gap: 15px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--card); box-shadow: 0 5px 19px rgba(16,42,67,.03); }
.backup-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 15px; padding: 17px 18px; }
.backup-panel h2 { margin: 0; font-size: 13px; }
.backup-panel p { max-width: 680px; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.backup-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.ai-security-note { margin-bottom: 12px; padding: 14px 16px; border-color: #f1d7ac; background: #fffaf0; }
.ai-security-note strong { color: #7b5010; font-size: 11px; }
.ai-security-note p { margin: 5px 0 0; color: #68583d; font-size: 10px; line-height: 1.55; }
.ai-key-form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; padding: 13px 15px; }
.ai-key-form .field { flex: 1 1 280px; margin: 0; }
.ai-key-form .field input { font-size: 11px; }
.ai-key-form > .muted { align-self: center; font-size: 10px; }
.ai-chat { display: flex; flex-direction: column; min-height: 400px; max-height: 65vh; overflow: hidden; }
.ai-messages { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 10px; overflow: auto; padding: 18px; }
.ai-message { max-width: min(85%,760px); padding: 11px 13px; border-radius: 13px; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-message.assistant { border: 1px solid var(--line); border-bottom-left-radius: 4px; background: #f7fafb; }
.ai-message.user { align-self: flex-end; border-bottom-right-radius: 4px; color: #fff; background: var(--teal); }
.ai-chat-form { display: flex; align-items: end; gap: 9px; padding: 12px; border-top: 1px solid var(--line); }
.ai-chat-form textarea { flex: 1; min-width: 0; resize: vertical; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; color: var(--text); font-size: 11px; }
.ai-chat-form textarea:focus { outline: 2px solid rgba(18,128,150,.15); border-color: #5d9ca7; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px; border-bottom: 1px solid #edf1f4; }
.panel-heading h2 { margin: 0; font-size: 13px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.text-button { padding: 7px; white-space: nowrap; }
.priority-list, .company-summary { display: grid; gap: 9px; padding: 15px 17px; }
.priority-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px; border: 1px solid #e6edf2; border-radius: 12px; background: #fbfdfe; }
.priority-label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.priority-label strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.priority-meta { margin-top: 5px; color: var(--muted); font-size: 9px; }
.priority-value { text-align: right; }
.priority-value strong { display: block; font-size: 11px; }
.priority-value small { display: block; margin-top: 3px; color: var(--red); font-size: 9px; }
.company-row { padding: 3px 0 8px; }
.company-top, .company-foot { display: flex; justify-content: space-between; gap: 8px; }
.company-top { font-size: 10px; font-weight: 800; }
.company-top span, .company-foot { color: var(--muted); }
.bar-track { height: 7px; margin: 7px 0 5px; overflow: hidden; border-radius: 9px; background: #edf2f5; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--teal),#35b4c2); }
.company-foot { font-size: 9px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.heading-actions { display: flex; gap: 8px; }
.filters { display: grid; grid-template-columns: minmax(190px,1.6fr) repeat(5,minmax(120px,.7fr)); align-items: center; gap: 8px; padding: 11px; margin-bottom: 12px; }
.filters.compact { grid-template-columns: minmax(220px,1fr) minmax(145px,.4fr) auto; }
.filters select { min-height: 39px; padding: 8px 9px; font-size: 10px; }
.search-box { display: flex; align-items: center; gap: 7px; min-width: 0; }
.search-box > span { padding-left: 5px; color: var(--muted); font-size: 24px; line-height: 1; }
.search-box input { height: 39px; font-size: 11px; }
.result-count { display: flex; align-items: center; justify-content: center; min-height: 35px; padding: 0 9px; border-radius: 9px; color: var(--muted); background: #f3f6f8; font-size: 10px; font-weight: 800; white-space: nowrap; }
.record-list { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: #62778a; background: #f7f9fb; font-size: 9px; font-weight: 900; letter-spacing: .055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #edf1f4; font-size: 10px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfe; }
.main-cell strong, .main-cell small { display: block; }
.main-cell strong { max-width: 210px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.main-cell small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.company-chip { display: inline-block; margin-right: 6px; padding: 4px 7px; border-radius: 99px; color: #0b5863; background: var(--cyan); font-size: 9px; font-weight: 900; }
.amount-cell { font-weight: 850; white-space: nowrap; }
.status-chip { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.status-chip.paid { color: var(--green); background: var(--green-bg); }
.status-chip.overdue { color: var(--red); background: var(--red-bg); }
.status-chip.soon { color: var(--amber); background: var(--amber-bg); }
.status-chip.future { color: var(--blue); background: var(--blue-bg); }
.actions { display: flex; justify-content: flex-end; gap: 4px; }
.action-button { display: grid; place-items: center; min-width: 30px; height: 29px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy-2); background: white; font-size: 9px; font-weight: 750; }
.action-button:hover { border-color: #91bfc6; background: var(--cyan); }
.action-button.delete { color: var(--red); }
.mobile-records { display: none; }
.empty-state { padding: 44px 20px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--navy-2); font-size: 13px; }
.tabs { display: flex; gap: 5px; overflow: auto; margin-bottom: 10px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.tab { min-width: 115px; padding: 9px 11px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; }
.tab.active { color: var(--navy); background: var(--cyan); }
.history-list { display: grid; gap: 0; padding: 4px 16px; }
.history-item { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: start; gap: 11px; padding: 13px 2px; border-bottom: 1px solid #edf1f4; }
.history-item:last-child { border-bottom: 0; }
.history-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--teal); background: var(--cyan); font-size: 10px; font-weight: 900; }
.history-item strong { font-size: 10px; }
.history-item p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.history-item time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.modal { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(8,25,40,.6); backdrop-filter: blur(3px); }
.modal-card { width: min(100%,680px); max-height: min(92vh,850px); overflow: auto; padding: 0 21px 18px; border-radius: 19px; background: #fff; box-shadow: 0 28px 90px rgba(0,0,0,.28); }
.modal-card.narrow { width: min(100%,480px); }
.modal-heading { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 18px 0 13px; border-bottom: 1px solid #edf1f4; background: #fff; }
.modal-heading h2 { margin: 0; font-size: 17px; }
.modal-heading p { margin: 4px 0 0; }
.icon-close { width: 34px; height: 34px; border: 0; border-radius: 9px; color: var(--muted); background: #f1f4f6; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.form-grid .wide { grid-column: 1/-1; }
.modal-footer { position: sticky; bottom: -18px; display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding: 13px 0 0; border-top: 1px solid #edf1f4; background: #fff; }
.floating-add { display: none; }
.bottom-nav { display: none; }
.loading { position: fixed; z-index: 80; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(243,246,249,.78); backdrop-filter: blur(3px); font-size: 11px; font-weight: 800; }
.spinner { width: 21px; height: 21px; border: 3px solid #dce8ed; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; z-index: 90; top: 14px; right: 14px; display: grid; gap: 8px; width: min(350px,calc(100vw - 28px)); }
.toast { padding: 12px 14px; border-radius: 11px; color: white; background: var(--navy); box-shadow: var(--shadow); font-size: 10px; line-height: 1.5; }
.toast.error { background: #a5362e; }
.toast.success { background: #176c43; }
#printReport { display: none; }

@media (max-width: 1100px) {
  .filters { grid-template-columns: minmax(220px,1.4fr) repeat(3,minmax(130px,.7fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .topbar { min-height: 67px; padding: 10px 15px; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 16px; }
  .top-actions { gap: 5px; }
  .sync-status { display: none; }
  .top-actions .button { min-height: 37px; padding: 8px 10px; font-size: 10px; }
  .desktop-add { display: none; }
  .content { padding: 17px 14px 90px; }
  .backup-panel { align-items: flex-start; flex-direction: column; }
  .backup-actions { flex-wrap: wrap; }
  .welcome { min-height: 136px; align-items: flex-start; padding: 19px; }
  .today-card { display: none; }
  .welcome h2 { font-size: 22px; }
  .welcome p:not(.eyebrow) { max-width: 420px; font-size: 10px; }
  .filters, .filters.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .search-box { grid-column: 1/-1; }
  .filters select:last-of-type { grid-column: 1/-1; }
  .result-count { grid-column: 1/-1; }
  .record-list { overflow: visible; border: 0; background: transparent; }
  .data-table { display: none; }
  .mobile-records { display: grid; gap: 10px; }
  .mobile-card { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; }
  .mobile-card-head { display: flex; justify-content: space-between; gap: 10px; }
  .mobile-card h3 { margin: 6px 0 4px; font-size: 12px; }
  .mobile-card .amount-cell { text-align: right; }
  .mobile-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
  .mobile-card-grid small, .mobile-card-grid strong { display: block; }
  .mobile-card-grid small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
  .mobile-card-grid strong { margin-top: 3px; font-size: 9px; overflow-wrap: anywhere; }
  .mobile-card-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf1f4; }
  .mobile-card-actions .action-button { flex: 1; }
  .bottom-nav { position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-template-columns: repeat(5,1fr); min-height: 59px; padding: 5px 7px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 16px; }
  .bottom-nav button span { font-size: 8px; font-weight: 800; }
  .bottom-nav button.active { color: var(--teal); background: var(--cyan); }
  .floating-add { position: fixed; z-index: 18; right: 15px; bottom: 76px; display: grid; place-items: center; width: 49px; height: 49px; border: 0; border-radius: 16px; color: white; background: linear-gradient(135deg,var(--teal),var(--teal-2)); box-shadow: 0 12px 25px rgba(15,101,115,.28); font-size: 25px; }
}
@media (max-width: 560px) {
  .login-card { padding: 27px 22px; }
  .kpi-grid { gap: 8px; }
  .kpi { padding: 13px; }
  .kpi-note { display: none; }
  .kpi-value { font-size: 15px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 19px; }
  .section-heading p { max-width: 235px; font-size: 10px; line-height: 1.4; }
  .heading-actions { flex-direction: column; align-items: flex-end; }
  .heading-actions .button { min-height: 34px; font-size: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .modal { align-items: end; padding: 0; }
  .modal-card, .modal-card.narrow { width: 100%; max-height: 93vh; padding: 0 16px 16px; border-radius: 19px 19px 0 0; }
  .modal-footer { bottom: -16px; }
  .history-item { grid-template-columns: 29px minmax(0,1fr); }
  .history-item time { grid-column: 2; }
  .ai-chat { min-height: 350px; max-height: 58vh; }
  .ai-key-form .button { flex: 1; }
  .ai-message { max-width: 94%; }
}

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: white !important; }
  body > *:not(#printReport) { display: none !important; }
  #printReport { display: block !important; color: #172b3a; font: 10px Arial, sans-serif; }
  #printReport h1 { margin: 0 0 4px; font-size: 18px; }
  #printReport .print-meta { margin: 0 0 12px; color: #526578; font-size: 9px; }
  #printReport table { width: 100%; border-collapse: collapse; }
  #printReport th, #printReport td { padding: 6px 7px; border: 1px solid #cbd5de; text-align: left; vertical-align: top; }
  #printReport th { background: #edf3f6 !important; font-size: 8px; text-transform: uppercase; }
  #printReport td { font-size: 8px; }
  #printReport .money { text-align: right; white-space: nowrap; }
  #printReport .overdue-days { color: #b42318; font-weight: bold; white-space: nowrap; }
  #printReport tfoot td { font-weight: bold; }
}

/* ==========================================================================
   Tema Pawon (tahap 1): palet terracotta yang sama dengan dashboard pengantaran
   pawonrizkilumintir.my.id, supaya dua aplikasi owner terasa satu keluarga.
   ========================================================================== */
:root {
  --navy: #1C1917;
  --navy-2: #292524;
  --teal: #C2410C;
  --teal-2: #9A3412;
  --cyan: #FFEDD5;
  --bg: #F8F5EE;
  --text: #1C1917;
  --muted: #67605A;
  --line: #E7E2D6;
  --shadow: 0 10px 28px rgba(28, 25, 23, .06);
}

.brand-logo { display: block; width: 56px; height: 56px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.brand-logo.small { width: 41px; height: 41px; border-radius: 12px; border-color: rgba(255,255,255,.18); }

.login-screen { background: linear-gradient(160deg, #1C1917, #292524 60%, #431407); }
.button.primary { background: var(--teal); box-shadow: 0 6px 14px rgba(194, 65, 12, .22); }
.button.primary:hover { background: var(--teal-2); }
.sidebar { background: #1C1917; }
/* Kartu ringkasan: satu-satunya blok gelap di dashboard, jadi titik fokus utama */
.welcome { background: #1C1917; }
.welcome p:not(.eyebrow) { color: #E7E5E4; }
.bar-fill { background: var(--teal); }
.kpi, .panel { box-shadow: none; }
.field input:focus, .field select:focus, .field textarea:focus, .filters select:focus, .search-box input:focus,
.ai-chat-form textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(194, 65, 12, .14); outline: none; }
.eyebrow { text-transform: none; letter-spacing: 0; }

/* HP: teks minimal 12px dan area sentuh minimal 44px, supaya nyaman dibaca sambil jalan */
@media (max-width: 820px) {
  .topbar h1 { font-size: 18px; }
  .top-actions .button { min-height: 44px; padding: 10px 14px; font-size: 13px; }
  .welcome p:not(.eyebrow) { font-size: 13px; }
  .mobile-card { padding: 14px; }
  .mobile-card h3 { font-size: 15px; line-height: 1.35; }
  .mobile-card-grid small { font-size: 11px; text-transform: none; }
  .mobile-card-grid strong { font-size: 13px; }
  .mobile-card-actions .action-button { min-height: 44px; font-size: 13px; }
  .bottom-nav { min-height: 64px; }
  .bottom-nav button { min-height: 52px; font-size: 18px; }
  .bottom-nav button span { font-size: 11px; }
  .bottom-nav button.active { color: var(--teal); background: var(--cyan); }
  .floating-add { width: 56px; height: 56px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .content { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
}

@media (max-width: 560px) {
  .kpi-value { font-size: 18px; }
  .kpi-label { font-size: 12px; }
  .kpi-note { display: block; font-size: 11px; }
  .section-heading p { font-size: 13px; max-width: none; }
  .heading-actions .button { min-height: 44px; font-size: 13px; }
}

/* Skala teks: versi awal memakai 8-10px di banyak tempat, terlalu kecil untuk dibaca.
   Teks bantu minimal 12px, isi data minimal 13px. */
.eyebrow, .field small, .help-text, .login-footnote, .sync-status,
.backup-panel p, .ai-security-note p, .ai-key-form > .muted, .panel-heading p,
.today-card small, .account small, .brand-lockup span { font-size: 12px; }
.topbar .eyebrow { font-size: 12px; }
.kpi-label { font-size: 12px; }
.kpi-note { font-size: 12px; }
.priority-meta, .priority-value small, .company-foot { font-size: 12px; }
.company-top { font-size: 13px; }
.filters select, .search-box input { min-height: 44px; font-size: 13px; }
.result-count { font-size: 12px; }
.data-table th { font-size: 11px; }
.data-table td, .main-cell strong { font-size: 13px; }
.main-cell small { font-size: 12px; }
.company-chip, .status-chip { font-size: 11px; }
.action-button { min-height: 36px; min-width: 36px; font-size: 12px; }
.account strong { font-size: 13px; }
.tab { font-size: 13px; }
.history-item strong { font-size: 13px; }
.history-item p, .history-item time { font-size: 12px; }
.nav-link { color: #E7E5E4; }
.brand-lockup span, .account small { color: #D6D3D1; }
@media (max-width: 560px) {
  .kpi-value { font-size: 17px; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
}
/* Sisa aksen biru-tosca lama di area gelap diganti ke palet Pawon */
.eyebrow.light { color: #FDBA74; }
.nav-link.active { box-shadow: inset 3px 0 #F97316; }
.today-card small { color: #D6D3D1; }

/* Tahap 2: ikon menu SVG menggantikan karakter teks */
.nav-link .nav-icon { flex-shrink: 0; opacity: .9; }
.bottom-nav .nav-icon { width: 22px; height: 22px; }

.ai-note { margin: 0 0 12px; font-size: 13px; }
.followup-button { width: 100%; margin-top: 10px; min-height: 40px; font-size: 13px; }
.quality-panel { margin-bottom: 17px; }
.quality-list { display: grid; gap: 8px; padding: 0 16px 16px; }
.quality-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.quality-item strong { font-size: 13px; }
.quality-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.quality-item .button { flex-shrink: 0; min-height: 40px; font-size: 13px; }
@media (max-width: 560px) {
  .quality-item { flex-direction: column; align-items: stretch; }
  .quality-item .button { min-height: 44px; }
}
/* Penanda offline tetap terlihat di HP (status online biasa disembunyikan di layar kecil) */
.sync-status.offline { display: inline-flex !important; padding: 6px 10px; border-radius: 99px; color: var(--amber); background: var(--amber-bg); font-weight: 700; }
.sync-status.offline { white-space: nowrap; }

/* Tombol Cetak + Download PDF: desktop sejajar di kanan judul, HP turun ke bawah judul selebar layar */
.heading-actions { flex-wrap: wrap; justify-content: flex-end; }
.heading-actions .button svg { flex-shrink: 0; }
@media (max-width: 820px) {
  .section-heading { flex-direction: column; align-items: stretch; gap: 12px; }
  .heading-actions { flex-direction: row; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .heading-actions .button { width: 100%; min-height: 44px; font-size: 13px; }
  /* tombol + Tambah sudah ada sebagai tombol mengambang di HP */
  .heading-actions .heading-add { display: none; }
}
