/* Dark, mobile-first, print-friendly */
:root{
  --bg:#0b0f19;
  --card:#0f172a;
  --card2:#0b1327;
  --text:#e6e9f2;
  --muted:#a8b3cf;
  --accent:#7dd3fc;
  --ok:#86efac;
  --warn:#fbbf24;
  --err:#fb7185;
  --border:rgba(255,255,255,.12);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background:radial-gradient(1200px 600px at 20% 0%, rgba(125,211,252,.10), transparent 60%),
             radial-gradient(900px 500px at 90% 10%, rgba(134,239,172,.08), transparent 55%),
             var(--bg);
  color:var(--text);
}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  background:rgba(11,15,25,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}

.brand{display:flex; align-items:center; gap:10px;}
.logo{
  width:40px; height:40px; border-radius:12px;
  display:grid; place-items:center;
  background:linear-gradient(135deg, rgba(125,211,252,.25), rgba(134,239,172,.18));
  border:1px solid var(--border);
  font-weight:800;
}
.title{font-weight:800; letter-spacing:.2px}
.subtitle{font-size:12px; color:var(--muted)}

.top-actions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}
.btn{
  border:1px solid var(--border);
  background:rgba(125,211,252,.12);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}
.btn:hover{background:rgba(125,211,252,.18)}
.btn.ghost{background:transparent}
.btn.ghost:hover{background:rgba(255,255,255,.06)}

.wrap{max-width:1024px; margin:0 auto; padding:14px; padding-bottom:60px;}
.card{
  background:linear-gradient(180deg, rgba(255,255,255,.03), transparent 30%),
             var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  margin:12px 0;
}
.card-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
}
.card-head h2{margin:0; font-size:16px}
.pill{
  font-size:12px; color:var(--muted);
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  padding:4px 8px;
  border-radius:999px;
}
.pill.ok{border-color:rgba(134,239,172,.35); color:rgba(134,239,172,.95);}

.card-body{padding:14px}
.grid2{display:grid; grid-template-columns:1fr; gap:12px}
.grid3{display:grid; grid-template-columns:1fr; gap:12px}
.grid4{display:grid; grid-template-columns:1fr; gap:12px}
@media (min-width:820px){
  .grid2{grid-template-columns:1fr 1fr}
  .grid3{grid-template-columns:1fr 1fr 1fr}
  .grid4{grid-template-columns:1fr 1fr 1fr 1fr}
}

.field label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
.input{
  width:100%;
  background:rgba(15,23,42,.75);
  border:1px solid var(--border);
  color:var(--text);
  padding:12px 12px;
  border-radius:12px;
  outline:none;
}
.input:focus{border-color:rgba(125,211,252,.55); box-shadow:0 0 0 4px rgba(125,211,252,.12)}
textarea.input{resize:vertical}
.hint{margin-top:6px; font-size:12px; color:var(--muted)}

.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:8px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}
.chip.active{border-color:rgba(125,211,252,.6); background:rgba(125,211,252,.16)}

.checks{display:grid; gap:8px}
.check{display:flex; gap:10px; align-items:flex-start; font-size:14px}
.check input{transform:translateY(2px)}

.toolbar{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px}
.muted{color:var(--muted)}

.help{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:rgba(255,255,255,.03);
}
.help summary{cursor:pointer; color:var(--accent); font-weight:800}
.help ul{margin:10px 0 0 18px; color:var(--text)}
.help li{margin:6px 0}

.calc{
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.03);
  padding:12px;
}
.calc-row{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
@media (min-width:820px){
  .calc-row{grid-template-columns:1fr 1fr 2fr}
}
.calc-label{font-size:12px; color:var(--muted)}
.calc-value{font-size:20px; font-weight:900; margin-top:4px}
.calc-note{font-size:13px; color:var(--muted)}

.doc-grid{display:grid; grid-template-columns:1fr; gap:12px}
@media (min-width:820px){ .doc-grid{grid-template-columns:1fr 1fr 1fr} }
.doc-col{
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.03);
  padding:12px;
}
.doc-col h3{margin:0 0 10px 0; font-size:14px}
.doc{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:10px 0;
  border-bottom:1px dashed rgba(255,255,255,.12);
}
.doc:last-child{border-bottom:none}
.doc-actions{display:flex; gap:10px; font-size:12px; color:var(--muted)}

.item{
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.03);
  padding:12px;
  margin:10px 0;
}
.item-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.item-title{font-weight:900}
.item-actions{display:flex; gap:8px}
.small{font-size:12px; color:var(--muted)}

.foot{
  position:fixed; left:0; right:0; bottom:0;
  background:rgba(11,15,25,.85);
  backdrop-filter: blur(10px);
  border-top:1px solid var(--border);
  padding:10px 14px;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
}
.foot-right{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}

.modal{
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--card2);
  color:var(--text);
  width:min(920px, 96vw);
}
.modal::backdrop{background:rgba(0,0,0,.55)}
.modal-head, .modal-foot{
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
}
.modal-foot{border-top:1px solid var(--border); border-bottom:none}
.modal-body{padding:12px 14px; max-height:70vh; overflow:auto}
.pre{
  font-family:var(--mono);
  font-size:12px;
  white-space:pre-wrap;
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
}

@media print{
  .topbar,.foot,.btn,#btnImport,#btnExport,#btnSave,#btnNew,#btnDelete{display:none !important}
  body{background:#fff; color:#000}
  .card{box-shadow:none; border:1px solid #ccc}
  .input{border:1px solid #bbb; color:#000; background:#fff}
  .pill{display:none}
}
