* { box-sizing: border-box; font-family: -apple-system,BlinkMacSystemFont,system-ui,sans-serif; }

/* ====== Beige Theme Tokens ====== */
:root{
  --bg: #0b1120;           /* deep navy */
  --panel: #111827;        /* dark panel */
  --card: #f4ecdf;         /* beige card */
  --card2:#efe4d3;         /* beige alt */
  --text: #0f172a;         /* dark text on beige */
  --muted:#334155;         /* muted text on beige */
  --ink:  #e5e7eb;         /* light text on dark */
  --ink2: #94a3b8;         /* muted light */
  --line: rgba(15,23,42,.12);

  --brand: #e3d7c5;        /* your signature beige */
  --brand2:#d8c7ad;        /* deeper beige */
  --primaryText:#0f172a;

  --danger:#ef4444;
  --shadow: 0 10px 26px rgba(0,0,0,.28);
}

body { margin:0; background:var(--bg); color:var(--ink); }
#app { min-height: 100vh; display:flex; flex-direction:column; }

/* ===== Top Bar ===== */
.top-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 12px; background:rgba(17,24,39,.88);
  border-bottom:1px solid rgba(227,215,197,.18);
  position:sticky; top:0; z-index:10;
  backdrop-filter: blur(8px);
}
.brand-pill{
  background:linear-gradient(180deg, var(--brand), var(--brand2));
  color:var(--primaryText);
  font-weight:1000; font-size:12px;
  padding:7px 10px; border-radius:999px;
  letter-spacing:.7px;
  box-shadow: 0 8px 18px rgba(227,215,197,.22);
}
.top-actions { display:flex; gap:8px; }

/* ===== Tabs ===== */
.tabs{
  display:flex; gap:8px; padding:10px 12px;
  background:rgba(15,23,42,.78);
  border-bottom:1px solid rgba(227,215,197,.18);
  position:sticky; top:52px; z-index:9;
  overflow:auto;
  backdrop-filter: blur(8px);
}
.tab-button{
  border:1px solid rgba(227,215,197,.22);
  padding:8px 12px; border-radius:999px; cursor:pointer;
  background:rgba(17,24,39,.9); color:var(--ink);
  font-weight:900; font-size:13px;
  white-space:nowrap;
}
.tab-button.active{
  background:linear-gradient(180deg, var(--brand), var(--brand2));
  color:var(--primaryText);
  border-color: rgba(15,23,42,.08);
}

/* ===== Main ===== */
main{ flex:1; padding:12px; max-width:900px; width:100%; margin:0 auto; }
.tab{ display:none; }
.tab.active{ display:block; }

/* ===== Cards ===== */
.card{
  background:linear-gradient(180deg, var(--card), var(--card2));
  border:1px solid rgba(15,23,42,.10);
  border-radius:18px;
  padding:12px;
  margin-bottom:12px;
  box-shadow: var(--shadow);
  color:var(--text);
}
.card-title{
  font-weight:1000;
  margin-bottom:10px;
  color:var(--text);
}
.row-between{ display:flex; justify-content:space-between; align-items:center; gap:10px; }

/* ===== Inputs ===== */
label{ display:block; font-size:13px; font-weight:900; margin:10px 0; color:var(--muted); }
input, select, textarea{
  width:100%; margin-top:6px; padding:10px 10px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.14);
  background:rgba(255,255,255,.68);
  color:var(--text);
  font-size:14px;
  outline:none;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(15,23,42,.35);
  box-shadow: 0 0 0 4px rgba(227,215,197,.55);
  background:#fff;
}
textarea{ resize:vertical; }
.ghost{ opacity:.75; }

.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media (max-width: 560px){ .grid-2{ grid-template-columns:1fr; } }

/* ===== Buttons ===== */
.btn{
  border:1px solid rgba(227,215,197,.28);
  cursor:pointer; border-radius:999px;
  padding:10px 12px;
  font-weight:1000; font-size:13px;
  background:rgba(17,24,39,.92);
  color:var(--ink);
}
.btn:hover{ filter: brightness(1.06); }
.btn.small{ padding:8px 10px; font-size:12px; }
.btn.primary{
  background:linear-gradient(180deg, var(--brand), var(--brand2));
  color:var(--primaryText);
  border-color: rgba(15,23,42,.10);
}
.btn.danger{
  background:var(--danger);
  color:#fff;
  border-color: rgba(239,68,68,.35);
}

/* ===== Hint Box ===== */
.hint-box{
  background:rgba(255,255,255,.55);
  border:1px dashed rgba(15,23,42,.22);
  border-radius:14px;
  padding:10px;
  margin-top:10px;
}
.hidden{ display:none !important; }
.mini-muted{ font-size:12px; color:rgba(15,23,42,.70); font-weight:800; }

/* ===== Lines ===== */
.lines-box{ display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.line-row{
  display:grid; grid-template-columns: 1fr 110px 44px;
  gap:8px; align-items:center;
}
.line-row input{ margin:0; }

.line-row .rm{
  width:44px; height:44px;
  border-radius:14px;
  background:rgba(17,24,39,.92);
  border:1px solid rgba(227,215,197,.28);
  color:var(--ink);
  font-weight:1000;
  cursor:pointer;
}
.line-row .rm:hover{ background:var(--danger); border-color: var(--danger); color:#fff; }

/* ===== Totals ===== */
.totals{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid rgba(15,23,42,.12);
}
.tot-row{ display:flex; justify-content:space-between; align-items:center; padding:8px 0; }
.tot-row.big{ font-size:16px; }
.tot-row b{ color:var(--text); }

/* ===== Lists ===== */
.list{ margin-top:12px; display:flex; flex-direction:column; gap:10px; }
.item{
  background:rgba(255,255,255,.62);
  border:1px solid rgba(15,23,42,.12);
  border-radius:14px;
  padding:10px;
  color:var(--text);
}
.item h4{ margin:0 0 6px 0; font-size:14px; font-weight:1000; }
.item .meta{ font-size:12px; color:rgba(15,23,42,.72); font-weight:800; }
.item .actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }

/* ===== Footer ===== */
.bottom-bar{
  padding:12px;
  text-align:center;
  font-size:12px;
  color:rgba(227,215,197,.75);
  border-top:1px solid rgba(227,215,197,.14);
  background:rgba(15,23,42,.86);
}

/* ===== Print ===== */
@media print {
  body{ background:#fff; color:#111; }
  .top-bar,.tabs,.bottom-bar,.btn{ display:none !important; }
  main{ padding:0; max-width:100%; }
  .card{ border:none; background:#fff; box-shadow:none; }
  #printArea{ display:block !important; }
}
.print-area{ display:none; }