*{box-sizing:border-box}html{-webkit-text-size-adjust:none;text-size-adjust:none}body{margin:0;font-family:Arial,Helvetica,sans-serif;background:#f5f6f8;color:#18202a;line-height:1.5}a{text-decoration:none;color:inherit}img{max-width:100%;display:block}button,input,select,textarea{font:inherit}input,select,textarea{width:100%;padding:.9rem 1rem;border:1px solid #d6dbe3;border-radius:12px;background:#fff}textarea{min-height:110px;resize:vertical}label span{display:block;font-size:.92rem;font-weight:700;margin-bottom:.4rem}.hidden{display:none!important}.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:.8rem 1.1rem;border-radius:999px;border:1px solid #cfd6df;background:#fff;color:#102030;cursor:pointer}.btn:hover{background:#f0f4f7}.btn-primary{background:#046a70;color:#fff;border-color:#046a70}.btn-primary:hover{background:#03565a}.alert{padding:1rem 1.1rem;border-radius:14px;margin-bottom:1rem}.alert-success{background:#e5f6ea;color:#185531}.alert-error{background:#fde8ef;color:#8b204f}.login-body,.install-body{min-height:100vh;display:grid;place-items:center;background:linear-gradient(180deg,#f6f7fa,#ebeff3)}.login-shell,.install-shell{width:min(100%,1180px);padding:24px}.login-card,.install-card{background:#fff;border:1px solid #d9dee7;border-radius:24px;box-shadow:0 20px 50px rgba(15,23,42,.08);padding:28px}.install-card.wide{max-width:1120px}.brand-line,.brand-box,.brand-preview-row{display:flex;align-items:center;gap:14px}.brand-mark,.sheet-logo{width:52px;height:52px;border-radius:18px;background:linear-gradient(145deg,#d6a315,#046a70);display:grid;place-items:center;color:#fff;font-weight:700}.brand-mark.large{width:72px;height:72px;font-size:1.2rem}.brand-logo,.brand-logo-lg{width:52px;height:52px;border-radius:18px;object-fit:cover}.brand-logo-lg{width:72px;height:72px}.login-card h1,.install-header h1{margin:.2rem 0 0;font-size:2rem}.login-card p,.install-header p{margin:.35rem 0 0;color:#5f6b7a}.grid-form{display:grid;gap:1rem}.grid-form.compact{margin-top:1rem}.grid{display:grid;gap:1rem}.grid.two,.content-grid.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}.grid .full{grid-column:1/-1}.actions-row{display:flex;justify-content:flex-end}.card-block{padding:1rem;border:1px solid #e3e8ef;border-radius:18px;background:#fcfcfd}.card-block h3,.card-block h2{margin:0 0 1rem;font-size:1.1rem}.require-list{display:grid;gap:.75rem}.require-item{display:flex;justify-content:space-between;gap:1rem;padding:.9rem 1rem;border:1px solid #e2e7ef;border-radius:14px;background:#fafbfd}.status-ok{color:#1b7d3c}.status-bad{color:#b4235b}.compact-panel{padding:1.1rem}.app-shell{display:grid;grid-template-columns:280px 1fr;min-height:100vh}.sidebar{padding:24px;background:#fff;border-right:1px solid #dde2ea;position:sticky;top:0;height:100vh}.menu{display:grid;gap:.45rem;margin-top:2rem}.menu-link{padding:.85rem 1rem;border-radius:14px;color:#536273;font-weight:700}.menu-link:hover,.menu-link.active{background:#e6f1f2;color:#046a70}.main-content{padding:28px}.topbar{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1rem}.topbar h1{margin:0;font-size:2rem}.topbar p{margin:.35rem 0 0;color:#667284}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-bottom:1rem}.stat-card,.panel{background:#fff;border:1px solid #dce2ea;border-radius:22px;box-shadow:0 10px 24px rgba(15,23,42,.04)}.stat-card{padding:1.25rem}.stat-card span{display:block;color:#687486;margin-bottom:.4rem}.stat-card strong{font-size:1.45rem}.panel{padding:1.25rem}.panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.panel-head h2{margin:0;font-size:1.18rem}.content-grid{display:grid;gap:1rem}.content-grid.wide-right{grid-template-columns:1fr 1.25fr}.table-wrap{overflow:auto;border:1px solid #e1e7ee;border-radius:18px}table{width:100%;border-collapse:collapse;background:#fff}th,td{padding:14px;border-bottom:1px solid #edf1f5;text-align:left;white-space:nowrap}th{background:#f8fafc;color:#5e6a79}.link-inline{color:#046a70;font-weight:700;margin-right:10px}.danger-link{color:#b4235b}.summary-box{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:1rem;border:1px solid #dde4ea;border-radius:16px;background:#f8fbfc}.summary-box strong{display:block;font-size:1.15rem;margin-top:.2rem}.preview-card small{color:#687486}.filter-panel{margin-bottom:1rem}.inline-filter{align-items:end}.filter-actions{display:flex;gap:.75rem;align-items:end}.print-body{background:#e9eef2;padding:22px}.print-actions{display:flex;gap:.75rem;justify-content:flex-end;margin-bottom:1rem}.sheet{width:min(100%,960px);margin:0 auto;background:#fff;border-radius:20px;padding:32px;box-shadow:0 20px 50px rgba(15,23,42,.08)}.sheet-head{display:flex;justify-content:space-between;gap:1rem;border-bottom:2px solid #141414;padding-bottom:18px;margin-bottom:20px}.sheet-brand{display:flex;gap:14px;align-items:flex-start}.sheet-logo-img{width:58px;height:58px;object-fit:cover;border-radius:18px}.sheet-brand h1{margin:0;font-size:1.8rem}.sheet-brand p,.sheet-meta div:last-child,.muted{margin:.2rem 0 0;color:#5a5a5a}.sheet-meta{text-align:right}.sheet-meta .label{text-transform:uppercase;letter-spacing:.08em;color:#777;font-size:.8rem}.sheet-meta .number{font-size:1.18rem;font-weight:800;margin:.2rem 0}.sheet-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}.sheet-box{border:1px solid #e1e1e1;border-radius:16px;padding:16px}.sheet-box h3{margin:0 0 .6rem;font-size:.92rem;text-transform:uppercase;letter-spacing:.08em;color:#666}.sheet-box p{margin:0}.sheet-table{width:100%;border-collapse:collapse}.sheet-table th,.sheet-table td{padding:12px;border-bottom:1px solid #e9e9e9;text-align:left}.sheet-summary{margin-left:auto;max-width:360px;margin-top:18px}.sheet-summary .line{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px dashed #d7d7d7}.sheet-summary .line.total{border-bottom:2px solid #111;padding-top:14px;font-size:1.1rem}.notes-box{margin-top:20px}.no-print{}@media print{body{background:#fff}.no-print{display:none!important}.sheet{box-shadow:none;border-radius:0;padding:0;max-width:none}}@media (max-width:1100px){.app-shell{grid-template-columns:1fr}.sidebar{position:static;height:auto}.stats-grid,.content-grid.two-col,.content-grid.wide-right,.grid.two,.sheet-grid,.summary-box{grid-template-columns:1fr}.main-content{padding:18px}.sheet-head{display:grid}.filter-actions{display:grid}}

/* Print rebuild v3: keep app unchanged, only refine invoice print layout */
.print-body{
  background:#eef2f5;
  padding:24px;
}
.print-actions{
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin:0 auto 18px;
  max-width:210mm;
}
.sheet-half-a4{
  width:190mm;
  min-height:133mm;
  margin:0 auto;
  background:#fff;
  border-radius:0;
  box-shadow:0 0 0 1px #d9d9d9;
  padding:9mm 10mm 8mm;
}
.print-body .sheet-head{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:8mm;
  align-items:start;
  padding-bottom:4mm;
  margin-bottom:4mm;
  border-bottom:0.5mm solid #222;
}
.print-body .sheet-brand{
  gap:4mm;
  align-items:flex-start;
}
.print-body .sheet-brand h1{
  margin:0 0 2mm;
  font-size:16pt;
  line-height:1.15;
}
.print-body .sheet-brand p,
.print-body .sheet-meta,
.print-body .sheet-box,
.print-body .sheet-table,
.print-body .sheet-summary{
  font-size:10.5pt;
  line-height:1.35;
}
.print-body .sheet-logo,
.print-body .sheet-logo-img{
  width:18mm;
  height:18mm;
  min-width:18mm;
  object-fit:contain;
  border-radius:0;
}
.print-body .sheet-meta{
  text-align:right;
}
.print-body .sheet-meta .label{
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#6a6a6a;
  font-size:9pt;
}
.print-body .sheet-meta .number{
  margin:1mm 0;
  font-size:14pt;
  font-weight:700;
}
.print-body .sheet-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4mm;
  margin-bottom:4mm;
}
.print-body .sheet-box{
  min-height:29mm;
  border:0.35mm solid #cfcfcf;
  border-radius:0;
  padding:4mm;
}
.print-body .sheet-box h3{
  margin:0 0 3mm;
  font-size:9pt;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:#5b5b5b;
}
.print-body .sheet-box p{
  margin:0;
  white-space:pre-line;
}
.print-body .sheet-table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  margin-bottom:4mm;
}
.print-body .sheet-table th,
.print-body .sheet-table td{
  border:0.3mm solid #bdbdbd;
  padding:3mm 2.5mm;
  vertical-align:middle;
}
.print-body .sheet-table th{
  background:#f3f3f3;
  font-weight:700;
  text-align:left;
}
.print-body .sheet-table th:nth-child(1),
.print-body .sheet-table td:nth-child(1){width:30%;}
.print-body .sheet-table th:nth-child(2),
.print-body .sheet-table td:nth-child(2){width:14%; text-align:center;}
.print-body .sheet-table th:nth-child(3),
.print-body .sheet-table td:nth-child(3){width:14%; text-align:center;}
.print-body .sheet-table th:nth-child(4),
.print-body .sheet-table td:nth-child(4){width:19%; text-align:right;}
.print-body .sheet-table th:nth-child(5),
.print-body .sheet-table td:nth-child(5){width:23%; text-align:right;}
.print-body .sheet-summary{
  width:78mm;
  margin-left:auto;
  margin-top:1mm;
  border-top:0.5mm solid #222;
  padding-top:2mm;
}
.print-body .sheet-summary .line{
  display:grid;
  grid-template-columns:1fr auto;
  gap:4mm;
  padding:2mm 0;
  border-bottom:0.2mm dashed #c9c9c9;
}
.print-body .sheet-summary .line.total{
  font-size:11pt;
  font-weight:700;
  border-bottom:0.5mm solid #222;
}
.print-body .notes-box{
  display:none !important;
}
@page{
  size:A4 portrait;
  margin:10mm;
}
@media print{
  html,body{
    background:#fff !important;
    margin:0 !important;
    padding:0 !important;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
  .no-print,
  .sidebar,
  .topbar,
  .page-head,
  .actions,
  .app-shell{
    display:none !important;
  }
  .print-body{
    background:#fff !important;
    padding:0 !important;
  }
  .sheet-half-a4{
    width:190mm !important;
    min-height:133mm !important;
    margin:0 auto !important;
    padding:8mm 9mm 7mm !important;
    box-shadow:none !important;
    border:none !important;
    break-inside:avoid;
    page-break-inside:avoid;
  }
  .print-body .sheet-head,
  .print-body .sheet-grid,
  .print-body .sheet-table,
  .print-body .sheet-summary{
    break-inside:avoid;
    page-break-inside:avoid;
  }
}
