
:root{
  --ink:#16222f;--blue:#3769e8;--blue2:#edf2ff;--paper:#f5f7fb;--white:#fff;
  --muted:#697586;--line:#dfe5ee;--green:#1f8c67;--danger:#bd3c3c;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--paper);color:var(--ink);font-family:Inter,Arial,Helvetica,sans-serif;line-height:1.5}
button,input,select,textarea{font:inherit}
.topbar{height:76px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 4vw;position:sticky;top:0;z-index:40}
.brand{display:flex;align-items:center;gap:11px;text-decoration:none}
.brand-mark{width:42px;height:42px;border-radius:13px;background:var(--blue);color:#fff;display:grid;place-items:center;font-weight:900;font-size:21px}
.brand strong,.brand small{display:block}.brand strong{font-size:15px}.brand small{font-size:10px;color:var(--muted)}
.top-note{font-size:12px;color:var(--muted);font-weight:700}
.page{max-width:1600px;margin:auto;padding:45px 3vw 70px}
.intro{display:grid;grid-template-columns:1.2fr .8fr;gap:40px;align-items:end;margin-bottom:36px}
.pill{display:inline-block;background:var(--blue2);color:var(--blue);font-size:10px;letter-spacing:.16em;font-weight:900;padding:7px 10px;border-radius:999px}
.intro h1{font:700 clamp(42px,5vw,72px)/.98 Arial,sans-serif;letter-spacing:-.045em;margin:16px 0 18px;max-width:850px}
.intro p{font-size:17px;color:var(--muted);max-width:760px}
.intro-card{justify-self:end;width:min(390px,100%);background:#fff;border:1px solid var(--line);border-radius:22px;padding:24px;box-shadow:0 14px 40px rgba(41,57,79,.06)}
.intro-card strong{display:block;margin-bottom:12px}.intro-card span{display:block;font-size:13px;padding:7px 0;color:#455365}
.tool-layout{display:grid;grid-template-columns:minmax(0,1.22fr) minmax(400px,.78fr);gap:22px;align-items:start}
.form-panel{display:grid;gap:16px}
.section-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:24px}
.section-head{display:flex;gap:15px;align-items:flex-start;margin-bottom:20px}
.section-head>span,.head-left>span{width:34px;height:34px;border-radius:10px;background:var(--blue2);color:var(--blue);display:grid;place-items:center;font-size:11px;font-weight:900;flex:0 0 auto}
.section-head h2{font-size:18px;margin:1px 0 2px}.section-head p{font-size:12px;color:var(--muted);margin:0}
.section-head.split{justify-content:space-between}.head-left{display:flex;gap:15px}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.grid{display:grid;gap:12px}.g2{grid-template-columns:1fr 1fr}.g4{grid-template-columns:repeat(4,1fr)}
label{font-size:11px;font-weight:800;color:#536071;display:block}
input,select,textarea{width:100%;margin-top:6px;border:1px solid #d9e0ea;background:#fff;border-radius:10px;padding:12px;color:#15212e;outline:none}
input:focus,select:focus,textarea:focus{border-color:#8ca9ef;box-shadow:0 0 0 3px rgba(55,105,232,.09)}
textarea{resize:vertical}
.small-btn{border:1px solid #cfd9e8;background:#fff;color:var(--blue);font-weight:900;border-radius:10px;padding:9px 12px;cursor:pointer}
.items-wrap{overflow-x:auto}
.items-head,.invoice-line{display:grid;grid-template-columns:minmax(180px,2.2fr) 70px 78px 105px 95px 115px 38px;gap:8px;align-items:center;min-width:750px}
.items-head{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:#7c8795;padding:0 4px 8px}
.invoice-line{padding:9px 0;border-top:1px solid #eef1f5}
.invoice-line input,.invoice-line select{margin:0;padding:10px 8px;font-size:12px}
.line-total{font-weight:900;font-size:12px;text-align:right}
.remove-line{width:32px;height:32px;border:0;border-radius:9px;background:#fff0f0;color:var(--danger);cursor:pointer;font-weight:900}
.warning{background:#fff8e8;border:1px solid #f0dca9;border-radius:16px;padding:18px}.warning strong{font-size:12px}.warning p{font-size:11px;color:#6f6042;margin:4px 0 0}
.generate-bar{background:#172738;color:#fff;border-radius:20px;padding:20px 22px;display:flex;align-items:center;justify-content:space-between;gap:20px;position:sticky;bottom:14px;z-index:20;box-shadow:0 18px 42px rgba(22,34,47,.20)}
.generate-bar small,.generate-bar strong{display:block}.generate-bar small{font-size:10px;color:#b9c3ce}.generate-bar strong{font-size:24px}
.generate-bar button{border:0;background:#5a83f0;color:#fff;font-weight:900;border-radius:12px;padding:14px 22px;cursor:pointer}
.preview-sticky{position:sticky;top:98px}
.preview-toolbar{display:flex;justify-content:space-between;font-size:9px;letter-spacing:.08em;color:#8791a0;margin:0 4px 8px}
.invoice-preview{background:#fff;border:1px solid var(--line);border-radius:20px;padding:32px;min-height:720px;box-shadow:0 14px 40px rgba(41,57,79,.05)}
.pv-top{display:flex;justify-content:space-between;gap:25px;padding-bottom:25px;border-bottom:2px solid #202c39}.pv-top small,.pv-parties small{font-size:9px;letter-spacing:.15em;color:#87909c}.pv-top h3{font-size:27px;margin:4px 0}.pv-dates{display:flex;flex-direction:column;gap:4px;text-align:right;font-size:10px}.pv-dates i{font-style:normal;color:#707a87}
.pv-parties{display:grid;grid-template-columns:1fr 1fr;gap:28px;padding:26px 0}.pv-parties div{display:flex;flex-direction:column}.pv-parties strong{font-size:13px;margin:5px 0}.pv-parties span{font-size:10px;color:#727c88}
.pv-table{border-top:1px solid var(--line)}.pv-row{display:grid;grid-template-columns:1.8fr .55fr .8fr .9fr;gap:10px;padding:10px 0;border-bottom:1px solid #edf0f4;font-size:10px}.pv-row span:last-child{text-align:right}.pv-head{font-weight:900;color:#687381;font-size:9px}
.pv-totals{width:62%;margin-left:auto;margin-top:25px}.pv-totals div{display:flex;justify-content:space-between;padding:6px 0;font-size:11px}.pv-grand{border-top:2px solid #243241;margin-top:5px;padding-top:10px!important;font-size:15px!important}
.modal{position:fixed;inset:0;background:rgba(18,28,39,.55);display:none;align-items:center;justify-content:center;padding:20px;z-index:100}
.modal.open{display:flex}.modal-card{width:min(470px,100%);background:#fff;border-radius:24px;padding:34px;position:relative;box-shadow:0 30px 80px rgba(0,0,0,.20)}
.modal-close{position:absolute;right:14px;top:10px;border:0;background:none;font-size:28px;cursor:pointer}.modal-badge{font-size:9px;letter-spacing:.16em;color:var(--blue);font-weight:900}.modal-card h2{font-size:32px;margin:10px 0}.modal-card p{color:var(--muted)}.modal-card a{display:inline-block;margin-top:8px;background:var(--blue);color:#fff;text-decoration:none;font-weight:900;padding:12px 16px;border-radius:11px}
footer{padding:25px 4vw;background:#fff;border-top:1px solid var(--line);display:flex;justify-content:space-between;font-size:10px;color:#7b8796}
@media(max-width:1150px){.tool-layout{grid-template-columns:1fr}.preview-panel{order:-1}.preview-sticky{position:static}.invoice-preview{min-height:auto}.two-col{grid-template-columns:1fr}.g4{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.top-note{display:none}.page{padding:30px 14px 50px}.intro{grid-template-columns:1fr}.intro-card{justify-self:stretch}.intro h1{font-size:45px}.section-card{padding:18px}.g2,.g4{grid-template-columns:1fr}.invoice-preview{padding:20px}.pv-parties{grid-template-columns:1fr}.generate-bar{flex-direction:column;align-items:stretch}.generate-bar button{width:100%}.preview-toolbar{display:none}footer{flex-direction:column;gap:5px}}

/* V2 refinements */
.intro h1{
  font-size:clamp(34px,4vw,58px);
  line-height:1.02;
  max-width:780px;
}

.generate-bar{
  width:min(520px,100%);
  margin-left:auto;
  border-radius:16px;
  padding:14px 16px;
  position:sticky;
  bottom:14px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
}

.generate-bar small{
  font-size:9px;
  line-height:1.2;
  margin-bottom:3px;
}

.generate-bar strong{
  font-size:20px;
}

.generate-bar button{
  padding:12px 16px;
  white-space:nowrap;
}

@media(max-width:700px){
  .intro h1{font-size:38px}
  .generate-bar{
    width:100%;
    grid-template-columns:1fr;
    margin-left:0;
  }
  .generate-bar button{width:100%}
}

/* V3 — WebLight brand refresh */
:root{
  --ink:#f5f7fb;
  --blue:#6f8cff;
  --blue2:#202839;
  --paper:#0f1520;
  --white:#ffffff;
  --muted:#9ca8b8;
  --line:#2d3747;
  --green:#28c891;
  --danger:#e56d6d;
  --panel:#171f2b;
  --panel2:#1c2633;
  --accent:#9db1ff;
}

body{
  background:
    radial-gradient(circle at 75% 0%,rgba(107,126,168,.14),transparent 36%),
    linear-gradient(180deg,#0e141f,#111824 56%,#0f1520);
  color:var(--ink);
}

.topbar{
  background:rgba(13,19,29,.95);
  border-bottom:1px solid #2a3444;
  box-shadow:0 10px 30px rgba(0,0,0,.16);
}

.brand strong{font-size:16px;text-transform:lowercase;color:#fff}
.brand small{color:#8e9aab}
.brand-mark{
  background:linear-gradient(180deg,#f9fbff,#d7dfeb);
  color:#101722;
  border:1px solid rgba(255,255,255,.35);
  box-shadow:0 0 28px rgba(255,255,255,.10);
  position:relative;
}
.brand-mark:before,
.brand-mark:after{
  content:"";
  position:absolute;
  width:2px;
  height:7px;
  background:#95a0af;
  top:-5px;
  left:50%;
  transform-origin:center 26px;
}
.brand-mark:before{transform:translateX(-50%) rotate(-28deg)}
.brand-mark:after{transform:translateX(-50%) rotate(28deg)}
.brand-mark .bulb{
  font-size:0;
  width:14px;
  height:18px;
  border:2px solid #111722;
  border-radius:50% 50% 45% 45%;
  display:block;
  position:relative;
}
.brand-mark .bulb:after{
  content:"";
  position:absolute;
  width:8px;
  height:4px;
  border-top:2px solid #111722;
  border-bottom:2px solid #111722;
  left:1px;
  bottom:-7px;
}

.top-note{color:#8f9bad}

.page{max-width:1600px}

.pill{
  background:#1e2a3b;
  color:#a8b8ff;
  border:1px solid #2e3a4e;
}

.intro h1{color:#fff}
.intro p{color:#9ca8b8}
.intro-card,
.section-card,
.invoice-preview{
  background:linear-gradient(180deg,#18212d,#141c27);
  border-color:#2d3747;
  box-shadow:0 18px 48px rgba(0,0,0,.16);
}
.intro-card strong{color:#fff}
.intro-card span{color:#b4beca}

.section-head>span,.head-left>span{
  background:#222d40;
  color:#9cb0ff;
}
.section-head h2{color:#f6f8fb}
.section-head p{color:#8490a0}

label{color:#aab4c1}

input,select,textarea{
  background:#111923;
  border-color:#303b4c;
  color:#f5f7fb;
}
input::placeholder,textarea::placeholder{color:#657184}
input:focus,select:focus,textarea:focus{
  border-color:#7189e8;
  box-shadow:0 0 0 3px rgba(113,137,232,.10);
}

.small-btn{
  background:#111923;
  border-color:#344054;
  color:#aab8ff;
}

.items-head{color:#7f8a99}
.invoice-line{border-top-color:#283242}
.line-total{color:#fff}
.remove-line{background:#2b1d22;color:#ff9aa8}

.warning{
  background:#251f14;
  border-color:#5a4a2f;
}
.warning p{color:#cabd9d}

.generate-bar{
  background:linear-gradient(135deg,#222d3d,#16202d);
  border:1px solid #3b4658;
  box-shadow:0 16px 46px rgba(0,0,0,.26);
}
.generate-bar button{
  background:linear-gradient(135deg,#8ba0ff,#627ef0);
}
.generate-bar small{color:#93a0b0}

.preview-toolbar{color:#7c8797}
.pv-top{border-bottom-color:#dbe1ea}
.pv-top small,.pv-parties small{color:#778493}
.pv-dates i,.pv-parties span{color:#a5afbb}
.pv-table{border-top-color:#2d3747}
.pv-row{border-bottom-color:#283141;color:#dfe5ec}
.pv-head{color:#8893a2}
.pv-grand{border-top-color:#dbe1ea}

.modal{background:rgba(4,9,15,.72)}
.modal-card{
  background:linear-gradient(180deg,#1a2330,#121923);
  border:1px solid #303b4c;
  color:#fff;
}
.modal-card p{color:#9ca8b8}
.modal-card a{background:#7189e8}
.modal-badge{color:#a4b5ff}

.save-company-box{
  margin-top:8px;
  padding:14px;
  border:1px solid #303b4c;
  border-radius:12px;
  background:#111923;
}
.save-company-check{
  display:flex;
  gap:9px;
  align-items:flex-start;
  font-size:11px;
  color:#d6dce4;
}
.save-company-check input{
  width:auto;
  margin:2px 0 0;
}
.clear-saved-btn{
  margin-top:10px;
  border:1px solid #3c495b;
  background:#1a2431;
  color:#9eacc0;
  border-radius:9px;
  padding:8px 10px;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.save-company-box small{
  display:block;
  margin-top:9px;
  color:#6f7c8d;
  font-size:9px;
}

footer{
  background:#0b111a;
  border-top-color:#26303f;
  color:#6f7d90;
}

/* V4 — lighter WebLight contrast */
:root{
  --ink:#1a2430;
  --blue:#4f67d8;
  --blue2:#eef1f7;
  --paper:#eef2f6;
  --white:#ffffff;
  --muted:#6f7a88;
  --line:#d5dce5;
  --green:#1f9b72;
  --danger:#bd3c3c;
  --panel:#ffffff;
  --panel2:#f7f9fb;
  --accent:#7f91e6;
}

body{
  background:
    radial-gradient(circle at 82% 0%,rgba(39,50,68,.07),transparent 32%),
    linear-gradient(180deg,#edf1f5 0%,#f8fafc 44%,#eef2f6 100%);
  color:#1a2430;
}

.topbar{
  background:#171e2a;
  border-bottom:0;
  box-shadow:0 8px 24px rgba(27,35,47,.12);
}

.brand{
  gap:10px;
}
.brand img{
  width:150px;
  height:50px;
  object-fit:cover;
  object-position:center;
  border-radius:8px;
  display:block;
}
.brand strong{
  color:#fff;
  font-size:15px;
}
.brand small{
  color:#aeb7c4;
}
.top-note{
  color:#b8c1cc;
}

.pill{
  background:#e4e9f1;
  color:#3e4e72;
  border:1px solid #d2d9e4;
}

.intro h1{
  color:#17222e;
}
.intro p{
  color:#657180;
}
.intro-card,
.section-card,
.invoice-preview{
  background:#fff;
  border-color:#d9e0e8;
  box-shadow:0 12px 34px rgba(35,48,66,.07);
}
.intro-card strong{color:#1c2733}
.intro-card span{color:#526070}

.section-head>span,.head-left>span{
  background:#eef1f7;
  color:#4f67d8;
}
.section-head h2{color:#1d2732}
.section-head p{color:#74808d}
label{color:#4f5d6c}

input,select,textarea{
  background:#f9fbfc;
  border-color:#d4dce6;
  color:#1c2631;
}
input::placeholder,textarea::placeholder{color:#9aa4b0}
input:focus,select:focus,textarea:focus{
  border-color:#8a9be3;
  box-shadow:0 0 0 3px rgba(79,103,216,.08);
}

.small-btn{
  background:#f7f9fb;
  border-color:#d6deea;
  color:#4f67d8;
}
.items-head{color:#788492}
.invoice-line{border-top-color:#e7ebf0}
.line-total{color:#1e2a35}
.remove-line{background:#fff0f0;color:#bd3c3c}

.warning{
  background:#fff8e8;
  border-color:#f0dca9;
}
.warning p{color:#6f6042}

.generate-bar{
  background:#263244;
  border:0;
  box-shadow:0 12px 30px rgba(27,38,52,.16);
}
.generate-bar button{
  background:#667eea;
}
.generate-bar small{color:#bdc7d4}

.preview-toolbar{color:#7d8793}
.pv-top{border-bottom-color:#263244}
.pv-top small,.pv-parties small{color:#7e8995}
.pv-dates i,.pv-parties span{color:#77818c}
.pv-table{border-top-color:#dfe5ec}
.pv-row{border-bottom-color:#e9edf2;color:#2e3945}
.pv-head{color:#6f7b88}
.pv-grand{border-top-color:#273241}

.modal{
  background:rgba(19,28,39,.55);
}
.modal-card{
  background:#fff;
  border:1px solid #d7dee8;
  color:#1b2530;
}
.modal-card p{color:#6c7784}
.modal-card a{background:#526bdc}
.modal-badge{color:#526bdc}

.save-company-box{
  border-color:#d9e0e8;
  background:#f8fafc;
}
.save-company-check{
  color:#4d5a68;
}
.clear-saved-btn{
  border-color:#d3dbe6;
  background:#fff;
  color:#647181;
}
.save-company-box small{
  color:#87919d;
}

footer{
  background:#202a38;
  border-top:0;
  color:#aab4c1;
}
