/* IN Accounting — additions on top of the Fawtara theme (app.css is kept identical). */

/* brand + company switcher */
.brand-name { text-decoration: none; color: inherit; display: block; }
.company-switch { border: 0; background: transparent; padding: 0; cursor: pointer; font: inherit; font-size: 11px; color: var(--muted); max-width: 200px; text-align: start; }
.company-switch:hover { color: var(--ink); }

/* sub-navigation under the title */
.subnav { margin: -4px 0 16px; }
.subnav:empty { display: none; }
.tabs a {
  position: relative; z-index: 1; padding: 7px 14px; border-radius: 999px; font-size: 12.5px; color: var(--muted); white-space: nowrap; text-decoration: none;
  display: inline-flex; gap: 6px; align-items: center;
}
.tabs a.active { color: var(--ink); font-weight: 600; }
.tabs a:hover { color: var(--ink); }
/* filter tabs rebuilt on every load have no sliding pill: give the active one the pill look */
.toolbar .tabs button.active { background: var(--surface); box-shadow: var(--shadow); }

/* money colours */
.pos { color: var(--green); }
.neg { color: var(--red); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; margin: 0; }
.tbl .sub svg, .tag svg { width: 12px; height: 12px; vertical-align: -2px; }
.check svg, .pay-row svg, .empty svg { flex: none; }
.check svg { width: 15px; height: 15px; }
.strong { font-weight: 600; }

/* dashboard */
.setup-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.setup-step { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: var(--surface-2); text-decoration: none; font-size: 13px; }
[dir="rtl"] .setup-step { padding: 8px 10px 8px 14px; }
.setup-step .dotc { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.setup-step .dotc svg { width: 12px; height: 12px; }
.setup-step.done { color: var(--muted); text-decoration: line-through; }
.setup-step.done .dotc { background: var(--green); border-color: var(--green); color: #fff; }
.bank-list { display: grid; gap: 4px; margin-top: 10px; }
.bank-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 12px; text-decoration: none; font-size: 13px; }
.bank-row:hover { background: var(--surface-2); }
.bank-row .ico { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.bank-row .ico svg { width: 14px; height: 14px; }
.grow { flex: 1; min-width: 0; }
a.kpi { color: inherit; transition: transform .2s var(--ease); }
a.kpi:hover { transform: translateY(-2px); }
.hello a.warn { color: var(--orange); text-decoration: none; font-weight: 600; }

/* banking */
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.muted-card { opacity: .6; }
.pay-list { display: grid; gap: 6px; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pay-row:last-child { border-bottom: 0; }
.toolbar .input.sm { width: auto; }

/* reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.report-card { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; transition: transform .2s var(--ease); }
.report-card:hover { transform: translateY(-2px); }
.report-card .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.report-card .ico svg { width: 18px; height: 18px; }
.report-card .muted { font-size: 12px; margin-top: 4px; }
.rep-head { text-align: center; margin-bottom: 18px; display: grid; gap: 2px; }
.rep-head b { font-size: 16px; }
.tbl.rep tr.sec td { font-weight: 700; background: var(--surface-2); }
.tbl.rep tr.subtotal td { font-weight: 600; border-top: 1px solid var(--ink-2); }
.tbl.rep tr.grandrow td, .tbl tfoot tr td { font-weight: 700; font-size: 14px; border-top: 2px solid var(--ink); }

/* forms */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 50; inset-inline: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; max-height: 280px; overflow: auto; }
.combo-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: transparent; text-align: start; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.combo-list button:hover { background: var(--surface-2); }
.combo-list .combo-new { color: var(--blue); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; justify-content: flex-start; align-items: center; }
.combo-list .combo-new svg { width: 14px; height: 14px; }
.chips-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 12px; }
.chip.on { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }
.tag-x { border: 0; background: transparent; cursor: pointer; padding: 0 0 0 2px; font-size: 13px; line-height: 1; color: inherit; opacity: .7; }
.tag-x:hover { opacity: 1; }
.lines .tax-row { flex-wrap: wrap; }
.rec-wrap { margin-top: 16px; display: grid; gap: 10px; }
.rec-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.totals .row.hint { font-size: 12px; }
.totals-card .totals .grand { font-size: 22px; }
.logo-preview { width: 100%; height: 120px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.logo-preview img { max-width: 90%; max-height: 100px; object-fit: contain; }
.logo-preview svg { width: 36px; height: 36px; opacity: .4; }
.menu button.danger { color: var(--red); }
.modal.palette { width: min(560px, 100%); }

/* phase 6: notifications, offline, two-step sign-in */
.ntf-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.ntf-dot.red { background: var(--red); }
.ntf-dot.amber { background: var(--amber); }
.ntf-dot.blue { background: var(--blue); }
.menu .grow { flex: 1; text-align: start; }
.offline-bar { margin-bottom: 14px; }
.otp-input { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; direction: ltr; }
.tfa-key { font-size: 15px; letter-spacing: .08em; direction: ltr; }
/* Fawtara connector */
.copy-row { display: flex; align-items: center; gap: 8px; direction: ltr; }
.copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2, transparent); font-size: 13px; }
.eta-errors { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--red) 10%, transparent); font-size: 12.5px; }
.eta-errors ul { margin: 6px 0 0; padding-inline-start: 18px; }
.eta-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.eta-counts > div { display: grid; gap: 6px; justify-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.eta-counts b { font-size: 20px; }
@media (display-mode: standalone) { .topbar { padding-top: max(14px, env(safe-area-inset-top)); } }

/* phase 5: cost centers, budgets, payroll, portal */
.cc-bars { display: grid; gap: 3px; }
.cc-bars i { display: block; height: 6px; border-radius: 4px; min-width: 2px; }
.cc-bars .in { background: var(--green); }
.cc-bars .out { background: var(--orange); }
.bud-meter { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; justify-content: flex-end; }
.bud-meter i { display: block; height: 6px; border-radius: 4px; width: 0; max-width: 70px; background: var(--green); }
.bud-meter i.bad { background: var(--red); }
.bud-grid .bud-cell { width: 82px; padding: 5px 6px; }
.bud-grid td.bud-acc { white-space: nowrap; min-width: 180px; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.payroll-tbl td, .payroll-tbl th { white-space: nowrap; }
.pay-preview { position: sticky; top: 0; background: var(--surface-2); border-radius: 14px; padding: 14px; align-self: start; }
.slips { display: grid; gap: 14px; }
.slip .totals .section-title { margin-bottom: 4px; }
.portal-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 6px solid var(--doc, var(--ink)); }
.portal-head > div:nth-child(2), .portal-head > div:first-child:not(img) { flex: 1; min-width: 200px; }
.portal-balance { text-align: end; }
.cc-pick { max-width: 220px; }
@media print { .slip { break-after: page; } .slip:last-child { break-after: auto; } }

/* import, online payment */
.imp-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.imp-table { max-height: 340px; overflow: auto; }
.imp-table .tbl th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.steps-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.pay-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pay-box > div { flex: 1; min-width: 160px; }
.pay-amount { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.pay-box small { width: 100%; }

/* attachments */
.att-list { display: grid; gap: 2px; }
.att-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 1; text-decoration: none; font-size: 13px; }
.att-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-name svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.att-drop { padding: 16px; gap: 4px; font-size: 13px; }
.att-drop small { font-size: 11px; }
.att-drop.busy { opacity: .6; pointer-events: none; }

/* subscription plans */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.plan-card { display: flex; flex-direction: column; gap: 12px; }
.plan-card.current { outline: 2px solid var(--ink); }
.plan-card .card-title { justify-content: space-between; font-size: 15px; }
.plan-price b { font-size: 30px; letter-spacing: -.02em; }
.plan-card .tag { align-self: flex-start; }
.plan-feats { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); flex: 1; }
.plan-card .btn { width: 100%; }
.copy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; background: var(--surface-2); border-radius: 10px; padding: 6px 10px; }
.copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mail-log { border-top: 1px solid var(--line); }

/* document paper */
.doc-paper { border-top: 6px solid var(--doc, var(--ink)); }
.doc-from h2 { font-size: 20px; }
.doc-from .muted { font-size: 12.5px; }
.doc-logo { max-height: 64px; max-width: 200px; object-fit: contain; display: block; margin-bottom: 10px; }
.doc-meta { min-width: 220px; }
.doc-kind { font-size: 24px; font-weight: 700; color: var(--doc, var(--ink)); margin-bottom: 10px; letter-spacing: -.01em; }
[data-theme="dark"] .doc-kind { color: var(--ink); }
.party .muted { display: block; font-size: 11px; margin-bottom: 4px; }
.doc-bottom { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 24px; margin-top: 18px; }
.doc-footer { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; white-space: pre-wrap; }
.public-main { max-width: 960px; padding: 24px 16px 48px !important; }
.public-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 14px; }

@media (max-width: 860px) {
  .hide-sm { display: none; }
  .doc-bottom { grid-template-columns: 1fr; }
  .company-switch { max-width: 140px; }
}

@media print {
  .subnav, .credit, .public-tools { display: none !important; }
  .doc-paper { border-top: 0; }
  .g-editor { grid-template-columns: 1fr !important; }
  .report .tbl tr { break-inside: avoid; }
  body { font-size: 12px; }
}
