@font-face {
  font-family: "HelveticaNeue";
  src: url("/static/fonts/HelveticaNeueThin.otf") format("opentype");
  font-weight: 100 400;
  font-style: normal;
}
@font-face {
  font-family: "HelveticaNeue";
  src: url("/static/fonts/HelveticaNeueMedium.otf") format("opentype");
  font-weight: 500 600;
  font-style: normal;
}
@font-face {
  font-family: "HelveticaNeue";
  src: url("/static/fonts/HelveticaNeueBold.otf") format("opentype");
  font-weight: 700 900;
  font-style: normal;
}

:root {
  --qb-green: #2ca01c;
  --qb-green-dark: #108000;
  --nav-bg: #1e2e48;
  --nav-bg2: #15223a;
  --ink: #333333;
  --muted: #6b7a85;
  --line: #d4d9dd;
  --bg: #ececec;
  --panel: #ffffff;
  --accent: #1f6fb2;
  --lane-head: #dbe7f1;
  --lane-head-pill: #c3d6e8;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "HelveticaNeue", "Segoe UI", Tahoma, Arial, sans-serif;
  font-weight: 300;
  color: var(--ink);
  background: var(--bg);
  font-size: 13px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top application bar — brand · search · account actions (Oracle-style single bar) */
.appbar {
  display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 14px;
  background: linear-gradient(180deg, #24364f, #1b2a40);
  border-bottom: 1px solid #0f1a2b; color: #e8edf4;
}
.appbar-brand { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; white-space: nowrap; }
.appbar-brand:hover { text-decoration: none; }
.appbar-brand .brand-mark { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.appbar-brand .brand-co { font-size: 12px; color: #aebbcd; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* Search moved into the top bar (was its own iconbar row). */
.appbar-search { flex: 1; display: flex; justify-content: center; min-width: 0; }
.appbar-search .search-box { position: relative; width: 100%; max-width: 560px; display: flex; align-items: center; }
.appbar-search .search-ico { position: absolute; left: 11px; display: flex; color: #8a97ab; pointer-events: none; }
.appbar-search input { width: 100%; box-sizing: border-box; border: 1px solid #38475f; background: #fbfcfe;
  border-radius: 16px; padding: 6px 14px 6px 32px; font-size: 13px; color: #1f2d3d; }
.appbar-search input:focus { outline: none; border-color: #5b82b8; box-shadow: 0 0 0 2px rgba(91,130,184,.35); }

/* Account navigation, now icon buttons on the right of the bar. */
.appbar-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.appbar-ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 6px; color: #cdd7e6; background: transparent; border: none; cursor: pointer; padding: 0; }
.appbar-ico:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.appbar-logout { display: inline-flex; margin: 0; }

/* Live suggestions dropdown */
.search-suggest { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: #fff; border: 1px solid #b7c0c7; border-top: none;
  border-radius: 0 0 3px 3px; box-shadow: 0 4px 10px rgba(0,0,0,.14); max-height: 320px; overflow-y: auto; }
.search-box.open .search-suggest { display: block; }
.search-suggest-list { list-style: none; margin: 0; padding: 0; }
.search-suggest-list a { display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; padding: 5px 10px; text-decoration: none; color: #1f2d3d; }
.search-suggest-list a:hover, .search-suggest-list a.active { background: #e8f0fe; }
.search-suggest-list .ss-label { font-weight: 500; }
.search-suggest-list .ss-section { color: #8a96a3; font-size: 11px; white-space: nowrap; }
.search-suggest-list .ss-empty { padding: 6px 10px; color: #8a96a3; font-size: 12px; }

/* Full results page */
.search-results { list-style: none; margin: 8px 0 0; padding: 0; }
.search-results li { padding: 6px 0; border-bottom: 1px solid #eee; display: flex; gap: 10px; align-items: baseline; }
.search-results li a { font-weight: 500; }

/* Layout */
.layout { display: flex; min-height: calc(100vh - 48px); }

/* Sidebar — grouped navigation */
.sidebar { width: 196px; background: var(--nav-bg); color: #d7d7d7; flex-shrink: 0; display: flex; flex-direction: column; max-height: calc(100vh - 62px); overflow-y: auto; }
.sidebar-section:not(:first-of-type) { margin-top: 2px; }
.sample-note { background: #f3f3f3; color: #333; text-align: center; font-size: 12px; padding: 10px 8px; font-weight: 600; }
.sidebar-section { background: var(--nav-bg2); color: #9fd38f; font-size: 11px; font-weight: 700; padding: 8px 12px; letter-spacing: .3px; }
.short { display: flex; align-items: center; gap: 9px; color: #d7d7d7; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.short:hover { background: #2a3d5c; color: #fff; text-decoration: none; }
.short.active { background: var(--qb-green); color: #fff; }
.short.disabled { color: #8a8a8a; cursor: default; }
.short .ico { width: 18px; display: inline-flex; align-items: center; justify-content: center; }
.short .ico img { width: 16px; height: 16px; display: block; }
.short.disabled .ico img { filter: grayscale(100%); opacity: .6; }
.sidebar-tabs { margin-top: auto; }
.sidebar-tabs .tab { background: #2a3d5c; border-top: 1px solid #3a4e6e; padding: 7px 12px; font-size: 12px; color: #cfcfcf; }
.sidebar-tabs .tab.active { background: #0f1826; font-weight: 600; }

/* Content window */
.content { flex: 1; display: flex; flex-direction: column; }
.window-head { background: linear-gradient(180deg, #5a5a5a, #474747); color: #fff; text-align: center; padding: 5px; font-size: 13px; }
.window-body { flex: 1; padding: 14px 18px; overflow: auto; }

/* Home tabs */
.home-tabs { margin-bottom: 10px; }
.home-tab { display: inline-block; padding: 5px 16px; border: 1px solid var(--line); border-bottom: none; background: #eef2f4; border-radius: 5px 5px 0 0; font-size: 12px; }
.home-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Home layout */
.home-grid { display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: start; }
.home-center { display: flex; flex-direction: column; gap: 14px; }

/* Swimlanes */
.swimlane { background: var(--panel); border: 1px solid #b9c7d2; border-radius: 4px; }
.lane-title { text-align: center; background: var(--lane-head); color: #2f5a80; font-weight: 700; font-size: 11px; letter-spacing: 1px; padding: 4px; }
.lane-title { position: relative; }
.lane-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.wf-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.wf-row.indent { padding-left: 30px; }

/* Workflow node */
.wf-node {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  width: 92px; padding: 4px; text-align: center; color: var(--ink); position: relative;
}
.wf-node:hover { text-decoration: none; }
.wf-node:hover .wf-ico { outline: 2px solid var(--qb-green); background: #eafbe6; }
.wf-ico {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: #f4f7f9; border: 1px solid #cdd7df; border-radius: 6px;
}
.wf-ico img { width: 26px; height: 26px; display: block; }
.wf-node.disabled .wf-ico img { filter: grayscale(100%); }
.wf-label { font-size: 11px; margin-top: 5px; line-height: 1.2; color: #2f3b44; }
.wf-node.disabled { opacity: .55; cursor: default; }
.wf-node.disabled .wf-label { color: #8a97a0; }
.wf-badge { position: absolute; top: 0; right: 18px; background: #d64545; color: #fff; border-radius: 10px; font-size: 10px; padding: 0 5px; }
.arrow { color: #9bb0bf; font-size: 18px; padding: 0 2px; }
.arrow.long { min-width: 120px; text-align: center; }

/* Right-side boxes */
.home-right { display: flex; flex-direction: column; gap: 14px; }
.panel-box { background: var(--panel); border: 1px solid #b9c7d2; border-radius: 4px; }
.box-title { text-align: center; background: var(--lane-head); color: #2f5a80; font-weight: 700; font-size: 11px; letter-spacing: 1px; padding: 4px; }
.box-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; }
.panel-box.stats { padding-bottom: 8px; }
.stat-line { display: flex; justify-content: space-between; padding: 6px 14px; border-top: 1px solid #eef2f4; font-size: 12.5px; }
.stat-line strong { font-variant-numeric: tabular-nums; }

/* ---- Shared content components (list/form/report pages) ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.page-head h1 { font-size: 20px; margin: 0; font-weight: 600; }

.btn { display: inline-block; background: var(--qb-green); color: #fff; padding: 7px 15px; border-radius: 4px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn:hover { background: var(--qb-green-dark); text-decoration: none; }
.btn.secondary { background: #e3eaee; color: var(--ink); }
.btn.secondary:hover { background: #d2dce2; }
.btn.danger { background: #b4402f; color: #fff; }
.btn.small { padding: 4px 10px; font-size: 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
.panel table { background: transparent; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { background: #eef3f6; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
tr:hover td { background: #f6fafb; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }

.form-grid { display: grid; grid-template-columns: 160px 1fr; gap: 12px 16px; align-items: center; max-width: 640px; }
.form-grid label { color: var(--muted); font-weight: 600; }
input, select, textarea { width: 100%; padding: 7px 9px; border: 1px solid #c3cfd6; border-radius: 4px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfe0f3; border-color: var(--accent); }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }
.lines input, .lines select { padding: 5px 7px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 11px; font-weight: 700; }
.badge.OPEN { background: #e6f0fb; color: #0a6ebd; }
.badge.PARTIAL { background: #fff2d9; color: #a8710a; }
.badge.PAID { background: #e2f3e8; color: #1f7a45; }
.badge.VOID { background: #eceff1; color: #90a0a8; text-decoration: line-through; }
.badge.ACCEPTED { background: #e6f0fb; color: #0a6ebd; }
.badge.INVOICED { background: #e2f3e8; color: #1f7a45; }
.badge.CLOSED { background: #eceff1; color: #6b7a85; }

.muted { color: var(--muted); }
.totals { margin-left: auto; width: 280px; }
.totals td { border: none; padding: 4px 10px; }
.totals .grand td { border-top: 2px solid var(--ink); font-weight: 700; font-size: 16px; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.flash-ok { background: #e2f3e8; border: 1px solid #b6ddc3; color: #1f7a45; padding: 10px 14px; border-radius: 5px; margin-bottom: 14px; }
.flash-bad { background: #fde8e4; border: 1px solid #f0c0b6; color: #a8381f; padding: 10px 14px; border-radius: 5px; margin-bottom: 14px; }

/* My Profile — details + password side by side, stacking on narrow screens. */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- Tracker pages (Income / Bill) ---- */
.tracker-tiles { display: flex; gap: 2px; margin-bottom: 14px; }
.tile { flex: 1; color: #fff; padding: 14px 18px; min-height: 64px; }
.tile-amt { font-size: 24px; font-weight: 700; line-height: 1.1; }
.tile-lbl { font-size: 11px; letter-spacing: .5px; margin-top: 4px; opacity: .95; }
.tile.slate { background: #5b738a; }
.tile.amber { background: #e5a93b; }
.tile.red { background: #d6553f; }
.tile.green { background: #8bc34a; }

.filter-bar { display: flex; align-items: center; gap: 8px; background: #eef3f6; border: 1px solid var(--line); border-radius: 5px; padding: 8px 12px; margin-bottom: 12px; }
.filter-bar label { font-size: 12px; color: var(--muted); font-weight: 600; }
.filter-bar select { width: auto; min-width: 150px; }

.st-overdue { color: #c0392b; font-weight: 700; }
.st-open { color: #2f6f3e; }
.st-paid { color: #1f7a45; font-weight: 700; }

/* ---- Calendar ---- */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cal-head h2 { margin: 0; font-size: 18px; }
.cal-nav { text-decoration: none; background: #e3eaee; border-radius: 4px; padding: 3px 10px; color: var(--ink); font-weight: 700; }
.calendar { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--panel); border: 1px solid var(--line); }
.calendar th { background: #eef3f6; text-align: center; padding: 6px; font-size: 11px; }
.calendar td { height: 92px; vertical-align: top; border: 1px solid var(--line); padding: 4px 6px; }
.calendar td.other { background: #f6f8f9; }
.calendar td.today { background: #eafbe6; outline: 2px solid var(--qb-green); }
.cal-daynum { font-weight: 700; color: #556; font-size: 12px; }
.cal-event { display: block; font-size: 11px; margin-top: 3px; padding: 1px 4px; border-radius: 3px; }
.cal-event.inv { background: #e6f0fb; color: #0a6ebd; }
.cal-event.pay { background: #e2f3e8; color: #1f7a45; }
.cal-side { float: right; width: 240px; margin-left: 14px; }
.cal-side .panel h3 { margin: 0 0 8px; font-size: 13px; }

/* ---- Customer Center (master-detail) ---- */
.center-toolbar { display: flex; gap: 6px; background: linear-gradient(180deg,#fff,#eef1f3); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; margin-bottom: 10px; }
.tb-btn { font-size: 12px; color: var(--ink); background: #f3f6f8; border: 1px solid #cdd7df; border-radius: 4px; padding: 4px 10px; }
.tb-btn:hover { background: #e3eaee; text-decoration: none; }

.center-grid { display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: start; }
.center-list { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.center-tabs { display: flex; background: #e9eef1; border-bottom: 1px solid var(--line); }
.ctab { padding: 7px 14px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); }
.ctab.active { background: var(--panel); color: var(--ink); font-weight: 600; }
.center-search { display: flex; align-items: center; gap: 4px; padding: 7px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.center-search input { flex: 1; min-width: 0; border: 1px solid #b7c0c7; border-radius: 3px; padding: 4px 8px; font-size: 12.5px; }
.center-search .search-btn { border: 1px solid #b7c0c7; background: #eef1f3; border-radius: 3px; cursor: pointer; padding: 3px 9px; }
.center-search-clear { color: var(--muted); padding: 0 4px; text-decoration: none; }
.center-filter { padding: 7px 10px; font-size: 12px; font-weight: 600; color: #2f5a80; background: #f3f7f9; border-bottom: 1px solid var(--line); }
table.mini th, table.mini td { padding: 6px 10px; font-size: 12.5px; }
table.mini tr.sel td { background: var(--qb-green); }
table.mini tr.sel td a { color: #fff; }

.center-detail { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 16px 20px; }
.detail-head h1 { font-size: 24px; font-weight: 600; margin: 0 0 14px; color: #3a3a3a; }
.detail-info { display: grid; grid-template-columns: 1.4fr 1fr 180px; gap: 10px 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.info-row { display: flex; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.info-row .il { color: var(--muted); min-width: 92px; text-align: right; }
.info-reports { border-left: 1px solid var(--line); padding-left: 16px; }
.info-reports .ir-title { font-size: 10px; color: var(--muted); letter-spacing: .5px; margin-bottom: 6px; }
.info-reports a { display: block; font-size: 12.5px; padding: 2px 0; }
.detail-txns { margin-top: 14px; }
.detail-txns .center-tabs { border: 1px solid var(--line); border-bottom: none; }

/* ---- Report Center ---- */
.report-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--qb-green); margin-bottom: 12px; }
.rtab { padding: 7px 18px; font-size: 13px; background: #e9eef1; border: 1px solid var(--line); border-bottom: none; border-radius: 5px 5px 0 0; color: var(--muted); }
.rtab.active { background: var(--qb-green); color: #fff; border-color: var(--qb-green); font-weight: 600; }

.report-grid { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: start; }
.report-cats { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.rcat { display: block; padding: 9px 14px; font-size: 13px; color: var(--ink); border-bottom: 1px solid #eef2f4; }
.rcat:hover { background: #f3f7f9; text-decoration: none; }
.rcat.active { background: var(--qb-green); color: #fff; font-weight: 600; }

.rc-heading { font-size: 18px; font-weight: 600; margin: 0 0 14px; color: #3a3a3a; }
.rc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.rc-card { }
.rc-thumb { position: relative; height: 150px; background: #fff; border: 1px solid #b9c7d2; border-radius: 3px; padding: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.rc-thumb-title { font-size: 10px; font-weight: 700; color: #333; border-bottom: 1px solid #ccc; padding-bottom: 4px; margin-bottom: 8px; }
.rc-thumb-lines span { display: block; height: 5px; margin: 5px 10px; background: linear-gradient(90deg, #dfe6ea 60%, transparent 60%); background-size: 22px 100%; }
.rc-sample { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; color: rgba(140,150,160,.35); transform: rotate(-18deg); letter-spacing: 2px; }
.rc-title { font-weight: 600; margin-top: 8px; font-size: 13px; }
.rc-dates { font-size: 11px; color: var(--muted); margin: 3px 0 6px; }
.rc-card.soon .rc-title { color: var(--muted); }
.btn.small.secondary { background: #e3eaee; color: #8a97a0; cursor: default; }

/* ---- Item List toolbar ---- */
.itemlist-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: linear-gradient(180deg,#fff,#eef1f3); border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; margin-bottom: 10px; }
.look-for { display: flex; align-items: center; gap: 8px; }
.look-for label { font-size: 12px; color: var(--muted); font-weight: 600; }
.look-for input[type=search] { width: 220px; }
.look-for select { width: auto; }

/* ---- Settings tabs ---- */
.settings-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--qb-green); margin-bottom: 16px; }
.stab { padding: 9px 20px; font-size: 13px; background: #e9eef1; border: 1px solid var(--line); border-bottom: none; border-radius: 6px 6px 0 0; color: var(--muted); }
.stab:hover { background: #dde6eb; text-decoration: none; }
.stab.active { background: var(--qb-green); color: #fff; border-color: var(--qb-green); font-weight: 600; }
.settings-body { max-width: 760px; }

/* ---- Transaction forms (Invoice / Bill / Payment) QB chrome ---- */
.txn-chrome { border: 1px solid var(--line); border-radius: 6px 6px 0 0; }
.txn-tabs { display: flex; gap: 2px; background: linear-gradient(180deg,#eef2f5,#dde4ea); border-bottom: 1px solid var(--line); padding: 4px 6px 0; border-radius: 6px 6px 0 0; }
.txn-tab { font-size: 12px; color: #555; padding: 4px 14px; border: 1px solid transparent; border-bottom: none; border-radius: 4px 4px 0 0; cursor: default; }
.txn-tab.active { background: var(--panel); color: #1a1a1a; font-weight: 600; border-color: var(--line); margin-bottom: -1px; }
.txn-tab:not(.active):hover { background: #e7edf2; }

.txn-ribbon { display: flex; flex-wrap: wrap; align-items: stretch; gap: 2px; background: linear-gradient(180deg,#fbfbfb,#e9edf0); padding: 6px 8px; }
.txn-ribbon .rb { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; font-size: 11px; line-height: 1.1; text-align: center; color: #333; padding: 4px 8px; border-radius: 4px; min-width: 52px; border: none; background: transparent; cursor: pointer; }
.txn-ribbon .rb:hover { background: #d9e6f2; text-decoration: none; }
.txn-ribbon .rb .rb-ic { font-size: 17px; }
.txn-ribbon .rb.primary { color: var(--qb-green-dark); font-weight: 700; }
.txn-ribbon .rb.disabled { color: #a7acb1; cursor: default; }
.txn-ribbon .rb.disabled:hover { background: transparent; }
.txn-ribbon .rb-div { width: 1px; align-self: stretch; margin: 2px 4px; background: linear-gradient(180deg,transparent,#c3c9cf 20%,#c3c9cf 80%,transparent); }
.txn-ribbon .rb-checks { display: flex; flex-direction: column; justify-content: center; gap: 2px; font-size: 11px; color: #555; padding: 0 4px; }
.txn-ribbon .rb-checks label { display: flex; align-items: center; gap: 4px; }

.txn-topbar { display: flex; gap: 20px; align-items: center; background: #4e6a86; color: #fff; padding: 8px 14px; font-size: 12px; }
.txn-topbar label { color: #cfe0f0; margin-right: 6px; }
.txn-topbar select, .txn-topbar input { width: auto; min-width: 180px; }

.txn-doc { background: var(--panel); border: 1px solid var(--line); border-top: none; padding: 20px 24px; }
.txn-doc.tint-cust { background: linear-gradient(135deg,#fbfdff,#eef5fd); }
.txn-doc.tint-vend { background: linear-gradient(135deg,#fafdfb,#eef7f0); }
.txn-title { font-size: 34px; font-weight: 700; color: #3a3a3a; margin: 0 0 14px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; }
.doc-fields { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 12px; }
.doc-fields label { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: .4px; }
.doc-fields input, .doc-fields select { width: 160px; }
.doc-party { min-width: 260px; }
.doc-party .pbox { border: 1px solid #c7d2da; background: #fff; border-radius: 4px; min-height: 70px; padding: 8px; font-size: 12px; }

.txn-lines { margin-top: 16px; }
.txn-lines table { border: 1px solid #c7d2da; }
.txn-lines th { background: #eef3f6; }
.txn-lines input, .txn-lines select { padding: 4px 6px; }

.txn-totals { display: flex; justify-content: flex-end; margin-top: 12px; }
.txn-totals table td { border: none; padding: 3px 10px; }
.txn-totals .grand td { border-top: 2px solid var(--ink); font-weight: 700; font-size: 17px; }

.paid-stamp { display: inline-block; color: #2ca01c; font-weight: 800; border: 2px solid #2ca01c; border-radius: 6px; padding: 2px 10px; transform: rotate(-6deg); }

/* Customer Payment method tiles */
.pay-methods { display: flex; gap: 6px; margin: 10px 0; }
.pay-method { border: 1px solid #c7d2da; border-radius: 5px; background: #fff; padding: 8px 12px; font-size: 11px; text-align: center; min-width: 64px; }
.pay-method.sel { border-color: var(--qb-green); background: #eafbe6; font-weight: 700; }

/* Searchable combobox (Received From / Pay to the order of) */
.combo { position: relative; display: inline-block; width: 220px; }
.combo-input { width: 100%; }
.combo-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 2px); max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 22px rgba(0,0,0,.14); }
.combo-opt { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; font-size: 12.5px; cursor: pointer; }
.combo-opt:hover { background: #d9e6f2; }
.combo-opt .muted { color: var(--muted); font-size: 11px; }

/* Payment "Amounts for selected invoices" summary + customer balance */
.pay-summary { margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f6f9fc; padding: 10px 14px; max-width: 320px; margin-left: auto; font-size: 12.5px; }
.pay-summary .row { display: flex; justify-content: space-between; gap: 18px; padding: 2px 0; }
.pay-summary .row.grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; font-weight: 700; }
.doc-balance { text-align: right; font-size: 12px; color: var(--muted); }
.doc-balance strong { display: block; font-size: 20px; color: var(--ink, #1a2733); }
.applied-hist { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.applied-hist .tag { white-space: nowrap; }

/* Check form (Bill Payment) */
.check-doc { background: linear-gradient(135deg,#eef7ef,#e2f0e4); border: 1px solid #b8d2bc; border-radius: 6px; padding: 18px 22px; }
.check-row { display: flex; justify-content: space-between; align-items: flex-start; }
.check-amt-words { border-bottom: 1px solid #9ab; padding: 8px 0; margin: 10px 0; font-size: 13px; }

/* ---- Company Snapshot ---- */
.snap-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--qb-green); margin-bottom: 14px; }
.snap-tab { padding: 8px 20px; font-size: 13px; background: #e9eef1; border: 1px solid var(--line); border-bottom: none; border-radius: 6px 6px 0 0; color: var(--muted); }
.snap-tab:hover { background: #dde6eb; text-decoration: none; }
.snap-tab.active { background: var(--qb-green); color: #fff; border-color: var(--qb-green); font-weight: 600; }

.snap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.snap-panel { background: var(--panel); border: 1px solid #b9c7d2; border-radius: 4px; overflow: hidden; }
.snap-panel.wide { grid-column: 1 / -1; }
.snap-head { background: var(--lane-head); color: #2f5a80; font-weight: 700; font-size: 12px; padding: 6px 12px; display: flex; justify-content: space-between; align-items: baseline; }
.snap-note { font-weight: 400; font-size: 10.5px; color: #6f879b; }
.snap-body { padding: 12px 14px; }
.snap-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 12.5px; }

.data-table.compact table { font-size: 12.5px; }
.data-table.compact th, .data-table.compact td { padding: 5px 9px; }

/* Column (bar) chart */
.col-chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 6px; }
.col-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.col-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; width: 100%; }
.col-bars .bar { width: 44%; min-height: 2px; border-radius: 2px 2px 0 0; }
.col-chart.single .col-bars .bar { width: 60%; }
.col-label { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.bar.b-income, .sw.b-income { background: #8bc34a; }
.bar.b-expense, .sw.b-expense { background: #e58a3b; }
.bar.b-accent, .sw.b-accent { background: var(--accent); }

.legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }

/* Horizontal bars */
.hbar-list { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 76px; gap: 8px; align-items: center; }
.hbar-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: #eef3f6; border-radius: 3px; height: 14px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: linear-gradient(90deg,#3f8fd0,#1f6fb2); border-radius: 3px; min-width: 2px; }
.hbar-val { font-size: 12px; }

/* Pie */
.pie-body { display: flex; gap: 16px; align-items: center; }
.pie { width: 128px; height: 128px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.pie-legend { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pie-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 7px; align-items: center; font-size: 12px; }
.pie-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pie-row.total { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 4px; font-weight: 700; grid-template-columns: 1fr auto; }

/* Misc snapshot bits */
.quicklinks { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 4px 0; border-bottom: 1px solid #eef2f4; font-size: 12.5px; }
.reminder { display: flex; justify-content: space-between; padding: 6px 2px; border-bottom: 1px solid #eef2f4; font-size: 12.5px; }
.kv { display: flex; justify-content: space-between; padding: 6px 2px; border-bottom: 1px solid #eef2f4; font-size: 13px; }
.kv:last-child { border-bottom: none; }

/* Print — company letterhead/footer, shown only on paper */
.print-only { display: none; }
.print-header { padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid #333; }
.print-header .ph-name { font-size: 20px; font-weight: 700; }
.print-header .ph-line { font-size: 12px; color: #444; margin-top: 2px; }
.print-footer { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid #999; font-size: 11px; color: #555; }

@media print {
  /* Hide the application chrome and all action controls. */
  .appbar, .sidebar, .window-head,
  .txn-chrome, .txn-ribbon, .txn-tabs, .center-toolbar, .form-actions,
  .btn, button, .pay-methods { display: none !important; }

  body { background: #fff; color: #000; }
  .layout { display: block; min-height: 0; }
  .content { display: block; }
  .window-body { padding: 0; }
  .panel, .txn-doc, .data-table { box-shadow: none !important; border: none !important; }

  .print-only { display: block; }
  .print-footer { display: flex; }
  /* Repeat the footer at the bottom of every printed page. */
  .print-footer { position: fixed; bottom: 0; left: 0; right: 0; }

  @page { margin: 16mm; }
}

/* ---------- Auth pages (login / register / onboarding) ---------- */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--nav-bg) 0%, var(--nav-bg2) 100%);
  padding: 24px;
}
.auth-card {
  background: var(--panel);
  width: 100%;
  max-width: 380px;
  padding: 28px 30px 32px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.auth-brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--qb-green-dark);
  letter-spacing: 0.4px;
  margin-bottom: 18px;
}
.auth-title { font-size: 20px; font-weight: 500; margin: 0 0 18px; color: var(--ink); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 5px; }
.auth-form input {
  font: inherit;
  font-size: 14px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
}
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31, 111, 178, 0.15); }
.auth-form .btn-primary,
.btn-primary {
  background: var(--qb-green);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 5px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.auth-form .btn-primary:hover, .btn-primary:hover { background: var(--qb-green-dark); }
.auth-alt { margin: 18px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.auth-alt a { color: var(--accent); text-decoration: none; }
.auth-error {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #a4292c;
  padding: 9px 11px;
  border-radius: 5px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-form select {
  font: inherit; font-size: 14px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff;
}
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.company-list { display: flex; flex-direction: column; gap: 8px; }
.company-row { margin: 0; }
.company-pick {
  width: 100%; text-align: left; background: #f7f9fb; border: 1px solid var(--line);
  border-radius: 6px; padding: 12px 14px; cursor: pointer; font: inherit; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.company-pick:hover { border-color: var(--accent); background: #eef4fa; }
.company-name { font-weight: 500; }
.company-status { font-size: 11px; color: var(--muted); text-transform: capitalize; }

/* ---------- Admin: users & roles ---------- */
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.inline-form input[type=email], .inline-form input[type=text], .inline-form select {
  font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px;
}
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 12px; }
.perm-group { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.perm-group legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.perm-item { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.short-logout { margin: 0; }
.short-logout button.linklike { display: flex; align-items: center; gap: 8px; color: inherit; }

/* ---------- Billing & admin ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.plan-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.plan-name { font-weight: 600; font-size: 15px; }
.plan-price { font-size: 20px; margin: 6px 0 10px; }
.plan-feats { list-style: none; padding: 0; margin: 0 0 12px; font-size: 13px; color: var(--ink); }
.plan-feats li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.admin-tabs a {
  padding: 8px 14px; text-decoration: none; color: var(--muted); font-size: 13px;
  border-bottom: 2px solid transparent;
}
.admin-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.stat-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--panel); }
.stat-num { font-size: 28px; font-weight: 600; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---- Audit log ---- */
.audit-units { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.audit-units a {
  padding: 5px 12px; text-decoration: none; color: var(--muted); font-size: 13px;
  border: 1px solid var(--line); border-radius: 16px;
}
.audit-units a.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.audit-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.audit-filters select, .audit-filters input { min-height: 34px; font-size: 14px; }
.audit-count { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.audit-cat { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; text-transform: capitalize; }
.audit-cat-auth { background: #fde8e8; color: #9b1c1c; }
.audit-cat-navigation { background: #e8eefc; color: #1c3a9b; }
.audit-cat-admin { background: #fdf3e0; color: #8a5a00; }
.audit-cat-transaction { background: #e6f4ea; color: #1e6b32; }
.audit-pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; }

/* ---- Financials ---- */
.fin-h { margin: 22px 0 8px; font-size: 15px; }
.fin-status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; text-transform: capitalize; }
.fin-status-paid { background: #e6f4ea; color: #1e6b32; }
.fin-status-open { background: #fdf3e0; color: #8a5a00; }
.fin-status-void { background: #eceff1; color: #5a6b77; }

/* ---- Bank Reconciliation ---- */
.recon-begin .recon-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.recon-begin .recon-row > label { width: 140px; color: var(--muted); font-weight: 600; font-size: 13px; }
.recon-fixed { font-weight: 700; color: var(--ink); }
.recon-adjust { width: 100%; }
.recon-adjust th { background: none; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 12px; padding: 6px 8px 2px; border: none; }
.recon-adjust td { border: none; padding: 2px 8px 8px; }
.recon-adjust input, .recon-adjust select { width: 100%; }
.recon-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.recon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.recon-col-head { margin: 0; padding: 8px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: #eef3f6; border-bottom: 1px solid var(--line); }
.recon-grid td.chk, .recon-grid th.chk { width: 28px; text-align: center; }
.recon-summary { max-width: 420px; margin-left: auto; }
.recon-summary table { width: 100%; }
.recon-summary td { border: none; padding: 4px 6px; }
.recon-import { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.recon-import-file { display: inline-flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.recon-import-help { flex: 1 1 260px; font-size: 12px; line-height: 1.4; }
.recon-import-msg { margin: 0 0 12px; }
.recon-import-summary { margin-bottom: 14px; }
.recon-import-headline { margin: 0 0 6px; }
.recon-import-summary summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.recon-import-summary .data-table { margin-top: 8px; }

/* ================================================================
   Mobile / responsive — off-canvas nav + fluid layout below 900px.
   Desktop chrome above is untouched; everything here only kicks in
   at the two breakpoints (900px tablet, 600px phone).
   ================================================================ */

/* Hamburger button — hidden on desktop, shown once the sidebar goes off-canvas. */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 40px; margin-right: 8px; padding: 0 9px;
  background: transparent; border: none; border-radius: 4px; cursor: pointer; flex-shrink: 0;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 1px; }
.nav-toggle:hover { background: #e3eaee; }

/* Backdrop behind the drawer; only interactive/visible while open on mobile. */
.nav-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
  z-index: 90; opacity: 0; transition: opacity .2s ease;
}

html { overflow-x: hidden; }
body { overflow-x: hidden; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  /* Sidebar slides in from the left as an off-canvas drawer. */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    width: min(280px, 82vw); max-height: 100vh;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 2px 0 18px rgba(0, 0, 0, .3);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .nav-backdrop { pointer-events: none; }

  .layout { min-height: calc(100vh - 48px); }
  .short, .short-logout button { min-height: 44px; }

  /* Two-column dashboard/report/center grids collapse to one column. */
  .home-grid, .center-grid, .report-grid, .snap-grid, .recon-grid,
  .profile-grid, .detail-info { grid-template-columns: 1fr; }
  .info-reports { border-left: none; border-top: 1px solid var(--line); padding: 12px 0 0; margin-top: 10px; }
  .cal-side { float: none; width: auto; margin-left: 0; margin-top: 14px; }

  /* Content area scrolls horizontally for anything still too wide (calendar
     grid, wide reports) instead of forcing the whole page to scroll sideways. */
  .window-body { overflow-x: auto; }
  .calendar { min-width: 640px; }
}

@media (max-width: 600px) {
  .window-body { padding: 12px; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head h1 { font-size: 18px; }

  /* 16px inputs stop iOS Safari's auto-zoom-on-focus; keep touch targets tall enough. */
  input, select, textarea { font-size: 16px; min-height: 44px; }
  .lines input, .lines select, .txn-lines input, .txn-lines select,
  .recon-adjust input, .recon-adjust select { min-height: 36px; font-size: 14px; }
  .btn, .tb-btn, .cal-nav { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

  .form-grid { grid-template-columns: 1fr; max-width: none; }
  .form-grid label { padding-top: 4px; }
  .form-actions { flex-wrap: wrap; }

  .doc-head { flex-direction: column; }
  .doc-fields { grid-template-columns: auto 1fr; }
  .doc-fields input, .doc-fields select { width: 100%; }
  .doc-party { min-width: 0; width: 100%; }
  .txn-title { font-size: 26px; }
  .txn-doc { padding: 14px 16px; }
  .txn-topbar { flex-wrap: wrap; gap: 10px; }
  .txn-topbar select, .txn-topbar input { min-width: 0; width: 100%; }
  .txn-ribbon { overflow-x: auto; flex-wrap: nowrap; }

  .filter-bar, .itemlist-toolbar, .center-toolbar, .look-for { flex-wrap: wrap; }
  .filter-bar select, .look-for input[type=search] { width: 100%; }
  .pay-methods { flex-wrap: wrap; }

  .totals, .recon-summary { width: 100%; max-width: none; margin-left: 0; }
  .recon-begin .recon-row { flex-wrap: wrap; }
  .recon-begin .recon-row > label { width: 100%; }

  .hbar { grid-template-columns: 1fr; gap: 3px; }
  .hbar-val { text-align: left; }
  .pie-body { flex-direction: column; align-items: flex-start; }

  .snap-grid { gap: 10px; }
  .perm-grid, .plan-grid, .stat-grid, .rc-list { grid-template-columns: 1fr; }

  .txn-ribbon .rb { min-width: 44px; }
  .report-tabs, .settings-tabs, .snap-tabs, .admin-tabs { overflow-x: auto; flex-wrap: nowrap; }

  /* Top bar on phones: brand shrinks, account icons stay, search drops to its own row. */
  .appbar { flex-wrap: wrap; height: auto; padding: 6px 8px; gap: 8px; }
  .appbar-brand .brand-co { display: none; }
  .appbar-search { order: 3; flex-basis: 100%; }
  .appbar-search .search-box { max-width: none; }
  .appbar-ico { width: 40px; height: 40px; }
}
