:root{color-scheme:light;--paper:#f5f7f7;--white:#fff;--ink:#172522;--muted:#586b64;--soft:#435a51;--line:#e1e8e5;--green:#106852;--green-dark:#0a503e;--mint:#e7f3ec;--pale:#f2f8f5;--amber:#8a5315;--amber-bg:#fff3da;--danger:#9a322c;--danger-bg:#fff0ed;--radius:15px;--shadow:0 2px 5px #1b433409;font-family:"Segoe UI",Arial,sans-serif;font-size:15px}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);line-height:1.45;min-width:320px}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
button:disabled{cursor:wait;opacity:.65}
a{color:var(--green)}
:focus-visible{outline:3px solid #709d29;outline-offset:3px}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(1.7rem,3.3vw,2.45rem);font-weight:720;line-height:1.13;letter-spacing:-.045em}
h2{font-size:1.21rem;font-weight:690;letter-spacing:-.022em}
h3{font-size:1rem;font-weight:690}
small,.small{font-size:.84rem}
.muted{color:var(--muted)}
.ico{width:18px;height:18px;display:inline-block;flex:none;vertical-align:middle}
.topbar{background:var(--white);border-bottom:1px solid var(--line);position:relative;z-index:2}
.topbar-inner{min-height:69px;max-width:1192px;padding:0 24px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-weight:750;letter-spacing:-.035em;font-size:1.13rem;white-space:nowrap}
.brand-dot{color:var(--green);padding:0 1px}
.top-actions,.inline,.row-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.top-actions{justify-content:flex-end}
.top-account{position:relative}
.top-account>summary{list-style:none}
.top-account>summary::-webkit-details-marker{display:none}
.account-menu{position:absolute;right:0;top:calc(100% + 7px);min-width:200px;padding:7px;background:white;border:1px solid var(--line);border-radius:12px;box-shadow:0 5px 18px #10261c15;display:grid;z-index:3}
.account-menu button{text-align:left;justify-content:flex-start}
.avatar{border-radius:50%;background:#e5efe8;color:var(--green-dark);display:grid;place-items:center;width:28px;height:28px;font-weight:700;font-size:.73rem;flex:none}
.demo-badge,.badge{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:6px;white-space:nowrap;font-size:.75rem;font-weight:660;line-height:1.2}
.demo-badge{color:#526146;background:#eff2e9}
.badge.ok{color:var(--green-dark);background:var(--mint)}
.badge.late,.badge.limited{color:#784707;background:var(--amber-bg)}
.badge.absent{color:var(--danger);background:var(--danger-bg)}
.badge.missed,.badge.paused,.badge.neutral{color:#4e625b;background:#eaf0ee}
.badge i,.live-dot{width:7px;height:7px;border-radius:50%;background:currentColor;display:inline-block;flex:none}
.wrap{max-width:1192px;margin:auto;padding:29px 24px 58px}
.surface{border:1px solid var(--line);border-radius:var(--radius);background:var(--white);box-shadow:var(--shadow)}
.station-hero{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:23px 27px;margin-bottom:18px;border:1px solid #dbe8e0;border-radius:var(--radius);background:#edf5f0;position:relative;overflow:hidden}
.station-hero::after{content:"";position:absolute;width:248px;height:248px;right:-96px;top:-130px;border:24px solid #e3efe7;border-radius:50%;pointer-events:none}
.station-hero>*{position:relative;z-index:1}
.station-name{display:flex;align-items:center;gap:14px;min-width:0}
.station-hero .label{margin-bottom:4px;color:#49665b}
.station-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:.85rem;color:var(--soft);margin-top:7px}
.station-meta .ico{width:15px;height:15px}
.station-meta .separator{color:#9bb1a6;margin:0 5px}
.station-selector{margin-bottom:12px;max-width:410px}
.connection{display:inline-flex;align-items:center;gap:7px;color:var(--green-dark);background:#f8fffa;border:1px solid #d9e9df;border-radius:8px;padding:6px 10px;font-size:.76rem;font-weight:650;white-space:nowrap}
.connection.offline{color:var(--amber);background:var(--amber-bg);border-color:#f0d9ac}
.label{font-size:.73rem;font-weight:750;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.section-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:15px 21px}
.section-title,.stack-title{display:flex;align-items:center;gap:10px}
.section-icon{display:grid;place-items:center;width:31px;height:31px;border-radius:8px;background:var(--mint);color:var(--green)}
.section-icon .ico{width:17px;height:17px}
.count{background:#edf1ef;color:var(--muted);font-size:.73rem;min-width:22px;text-align:center;padding:2px 5px;border-radius:5px;font-weight:690}
.history{margin-bottom:18px;overflow:hidden}
.history-grid{display:grid;align-items:center;grid-template-columns:.95fr .85fr 1fr 1.32fr 1.4fr 184px;column-gap:10px;padding:7px 21px;min-height:39px;border-top:1px solid #eef2f0;font-size:.84rem}
.history-grid.heading,.data-grid.heading{background:#f7f9f8;color:var(--muted);font-size:.73rem;font-weight:680;min-height:32px;border-top:1px solid var(--line)}
.history-grid strong{font-weight:690}
.slot-chip{font-variant-numeric:tabular-nums;color:#3f594e;font-weight:700}
.row-actions{gap:6px;justify-content:flex-end;flex-wrap:nowrap}
.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:37px;border:1px solid transparent;border-radius:8px;padding:7px 11px;font-weight:660;font-size:.84rem;line-height:1.2;background:transparent;color:var(--ink);text-decoration:none;cursor:pointer}
.button .ico{width:15px;height:15px}
.button.ghost{color:var(--soft)}
.button.ghost:hover,.button.neutral:hover{background:#eef4f0}
.button.neutral{background:white;border-color:#dce6e1;color:var(--green-dark)}
.button.small-button{font-size:.75rem;min-height:28px;padding:4px 6px;gap:4px}
.button.small-button .ico{width:13px;height:13px}
.button.primary{color:white;background:var(--green);border-color:var(--green);min-height:42px;padding:10px 15px}
.button.primary:hover{background:var(--green-dark)}
.button.danger{color:var(--danger)}
.button.active{color:var(--green-dark);background:var(--mint)}
.button.square{padding:7px;min-width:34px}
.plain-link{border:0;background:transparent;color:var(--green);font-weight:650;padding:2px 0;text-align:left;text-decoration:underline}
.report{padding:19px 21px 21px}
.report-heading{padding:0 0 15px;border-bottom:1px solid var(--line);margin-bottom:16px}
.report-heading h2{font-size:1.38rem}
.report-heading p{margin-top:2px}
.form-step{margin-bottom:20px}
.step-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:9px}
.step-head h3{font-size:.98rem}
.time-grid{display:grid;grid-template-columns:minmax(140px,1fr) minmax(118px,.8fr) minmax(180px,1fr);gap:12px;max-width:720px}
label.field,.field{display:grid;gap:5px;align-content:start;min-width:0;color:var(--soft);font-size:.79rem;font-weight:630}
input:not([type=checkbox]),select,textarea{width:100%;min-width:0;border:1px solid #d8e3dd;background:#fff;border-radius:8px;min-height:39px;padding:7px 9px;color:var(--ink);outline-offset:1px;font-weight:540;font-size:.88rem}
input::placeholder,textarea::placeholder{color:#667a71;opacity:1}
textarea{resize:vertical;min-height:65px}
input[readonly],select:disabled,input:disabled{background:#f2f6f3;color:var(--muted)}
input[type=checkbox]{width:16px;height:16px;accent-color:var(--green);margin:2px 0 0;flex:none}
.check{display:flex;align-items:flex-start;gap:8px;font-size:.81rem;color:var(--soft)}
.controls{display:inline-flex;align-items:center;gap:3px;padding:3px;border:1px solid var(--line);background:#f6f9f7;border-radius:9px}
.controls button{min-width:57px;border:0}
.data-table{border:1px solid var(--line);border-radius:10px;overflow:hidden}
.data-grid{display:grid;align-items:center;grid-template-columns:1fr 1.56fr .82fr 1fr;gap:10px;padding:7px 12px;border-top:1px solid #edf1ef;font-size:.85rem}
.data-grid:first-child{border:0}
.data-grid .full{grid-column:1/-1}
.data-grid.fuel-line>*{min-width:0}
.fuel-id{display:flex;align-items:center;gap:8px;font-size:.86rem}
.fuel-symbol{display:grid;place-items:center;width:27px;height:27px;border-radius:7px;background:#eaf3ed;color:var(--green-dark)}
.fuel-symbol .ico{width:15px;height:15px}
.fuel-symbol.diesel{background:#e9eff5;color:#3c5879}
.fuel-symbol.gas{background:#fff3df;color:#885316}
.fuel-line .field>span:first-child{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
.fuel-extra{grid-column:2/-1;display:grid;gap:7px}
.unit-field{display:flex;align-items:center;position:relative}
.unit-field input{padding-right:41px}
.unit-field .unit{position:absolute;right:9px;color:#4c6359;font-weight:620;pointer-events:none}
.fuel-line input,.fuel-line select{min-height:35px}
.rule-list{display:grid;gap:9px;margin:12px 0}
.rule-card{padding:12px;background:#f8faf9;border:1px solid var(--line);border-radius:10px}
.rule-options,.two-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.rule-options{margin:10px 0}
.rule-options .full,.two-cols .full{grid-column:1/-1}
.report-footer{display:flex;align-items:center;justify-content:space-between;gap:11px;border-top:1px solid var(--line);padding-top:14px;margin-top:15px}
.report-footer .message{max-width:75%}
.notice{padding:9px 11px;margin-bottom:12px;border-radius:8px;background:var(--mint);color:var(--green-dark);font-size:.84rem}
.notice.warn{background:var(--amber-bg);color:var(--amber)}
.notice.error{background:var(--danger-bg);color:var(--danger)}
.notice:empty{display:none}
.field-error{display:block;font-size:.74rem;color:var(--danger);font-weight:630}
.field-error:empty{display:none}
.field-error.warning{color:var(--amber)}
[aria-invalid=true]{border-color:#bf5a50!important}
.help,.empty{padding:10px 0;color:var(--muted);font-size:.85rem}
.history .empty{padding:8px 21px 18px}
.modal-content{padding:20px;display:grid;gap:13px}
dialog{border:1px solid var(--line);border-radius:15px;padding:0;width:min(690px,calc(100% - 24px));max-height:calc(100% - 28px);color:var(--ink);box-shadow:0 20px 60px #13281c30}
dialog::backdrop{background:#12291d68}
dialog form{display:grid;gap:10px}
.modal-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.modal-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.detail-meta{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px;background:#f4f8f6;border-radius:9px;font-size:.86rem}
.detail-meta b{display:block;margin-top:2px}
.rule-summary{margin:0;padding-left:19px}
.rule-summary li{margin:3px 0}
.toast{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);background:#143f33;color:#fff;z-index:5;border-radius:9px;padding:10px 15px;max-width:calc(100vw - 25px);width:max-content;font-size:.85rem;box-shadow:0 3px 15px #15352933}
.toast:empty{display:none}
.login{width:min(470px,100%);margin:clamp(20px,8vh,80px) auto 0;padding:23px;display:grid;gap:13px}
.login form{display:grid;gap:10px}
.demo-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.loading{padding:25px;text-align:center;color:var(--muted)}
.admin-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.admin-title p{margin-top:6px}
.admin-tabs{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:12px}
.admin-tabs .button{min-height:38px}
.filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;padding:13px;margin-bottom:14px}
.filters .filter-actions{grid-column:1/-1}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.metric{padding:14px;min-height:82px;display:grid;gap:4px;font-size:.84rem;color:var(--muted)}
.metric strong{font-size:1.65rem;line-height:1.1;color:var(--green-dark)}
.admin-panel{padding:13px;margin-bottom:12px}
.admin-panel .section-head{padding:0 0 10px}
.records{display:grid}
.record{min-width:0;display:grid;grid-template-columns:1.5fr 1fr 1fr 1fr auto;align-items:center;gap:9px;padding:8px 7px;border-top:1px solid var(--line);font-size:.82rem}
.record>.button{justify-self:end}
.record strong,.record small{display:block}
.record small{color:var(--muted);font-size:.73rem}
.record>div{min-width:0;overflow-wrap:anywhere}
.map-layout{display:grid;grid-template-columns:1.6fr 1fr;gap:12px}
.map-canvas{border:1px solid #d9e7de;border-radius:10px;background:#eaf3ee;width:100%;height:auto;display:block}
.map-grid{stroke:#ccdcd2;stroke-width:1}
.map-label{font-size:12px;fill:var(--ink);paint-order:stroke;stroke:#edf5ef;stroke-width:3px}
.map-point{cursor:pointer}
.map-point circle{stroke:white;stroke-width:3;fill:#81948b}
.map-point.available circle{fill:#17765c}
.map-point.limited circle,.map-point.paused circle{fill:#bc7f27}
.map-point.absent circle{fill:#b34b41}
.member-line{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:6px 0;border-top:1px solid var(--line)}
.member-line p{font-size:.82rem;color:var(--muted)}
.audit-text{white-space:pre-wrap;overflow-wrap:anywhere;padding:9px;background:#f4f8f6;border-radius:7px;margin:0;font-size:.77rem}
@media(max-width:850px){
  .history-grid{grid-template-columns:.9fr .64fr .71fr 1.05fr 1fr 165px;padding-left:13px;padding-right:13px;gap:7px}
  .history-grid .badge{white-space:normal}
  .filters{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:650px){
  body{font-size:14px}
  .topbar-inner{min-height:57px;padding:0 12px;gap:5px}
  .brand{gap:6px;font-size:1rem}
  .brand img{width:30px;height:30px}
  .top-actions{gap:4px}
  .top-account>summary .account-name{display:none}
  .wrap{padding:13px 10px 35px}
  .station-hero{padding:13px 12px;gap:7px;margin-bottom:10px;align-items:flex-start}
  .station-hero h1{font-size:1.55rem}
  .station-meta{font-size:.76rem;gap:4px;margin-top:5px}
  .station-meta .separator{margin:0 2px}
  .connection{font-size:.67rem;padding:4px 5px;gap:4px}
  .history{margin-bottom:10px}
  .section-head{padding:10px 11px}
  .section-icon{width:27px;height:27px}
  .history-grid.heading,.data-grid.heading{display:none}
  .history-grid{grid-template-columns:auto auto 1fr;grid-template-areas:"date slot status" "send author actions";gap:2px 8px;padding:5px 10px;min-height:0}
  .history-grid .history-date{grid-area:date}
  .history-grid .history-slot{grid-area:slot}
  .history-grid .history-sent{grid-area:send}
  .history-grid .history-author{grid-area:author;align-self:center}
  .history-grid .history-status{grid-area:status;justify-self:end}
  .history-grid .row-actions{grid-area:actions;gap:2px}
  .history-grid .button.small-button{padding:4px 3px;font-size:.71rem;min-height:26px}
  .history-grid .button.small-button .ico{display:none}
  .history-author,.history-sent{font-size:.73rem}
  .report{padding:12px 10px}
  .report-heading{padding:0 0 10px;margin-bottom:11px}
  .report-heading h2{font-size:1.28rem}
  .form-step{margin-bottom:14px}
  .time-grid{grid-template-columns:1.04fr .83fr .9fr;gap:6px}
  .field{min-width:0}
  .time-grid input,.time-grid select{padding:6px 4px}
  .time-grid input[type=date],.time-grid input[type=time]{font-size:.78rem}
  .data-table{overflow:visible;border:none;display:grid;gap:7px}
  .data-table .data-grid{border:1px solid var(--line);border-radius:9px}
  .data-grid.fuel-line{grid-template-columns:1.2fr 1fr 1fr;grid-template-areas:"fuel fuel fuel" "availability price stock" "extra extra extra";gap:4px 5px;padding:7px}
  .fuel-line .fuel-id{grid-area:fuel}
  .fuel-line .fuel-a{grid-area:availability}
  .fuel-line .fuel-p{grid-area:price}
  .fuel-line .fuel-s{grid-area:stock}
  .fuel-line .fuel-extra{grid-area:extra}
  .fuel-line .field>span:first-child{position:static;width:auto;height:auto;clip-path:none}
  .fuel-line .field{gap:3px;font-size:.73rem}
  .fuel-line input,.fuel-line select{padding-left:5px;font-size:.8rem}
  .unit-field input{padding-right:27px}
  .unit-field .unit{right:5px;font-size:.68rem}
  .fuel-line .fuel-symbol{width:22px;height:22px}
  .fuel-line .fuel-symbol .ico{width:12px;height:12px}
  .detail-table .data-grid{grid-template-columns:1fr 1.35fr .65fr .75fr;gap:5px;padding:6px;font-size:.76rem}
  .report-footer{flex-wrap:wrap}
  .report-footer .message{max-width:none;width:100%}
  .report-footer>.button{width:100%}
  .modal-content{padding:12px}
  .admin-title{align-items:flex-start}
  .admin-title h1{font-size:1.45rem}
  .filters,.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .map-layout{grid-template-columns:1fr}
  .record{grid-template-columns:1fr 1fr;gap:5px}
  .record>.button{justify-self:start}
}
@media(max-width:365px){
  .station-hero .connection{position:absolute;right:9px;top:8px}
  .station-hero .label{padding-right:70px}
  .demo-badge{font-size:.65rem}
}
@media print{
  body{background:white;color:#111}
  .topbar,.no-print,.toast,.admin-tabs,.filters,dialog,.button{display:none!important}
  .wrap{padding:0;max-width:none}
  .surface{box-shadow:none}
  .record{break-inside:avoid}
  .record strong{font-size:10pt}
}
