/* The cloud's own pages. Same tokens as the device UI (EmptyCartDetection/
   web/app.css), so going from the fleet into a device does not change the
   look. No build step, no CDN. */

:root {
    --bg: #14161a;
    --panel: #1c1f26;
    --panel-2: #22262f;
    --line: #2e333d;
    --text: #e6e8ec;
    --muted: #949aa6;
    --accent: #4da3ff;
    --ok: #3ecf8e;
    --warn: #f0b429;
    --bad: #f2555a;
    color-scheme: dark;
}

* { box-sizing: border-box; }

/* An element's own display rule would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.topbar h1 { font-size: 15px; font-weight: 600; margin: 0; white-space: nowrap; }
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
}
.topbar nav a:hover, .topbar nav a.active { background: var(--panel-2); color: var(--text); }
.topbar .who { color: var(--muted); font-size: 13px; }

main { max-width: 1280px; margin: 0 auto; padding: 16px; }
main.narrow { max-width: 480px; }

h2 { font-size: 17px; margin: 20px 0 10px; }
h2:first-child { margin-top: 4px; }
p.hint, .muted { color: var(--muted); }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tbody tr:hover { background: var(--panel-2); }
tr.link { cursor: pointer; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.pill {
    display: inline-block;
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--muted);
    border: 1px solid var(--line);
    white-space: nowrap;
}
.pill-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.pill-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }

ul.problems { list-style: none; margin: 0; padding: 0; }
ul.problems li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.problems li:last-child { border-bottom: 0; }
.level-bad { color: var(--bad); }
.level-warn { color: var(--warn); }
.level-info { color: var(--muted); }

button, .button {
    font: inherit;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 7px 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
button:hover, .button:hover { border-color: var(--muted); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #0b1220; font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: 0.5; cursor: default; }

input, select, textarea {
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 7px 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); }
label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
label.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; color: var(--text); }
form .row, .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * { width: 100%; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 20px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.nowrap { white-space: nowrap; }
.grid dt { color: var(--muted); font-size: 12px; }
.grid dd { margin: 2px 0 0; }

/* Counts across the top of the Log and Review pages. */
.tiles { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; min-width: 120px; }
.tile-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* The Review page's check: the frame with its label drawn over it. */
.check { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr); gap: 16px; }
.check-picture { position: relative; align-self: start; line-height: 0; }
.check-picture img { width: 100%; height: auto; border-radius: 6px; }
.check-box { position: absolute; border: 2px solid; border-radius: 2px; pointer-events: none; }
.check-box span { position: absolute; left: -2px; top: -18px; font-size: 11px; line-height: 16px; padding: 0 4px; color: #0b1220; white-space: nowrap; }
@media (max-width: 800px) { .check { grid-template-columns: 1fr; } }

.error { color: var(--bad); }
.notice { color: var(--warn); }

.copy-list { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; }
.copy-results { padding-left: 18px; }
dialog h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); }

dialog {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    max-width: min(900px, 92vw);
}
dialog::backdrop { background: rgb(0 0 0 / 0.55); }
pre {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    overflow: auto;
    max-height: 60vh;
    font-size: 12px;
}

.qr svg { display: block; margin: 8px 0; }
code.secret { font-size: 15px; letter-spacing: 0.08em; word-break: break-all; }

@media (max-width: 700px) {
    .hide-narrow { display: none; }
    th, td { padding: 6px; }
}
