:root{
  --blue:#0B5CAD;--blue-dk:#08478A;--blue-lt:#E8F1FB;--sky:#1484D6;
  --ink:#0B2A55;--ink2:#1E4170;--mute:#5A7394;--line:#DCE6F2;--bg:#F3F7FC;--card:#FFFFFF;
  --green:#15803D;--green-lt:#E7F6EC;--amber:#B45309;--amber-lt:#FEF3E2;--red:#B91C1C;--red-lt:#FDECEC;
  --r:14px;--shadow:0 1px 2px rgba(11,42,85,.06),0 1px 3px rgba(11,42,85,.07);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--ink);
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);-webkit-text-size-adjust:100%}
body{min-height:100vh;font-size:16px;line-height:1.45}
a{color:var(--blue)}
h1{font-size:24px;line-height:1.2;margin:0 0 4px}
h2{font-size:18px;margin:0 0 10px}
h3{font-size:16px;margin:0 0 4px}
p{margin:0 0 10px}
.muted{color:var(--mute)}
.small{font-size:14px}
button,input,select,textarea{font:inherit;color:inherit}

/* layout */
.shell{display:flex;min-height:100vh}
.side{display:none}
.main{flex:1;min-width:0;padding:16px 16px 96px;max-width:860px;margin:0 auto;width:100%}
.top{display:flex;align-items:center;gap:10px;margin:0 0 16px}
.top .grow{flex:1;min-width:0}
.tabs{position:fixed;left:0;right:0;bottom:0;display:flex;background:#fff;border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom));z-index:20}
.tabs a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:12px;color:var(--mute);text-decoration:none;padding:4px 0;position:relative}
.tabs a svg{width:24px;height:24px}
.tabs a.on{color:var(--blue);font-weight:600}
.badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#E11D48;color:#fff;font-size:11px;font-weight:700}
.tabs .badge{position:absolute;top:0;left:calc(50% + 6px)}
@media (min-width:900px){
  .tabs{display:none}
  .side{display:flex;flex-direction:column;gap:4px;width:240px;flex:none;background:#fff;border-right:1px solid var(--line);padding:20px 12px;position:sticky;top:0;height:100vh}
  .side .brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:19px;padding:0 8px 18px}
  .side .brand img{width:34px;height:34px;border-radius:9px}
  .side a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;color:var(--ink2);text-decoration:none;font-weight:500}
  .side a svg{width:20px;height:20px}
  .side a.on{background:var(--blue-lt);color:var(--blue)}
  .side .grow{flex:1}
  .main{padding:28px 32px 40px}
}

/* cards and lists */
.card{background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);padding:16px;margin:0 0 12px}
.list{display:flex;flex-direction:column;gap:10px}
.item{display:block;background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);padding:14px 16px;text-decoration:none;color:inherit}
.item:active{background:#F7FAFE}
.row{display:flex;align-items:center;gap:10px}
.row .grow{flex:1;min-width:0}
.between{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.meta{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:14px;color:var(--mute);margin-top:4px}
.chip{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:999px;font-size:13px;font-weight:600;background:var(--blue-lt);color:var(--blue);white-space:nowrap}
.chip.green{background:var(--green-lt);color:var(--green)}
.chip.amber{background:var(--amber-lt);color:var(--amber)}
.chip.red{background:var(--red-lt);color:var(--red)}
.chip.grey{background:#EAF1FA;color:var(--ink2)}
.price{font-size:22px;font-weight:700}
.clip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pre{white-space:pre-wrap;word-break:break-word}
.empty{text-align:center;color:var(--mute);padding:32px 12px}
.spots{display:flex;gap:4px;margin-top:6px}
.spots i{width:22px;height:6px;border-radius:3px;background:var(--blue)}
.spots i.used{background:#C9D8EA}

/* forms */
label.f{display:block;margin:0 0 14px}
label.f>span{display:block;font-size:14px;font-weight:600;margin:0 0 6px;color:var(--ink2)}
input[type=text],input[type=email],input[type=password],input[type=tel],input[type=number],input[type=search],select,textarea{
  width:100%;padding:12px 14px;border:1px solid #C5D5E8;border-radius:12px;background:#fff;font-size:16px;outline:none}
input:focus,select:focus,textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(29,95,214,.15)}
textarea{min-height:110px;resize:vertical}
.check{display:flex;gap:10px;align-items:flex-start;margin:0 0 14px;font-size:15px}
.check input{width:20px;height:20px;margin:1px 0 0;flex:none}
.two{display:grid;grid-template-columns:1fr;gap:0 12px}
@media (min-width:600px){.two{grid-template-columns:1fr 1fr}}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:10px 18px;border-radius:12px;border:1px solid transparent;background:var(--blue);color:#fff;font-weight:600;cursor:pointer;text-decoration:none;font-size:16px}
.btn:hover{background:var(--blue-dk)}
.btn:disabled{opacity:.6;cursor:default}
.btn.ghost{background:#fff;color:var(--ink);border-color:#C5D5E8}
.btn.ghost:hover{background:#F5F9FD}
.btn.danger{background:#fff;color:var(--red);border-color:#F3C4C4}
.btn.green{background:var(--green)}
.btn.small{min-height:38px;padding:6px 12px;font-size:14px}
.btn.block{width:100%}
.btns{display:flex;flex-wrap:wrap;gap:10px}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:12px;border:0;background:transparent;color:var(--ink);cursor:pointer;text-decoration:none}
.icon-btn:hover{background:#EAF1FA}
.icon-btn svg{width:22px;height:22px}
.seg{display:flex;background:#E4EDF8;border-radius:12px;padding:4px;gap:4px;margin:0 0 14px;overflow-x:auto}
.seg button{flex:1;border:0;background:transparent;padding:8px 12px;border-radius:9px;font-weight:600;color:var(--ink2);cursor:pointer;white-space:nowrap;font-size:15px}
.seg button.on{background:#fff;color:var(--blue);box-shadow:var(--shadow)}
.err{background:var(--red-lt);color:var(--red);border-radius:12px;padding:10px 14px;margin:0 0 14px;font-size:15px}
.note{background:var(--blue-lt);color:#1E3A8A;border-radius:12px;padding:10px 14px;margin:0 0 14px;font-size:15px}
.ok{background:var(--green-lt);color:var(--green);border-radius:12px;padding:10px 14px;margin:0 0 14px;font-size:15px}
.choice{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 16px}
.choice button{border:2px solid var(--line);background:#fff;border-radius:14px;padding:14px 10px;text-align:center;cursor:pointer;font-weight:600}
.choice button svg{width:28px;height:28px;display:block;margin:0 auto 6px;color:var(--blue)}
.choice button.on{border-color:var(--blue);background:var(--blue-lt)}

/* auth */
.auth{max-width:440px;margin:0 auto;padding:28px 16px 40px}
.auth .logo{display:flex;align-items:center;gap:10px;font-weight:700;font-size:22px;margin:0 0 22px}
.auth .logo img{width:44px;height:44px;border-radius:11px}

.avatar{width:40px;height:40px;border-radius:50%;background:var(--blue-lt);color:var(--blue);display:flex;align-items:center;justify-content:center;font-weight:700;flex:none}
.toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%);background:var(--blue-dk);color:#fff;padding:10px 16px;border-radius:12px;z-index:50;font-size:15px;max-width:calc(100% - 32px)}
dialog{border:0;border-radius:16px;padding:20px;max-width:440px;width:calc(100% - 32px)}
dialog::backdrop{background:rgba(11,42,85,.45)}

/* big actions */
.big{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 16px}
.big a,.big button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:84px;border-radius:16px;background:var(--blue);color:#fff;font-weight:700;font-size:17px;text-decoration:none;border:0;cursor:pointer}
.big a.alt,.big button.alt{background:#fff;color:var(--ink);box-shadow:var(--shadow)}
.big svg{width:26px;height:26px}
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 16px}
@media (min-width:700px){.tiles{grid-template-columns:repeat(4,1fr)}}
.tile{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:14px;text-decoration:none;color:inherit;display:block}
.tile .n{font-size:24px;font-weight:800;line-height:1.15;margin-top:2px}
.tile .l{font-size:14px;color:var(--mute);font-weight:600}
.tile.warn .n{color:var(--red)}
.acts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0 0}
.acts a,.acts button{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px;border-radius:12px;background:var(--blue-lt);color:var(--blue);font-weight:700;font-size:14px;text-decoration:none;border:0;cursor:pointer}
.acts a.wa{background:#E7F8EE;color:#128C4A}
.acts svg{width:22px;height:22px}
.stages{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:12px 0 0}
.stages button{border:2px solid var(--line);background:#fff;border-radius:12px;padding:10px 2px;font-weight:700;font-size:14px;cursor:pointer;color:var(--ink2)}
.stages button.on{border-color:var(--blue);background:var(--blue);color:#fff}
/* quote lines */
.line{border:1px solid var(--line);border-radius:12px;padding:10px;margin:0 0 10px;background:#fff}
.line .lk{font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--blue);margin-bottom:6px;display:flex;justify-content:space-between;align-items:center}
.line .lk.mat{color:#9333EA}
.line .g{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-top:8px;align-items:end}
.line .g label{font-size:12px;color:var(--mute);font-weight:600}
.line .g .amt{font-weight:700;text-align:right;padding:12px 0}
.line input{padding:10px 12px}
.sum{display:grid;grid-template-columns:1fr auto;gap:4px 16px;font-size:15px}
.sum .t{font-weight:800;font-size:19px;border-top:1px solid var(--line);padding-top:6px;margin-top:4px}
.addl{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 14px}
.picker{position:relative}
.picks{position:absolute;left:0;right:0;top:100%;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 24px rgba(11,42,85,.12);z-index:30;max-height:260px;overflow:auto}
.picks button{display:block;width:100%;text-align:left;border:0;background:#fff;padding:12px 14px;cursor:pointer;border-bottom:1px solid #EEF4FB}
.picks button:hover{background:var(--blue-lt)}
.chosen{display:flex;align-items:center;gap:10px;background:var(--blue-lt);border-radius:12px;padding:10px 12px}
/* calendar */
.week{display:grid;grid-template-columns:1fr;gap:10px}
@media (min-width:900px){.week{grid-template-columns:repeat(7,1fr);gap:6px}}
.day{background:#fff;border-radius:12px;box-shadow:var(--shadow);padding:10px;min-height:70px}
.day.today{outline:2px solid var(--blue)}
.day.over{background:var(--blue-lt)}
.day h3{font-size:14px;color:var(--ink2);margin:0 0 6px}
.cj{display:block;background:var(--blue-lt);border-left:4px solid var(--blue);border-radius:8px;padding:6px 8px;margin:0 0 6px;font-size:14px;text-decoration:none;color:var(--ink);cursor:grab}
.cj.done{border-left-color:var(--green);background:var(--green-lt)}
.cj b{display:block;font-size:13px}
.stars{display:flex;gap:6px}
.stars button{font-size:32px;line-height:1;background:none;border:0;cursor:pointer;color:#C5D5E8;padding:0}
.stars button.on{color:#F59E0B}
.paper{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:20px}
.paper table{width:100%;border-collapse:collapse;font-size:15px}
.paper td,.paper th{padding:8px 4px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.paper th{font-size:13px;color:var(--mute)}
.paper .r{text-align:right;white-space:nowrap}
@media print{.noprint{display:none!important}body{background:#fff}.paper{box-shadow:none}}
.btn svg{width:20px;height:20px;flex:none}
/* chat */
.chat{display:flex;flex-direction:column;height:calc(100vh - 32px - 70px - env(safe-area-inset-bottom));min-height:360px}
@media (min-width:900px){.chat{height:calc(100vh - 68px)}}
.msgs{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:6px;padding:4px 2px 10px}
.msg{max-width:80%;align-self:flex-start;background:#fff;box-shadow:var(--shadow);border-radius:16px 16px 16px 4px;padding:8px 12px}
.msg.mine{align-self:flex-end;background:var(--blue);color:#fff;border-radius:16px 16px 4px 16px}
.msg .who{font-size:12px;font-weight:700;color:var(--blue);margin-bottom:2px}
.msg .at{font-size:11px;opacity:.7;margin-top:2px;text-align:right}
.mday{align-self:center;font-size:12px;color:var(--mute);margin:8px 0 2px}
.composer{display:flex;gap:8px;align-items:flex-end;padding-top:8px;border-top:1px solid var(--line)}
.composer textarea{min-height:46px;max-height:140px;flex:1;border-radius:22px;padding:11px 16px}
.composer .btn{border-radius:23px;width:46px;padding:0}
.cj small{display:block;color:var(--mute)}
.paper .between{flex-wrap:wrap}.paper .small{overflow-wrap:anywhere}@media (max-width:520px){.paper{padding:16px}.paper table{font-size:14px}}

.bell{position:fixed;top:10px;right:12px;z-index:25;width:44px;height:44px;border-radius:50%;background:#fff;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;color:var(--ink)}
.bell svg{width:22px;height:22px}.bell .badge{position:absolute;top:-2px;right:-2px}
@media (min-width:900px){.bell{top:18px;right:24px}}
.main .top{padding-right:52px}
.item.row > svg{width:26px;height:26px;flex:none;color:var(--blue)}

/* sticker sheet: A4, 3 x 7 labels of 63.5 x 38.1 mm */
.sheet{display:grid;grid-template-columns:repeat(3,63.5mm);grid-auto-rows:38.1mm;column-gap:2.5mm;background:#fff;padding:4mm;border-radius:12px;overflow-x:auto}
.lbl{display:flex;align-items:center;gap:2.5mm;padding:2.5mm;border:1px dashed #C5D5E8;border-radius:3mm;overflow:hidden;background:#fff;color:#0B2A55}
.lbl svg{width:31mm;height:31mm;flex:none}
.lt{display:flex;flex-direction:column;gap:.6mm;min-width:0;font-size:2.6mm;line-height:1.2}
.lt img{max-height:6mm;max-width:24mm;object-fit:contain;align-self:flex-start}
.lt b{font-size:3.1mm}.lt .ph{font-weight:700}.lt .ul{color:#5A7394}.lt em{font-style:normal;font-weight:800;color:#0B5CAD;font-size:2.4mm;margin-top:auto}
@media print{@page{size:A4;margin:15.1mm 7.2mm}.side,.tabs,.bell{display:none!important}.main{padding:0!important;max-width:none}.sheet{padding:0;border-radius:0;overflow:visible}.lbl{border-color:transparent}}

/* talk, don't type */
.micwrap{position:relative}.micwrap textarea{padding-right:52px}
.mic{position:absolute;right:8px;top:8px;width:38px;height:38px;border-radius:50%;border:0;background:var(--blue-lt);color:var(--blue);display:flex;align-items:center;justify-content:center;cursor:pointer}
.mic svg{width:20px;height:20px}.mic.on{background:#DC2626;color:#fff;animation:pulse 1.2s infinite}
.composer .micwrap{flex:1}.composer .mic{top:4px;right:4px}
@keyframes pulse{50%{box-shadow:0 0 0 8px rgba(220,38,38,.18)}}
.pics{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.pics img{width:96px;height:96px;object-fit:cover;border-radius:10px;display:block}
.signdlg{max-width:560px;width:calc(100% - 24px)}
.pad{display:block;width:100%;height:200px;border:2px dashed #9FB8D6;border-radius:12px;background:#fff;touch-action:none;cursor:crosshair}
.sigimg{display:block;max-width:100%;max-height:120px;border:1px solid var(--line,#DFE8F3);border-radius:10px;background:#fff}

/* choosing the design of quotes, invoices and reports */
.tpls{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tpls button{font:inherit;font-size:14px;font-weight:600;color:var(--ink);background:#fff;border:2px solid #DCE6F2;border-radius:12px;padding:10px 8px 8px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:6px}
.tpls button.on{border-color:var(--blue);box-shadow:0 0 0 3px #DCEBFA}
.mini{display:block;width:100%;max-width:96px;aspect-ratio:3/4;border:1px solid #DCE6F2;border-radius:6px;background:#fff;overflow:hidden;position:relative}
.mini b{display:block;height:8px;background:var(--blue)}.mini s{display:block;height:5px;margin:7px 8px 0;background:#DCE6F2;border-radius:3px}.mini s+s{width:60%}
.mini u{position:absolute;right:8px;bottom:10px;width:40%;height:8px;border-radius:3px;background:var(--blue)}
.mini.modern b{height:26px}.mini.minimal b{height:2px;margin:12px 8px 0;background:#0B2A55}.mini.minimal u{background:none;border-top:2px solid #0B2A55;height:0;border-radius:0}
