/* MotorDoktor · wygląd A „Jasny i spokojny” (md-theme-a v1, 2026-11-17).
   Tylko wygląd: wszystkie reguły działają pod klasą .md-theme-a (dodaje ją theme-a.js).
   Wyłączenie: usunąć <link theme-a.css> i <script theme-a.js> z index.php. */

.md-theme-a{
  --a-bg:#F4F6F9; --a-surface:#FFFFFF; --a-line:#E3E7ED; --a-line-strong:#D5DCE3;
  --a-ink:#17263B; --a-muted:#5B6573; --a-accent:#F5A400; --a-accent-soft:#FFF4DB;
  --a-green:#1F7A4D; --a-green-soft:#E6F4EC; --a-red:#B3261E; --a-red-soft:#FDE8E7;
  --a-amber-ink:#7A5200; --a-blue:#1D527A; --a-blue-soft:#E9F1FB;
  --a-radius:16px; --a-radius-s:12px; --a-side:248px; --a-head:68px;
}
.md-theme-a,.md-theme-a body{background:var(--a-bg)!important;color:var(--a-ink)}
.md-theme-a :root,.md-theme-a body{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Inter,Roboto,sans-serif}
.md-theme-a body{-webkit-font-smoothing:antialiased}

/* ---------- Nagłówek ---------- */
.md-theme-a body header{height:var(--a-head)!important;background:var(--a-surface)!important;border-bottom:1px solid var(--a-line)!important;padding:0 20px!important;gap:12px;justify-content:flex-start!important;box-shadow:none}
.md-theme-a body header .logo{width:150px;max-width:42%;height:auto}
.md-theme-a body header>span{margin-left:auto;font-size:13px;font-weight:600;color:var(--a-muted);background:var(--a-bg);border:1px solid var(--a-line);border-radius:999px;padding:6px 12px}
.md-theme-a body header #md-refresh-page,.md-theme-a body header #header-refresh{order:3;width:44px;height:44px;min-height:44px;padding:0;margin:0!important;border:1px solid var(--a-line-strong);border-radius:var(--a-radius-s);background:var(--a-surface);color:var(--a-ink);font-size:22px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.md-theme-a body header #md-refresh-page:hover,.md-theme-a body header #header-refresh:hover{background:var(--a-bg)}

/* ---------- Treść ---------- */
.md-theme-a main{max-width:1180px!important;margin:0 auto;padding:24px 20px 110px!important}
.md-theme-a h1,.md-theme-a #title{font-size:26px;font-weight:700;letter-spacing:-.01em;margin:4px 0 12px;color:var(--a-ink)}
.md-theme-a h2{font-size:20px;font-weight:700;color:var(--a-ink)}
.md-theme-a h3{font-size:17px;font-weight:700}
.md-theme-a .muted,.md-theme-a #connection{color:var(--a-muted)}
.md-theme-a #connection{font-size:12px;margin-bottom:8px}

/* Przyciski i pola */
.md-theme-a button{border-radius:var(--a-radius-s);border:1px solid var(--a-line-strong);background:var(--a-surface);color:var(--a-ink);min-height:44px;font-weight:600;transition:background .12s,border-color .12s}
.md-theme-a button:hover{filter:none;background:#F8FAFC}
.md-theme-a .toolbar button,.md-theme-a .card-footer button,.md-theme-a .office-primary,.md-theme-a #approve,.md-theme-a #create-form>button,.md-theme-a #alt-create-form>button[type=submit]{background:var(--a-ink)!important;color:#fff!important;border-color:var(--a-ink)!important}
.md-theme-a .toolbar button:hover,.md-theme-a .card-footer button:hover,.md-theme-a .office-primary:hover{background:#0B1524!important}
.md-theme-a input,.md-theme-a select,.md-theme-a textarea{border:1px solid var(--a-line-strong);border-radius:var(--a-radius-s);background:var(--a-surface);color:var(--a-ink);min-height:44px}
.md-theme-a input:focus,.md-theme-a select:focus,.md-theme-a textarea:focus{outline:3px solid #F5A40055;border-color:var(--a-accent)}
.md-theme-a button:focus-visible,.md-theme-a a:focus-visible{outline:3px solid var(--a-accent);outline-offset:2px}
.md-theme-a #search,.md-theme-a #office-search{min-height:48px;border-radius:var(--a-radius-s);padding-left:42px;background:var(--a-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235B6573' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 14px center}

.md-theme-a input[type=checkbox],.md-theme-a input[type=radio]{width:22px!important;height:22px!important;min-height:22px!important;padding:0;flex:0 0 22px;accent-color:var(--a-ink)}
.md-theme-a #login-form label:has(input[type=checkbox]){display:flex;align-items:center;gap:10px;font-weight:500}

/* Filtry warsztatu jako „pigułki” */
.md-theme-a #filters{gap:8px;margin:14px 0 18px}
.md-theme-a #filters button{min-height:40px;padding:8px 16px;border-radius:999px;font-size:14px;font-weight:600;white-space:nowrap}
.md-theme-a #filters button.active{background:var(--a-ink);color:#fff;border-color:var(--a-ink)}

/* ---------- Karty (warsztat, stary silnik) ---------- */
.md-theme-a #cards{gap:12px}
.md-theme-a .card{background:var(--a-surface)!important;border:1px solid var(--a-line)!important;border-left:6px solid #9AA6B5!important;border-radius:var(--a-radius)!important;box-shadow:0 1px 2px #17263B0A;overflow:hidden}
.md-theme-a .card.dispatch{border-left-color:var(--a-accent)!important}
.md-theme-a .card.pickup{border-left-color:var(--a-blue)!important}
.md-theme-a .card.md-ready-card{border:1px solid var(--a-line)!important;border-left:6px solid var(--a-green)!important}
.md-theme-a .card.md-alt-review-card{border:1px solid var(--a-line)!important;border-left:6px solid var(--a-red)!important;box-shadow:0 1px 2px #17263B0A!important}
.md-theme-a .card-main{padding:16px 18px}
.md-theme-a .card h2{font-size:19px;margin:0 0 4px}
.md-theme-a .number{font-size:14px;font-weight:600;color:var(--a-ink)}
.md-theme-a .tag{background:var(--a-bg);border:1px solid var(--a-line);border-radius:8px;padding:4px 9px;font-size:13px;color:var(--a-ink)}
.md-theme-a .extras{font-weight:600;font-size:14px;color:var(--a-muted)}
.md-theme-a .card-footer{padding:12px 16px;border-top:1px solid var(--a-line);background:#FBFCFD}
/* Paski NOWE / GOTOWY jako delikatne etykiety */
.md-theme-a .new-alert,.md-theme-a .ready-alert{display:flex;align-items:center;gap:8px;padding:9px 18px;font-size:13px;font-weight:700;letter-spacing:.02em}
.md-theme-a .new-alert{background:var(--a-red-soft);color:var(--a-red)}
.md-theme-a .ready-alert{background:var(--a-green-soft);color:var(--a-green)}
.md-theme-a .new-alert b,.md-theme-a .ready-alert b{font-size:15px;margin:0}
.md-theme-a .new-alert small,.md-theme-a .ready-alert small{display:inline;margin:0 0 0 6px;font-weight:500;font-size:12px;opacity:.85}
.md-theme-a .error{background:var(--a-red-soft);color:var(--a-red);border:1px solid #F3C4C0;border-radius:var(--a-radius-s)}
.md-theme-a .review{background:var(--a-accent-soft);color:var(--a-amber-ink);border:1px solid #F1D48A;border-radius:var(--a-radius-s)}
.md-theme-a .md-engine-approval{border-radius:var(--a-radius-s)}
.md-theme-a .md-workflow-progress{background:var(--a-surface);border:1px solid var(--a-line);border-radius:var(--a-radius)}
.md-theme-a .md-workflow-progress li{background:var(--a-bg);border-radius:10px}
.md-theme-a .md-workflow-progress li[aria-current=step]{background:var(--a-ink)}
.md-theme-a .camera{background:var(--a-ink);border-radius:var(--a-radius-s)}
.md-theme-a .actions button{background:var(--a-ink);color:#fff;border-color:var(--a-ink)}

/* ---------- Biuro: kafle kategorii (Wysyłki / Altteil / Kaucje) ---------- */
.md-theme-a #md-queue-tabs{gap:12px;margin:4px 0 20px}
.md-theme-a #md-queue-tabs button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;text-align:left;min-height:76px;padding:14px 16px;border:1px solid var(--a-line);border-radius:var(--a-radius);background:var(--a-surface);color:var(--a-muted);font-size:13px;font-weight:600;box-shadow:none}
.md-theme-a #md-queue-tabs button span{order:2;margin:0;padding:0;background:transparent!important;color:var(--a-ink)!important;font-size:26px;font-weight:700;line-height:1}
.md-theme-a #md-queue-tabs button.active{background:var(--a-accent-soft);border-color:#F1D48A;color:var(--a-ink);box-shadow:inset 0 -3px 0 var(--a-accent)}

/* Kolejki: wspólny wygląd listy */
.md-theme-a #md-dispatch-queue,.md-theme-a .md-alt-review-queue,.md-theme-a #md-alt-review-queue,.md-theme-a .md-alt-transfer-queue,.md-theme-a #md-alt-deposit-queue{padding:0;border:0;background:transparent;margin:0 0 24px}
.md-theme-a #md-dispatch-queue>h2,.md-theme-a #md-alt-review-queue>h2,.md-theme-a #md-alt-deposit-queue>h2{font-size:18px;color:var(--a-ink)!important;margin:0 0 10px}
.md-theme-a #md-dispatch-queue,.md-theme-a #md-alt-review-queue,.md-theme-a #md-alt-deposit-queue{display:grid;gap:10px}
.md-theme-a #md-dispatch-queue>p,.md-theme-a #md-alt-review-queue>p,.md-theme-a #md-alt-deposit-queue>p{margin:0}

.md-theme-a .md-dispatch-card,.md-theme-a .md-alt-review-queue-card,.md-theme-a .md-alt-transfer-card{margin:0;background:var(--a-surface);border:1px solid var(--a-line)!important;border-left:6px solid var(--a-green)!important;border-radius:var(--a-radius);box-shadow:0 1px 2px #17263B0A;overflow:hidden}
.md-theme-a .md-alt-review-queue-card{border-left-color:var(--a-red)!important}
.md-theme-a .md-alt-transfer-card{border-left-color:var(--a-accent)!important}
.md-theme-a .md-dispatch-card-head,.md-theme-a .md-alt-review-queue-head,.md-theme-a .md-alt-transfer-head{display:inline-block;margin:16px 18px 0;padding:3px 10px;border-radius:8px;font-size:12px;font-weight:700;letter-spacing:.02em}
.md-theme-a .md-dispatch-card-head{background:var(--a-green-soft);color:var(--a-green)}
.md-theme-a .md-alt-review-queue-head{background:var(--a-red-soft);color:var(--a-red)}
.md-theme-a .md-alt-transfer-head{background:var(--a-accent-soft);color:var(--a-amber-ink)}
.md-theme-a .md-dispatch-card-body,.md-theme-a .md-alt-review-queue-body,.md-theme-a .md-alt-transfer-body{padding:8px 18px 16px}
.md-theme-a .md-dispatch-card-body h3,.md-theme-a .md-alt-review-queue-body h3,.md-theme-a .md-alt-transfer-body h3{font-size:19px;margin:4px 0 2px}
.md-theme-a .md-dispatch-card-body>strong,.md-theme-a .md-alt-review-queue-body>strong{font-size:14px}
.md-theme-a .md-dispatch-card-body p,.md-theme-a .md-alt-review-queue-body p,.md-theme-a .md-alt-transfer-body p{margin:6px 0;font-size:14px;color:#3B4552}
.md-theme-a .md-dispatch-address{background:var(--a-bg);border:1px solid var(--a-line);border-radius:var(--a-radius-s);padding:10px 12px;font-size:14px}
.md-theme-a .md-dispatch-address p{margin:4px 0}
.md-theme-a .md-dispatch-ready,.md-theme-a .md-dispatch-card .md-dispatch-ready{background:var(--a-surface)!important;color:var(--a-ink)!important;border:1px solid var(--a-ink)!important;border-radius:var(--a-radius-s);padding:12px 16px;font-weight:600;text-align:center;margin:10px 0 0}
.md-theme-a .md-alt-review-open{background:var(--a-red);border-radius:var(--a-radius-s);min-height:44px;padding:10px 16px}

/* Cargoboard */
.md-theme-a .md-cb-links{margin:12px 0 0}
.md-theme-a .md-cb-link,.md-theme-a .md-cb-api{background:var(--a-ink)!important;color:#fff!important;border:1px solid var(--a-ink)!important;border-radius:var(--a-radius-s);min-height:44px;padding:8px 16px;font-weight:600;gap:10px}
.md-theme-a .md-cb-link img{width:22px;height:22px;border-radius:6px;background:#fff;padding:2px;box-sizing:border-box}
.md-theme-a .md-cb-link.md-cb-ret{background:var(--a-surface)!important;color:var(--a-ink)!important;border-color:var(--a-line-strong)!important}

/* ---------- Biuro: zamówienia ---------- */
.md-theme-a .office-order-grid{gap:12px}
.md-theme-a #office-panel .office-order-card{border:1px solid var(--a-line)!important;border-top:1px solid var(--a-line)!important;border-left:6px solid var(--a-blue)!important;border-radius:var(--a-radius)!important;box-shadow:0 1px 2px #17263B0A!important;padding:16px 18px}
.md-theme-a .office-card-top strong,.md-theme-a .office-card-bottom strong{color:var(--a-ink)}
.md-theme-a .office-card-title{font-size:17px;margin:10px 0 4px}
.md-theme-a .office-card-customer{color:var(--a-muted)}
.md-theme-a #office-panel .office-inline-status{border-radius:10px}
.md-theme-a .office-card-bottom{border-top:1px solid var(--a-line)}
.md-theme-a #office-panel .md-order-actions .office-card-link{color:var(--a-ink);font-weight:600}
.md-theme-a #office-filter-details{border:1px solid var(--a-line);border-radius:var(--a-radius)}
.md-theme-a .office-empty{border:1px dashed var(--a-line-strong);border-radius:var(--a-radius)}
/* Telefon: zielony kwadrat po prawej */
.md-theme-a .md-phone-direct{background:var(--a-green);color:#fff;border:0;border-radius:var(--a-radius-s);width:48px;height:48px;font-size:22px}
.md-theme-a .md-phone-direct:active{background:#16603C}
.md-theme-a .md-phone-unavailable,.md-theme-a .md-phone-loading{width:48px;height:48px;border-radius:var(--a-radius-s);font-size:22px}

/* ---------- Okna ---------- */
.md-theme-a dialog{border-radius:20px;border:0;box-shadow:0 24px 64px #17263B33;color:var(--a-ink)}
.md-theme-a dialog::backdrop{background:#17263B80;backdrop-filter:blur(2px)}
.md-theme-a .dialog-head{border-bottom:1px solid var(--a-line)}
.md-theme-a .dialog-head h2{font-size:19px;margin:6px 0}
.md-theme-a .dialog-head button{width:44px;height:44px;padding:0;font-size:22px;border-radius:var(--a-radius-s)}
.md-theme-a #office-order-dialog .office-tabs button{border-radius:10px;border:1px solid var(--a-line);background:var(--a-bg);color:#3B4552}
.md-theme-a #office-order-dialog .office-tabs button.active,.md-theme-a #office-order-dialog .office-tabs button[data-office-tab].active{background:var(--a-ink)!important;border-color:var(--a-ink)!important;color:#fff}
.md-theme-a .office-item,.md-theme-a .office-status-box,.md-theme-a .office-summary section{border-color:var(--a-line);border-radius:var(--a-radius-s)}
.md-theme-a #toast{background:var(--a-ink);border-radius:var(--a-radius-s);box-shadow:0 12px 32px #17263B40}
.md-theme-a #identity-bar{background:var(--a-surface);border:1px solid var(--a-line);border-radius:var(--a-radius-s)}
.md-theme-a #login-form{max-width:420px;margin:40px auto;background:var(--a-surface);border:1px solid var(--a-line);border-radius:20px;padding:24px}
.md-theme-a #login-form button[type=submit]{width:100%;background:var(--a-ink);color:#fff;border-color:var(--a-ink)}

/* ---------- Menu: telefon = pasek na dole ---------- */
.md-theme-a body nav{position:fixed!important;top:auto!important;bottom:0!important;left:0!important;right:0!important;transform:none!important;translate:none!important;width:100%!important;max-width:none!important;margin:0!important;display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:2px!important;padding:6px 6px calc(8px + env(safe-area-inset-bottom))!important;background:var(--a-surface)!important;border:0!important;border-top:1px solid var(--a-line)!important;box-shadow:0 -4px 16px #17263B0D!important;z-index:5}
.md-theme-a body nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:56px!important;padding:6px 2px!important;border:0!important;border-radius:12px!important;background:transparent!important;color:var(--a-muted)!important;font-size:11px!important;font-weight:600}
.md-theme-a body nav button::before{content:"";width:22px;height:22px;background:currentColor;-webkit-mask:var(--a-ico) center/contain no-repeat;mask:var(--a-ico) center/contain no-repeat}
.md-theme-a body nav button.active{color:var(--a-ink)!important;background:var(--a-accent-soft)!important}
.md-theme-a body nav [data-view="jobs"]{--a-ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.5 2.5-2.5-2.5z'/%3E%3C/svg%3E")}
.md-theme-a body nav [data-view="alt"]{--a-ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7'/%3E%3Cpath d='M21 4v5h-5'/%3E%3C/svg%3E")}
.md-theme-a body nav #office-nav{--a-ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h11v9H3z'/%3E%3Cpath d='M14 10h4l3 3v3h-7'/%3E%3Ccircle cx='7' cy='17' r='2'/%3E%3Ccircle cx='17' cy='17' r='2'/%3E%3C/svg%3E")}
.md-theme-a body nav #settings{--a-ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19 12a7 7 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7 7 0 0 0-2-1.2L14 3h-4l-.5 2.6a7 7 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6A7 7 0 0 0 5 12c0 .4 0 .8.1 1.2l-2 1.6 2 3.4 2.4-1a7 7 0 0 0 2 1.2L10 21h4l.5-2.6a7 7 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6c.1-.4.1-.8.1-1.2z'/%3E%3C/svg%3E")}
.md-theme-a body nav button:not([data-view]):not(#office-nav):not(#settings){--a-ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E")}
.md-theme-a body main{padding-top:20px!important;padding-bottom:calc(96px + env(safe-area-inset-bottom))!important}
.md-theme-a body header{position:sticky;top:0;z-index:4}

/* ---------- Komputer: menu z boku ---------- */
@media (min-width:1024px){
  .md-theme-a body nav{top:var(--a-head)!important;bottom:0!important;right:auto!important;width:var(--a-side)!important;grid-auto-flow:row;grid-auto-rows:min-content;align-content:start;gap:4px!important;padding:20px 14px!important;border-top:0!important;border-right:1px solid var(--a-line)!important;box-shadow:none!important}
  .md-theme-a body nav button{flex-direction:row;justify-content:flex-start;gap:12px;min-height:46px!important;padding:10px 14px!important;font-size:14px!important;text-align:left}
  .md-theme-a body nav button::before{width:20px;height:20px;flex:0 0 20px}
  .md-theme-a body nav #settings{margin-top:16px}
  .md-theme-a body main{margin-left:var(--a-side)!important;margin-right:0!important;max-width:none!important;padding:28px 36px 48px!important}
  .md-theme-a body main>*{max-width:1100px}
  .md-theme-a .office-order-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .md-theme-a #md-dispatch-queue,.md-theme-a #md-alt-review-queue,.md-theme-a #md-alt-deposit-queue{grid-template-columns:repeat(2,minmax(0,1fr))}
  .md-theme-a #md-dispatch-queue>h2,.md-theme-a #md-dispatch-queue>p,.md-theme-a #md-alt-review-queue>h2,.md-theme-a #md-alt-review-queue>p,.md-theme-a #md-alt-deposit-queue>h2,.md-theme-a #md-alt-deposit-queue>p{grid-column:1/-1}
  .md-theme-a #cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .md-theme-a body header{height:60px!important;padding:0 14px!important}
  .md-theme-a body header .logo{width:120px}
  .md-theme-a body main{padding:16px 12px calc(92px + env(safe-area-inset-bottom))!important}
  .md-theme-a #md-queue-tabs{gap:8px}
  .md-theme-a #md-queue-tabs button{min-height:64px;padding:10px 12px}
  .md-theme-a #md-queue-tabs button span{font-size:22px}
  .md-theme-a h1,.md-theme-a #title{font-size:22px}
}
@media print{.md-theme-a body nav{display:none!important}.md-theme-a body main{margin:0!important}}
