/* Tally Business Desk — QuickBooks/PayPal-style dashboard styling.
   Builds on the site theme vars set in the shared shell:
   --bg --ink --mint --aqua --blue --muted --line --card --shadow */

.desk { max-width: 1080px; margin: 0 auto; padding: 0 18px 90px; }

/* ── Connect hero ─────────────────────────────────────────────── */
.hero-connect { max-width: 560px; margin: 26px auto 0; }
.dash-title { font-size: 32px; line-height: 1.08; margin: 18px 0 8px; letter-spacing: -.5px; }
.dash-sub { color: #4f6f66; font-size: 15px; margin: 0 0 22px; max-width: 480px; }
.connect-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.addr-input, .fld { flex: 1; min-width: 200px; background: #fff; border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 12px 13px; font-family: inherit; font-size: 13px; outline: none; }
.fld { width: 100%; min-width: 0; }
.fld:focus, .addr-input:focus { border-color: var(--mint); }
.dash-status { color: var(--muted); font-size: 13px; margin: 14px 2px; min-height: 18px; }
.addr-mono { font-family: ui-monospace, Menlo, monospace; }

/* ── Top bar ──────────────────────────────────────────────────── */
.desk-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.desk-hello { font-size: 24px; font-weight: 900; letter-spacing: -.4px; }
.desk-hello small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.desk-wallet { display: inline-flex; align-items: center; gap: 8px; background: #eafff6; color: #087a55;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 800; cursor: pointer; font-family: ui-monospace, Menlo, monospace; }

/* ── Nav tabs ─────────────────────────────────────────────────── */
.desk-nav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, rgba(245,255,251,.96), rgba(245,255,251,.88)); backdrop-filter: blur(8px); }
.desk-nav::-webkit-scrollbar { display: none; }
.dnav { flex: none; background: #fff; border: 1px solid var(--line); color: var(--muted); border-radius: 999px;
  padding: 10px 18px; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .12s; }
.dnav:hover { transform: translateY(-1px); }
.dnav.active { background: var(--mint); color: #04221d; border-color: var(--mint); }
.dnav .n { display: inline-block; min-width: 17px; margin-left: 6px; background: rgba(0,0,0,.1); border-radius: 999px;
  font-size: 10px; padding: 1px 5px; vertical-align: 1px; }

/* ── Glance cards ─────────────────────────────────────────────── */
.glance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 18px; }
.gcard { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  box-shadow: 0 10px 26px rgba(0,94,74,.06); }
.gcard .lbl { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.gcard .val { font-size: 24px; font-weight: 900; color: var(--ink); margin-top: 6px; letter-spacing: -.5px; }
.gcard .val .u { font-size: 13px; color: var(--mint); font-weight: 800; }
.gcard .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.gcard.hot { background: linear-gradient(135deg, #063a30, #052b24); border-color: transparent; }
.gcard.hot .lbl { color: #8ad9c1; }
.gcard.hot .val { color: #fff; }
.gcard.hot .sub { color: #94d9c4; }

/* ── Create-new action row (QuickBooks style) ─────────────────── */
.create-row { margin: 4px 0 18px; }
.create-row .cr-lbl { color: #087a55; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; margin: 0 0 10px 2px; }
.create-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.act { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px 6px; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 12px; color: #063b31; display: flex; flex-direction: column;
  align-items: center; gap: 8px; box-shadow: 0 10px 26px rgba(0,94,74,.07); transition: transform .14s, box-shadow .14s; }
.act:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(0,94,74,.13); }
.act-i { width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: #e9fff6; color: var(--mint); font-size: 18px; font-weight: 900; }

/* ── Panels & section cards ───────────────────────────────────── */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 16px;
  box-shadow: 0 12px 30px rgba(0,94,74,.07); }
.panel h3 { margin: 0 0 4px; font-size: 17px; }
.panel .phint { color: var(--muted); font-size: 12px; margin: 0 0 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grp-title { color: #087a55; font-size: 11px; letter-spacing: .16em; margin: 22px 0 10px; text-transform: uppercase; font-weight: 800; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.sec-head h2 { font-size: 20px; margin: 0; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-block; background: var(--mint); color: #04221d; border: none; text-decoration: none; font-family: inherit;
  font-weight: 800; font-size: 13px; padding: 11px 16px; border-radius: 11px; cursor: pointer; }
.btn.ghost { background: #f6fffb; color: #087a55; border: 1px solid var(--line); }
.btn.mini { padding: 7px 12px; font-size: 12px; border-radius: 9px; }
.btn.danger { background: #ffeef0; color: #b42334; border: 1px solid #ffd4da; }
.btn:disabled { opacity: .55; cursor: default; }

/* ── Filter pills / status pills ──────────────────────────────── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fpill { background: #fff; border: 1px solid var(--line); color: var(--muted); border-radius: 999px;
  padding: 7px 14px; font-family: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.fpill.active { background: #063a30; color: #aef7db; border-color: #063a30; }
.pill { font-size: 11px; font-weight: 800; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.pill.in { background: rgba(0,208,132,.14); color: #0a8f5e; }
.pill.out { background: rgba(36,107,254,.12); color: var(--blue); }
.pill.s { border: 1px solid var(--line); color: var(--muted); }
.pill.paid { background: rgba(0,208,132,.16); color: #0a8f5e; }
.pill.unpaid { background: rgba(255,122,0,.13); color: #c05600; }
.pill.overdue { background: rgba(220,38,63,.12); color: #b42334; }
.pill.draft { background: rgba(0,0,0,.06); color: var(--muted); }
.pill.void { background: rgba(0,0,0,.06); color: var(--muted); text-decoration: line-through; }

/* ── List rows (invoices, customers, activity) ────────────────── */
.rowlist { display: flex; flex-direction: column; gap: 10px; }
.lrow2 { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 16px; box-shadow: 0 8px 20px rgba(0,94,74,.05); transition: transform .12s, box-shadow .12s; }
.lrow2:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(0,94,74,.1); }
.lrow2 .av { width: 40px; height: 40px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; color: #04140c; background: linear-gradient(135deg, #5af0ba, #11a7b5); }
.lrow2 .av.blue { background: linear-gradient(135deg, #7fa8ff, #246bfe); color: #fff; }
.lrow2 .av.warm { background: linear-gradient(135deg, #ffd66b, #ff9a3c); }
.lrow2 .body { flex: 1; min-width: 0; }
.lrow2 .body b { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow2 .body em { font-style: normal; font-size: 12px; color: var(--muted); }
.lrow2 .amt { text-align: right; font-weight: 900; font-size: 15px; color: var(--ink); white-space: nowrap; }
.lrow2 .amt em { display: block; font-style: normal; font-weight: 700; font-size: 11px; color: var(--muted); }
.lrow2 .amt.pos { color: #0a8f5e; }
.lrow2 .amt.neg { color: var(--blue); }
.rowacts { display: flex; gap: 6px; flex: none; }
.empty { color: var(--muted); font-size: 13px; padding: 26px 10px; text-align: center; background: #fbfffd;
  border: 1px dashed var(--line); border-radius: 16px; }

/* ── Charts (pure CSS bars) ───────────────────────────────────── */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 8px 4px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar2 { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--mint), var(--aqua));
  min-height: 3px; transition: height .4s ease; }
.chart .bar2.warn { background: linear-gradient(180deg, #ffb45c, #ff7a00); }
.chart .bar2.bad { background: linear-gradient(180deg, #ff8598, #dc263f); }
.chart .cl { font-size: 10px; color: var(--muted); font-weight: 800; }
.chart .cv { font-size: 10px; color: var(--ink); font-weight: 900; }

/* ── Invoice builder ──────────────────────────────────────────── */
.itemrow { display: grid; grid-template-columns: 1fr 76px 110px 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.itemrow .del { background: none; border: none; color: #b42334; font-size: 16px; cursor: pointer; font-weight: 900; }
.inv-totals { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.trow { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 3px 0; }
.trow.grand { font-size: 17px; font-weight: 900; color: var(--ink); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 9px; }
.fldlbl { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 2px 5px; }
.fldrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Link / QR result panel ───────────────────────────────────── */
.linkout { word-break: break-all; color: #087a55; font-size: 12px; background: #f6fffb; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-family: ui-monospace, Menlo, monospace; }
.qrbox { margin: 12px 0; background: #fff; display: inline-block; padding: 10px; border-radius: 14px; border: 1px solid var(--line); }

/* ── Contract cards (streams / loans / splits) ────────────────── */
.scard { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 12px;
  box-shadow: 0 10px 26px rgba(0,94,74,.06); }
.scard .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.claim { font-size: 26px; font-weight: 900; color: var(--ink); }
.claim .u { font-size: 14px; color: var(--mint); font-weight: 800; }
.meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.bar { height: 8px; background: #e2f6ed; border-radius: 50px; overflow: hidden; margin: 14px 0 6px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--mint), var(--aqua)); border-radius: 50px; }
.krow { display: flex; justify-content: space-between; margin-top: 6px; }
.krow span:first-child { color: var(--muted); font-size: 12px; }
.krow span:last-child { color: var(--ink); font-size: 12px; font-weight: 700; }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Fee table ────────────────────────────────────────────────── */
.feetable { width: 100%; border-collapse: collapse; font-size: 13px; }
.feetable th { text-align: left; color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.feetable td { padding: 11px 10px; border-bottom: 1px solid #ecf8f2; vertical-align: top; }
.feetable td b { color: var(--ink); }
.feetable .free { color: #0a8f5e; font-weight: 900; }

/* ── Success overlay (Venmo/PayPal celebration) ───────────────── */
.paysplash { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(6,43,37,.45); backdrop-filter: blur(4px); }
.paysplash .inner { background: #fff; border-radius: 26px; padding: 34px 30px; text-align: center; max-width: 330px; width: 88%;
  box-shadow: 0 30px 90px rgba(0,43,37,.35); animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.paysplash .tick { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--mint), var(--aqua)); color: #04221d; font-size: 34px; font-weight: 900; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 880px) {
  .glance { grid-template-columns: repeat(2, 1fr); }
  .create-grid { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .cgrid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .create-grid { grid-template-columns: repeat(3, 1fr); }
  .itemrow { grid-template-columns: 1fr 56px 84px 28px; }
  .desk-hello { font-size: 20px; }
  .rowacts { flex-wrap: wrap; justify-content: flex-end; }
}
