/* PADM Central: the fleet pages (Overview, Customers, customer page, New customer). Feature stylesheet of pages/fleet.js.
   Uses only the tokens of app.css (light theme). No inline styles anywhere (CSP). */

/* The page grid of app.css sizes its column to the widest child; on a phone that pushes the page past the screen. */
.page.fl-page { grid-template-columns: minmax(0, 1fr); }

/* ---- state colours (ok / warn / silent / waiting / removed) ---- */
.st-ok { --st: var(--success); --st-bg: var(--success-bg); --st-line: var(--success-line); }
.st-warn { --st: var(--warning); --st-bg: var(--warning-bg); --st-line: var(--warning-line); }
.st-silent { --st: var(--critical); --st-bg: var(--critical-bg); --st-line: var(--critical-line); }
.st-waiting { --st: var(--info); --st-bg: var(--info-bg); --st-line: var(--info-line); }
.st-removed { --st: var(--faint); --st-bg: var(--soft); --st-line: var(--line); }
.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--st, var(--faint)); flex: none;
        box-shadow: 0 0 0 3px var(--st-bg, var(--soft)); }
.st-silent .sdot, .sdot.st-silent { animation: fl-pulse 2s ease-in-out infinite; }
@keyframes fl-pulse { 50% { box-shadow: 0 0 0 6px var(--st-bg, var(--soft)); } }
.spill { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1.6 var(--font); letter-spacing: .3px; padding: 1px 9px 1px 7px;
         border-radius: 999px; border: 1px solid var(--st-line, var(--line)); background: var(--st-bg, var(--soft)); color: var(--st, var(--muted));
         white-space: nowrap; text-transform: uppercase; }
.spill .sdot { width: 7px; height: 7px; box-shadow: none; animation: none; }

/* ---- Overview: fleet tiles, composition bar, fleet map ---- */
.fl-tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.fl-tile { position: relative; display: grid; gap: 2px; padding: 16px 18px 14px; border-radius: var(--radius); background: var(--panel);
           border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; min-width: 0; overflow: hidden; }
.fl-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--st, var(--accent)); opacity: .9; }
a.fl-tile:hover { text-decoration: none; border-color: #b9c6e4; background: var(--soft); }
.fl-tile b { font-size: 30px; line-height: 1.15; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--fg); }
.fl-tile.lit b { color: var(--st); }
.fl-tile span { color: var(--muted); font-size: 13px; }
.fl-tile .ic.corner { position: absolute; right: 16px; top: 16px; color: var(--st, var(--faint)); opacity: .55; }
.fl-tile .sub { font-size: 12px; color: var(--faint); }
.compbar { display: block; width: 100%; height: 10px; border-radius: 5px; overflow: hidden; }
.compbar rect.ok { fill: #12b76a; } .compbar rect.warn { fill: #f79009; } .compbar rect.silent { fill: #d92d20; }
.compbar rect.waiting { fill: #84caff; } .compbar rect.none { fill: var(--hover); }
.fleetmap { display: flex; flex-wrap: wrap; gap: 8px; }
.fleetmap a { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 9px; border-radius: 999px; border: 1px solid var(--line);
              background: var(--panel); color: var(--fg-2); font: 500 13px var(--mono); transition: border-color .12s, background .12s; }
.fleetmap a:hover { text-decoration: none; border-color: var(--st-line, var(--line-2)); background: var(--st-bg, var(--soft)); }
.fleetmap a .sdot { width: 8px; height: 8px; box-shadow: none; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row .sdot { width: 8px; height: 8px; box-shadow: none; animation: none; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; }
.mini-list li:first-child { border-top: 0; padding-top: 0; }
.mini-list a.grow, .mini-list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.mini-list a.grow:hover { color: var(--accent); }
.mini-list .when, .mini-list .muted { white-space: nowrap; font-size: 12.5px; }

/* ---- 24 h strip (one cell per hour) ---- */
svg.strip { display: block; width: 100%; height: 14px; }
svg.strip.lg { height: 26px; }
svg.strip .c-o { fill: #32d583; } svg.strip .c-w { fill: #fdb022; } svg.strip .c-m { fill: #f97066; } svg.strip .c-n { fill: var(--hover); }
.strip-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 3px; }

a.panel.stat-link { display: block; color: inherit; transition: border-color .12s, background .12s; }
a.panel.stat-link:hover { text-decoration: none; border-color: #b9c6e4; background: var(--soft); }

/* ---- Customers: toolbar, cards ---- */
.fl-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 16px; }
.fl-bar input[type=search] { max-width: 300px; }
.fl-bar .seg button { padding: 6px 12px; font-size: 13px; }
.fl-bar .seg button .n { color: var(--faint); font-variant-numeric: tabular-nums; margin-left: 2px; }
.fl-bar .seg button.on .n { color: var(--accent); }
.fl-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ccard { display: grid; gap: 12px; align-content: start; padding: 16px 18px; border-radius: var(--radius); background: var(--panel);
         border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; min-width: 0; position: relative;
         transition: border-color .12s, box-shadow .12s, transform .12s; }
.ccard:hover { border-color: #b9c6e4; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.ccard:focus-visible { outline: none; box-shadow: var(--ring); }
.ccard.st-silent { border-color: var(--critical-line); }
.ccard.st-removed { opacity: .65; }
.ccard .top { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.ccard .top .cwho { flex: 1; min-width: 0; }
.ccard .top .cwho b { display: block; font: 650 15px var(--mono); color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.ccard .top .cwho span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard .top .sdot { margin-top: 6px; }
.ccard dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 13px; }
.ccard dt { color: var(--muted); }
.ccard dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard .why { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--st-bg); color: var(--st); font-size: 12.5px; line-height: 1.45; }
.ccard .foot { display: flex; gap: 6px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.ccard .foot .tags { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--fg-2); background: var(--soft);
       border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; line-height: 1.7; white-space: nowrap; }
.tag.crit { color: var(--critical); background: var(--critical-bg); border-color: var(--critical-line); }
.tag.warn { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-line); }
.tag.ok { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }

/* ---- customer page ---- */
.cu-head { display: flex; gap: 14px; align-items: center; }
.cu-head .sdot { width: 14px; height: 14px; }
.why-list { margin: 0; padding-left: 18px; color: var(--fg-2); }
.why-list li { margin: 2px 0; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 20px; margin: 0; }
.kv-grid div { min-width: 0; }
.kv-grid dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.kv-grid dd { margin: 2px 0 0; font-size: 14px; color: var(--fg); overflow-wrap: anywhere; }
.health { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- install commands, wizard ---- */
.cmds { display: grid; gap: 14px; counter-reset: cmd; margin: 0; padding: 0; list-style: none; }
.cmds > li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 12px; counter-increment: cmd; }
.cmds > li::before { content: counter(cmd); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
                     background: var(--accent-soft); color: var(--accent-2); font-weight: 650; font-size: 13px; grid-row: span 3; }
.cmds h3 { margin: 2px 0 0; font-size: 14px; }
.cmds p { margin: 0; font-size: 13px; color: var(--muted); }
.cmd { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #0c111d; color: #e4e7ec;
       border-radius: 8px; padding: 9px 9px 9px 14px; font: 12.5px/1.5 var(--mono); min-width: 0; }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: pre; font: inherit; }
.cmd code .pr { color: #667085; user-select: none; }
.cmd button { background: #1d2939; color: #e4e7ec; border-color: #344054; box-shadow: none; flex: none; }
.cmd button:hover { background: #344054; color: #fff; }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.stepper li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
              background: var(--panel); color: var(--muted); min-width: 0; font-size: 13px; }
.stepper li .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 650;
                 background: var(--hover); color: var(--fg-2); font-size: 12px; }
.stepper li b { display: block; color: var(--fg); font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper li span.t { min-width: 0; }
.stepper li.on { border-color: #84adff; box-shadow: var(--ring); }
.stepper li.on .n { background: var(--accent); color: #fff; }
.stepper li.done .n { background: var(--success); color: #fff; }
.stepper li.fail .n { background: var(--critical); color: #fff; }
.wz { display: grid; gap: 16px; }
.wz-step { display: grid; gap: 12px; }
.wz-step .panel-head { margin-bottom: 0; }
.wz-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13.5px;
             border: 1px solid var(--line); background: var(--soft); }
.wz-status.ok { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }
.wz-status.warn { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
.wz-status.crit { background: var(--critical-bg); border-color: var(--critical-line); color: var(--critical); }
.wz-status .ic { flex: none; margin-top: 2px; }
.wz-status div { min-width: 0; color: var(--fg-2); }
.wz-status div b { color: inherit; }

@media (max-width: 900px) {
  .fl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .fl-tile b { font-size: 24px; }
  .fl-cards { grid-template-columns: minmax(0, 1fr); }
  .fl-bar input[type=search] { max-width: none; }
  .fl-bar .seg { overflow-x: auto; max-width: 100%; }
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .sdot { animation: none !important; } .ccard:hover { transform: none; } }
