/* MAXPOS Monitor
   Every POS is a coloured tile, like the product tiles in the POS itself, with the
   receipt it prints coming out of it. Colour carries meaning: the POS's own colour
   identifies it, green / amber / red is its health. */

:root {
    --bg: #F4F2FF;
    --bg-2: #EAE6FF;
    --card: #FFFFFF;
    --ink: #1E1B3A;
    --ink-2: #4B4870;
    --ink-3: #8481A6;
    --line: #E4E0F7;

    --brand-1: #4F46E5;
    --brand-2: #8B3DF0;
    --brand-3: #E0338A;
    --accent: #5B3FF2;

    --ok: #12A150;
    --ok-soft: #DCF7E7;
    --late: #E08A00;
    --late-soft: #FFF0D1;
    --bad: #E5384F;
    --bad-soft: #FFE1E5;
    --info: #2B7BF2;
    --info-soft: #DFEBFF;

    --font: "Onest", system-ui, sans-serif;
    --mono: "Spline Sans Mono", ui-monospace, monospace;

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --shadow: 0 1px 2px rgba(30, 27, 58, 0.06), 0 12px 32px -14px rgba(60, 40, 160, 0.28);

    color-scheme: light;
    scrollbar-color: #C9BEFF transparent;
    scrollbar-width: thin;
}

* { box-sizing: border-box; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C9BEFF; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #A897FF; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font: 400 15px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #A897FF; outline-offset: 2px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------ banner (top of every page) */

.banner {
    background: linear-gradient(115deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
    color: #fff;
    padding-bottom: 34px;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.banner.station-banner {
    background: linear-gradient(135deg, var(--c) 0%, color-mix(in srgb, var(--c) 72%, #1E1B3A) 100%);
}

.top { display: flex; align-items: center; gap: 16px; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand img { width: 30px; height: 30px; background: #fff; border-radius: 9px; padding: 3px; }
.top .spacer { flex: 1; }
.ghost {
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}
.ghost:hover { background: rgba(255, 255, 255, 0.22); }

.banner h1 {
    margin: 22px 0 6px;
    font-size: clamp(30px, 4.4vw, 46px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.banner .lead { margin: 0; font-size: 16px; color: rgba(255, 255, 255, 0.85); }

/* counts that double as filters */
.counts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.count-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 150px;
    padding: 12px 18px 12px 14px;
    border: 0;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, transform 0.15s;
}
.count-btn:hover { background: rgba(255, 255, 255, 0.24); }
.count-btn[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5); }
.count-btn .num { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.count-btn .lbl { font-size: 14px; line-height: 1.2; opacity: 0.9; }
.count-btn .orb { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25); }
.orb.all { background: #fff; }
.orb.online { background: #3BE08A; }
.orb.attention { background: #FFC53D; }
.orb.offline { background: #FF6B7F; }
.count-btn[aria-pressed="true"] .orb { box-shadow: 0 0 0 4px var(--bg-2); }
.count-btn[aria-pressed="true"] .orb.all { background: var(--accent); }

.search-row { margin-top: 18px; }
.search {
    width: 100%;
    max-width: 420px;
    height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink);
    box-shadow: 0 8px 22px -12px rgba(0, 0, 0, 0.45);
}
.search::placeholder { color: var(--ink-3); }

/* ------------------------------------------------------------ receipt */

.receipt {
    position: relative;
    background: #fff;
    color: #1F2633;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
    padding: 16px 16px 12px;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.45);
    margin-bottom: 10px;
}
.receipt::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
    background:
        linear-gradient(135deg, #fff 50%, transparent 50%) 0 0 / 16px 10px repeat-x,
        linear-gradient(225deg, #fff 50%, transparent 50%) 0 0 / 16px 10px repeat-x;
}
.receipt .r-title { font-weight: 600; font-size: 15px; letter-spacing: 0.02em; word-break: break-word; }
.receipt .r-line { color: #4A5468; word-break: break-word; }
.receipt .r-rule { border: 0; border-top: 1px dashed #B9C0CC; margin: 8px 0; }
.receipt .r-foot { display: flex; justify-content: space-between; color: #4A5468; }
.receipt .r-unknown { color: #7A8396; font-style: italic; }

/* ------------------------------------------------------------ POS cards */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 30px 0 70px;
}

.station {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: var(--r-lg);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.station:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(30, 27, 58, 0.06), 0 22px 40px -16px color-mix(in srgb, var(--c) 60%, transparent); }

.tile {
    background:
        radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.28) 0 18%, transparent 19%),
        linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 78%, #1E1B3A));
    padding: 18px 22px 22px;
}
.tile .name { color: #fff; font-weight: 700; font-size: 15px; margin: -4px 0 10px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }

.card-body { padding: 14px 20px 18px; display: grid; gap: 12px; flex: 1; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    width: max-content;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.online { background: var(--ok-soft); color: var(--ok); }
.pill.late { background: var(--late-soft); color: var(--late); }
.pill.offline { background: var(--bad-soft); color: var(--bad); }
.pill.offline i, .pill.late i { animation: blink 1.4s ease-in-out infinite; }
.status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-row .when { color: var(--ink-3); font-size: 14px; }

.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg);
    color: var(--ink-2);
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--late-soft); color: #B56F00; }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.info { background: var(--info-soft); color: var(--info); }

.uptime {
    display: grid;
    grid-template-columns: repeat(96, 1fr);
    gap: 1px;
    height: 18px;
}
.uptime i { background: var(--bg-2); border-radius: 2px; }
.uptime i.on { background: linear-gradient(var(--ok), #0E8A44); }
.uptime-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: -8px; }

.empty {
    max-width: 560px;
    margin: 30px 0 80px;
    padding: 28px;
    border-radius: var(--r-lg);
    background: var(--card);
    box-shadow: var(--shadow);
}
.empty h2 { margin: 0 0 8px; font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.empty p { margin: 0 0 8px; color: var(--ink-2); }
.empty code { font-family: var(--mono); font-size: 13px; background: var(--bg-2); padding: 1px 6px; border-radius: 5px; }

/* ------------------------------------------------------------ POS detail */

.pos-head {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 36px;
    align-items: start;
    padding-top: 8px;
}
.pos-head .receipt { font-size: 13.5px; transform: rotate(-1.2deg); }
.pos-info { color: #fff; padding-top: 4px; min-width: 0; }
.back { display: inline-flex; color: rgba(255, 255, 255, 0.85); text-decoration: none; font-weight: 500; margin-bottom: 10px; }
.back:hover { color: #fff; }

.label-input {
    display: block;
    width: 100%;
    max-width: 560px;
    border: 2px solid transparent;
    background: transparent;
    color: #fff;
    border-radius: var(--r-sm);
    padding: 2px 8px;
    margin-left: -10px;
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 700;
    letter-spacing: -0.025em;
}
.label-input::placeholder { color: #fff; opacity: 1; }
.label-input:hover { border-color: rgba(255, 255, 255, 0.35); }
.label-input:focus { border-color: #fff; background: rgba(255, 255, 255, 0.12); outline: none; }

.pos-info .status-row { margin-top: 10px; }
.pos-info .status-row .when { color: rgba(255, 255, 255, 0.85); }
.pos-info .facts { margin-top: 12px; }
.pos-info .tag { background: rgba(255, 255, 255, 0.9); }
.pos-info .uptime-wrap { max-width: 520px; margin-top: 16px; display: grid; gap: 12px; }
.pos-info .uptime i { background: rgba(255, 255, 255, 0.25); }
.pos-info .uptime i.on { background: #fff; }
.pos-info .uptime-scale { color: rgba(255, 255, 255, 0.8); }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.head-actions .btn { background: #fff; border-color: #fff; color: var(--ink); }
.head-actions .btn:hover { filter: brightness(0.95); }

/* tabs: a wrapping pill row, never a scroll container */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 26px 0 24px;
}
.tabs a {
    padding: 9px 18px;
    border-radius: 999px;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 600;
    background: var(--card);
    box-shadow: 0 1px 2px rgba(30, 27, 58, 0.06);
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--c, var(--accent)); color: #fff; box-shadow: 0 8px 18px -10px var(--c, var(--accent)); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--brand-3); color: #fff; font-size: 12px; text-align: center; }

.content { padding-bottom: 80px; }
.card {
    background: var(--card);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 22px;
}
h2.sec { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; }
p.sec-lead { margin: 0 0 18px; color: var(--ink-2); max-width: 66ch; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin: 0;
}
.stat {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: var(--r-md);
    background: var(--bg);
}
.stat .ico {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
}
.stat .ico svg { width: 20px; height: 20px; }
.ico.green { background: linear-gradient(135deg, #2FD07A, #0E9A4B); }
.ico.violet { background: linear-gradient(135deg, #9C7BFF, #6A3DF0); }
.ico.sky { background: linear-gradient(135deg, #4FC3FF, #1B7FE0); }
.ico.amber { background: linear-gradient(135deg, #FFC24A, #E58A00); }
.ico.rose { background: linear-gradient(135deg, #FF7D93, #E0334E); }
.ico.teal { background: linear-gradient(135deg, #3ADBC8, #0E9C8C); }
.ico.fuchsia { background: linear-gradient(135deg, #F07CF5, #B832C9); }
.ico.indigo { background: linear-gradient(135deg, #7F8CFF, #4446D8); }
.stat dt { color: var(--ink-3); font-size: 13px; }
.stat dd { margin: 1px 0 0; font-size: 17px; font-weight: 600; word-break: break-word; }
.stat dd small { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; }
.stat > div { min-width: 0; flex: 1; }
.meter { height: 6px; border-radius: 4px; background: var(--bg-2); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #9C7BFF, #6A3DF0); }
.meter i.hot { background: linear-gradient(90deg, #FF7D93, #E0334E); }

/* ------------------------------------------------------------ forms */

.form { display: grid; gap: 16px; max-width: 600px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { display: block; color: var(--ink-3); font-size: 13px; margin-top: 5px; }
.field input[type="text"], .field input[type="password"], .field textarea {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { height: auto; min-height: 110px; padding: 12px 14px; font-family: var(--mono); font-size: 13px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px #E4DEFF; }
.field.invalid input { border-color: var(--bad); }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.check span { font-weight: 600; }
.check span small { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; }

.drop {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 2px dashed #C9BEFF;
    border-radius: var(--r-md);
    background: #FAF8FF;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #F0ECFF; }
.drop.has { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.drop .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
.drop .ico svg { width: 26px; height: 26px; }
.drop strong { display: block; font-size: 16px; }
.drop span { color: var(--ink-2); font-size: 13px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { border-color: #C9BEFF; }
.btn.primary {
    border: 0;
    color: #fff;
    background: linear-gradient(115deg, var(--brand-1), var(--brand-2));
    box-shadow: 0 10px 20px -10px var(--brand-2);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-error { color: var(--bad); font-weight: 600; }

/* ------------------------------------------------------------ EET status */

.eet-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-radius: var(--r-md);
    margin-bottom: 18px;
}
.eet-hero.good { background: var(--ok-soft); }
.eet-hero.bad { background: var(--bad-soft); }
.eet-hero.warn { background: var(--late-soft); }
.eet-hero.off { background: var(--bg); }
.eet-hero .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: none; }
.eet-hero .ico svg { width: 28px; height: 28px; }
.eet-hero h3 { margin: 0; font-size: 18px; font-weight: 700; }
.eet-hero p { margin: 2px 0 0; color: var(--ink-2); word-break: break-word; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 18px; }
.kv div { padding: 10px 14px; border-radius: var(--r-sm); background: var(--bg); }
.kv dt { color: var(--ink-3); font-size: 13px; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ------------------------------------------------------------ settings */

.settings-list { display: grid; gap: 8px; }
.setting { border-radius: var(--r-md); background: var(--bg); }
.setting[open] { background: #fff; box-shadow: 0 0 0 2px #E4DEFF; }
.setting summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
}
.setting summary::-webkit-details-marker { display: none; }
.setting summary .k { font-weight: 600; flex: none; max-width: 52%; }
.setting summary .k small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12.5px; font-family: var(--mono); }
.setting summary .v {
    flex: 1 1 0;
    min-width: 0;
    text-align: right;
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.setting[open] summary .v { visibility: hidden; }
.setting .editor { padding: 0 16px 16px; display: grid; gap: 10px; }
.setting .pending-note { color: var(--accent); font-size: 13px; font-weight: 600; }
.add-setting { margin-top: 14px; background: #FAF8FF; border: 2px dashed #C9BEFF; }
.add-setting[open] { border-style: solid; }
.add-setting summary .k { color: var(--accent); }

/* ------------------------------------------------------------ settings screen */

.settings-layout { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: start; }
.set-nav { padding: 10px; display: grid; gap: 2px; position: sticky; top: 16px; }
.set-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 600;
}
.set-nav a:hover { background: var(--bg); color: var(--ink); }
.set-nav a[aria-current="page"] { background: var(--bg-2); color: var(--ink); }
.set-nav .ico, .set-head .ico { flex: none; display: grid; place-items: center; color: #fff; }
.set-nav .ico { width: 32px; height: 32px; border-radius: 10px; }
.set-nav .ico svg { width: 17px; height: 17px; }
.set-body { min-width: 0; margin-bottom: 0; }
.set-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 4px; }
.set-head .ico { width: 46px; height: 46px; border-radius: 14px; }
.set-head .ico svg { width: 24px; height: 24px; }
.set-head p.sec-lead { margin-bottom: 14px; }

h3.sub { font-size: 15px; font-weight: 700; margin: 26px 0 12px; color: var(--ink); }
h3.sub .muted { font-weight: 500; }
.small { font-size: 13px; }
.form.wide { max-width: none; }
.field label .cz, .switch-row .cz { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.field textarea.plain { font-family: var(--font); font-size: 15px; }
.field select, .inline-input {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    color: var(--ink);
}
.field select:focus, .inline-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px #E4DEFF; }
.field input[readonly] { background: var(--bg); color: var(--ink-2); }

.sync-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    margin-bottom: 16px;
    font-weight: 500;
}
.sync-note svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.sync-note.wait { background: #EEE9FF; color: #4B2FD6; }
.sync-note.wait svg { animation: spin 1.6s linear infinite; }
.sync-note.bad { background: var(--bad-soft); color: #B4243A; }
.sync-note.off { background: var(--late-soft); color: #8A5600; }

/* toggle switches */
.switches { display: grid; gap: 8px; }
.switch-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    background: var(--bg);
    cursor: pointer;
}
.switch-row > span { flex: 1; min-width: 0; }
.switch-row strong { font-weight: 600; }
.switch-row small { display: block; color: var(--ink-3); font-size: 13px; }
.switch {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    position: relative;
    width: 48px;
    height: 28px;
    margin: 0;
    border-radius: 999px;
    background: #CFC9EA;
    cursor: pointer;
    transition: background 0.18s;
}
.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(30, 27, 58, 0.25);
    transition: transform 0.18s;
}
.switch:checked { background: linear-gradient(115deg, #2FD07A, #0E9A4B); }
.switch:checked::after { transform: translateX(20px); }
.mini-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; min-width: 112px; }

/* list rows */
.list { display: grid; gap: 8px; margin-bottom: 12px; }
.list-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 14px;
    border-radius: var(--r-md);
    background: var(--bg);
    transition: opacity 0.2s;
}
.list-row.wrap-row { flex-wrap: wrap; }
.list-row.gone { opacity: 0.35; pointer-events: none; text-decoration: line-through; }
.list-row .grow { flex: 1 1 160px; min-width: 0; }
.list-row .strong { font-weight: 600; word-break: break-word; }
.list-row .inline-input { height: 38px; width: auto; }
.list-row .inline-input.grow { width: 100%; }
.list-row .inline-input.price { width: 110px; flex: none; }
.list-row select.inline-input { max-width: 180px; }
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, #4FC3FF, #1B7FE0);
    flex: none;
}
.icon-btn {
    flex: none;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: #fff; color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn svg { width: 17px; height: 17px; }

.add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 8px; }
.add-row .field { flex: 1 1 200px; }

/* tile groups as editable chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 4px 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #FBE3FD, #F3D6FF);
    transition: opacity 0.2s;
}
.chip.gone { opacity: 0.35; pointer-events: none; }
.chip.add { background: #fff; border: 2px dashed #E7B6F2; }
.chip-input { border: 0; background: transparent; width: 120px; font-weight: 600; color: #7A1F8C; padding: 4px 0; }
.chip-input:focus { outline: none; }
.chip button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #9B3DB0; cursor: pointer; display: grid; place-items: center; }
.chip button:hover { background: rgba(255, 255, 255, 0.8); }
.chip button svg { width: 15px; height: 15px; }

.save-bar { margin-top: 24px; padding-top: 18px; border-top: 2px solid var(--bg); }
.inline-check { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.inline-check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ------------------------------------------------------------ activity */

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--bg);
}
.timeline .badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.timeline .badge svg { width: 20px; height: 20px; }
.timeline .badge.applied { background: linear-gradient(135deg, #2FD07A, #0E9A4B); }
.timeline .badge.failed { background: linear-gradient(135deg, #FF7D93, #E0334E); }
.timeline .badge.pending, .timeline .badge.sent { background: linear-gradient(135deg, #9C7BFF, #6A3DF0); }
.timeline .badge.pending svg, .timeline .badge.sent svg { animation: spin 1.6s linear infinite; }
.timeline .badge.cancelled { background: #B9B5D6; }
.timeline .what { font-weight: 600; word-break: break-word; }
.timeline .result { color: var(--ink-2); font-size: 14px; margin-top: 2px; word-break: break-word; }
.timeline .result.bad { color: var(--bad); }
.timeline .result.good { color: var(--ok); }
.timeline .time { color: var(--ink-3); font-size: 13px; text-align: right; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 2px 0; color: var(--accent); cursor: pointer; font-weight: 600; }

@keyframes blink { 50% { opacity: 0.3; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ login */

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(115deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
}
.login-box { width: 100%; max-width: 380px; background: #fff; border-radius: var(--r-lg); padding: 28px; box-shadow: 0 30px 60px -20px rgba(20, 0, 60, 0.6); }
.login-box .receipt { margin: -6px 0 30px; transform: rotate(-1.5deg); box-shadow: 0 10px 22px -10px rgba(60, 40, 160, 0.45); }
.login-box .receipt .r-title { font-size: 17px; }

/* ------------------------------------------------------------ toasts */

#toasts {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    display: grid;
    gap: 8px;
    z-index: 10;
    width: max-content;
    max-width: calc(100vw - 32px);
}
.toast {
    background: var(--ink);
    color: #fff;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 500;
    box-shadow: 0 16px 30px -12px rgba(30, 27, 58, 0.6);
    animation: toast-in 0.2s ease-out;
}
.toast.good { background: linear-gradient(115deg, #12A150, #0E8A70); }
.toast.bad { background: linear-gradient(115deg, #E5384F, #C2265F); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ small screens */

@media (max-width: 860px) {
    .settings-layout { grid-template-columns: 1fr; }
    .set-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
    .set-nav a { padding: 6px 12px 6px 6px; background: var(--bg); }
    .pos-head { grid-template-columns: 1fr; gap: 22px; }
    .pos-head .receipt { max-width: 340px; }
}

@media (max-width: 560px) {
    .wrap { padding: 0 16px; }
    .grid { grid-template-columns: 1fr; }
    .count-btn { min-width: 0; flex: 1 1 calc(50% - 6px); }
    .form .row { grid-template-columns: 1fr; }
    .timeline li { grid-template-columns: 40px 1fr; }
    .timeline .time { grid-column: 2; text-align: left; }
    .setting summary .v { display: none; }
    .card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
