/* METROPARK_UI_POLISH_V1 (2026-11-13)
   Final detail layer, loaded after every other stylesheet. Layout and structure
   stay as they are; this layer only refines type weight, spacing rhythm,
   elevation, motion, focus and empty states, using the --mp-* theme tokens so
   light and dark themes stay paired. */
:root{
  --mp-ease-out:cubic-bezier(.22,.61,.36,1);
  --mp-ease-in-out:cubic-bezier(.65,0,.35,1);
  --mp-dur-fast:120ms;
  --mp-dur:180ms;
  --mp-dur-slow:260ms;
  --mp-elev-1:0 1px 2px rgba(16,32,60,.05),0 2px 8px rgba(16,32,60,.05);
  --mp-elev-2:0 1px 3px rgba(16,32,60,.06),0 8px 24px rgba(16,32,60,.08);
  --mp-elev-3:0 2px 6px rgba(16,32,60,.08),0 18px 44px rgba(16,32,60,.14);
  --mp-ring:0 0 0 3px color-mix(in srgb,var(--mp-accent,#245da8) 34%,transparent);
  --mp-radius-sm:10px;
  --mp-radius-md:14px;
  --mp-radius-lg:18px;
}
html[data-theme="dark"],html.theme-dark{
  --mp-elev-1:0 1px 2px rgba(0,0,0,.35),0 2px 8px rgba(0,0,0,.25);
  --mp-elev-2:0 1px 3px rgba(0,0,0,.4),0 10px 26px rgba(0,0,0,.32);
  --mp-elev-3:0 2px 8px rgba(0,0,0,.45),0 20px 48px rgba(0,0,0,.45);
  --mp-ring:0 0 0 3px color-mix(in srgb,var(--mp-accent-2,#60a5fa) 45%,transparent);
}

/* ---------- Type: calmer weights, crisp rendering, aligned digits ---------- */
html body{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  font-feature-settings:"kern" 1;
}
html body ::selection{background:color-mix(in srgb,var(--mp-accent,#245da8) 22%,transparent)}
html body h1{letter-spacing:-.015em}
html body h2,html body h3{letter-spacing:-.01em}
html body .page-head p,html body .page-head .muted,html body .muted{line-height:1.5}

/* body cells were 700: data reads lighter, key columns keep their weight */
html body tbody td,html body table td,
html body .clean-table tbody td,html body .data-table tbody td,
html body .sessions-clean-v2 tbody td{font-weight:500!important;line-height:1.4}
html body tbody td b,html body tbody td strong,
html body tbody td:first-child,html body td.plate,html body td .plate,
html body .session-plate,html body .oc-plate{font-weight:700!important}
html body thead th,html body table th{font-weight:700!important;letter-spacing:.045em!important;font-size:12px!important}

/* numbers that tick or sit in columns do not jump */
html body td,html body .mp-kpi-value,html body .kpi-value,html body .jl-kpi-value,
html body .kpi-money-value,html body .oc-kpi-body b,html body [id$="-clock"],
html body .psc2-date,html body time{font-variant-numeric:tabular-nums}

/* KPI: one line for values such as «215 ч 16 мин», readable captions */
html body .mp-kpi-value,html body .kpi-value{white-space:nowrap;letter-spacing:-.01em;line-height:1.1}
html body .mp-kpi-title,html body .kpi-title,html body .jl-kpi-label,html body .oc-kpi-label{
  font-size:12.5px!important;font-weight:650!important;letter-spacing:.01em;line-height:1.3;color:var(--mp-muted)!important}
html body .mp-kpi-meta,html body .jl-kpi-secondary{font-size:12px!important;font-weight:600!important}

/* micro text: never below 12px (the UI runs at 80% zoom on desktop) */
html body .session-plate-format,html body .plate-region-code,html body .psc2-date,
html body .access-kpi-chip,html body .mp-car-label,html body .mp-photo-state,
html body .mp-gate-loop-line,html body .jl-chip,html body .jl-day-heading,
html body .mp-core-badge,html body .oc-col-dir,html body .oc-col-ocr,
html body .help-eyebrow,html body .kpi-money-value,html body dt,
html body #entry-snapshot-info,html body #exit-snapshot-info{font-size:12px!important}
html body .access-kpi-chip{font-weight:600!important;padding:3px 9px!important}
html body .access-kpi-chip b{font-weight:800}
html body .mp-journal-unread-badge,html body .mp-critical-badge{font-size:11px!important;min-width:18px;height:18px;line-height:18px!important;padding:0 5px!important;font-weight:800!important}

/* ---------- Surfaces: one elevation scale ---------- */
html body .panel,html body .card,html body .mp-kpi-card,html body .kpi-card,
html body .jl-kpi-card,html body .oc-kpi{box-shadow:var(--mp-elev-1)!important}
html body .modal-card,html body .ai-legacy-modal,html body [role="dialog"]>.modal-card{box-shadow:var(--mp-elev-3)!important}
html body .mp-kpi-card:hover,html body .kpi-card:hover,html body .jl-kpi-card:hover{box-shadow:var(--mp-elev-2)!important}
html body .panel-head{gap:12px}

/* ---------- Header and tabs ---------- */
html body .topbar{box-shadow:0 1px 0 rgba(255,255,255,.08) inset,0 6px 18px rgba(20,62,120,.18)!important}
html body .nav-tabs{gap:4px}
html body .nav-tabs a{font-weight:650!important;border-radius:10px!important;
  transition:background-color var(--mp-dur) var(--mp-ease-out),color var(--mp-dur) var(--mp-ease-out),box-shadow var(--mp-dur) var(--mp-ease-out)!important}
html body .nav-tabs a.active,html body .nav-tabs [aria-current="page"]{font-weight:750!important}

/* ---------- Controls ---------- */
html body button,html body .btn,html body a.btn,html body input,html body select,html body textarea{
  transition:background-color var(--mp-dur) var(--mp-ease-out),border-color var(--mp-dur) var(--mp-ease-out),
    color var(--mp-dur) var(--mp-ease-out),box-shadow var(--mp-dur) var(--mp-ease-out),
    transform var(--mp-dur-fast) var(--mp-ease-out),opacity var(--mp-dur) var(--mp-ease-out)}
html body button:not(:disabled),html body .btn:not(:disabled),html body [role="button"],html body summary,
html body select,html body label[for],html body .access-kpi-chip{cursor:pointer}
html body button,html body .btn{touch-action:manipulation}
html body button:not(:disabled):active,html body .btn:not(:disabled):active{transform:translateY(1px) scale(.985)}
html body button:disabled,html body .btn:disabled,html body .btn[aria-disabled="true"]{cursor:not-allowed!important;opacity:.5}
html body input::placeholder,html body textarea::placeholder{color:var(--mp-muted);opacity:.75;font-weight:500}
html body input:hover:not(:focus):not(:disabled),html body select:hover:not(:focus):not(:disabled),
html body textarea:hover:not(:focus):not(:disabled){border-color:var(--mp-border-strong)!important}

/* visible keyboard focus everywhere, no ring on mouse click */
html body :focus{outline:none}
html body :focus-visible{outline:2px solid var(--mp-accent,#245da8)!important;outline-offset:2px!important;box-shadow:var(--mp-ring)!important;border-radius:inherit}
html body input:focus,html body select:focus,html body textarea:focus{
  border-color:var(--mp-accent)!important;box-shadow:var(--mp-ring)!important;outline:none!important}

/* status chips: softer, never shouting */
html body .status-badge,html body .mp-yolo-pill,html body .jl-chip,html body .ai-access-type-badge{
  font-weight:700!important;letter-spacing:.01em;border-radius:999px!important}

/* ---------- Tables ---------- */
html body tbody tr{transition:background-color var(--mp-dur-fast) var(--mp-ease-out)}
html body tbody tr:hover td{transition:background-color var(--mp-dur-fast) var(--mp-ease-out)}
html body tbody td{vertical-align:middle}
/* single-cell «no data» rows read as an empty state, not as a stray line */
html body tbody tr:only-child>td[colspan]{
  text-align:center!important;color:var(--mp-muted)!important;font-weight:600!important;
  padding:28px 16px!important;background:var(--mp-surface-soft)!important;letter-spacing:.01em}
html body tbody tr:only-child>td[colspan]::before{
  content:"";display:block;width:34px;height:34px;margin:0 auto 10px;border-radius:50%;
  background:var(--mp-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6f86' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M4 12h10M4 17h7'/%3E%3C/svg%3E") center/18px no-repeat}
html body tbody tr:only-child:hover>td[colspan]{background:var(--mp-surface-soft)!important}

/* tariff table: inputs show their whole value */
html body .tariff-input{font-variant-numeric:tabular-nums}
html body table:has(#tariff-table){table-layout:auto!important;min-width:100%}
html body #tariff-table td{padding-left:6px!important;padding-right:6px!important}
html body #tariff-table .tariff-input{padding:8px 9px!important;min-width:62px!important;text-overflow:ellipsis}
html body #tariff-table .tariff-label{min-width:150px!important}

/* ---------- Operator chip: compact, opens on hover/focus ---------- */
html body .operator-auth-widget-f2{
  right:16px!important;bottom:16px!important;top:auto!important;left:auto!important;
  padding:8px 12px!important;max-width:260px;font-size:12.5px!important;line-height:1.35;
  box-shadow:var(--mp-elev-2)!important;opacity:.92;
  transition:opacity var(--mp-dur) var(--mp-ease-out),box-shadow var(--mp-dur) var(--mp-ease-out),transform var(--mp-dur) var(--mp-ease-out)}
html body .operator-auth-widget-f2 #operator-auth-name{display:block;font-weight:700!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body .operator-auth-widget-f2 #operator-auth-role,html body .operator-auth-widget-f2 br{display:none}
html body .operator-auth-widget-f2 button{display:none;margin-top:8px;width:100%;padding:6px 10px!important;font-weight:700!important}
html body .operator-auth-widget-f2:hover,html body .operator-auth-widget-f2:focus-within{opacity:1;box-shadow:var(--mp-elev-3)!important;transform:translateY(-2px)}
html body .operator-auth-widget-f2:hover #operator-auth-role,html body .operator-auth-widget-f2:focus-within #operator-auth-role{display:block;color:var(--mp-muted)!important;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body .operator-auth-widget-f2:hover button,html body .operator-auth-widget-f2:focus-within button{display:block}

/* ---------- Access side card: label above value, aligned ---------- */
html body .ai-access-info-cell{display:flex;flex-direction:column;gap:2px;min-width:0}
html body .ai-access-info-cell small{color:var(--mp-muted)!important;font-weight:600!important;font-size:12px!important}
html body .ai-access-info-cell b{font-weight:700!important;overflow-wrap:anywhere}

/* ---------- Scrollbars ---------- */
html body *{scrollbar-width:thin;scrollbar-color:var(--mp-border-strong) transparent}
html body ::-webkit-scrollbar{width:10px;height:10px}
html body ::-webkit-scrollbar-thumb{background:var(--mp-border-strong);border-radius:10px;border:2px solid transparent;background-clip:padding-box}
html body ::-webkit-scrollbar-thumb:hover{background:var(--mp-muted);background-clip:padding-box;border:2px solid transparent}
html body ::-webkit-scrollbar-track{background:transparent}

/* ---------- Motion: content settles in, modals rise ---------- */
@keyframes mpPolishIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes mpPolishPop{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
html body main.content>*{animation:mpPolishIn var(--mp-dur-slow) var(--mp-ease-out) both}
html body main.content>*:nth-child(2){animation-delay:30ms}
html body main.content>*:nth-child(3){animation-delay:60ms}
html body main.content>*:nth-child(4){animation-delay:90ms}
html body main.content>*:nth-child(n+5){animation-delay:120ms}
html body .modal-backdrop.open .modal-card,html body .modal-backdrop[style*="flex"] .modal-card,
html body .ai-legacy-modal-backdrop.open>*{animation:mpPolishPop var(--mp-dur-slow) var(--mp-ease-out) both}

@media (prefers-reduced-motion:reduce){
  html body *,html body *::before,html body *::after{
    animation-duration:1ms!important;animation-iteration-count:1!important;animation-delay:0ms!important;
    transition-duration:1ms!important;scroll-behavior:auto!important}
}

/* ---------- Login ---------- */
html body .msg:empty{display:none}

/* ---------- Plates never break in the middle ---------- */
html body .plate-region-number,html body .plate-region-inline,html body .sessions-clean-v2 tbody td>b:first-child,
html body td>b:has(.plate-country-flag){white-space:nowrap}

/* ---------- Phones: the top bar fits, nothing is cut at the edge ---------- */
@media (max-width:560px){
  html body .topbar{gap:8px!important;padding-left:10px!important;padding-right:10px!important;min-width:0}
  html body .topbar .brand{min-width:0;gap:8px}
  html body .topbar .brand-title span{display:none}
  html body .topbar .top-actions{gap:6px!important;min-width:0;flex-wrap:nowrap}
  html body .topbar .top-actions .btn{padding:6px 10px!important;font-size:13px!important;white-space:nowrap}
  html body .topbar .mp-location-status-icon,html body .topbar .mp-theme-gear-btn{display:none!important}
  html body .operator-auth-widget-f2{right:10px!important;bottom:10px!important}
}
