:root {
  --navy: #1F2A44; --navy-2: #2C3A5C; --crimson: #A3182F; --crimson-soft: #FBEAEC;
  --ink: #1D2230; --muted: #5E6576; --line: #E3E6EC; --bg: #F5F6F9; --card: #FFFFFF;
  --good: #1E6B47; --amber-bg: #FFF6DD; --amber-line: #E8C766;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 1.6rem; color: var(--navy); margin: 0 0 6px; }
h2 { font-size: 1.1rem; color: var(--navy); margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.hint { color: var(--muted); font-size: .9rem; margin: -4px 0 10px; }

.topbar { background: var(--navy); color: #fff; border-bottom: 4px solid var(--crimson); }
.topbar-inner { display: flex; align-items: baseline; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { font-size: 1.5rem; font-weight: 800; text-decoration: none; letter-spacing: -.5px; }
.brand-pod { color: #fff; } .brand-bal { color: #FF8A9B; }
.tagline { color: #C9CFDD; font-size: .9rem; }

main.wrap { padding-top: 28px; padding-bottom: 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 20px; }

.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.source { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.source p { margin: 0; color: var(--muted); font-size: .95rem; }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--crimson); color: #fff; font-size: .8rem; margin-right: 6px; }
.warn { background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 8px; padding: 10px 14px; font-size: .95rem; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed #B7BECD; border-radius: 12px; padding: 34px 16px; cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--crimson); background: var(--crimson-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-big { font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.drop-small { color: var(--muted); font-size: .9rem; }

.file-list { list-style: none; padding: 0; margin: 16px 0 0; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.file-name { overflow-wrap: anywhere; }
.badge { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; align-self: center; }
.badge.etsy { background: #FDECE3; color: #A4400F; }
.badge.printify { background: #E5F3EC; color: var(--good); }
.badge.unknown { background: #EEE; color: #666; }
.badge.partial { background: #EEF0F4; color: var(--muted); margin-left: 8px; font-weight: 600; }

.error { color: var(--crimson); background: var(--crimson-soft); border-radius: 8px; padding: 10px 14px; }
.actions { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.btn { background: var(--crimson); color: #fff; border: 0; border-radius: 8px; padding: 12px 22px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.btn:disabled { background: #C9CDD6; cursor: not-allowed; }
.btn:not(:disabled):hover { background: #861326; }
.btn-outline { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-outline:hover { background: var(--bg) !important; }
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .95rem; }

.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile-label { color: var(--muted); font-size: .85rem; }
.tile-value { font-size: 1.5rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.tile.net { border-top: 4px solid var(--navy); }

.table-scroll { overflow-x: auto; }
.money-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.money-table th, .money-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.money-table th:first-child, .money-table td:first-child { text-align: left; }
.money-table th { color: var(--muted); font-weight: 600; font-size: .82rem; border-bottom: 2px solid var(--line); white-space: normal; vertical-align: bottom; }
.money-table th.text-h, .money-table td.left { text-align: left; }
.money-table td { font-variant-numeric: tabular-nums; }
.money-table td.text { text-align: left; white-space: normal; min-width: 140px; }
#orders-table th, #orders-table td, #month-table th, #month-table td { padding-left: 6px; padding-right: 6px; font-size: .88rem; }
.money-table tr.clickable { cursor: pointer; }
.money-table tr.clickable:hover td { background: #F8F9FB; }
.money-table tr.selected td { background: var(--crimson-soft); }
.money-table tr.is-partial td { color: var(--muted); }
.money-table tr.total td { font-weight: 800; border-top: 2px solid var(--navy); border-bottom: 0; }
.neg { color: var(--crimson); }
.strong { font-weight: 700; }

.review-block { margin-bottom: 16px; }
.review-block h3 { font-size: 1rem; margin: 0 0 4px; }
.review-block p { margin: 0 0 8px; color: var(--muted); font-size: .93rem; }
.notice { background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.fine { color: var(--muted); font-size: .85rem; }

@media (max-width: 760px) {
  .sources { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .card { padding: 18px; }
}
.money-table td.tax { color: var(--muted); }
.sub { color: var(--muted); font-size: .8rem; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.period-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.period-row label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); }
.period-row input { font: inherit; padding: 8px 10px; border: 1px solid #B7BECD; border-radius: 8px; color: var(--ink); }
.period-row input:focus { outline: 2px solid var(--crimson); outline-offset: 1px; }
.period-row .hint { margin: 0; }
#month-table td:first-child { white-space: normal; min-width: 120px; }
#month-table .badge.partial { display: table; margin: 4px 0 0; }
.tax-card { border-top: 4px solid var(--crimson); }
.tax-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
.tax-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tax-line .sub { display: block; }
.tax-total { border-bottom: 0; border-top: 2px solid var(--navy); font-size: 1.15rem; color: var(--navy); }
.tax-input label { font-weight: 600; color: var(--navy); display: block; margin-bottom: 6px; }
.pct-box { display: flex; align-items: center; gap: 6px; }
.pct-box input { width: 110px; font: inherit; padding: 8px 10px; border: 1px solid #B7BECD; border-radius: 8px; }
.pct-box input:focus { outline: 2px solid var(--crimson); outline-offset: 1px; }
.disclaimer { font-style: italic; color: var(--muted); font-size: .88rem; margin: 12px 0 0; }
@media (max-width: 760px) { .tax-grid { grid-template-columns: 1fr; gap: 12px; } }
.privacy { background: #E9F4EE; border: 1px solid #A9D3BC; border-radius: 8px; padding: 10px 14px; font-size: .95rem; color: #1E4D36; }
.account { margin-left: auto; display: flex; gap: 12px; align-items: baseline; color: #C9CFDD; font-size: .9rem; }
.btn-link.light { color: #fff; }
#back-btn { margin-bottom: 10px; padding: 0; }
.plan-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #EEF1F8; border: 1px solid #C9D2E6; border-radius: 10px; padding: 10px 16px; margin-bottom: 18px; color: var(--navy); }
.plan-banner.warn-banner { background: var(--amber-bg); border-color: var(--amber-line); color: var(--ink); }
.btn-small { padding: 8px 14px; font-size: .9rem; }
/* Wider page and tighter tables so all money columns fit on a laptop screen */
.wrap { max-width: 1180px; }
#month-table th, #month-table td, #orders-table th, #orders-table td { padding-left: 5px; padding-right: 5px; font-size: .85rem; }
#orders-table td.text { min-width: 120px; }
