:root{font-family:Inter,"Segoe UI",Arial,sans-serif;color:#26352f;background:#f6f8f7;font-synthesis:none;--green:#257957;--border:#e4e9e6;--muted:#7d8882}
*{box-sizing:border-box}
body{margin:0;min-width:320px}
button,input{font:inherit}
button,a,input{-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
button:disabled{cursor:default;opacity:.45}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.topbar{height:80px;background:#fff;border-bottom:1px solid var(--border)}
.topbar-inner{max-width:1144px;height:100%;padding:0 32px;margin:auto;display:flex;align-items:center;justify-content:flex-end}
.workspace-label{font-size:12px;color:var(--muted)}
.workspace{max-width:1144px;padding:51px 32px 64px;margin:auto}
h1{font-size:34px;letter-spacing:-1px;font-weight:650;line-height:1.2;margin:0 0 12px}
.page-heading{margin-bottom:32px}
.card{background:white;border:1px solid var(--border);border-radius:13px;box-shadow:0 3px 6px #233b2d02}
.crm-card{padding:23px 26px 21px;margin-bottom:26px}
.crm-heading,.section-title,.api-controls,.table-toolbar{display:flex;align-items:center}
.crm-heading{justify-content:space-between;gap:15px;margin-bottom:20px}
.section-title{gap:10px}
h2{font-size:15px;font-weight:650;margin:0;line-height:1.4}
.soft-icon{display:grid;place-items:center;width:30px;height:30px;background:#edf5f0;color:var(--green);border-radius:7px}
.soft-icon svg{width:17px;height:17px}
.status{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:11px;color:#7a817c;background:#f4f5f4;padding:6px 9px;border-radius:5px}
.status span{width:5px;height:5px;background:#a1aaa4;border-radius:50%}
label{display:block;font-size:12px;font-weight:600;margin-bottom:8px}
.api-controls{gap:10px}
.key-input{position:relative;flex:1;min-width:0}
.key-input>svg{position:absolute;left:13px;top:13px;width:17px;height:17px;color:#99a29c;pointer-events:none}
input{height:43px;border:1px solid #dfe5e1;background:white;border-radius:7px;padding:0 12px;color:#26352f;width:100%;min-width:0;font-size:13px;outline:none;transition:border-color .15s,box-shadow .15s}
#api-key{padding-left:40px}
input::placeholder{color:#a0a8a3}
input:focus{border-color:#499676;box-shadow:0 0 0 3px #25795713}
.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;border:1px solid transparent;border-radius:7px;padding:0 17px;font-size:12px;font-weight:600;white-space:nowrap;transition:background .15s,box-shadow .15s}
.button svg{width:16px;height:16px}
.primary{background:var(--green);color:white}
.primary:hover:enabled{background:#1c6447}
.secondary{color:var(--green);background:white;border-color:#d8e5dd}
.secondary:hover:enabled{background:#f1f7f3}
.field-hint{font-size:11px;line-height:1.5;color:#939c96;margin:10px 0 0}
.table-toolbar{justify-content:space-between;padding:23px 26px;gap:15px}
.count{display:grid;place-items:center;background:#f0f3f1;color:#7a857f;min-width:24px;height:23px;padding:0 6px;border-radius:6px;font-size:11px;font-weight:600}
.table-scroll{overflow-x:auto}
table{width:100%;border-collapse:collapse;table-layout:fixed;min-width:650px}
th{height:47px;padding:12px 26px;text-align:left;font-weight:500;font-size:11px;color:#7d8781;background:#f8faf9;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.quantity-column{width:145px}
.price-column{width:215px}
.actions-column{width:110px;padding-left:10px;padding-right:20px}
td{padding:17px 26px;border-bottom:1px solid #edf0ee;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
td:nth-child(2),td:nth-child(3){font-variant-numeric:tabular-nums}
td:nth-child(3){white-space:nowrap}
td:last-child{padding:12px 18px 12px 6px}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:#fcfdfc}
.row-actions{display:flex;gap:5px;justify-content:flex-end}
.icon-button{border:1px solid transparent;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;color:#8a958e;background:transparent;flex-shrink:0}
.icon-button svg{width:16px;height:16px}
.icon-button:hover:enabled{color:var(--green);background:#edf5ef}
.icon-button.danger:hover:enabled{color:#c34f47;background:#fff0ed}
.icon-button.save{color:var(--green);background:#e7f2eb}
.icon-button.save:hover{background:#d4e8dc}
.editing-row{background:#f6faf7!important}
.editing-row td{padding-top:13px;padding-bottom:13px}
.editing-row td:first-child{padding-right:5px}
.editing-row td:nth-child(2){padding-left:10px;padding-right:5px}
.editing-row td:nth-child(3){padding-left:10px;padding-right:14px}
.editing-row input{height:38px;font-size:12px}
.empty-state{text-align:center;padding:46px 20px 48px}
.empty-icon{position:relative;display:grid;place-items:center;width:54px;height:54px;border-radius:15px;background:#f0f5f2;color:#7ca78e;margin:0 auto 18px}
.empty-icon>svg{width:27px;height:27px;stroke-width:1.4}
.empty-icon>span{position:absolute;right:-4px;bottom:-2px;border:3px solid white;border-radius:50%;background:#dfeee4;color:var(--green);width:24px;height:24px;line-height:17px;font-size:17px}
h3{font-size:15px;font-weight:600;margin:0 0 9px}
.empty-state p{font-size:12px;color:#929b95;margin:0 0 22px;line-height:1.6}
.empty-state .button{min-height:37px;font-size:11px;padding:0 12px}
.table-summary{border-top:1px solid var(--border);background:#fcfdfc;display:flex;align-items:center;justify-content:space-between;padding:20px 26px;border-radius:0 0 13px 13px;font-size:11px;color:#88928b;gap:20px}
.table-summary>div{display:flex;align-items:center;gap:24px;color:#707e74;font-size:12px}
#total-price{font-size:20px;font-weight:650;color:#293e32;letter-spacing:-.3px;font-variant-numeric:tabular-nums}
.table-notes{display:flex;justify-content:space-between;gap:15px;margin:16px 3px 0}
.table-notes p{display:flex;align-items:center;gap:6px;font-size:10px;line-height:1.6;color:#97a099;margin:0}
.table-notes svg{width:13px;height:13px;color:#79a78b}
.actions-hint span{margin:0 4px;color:#bdc5bf}
.toast{position:fixed;bottom:26px;right:26px;max-width:460px;width:calc(100% - 40px);display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #f0d6d2;border-radius:11px;padding:16px 12px 16px 18px;box-shadow:0 8px 40px #303b3321;z-index:5}
.toast p{flex:1;font-size:13px;line-height:1.6;margin:0;color:#823f38}
.toast-icon{border:1.5px solid #c56f64;color:#b9584d;border-radius:50%;height:21px;width:21px;font-size:14px;font-weight:600;text-align:center;line-height:18px;flex-shrink:0}
.toast .icon-button{align-self:flex-start}
[hidden]{display:none!important}
:focus-visible{outline:3px solid #76b498;outline-offset:3px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.noscript{margin:30px;text-align:center;color:#a23a30}
.print-actions{display:flex;justify-content:flex-end;margin-top:24px}
.print-document{display:none}
@media(min-width:1450px){.workspace{padding-top:68px}}
@media(max-width:700px){.topbar{height:66px}.topbar-inner{padding:0 20px}.workspace{padding:32px 16px 40px}h1{font-size:29px}.page-heading{margin-bottom:25px}.crm-card{padding:20px;margin-bottom:20px}.crm-heading{align-items:flex-start;gap:8px}.crm-heading .section-title{gap:7px}.crm-heading h2{font-size:13px}.soft-icon{width:25px;height:25px}.status{font-size:9px;padding:6px}.table-toolbar{padding:20px}.table-toolbar .button{padding:0 12px;font-size:11px}.table-notes{flex-direction:column;gap:8px}.workspace-label{font-size:10px}.table-summary{padding:18px 20px}.toast{bottom:20px;right:20px}.intro{font-size:12px}.api-controls .button{padding:0 12px}.api-controls .button svg{display:none}.empty-state{padding:39px 16px}.key-input input{font-size:11px}.field-hint{font-size:10px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
@page{size:A4;margin:0 18mm}
@media print{
  :root{font-family:Arial,sans-serif;color:#000;background:#fff}
  body{min-width:0;margin:0}
  body>*{display:none!important}
  body>.print-document{display:block!important;padding:18mm 0}
  .print-document h1{text-align:center;font-size:18pt;font-weight:700;letter-spacing:0;margin:0 0 12mm}
  .print-table{width:100%;min-width:0;table-layout:fixed;border-collapse:collapse}
  .print-table thead{display:table-header-group}
  .print-table tr{break-inside:avoid}
  .print-table th,.print-table td{height:auto;padding:3mm;border:1px solid #000;background:#fff;color:#000;font-size:10pt;line-height:1.45;white-space:normal;overflow-wrap:anywhere}
  .print-table th{font-weight:700}
  .print-table th:first-child{width:52%}
  .print-table .print-quantity{width:18%}
  .print-table .print-price{width:30%}
  .print-table tbody tr:last-child td{border-bottom:1px solid #000}
  .print-total{text-align:right;font-size:11pt;margin:5mm 0 10mm;break-inside:avoid}
  .print-closing{break-inside:avoid;font-size:11pt;line-height:1.6}
  .print-closing>p{margin:0}
  .print-signatures{display:flex;justify-content:space-between;gap:12mm;margin-top:22mm}
  .print-signatures p{display:flex;align-items:baseline;gap:3mm;margin:0}
  .signature-line{display:inline-block;width:38mm;border-bottom:1px solid #000}
}
