/* =====================================================================
   Cash Checking - DESKTOP layout (on top of app.css)
   ===================================================================== */
:root { --side: 248px; --card: var(--cell); --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px -12px rgba(0,0,0,.18); }

html, body { height: auto; }
body { display: block; padding: 0; min-height: 100vh; background: var(--bg); font-size: 15px; letter-spacing: -.2px; }
#device.desk { position: relative; min-height: 100vh; }

/* ------------------------------ shell ------------------------------ */
.d-shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.d-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 18px 12px;
  background: var(--cell); border-right: .5px solid var(--sep); }
.d-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--label); }
.d-brand img { width: 38px; height: 38px; border-radius: 9px; }
.d-brand b { display: block; font-size: 16px; }
.d-brand small { display: block; font-size: 12px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.d-side nav { display: flex; flex-direction: column; gap: 2px; }
.d-nav { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--label); font-size: 15px; font-weight: 500; position: relative; }
.d-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; color: var(--label2); }
.d-nav:hover { background: var(--fill); }
.d-nav.on { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.d-nav.on svg { color: var(--blue); }
.d-nav.primary { background: var(--green); color: #fff; margin: 4px 0 8px; font-weight: 600; }
.d-nav.primary svg { color: #fff; }
.d-nav.primary.on, .d-nav.primary:hover { background: #2fb350; color: #fff; }
.d-badge { margin-left: auto; background: var(--red); color: #fff; font-style: normal; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 1px 8px; }
.d-side-foot { margin-top: auto; padding: 12px 8px 0; border-top: .5px solid var(--sep); display: flex; flex-direction: column; gap: 10px; }
.d-user { display: flex; align-items: center; gap: 10px; }
.d-user .avatar { width: 34px; height: 34px; font-size: 13px; }
.d-user b { display: block; font-size: 14px; } .d-user small { color: var(--label2); font-size: 12px; }
.d-mode { font-size: 12px; color: var(--label2); } .d-mode.warn { color: var(--orange); }

.d-main { min-width: 0; display: flex; flex-direction: column; }
.d-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 14px 28px; min-height: 64px;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); }
.d-top h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-back { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-size: 15px; }
.d-back svg { width: 9px; height: 16px; }
.d-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.d-top-right .nav-btn { font-size: 15px; }
.d-top-right .nav-plus { width: 24px; height: 24px; }
.d-search { position: relative; }
.d-search input { width: 240px; height: 34px; border: 0; border-radius: 9px; background: var(--fill); padding: 0 12px 0 32px; font-size: 14px; outline: none; }
.d-search svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; fill: none; stroke: var(--label2); stroke-width: 2.4; stroke-linecap: round; }

.d-content { padding: 22px 28px 60px; width: 100%; margin: 0 auto; }
.d-content.narrow { max-width: 780px; }
.d-content.wide { max-width: 1480px; }
.d-content .section { margin-left: 0; margin-right: 0; }
.d-content .section-head { margin-left: 4px; }
.d-content .seg, .d-content .search, .d-content .btn-row, .d-content .pad, .d-content .notice, .d-content .hero, .d-content .tiles, .d-content .chips, .d-content .quick { margin-left: 0; margin-right: 0; }
.d-content .chips { padding-left: 0; }
.d-content .bounce-banner { margin: 0 0 18px; }
.d-content .btn { max-width: 100%; }
.d-content .pad .btn { height: 48px; }

/* --------------------------- toolbar / kpis --------------------------- */
.d-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.d-toolbar .seg { margin: 0; min-width: 320px; }
.kpis { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpis.k4 { grid-template-columns: repeat(4, 1fr); }
.kpi { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); color: var(--label); display: block; min-width: 0; }
a.kpi:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 30%, transparent), var(--shadow); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--label2); font-weight: 500; }
.kpi-top .ico { width: 26px; height: 26px; border-radius: 50%; } .kpi-top .ico svg { width: 15px; height: 15px; }
.kpi-val { font-size: 26px; font-weight: 700; letter-spacing: -.4px; margin: 6px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12px; color: var(--label2); }
.kpi.in .kpi-val { color: var(--green); } .kpi.neg .kpi-val { color: var(--red); }
.hero-kpi { background: linear-gradient(145deg, #0a84ff 0%, #0060df 55%, #3a3ad6 100%); color: #fff; }
.hero-kpi .kpi-top { color: rgba(255,255,255,.85); }
.kpi-split { display: flex; gap: 8px; margin-top: 8px; }
.kpi-split a { flex: 1; background: rgba(255,255,255,.16); border-radius: 10px; padding: 6px 10px; color: #fff; }
.kpi-split a:hover { background: rgba(255,255,255,.28); }
.kpi-split b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; } .kpi-split span { font-size: 11px; opacity: .9; }

/* ------------------------------ cards ------------------------------ */
.d-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g-2-1 { grid-template-columns: 2fr 1fr; } .g-1-1 { grid-template-columns: 1fr 1fr; }
.d-card { background: var(--card); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; margin-bottom: 16px; }
.d-grid > .d-card { margin-bottom: 0; }
.d-card.flush { padding: 6px 0 0; } .d-card.flush .d-card-head { padding: 8px 18px 0; }
.d-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.d-card-head:empty, .d-card-head h3:empty + * { }
.d-card-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.d-card-head a { font-size: 14px; }

.chart-svg { width: 100%; height: 230px; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--sep); stroke-width: 1; }
.chart-svg .zero { stroke: var(--label3); stroke-width: 1.2; }
.chart-svg .ylab { font-size: 11px; fill: var(--label2); text-anchor: end; }
.chart-svg .xlab { font-size: 11px; fill: var(--label2); text-anchor: middle; }
.chart-svg rect:hover, .chart-svg circle:hover { opacity: .75; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--label2); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.donut-legend div { display: grid; grid-template-columns: 12px 1fr auto 38px; gap: 8px; align-items: center; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-legend b { font-variant-numeric: tabular-nums; } .donut-legend em { font-style: normal; color: var(--label2); text-align: right; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 92px; gap: 10px; align-items: center; color: var(--label); font-size: 13px; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 10px; background: var(--fill); border-radius: 5px; overflow: hidden; } .hb-track i { display: block; height: 100%; border-radius: 5px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------ tables ------------------------------ */
.d-table-wrap { overflow-x: auto; }
.d-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.d-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: .3px; padding: 8px 12px; border-bottom: .5px solid var(--sep); white-space: nowrap; }
.d-table td { padding: 9px 12px; border-bottom: .5px solid var(--sep); vertical-align: middle; }
.d-table tbody tr { cursor: pointer; } .d-table tbody tr:hover { background: var(--fill); }
.d-table tfoot td { border-bottom: 0; background: color-mix(in srgb, var(--fill) 60%, transparent); }
.d-table .r { text-align: right; } .d-table th.r { text-align: right; }
.d-card.flush .d-table th:first-child, .d-card.flush .d-table td:first-child { padding-left: 18px; }
.d-inline-search { max-width: 420px; margin: 0 0 16px !important; }

/* ----------------------- cash a check + camera ----------------------- */
.d-check { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(440px, 600px); gap: 24px; align-items: start; }
.d-check-form { min-width: 0; }
.cam-card { position: sticky; top: 86px; background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.cam-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cam-head select { max-width: 60%; border: 0; background: var(--fill); border-radius: 8px; height: 30px; padding: 0 8px; font-size: 13px; }
.cam-view { position: relative; aspect-ratio: 16 / 10; background: #111; border-radius: 12px; overflow: hidden; }
.cam-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-view.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; }
.cam-guide { position: absolute; inset: 14% 8%; border: 2px dashed rgba(255,255,255,.75); border-radius: 10px; pointer-events: none; display: flex; align-items: flex-end; justify-content: center; }
.cam-guide span { background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 8px; margin-bottom: -12px; }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #fff; font-size: 14px; background: rgba(0,0,0,.55); }
.cam-target { margin: 0 !important; }
.cam-target label span { font-size: 12px; }
.cam-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cam-buttons .btn { height: 44px; }
.cam-buttons .btn:disabled { opacity: .45; cursor: default; }
.drop-zone { display: block; border: 2px dashed var(--fill2); border-radius: 12px; padding: 16px; text-align: center; color: var(--label2); font-size: 14px; cursor: pointer; }
.drop-zone span { color: var(--blue); }
.drop-zone.over { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.d-check-form .scan-card { margin-left: 0; margin-right: 0; }

/* ---------------------------- sign in ---------------------------- */
.d-auth { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(1200px 600px at 20% 0%, color-mix(in srgb, var(--blue) 14%, var(--bg)), var(--bg)); }
.d-auth-card { width: 420px; max-width: 100%; background: var(--cell); border-radius: 22px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.35); overflow: hidden; }
.d-auth-card .login { padding: 40px 32px 24px; min-height: auto; }
.d-auth-card .login .group { background: var(--bg); }
.d-auth-card .field { background: var(--bg); }

/* ----------------------- toast + action sheet ----------------------- */
.desk .toast { position: fixed; top: 16px; left: calc(50% + var(--side) / 2); }
.desk .sheet-back { position: fixed; }
.desk .sheet { position: fixed; left: 50%; right: auto; width: 440px; bottom: auto; top: 30%; transform: translate(-50%, -30px); opacity: 0; transition: transform .2s, opacity .2s; }
.desk .sheet.open { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1150px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .g-2-1, .g-1-1 { grid-template-columns: 1fr; }
  .d-check { grid-template-columns: 1fr; }
  .cam-card { position: static; }
}
@media (max-width: 760px) {
  :root { --side: 0px; }
  .d-shell { grid-template-columns: 1fr; }
  .d-side { display: none; }
  .d-search input { width: 140px; }
}

/* 009 total profit box on Cash Flow */
.d-profit .section { margin: 0; }
.d-profit .section-head { margin-top: 0; }

/* 010 batch review */
.d-check .scan-status-out { margin-left: 0; margin-right: 0; }
.d-check .batch-bar { margin-left: 0; margin-right: 0; }
.d-batch .batch-pic { display: none; }
.batch-big { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.batch-big img { display: block; width: 100%; }
.batch-big span { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 8px; }
.batch-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.batch-mini .bm { display: block; text-decoration: none; color: var(--label2); font-size: 12px; text-align: center; border-radius: 8px; padding: 4px; }
.batch-mini .bm img { display: block; width: 100%; height: 44px; object-fit: cover; border-radius: 5px; margin-bottom: 3px; }
.batch-mini .bm.cur { box-shadow: 0 0 0 2.5px var(--blue); }
.batch-mini .bm.cashed { color: var(--green); }
.batch-mini .bm.skipped img { opacity: .5; }
