/* =============================================================
   HELPREX Agent — Visual Identity REXSUITE v1.0
   Brand: Geist + Geist Mono | Accent: #FF4D2E Apex Coral | Dark-first
   ============================================================= */

:root {
    --ink:       #0A0A0B;
    --ink-2:     #131316;
    --ink-3:     #1E1E22;
    --ink-4:     #2A2A30;
    --line:      #2E2E34;
    --line-soft: #1E1E22;
    --muted:     #6B6B72;
    --muted-2:   #9A9AA1;

    --paper:     #F4F1EA;
    --paper-2:   #E9E4D9;
    --paper-3:   #D9D3C5;

    /* HELPREX accent — Apex Coral */
    --coral:     #FF4D2E;
    --coral-dim: rgba(255,77,46,.12);
    --coral-glow:rgba(255,77,46,.20);
    --coral-dark:#B82A12;

    /* Status (dark mode) */
    --status-new:     #2E2A12;  --status-new-fg:    #D4CC6A;
    --status-open:    #122010;  --status-open-fg:   #6ABA6A;
    --status-pending: #2E1C08;  --status-pending-fg:#C49050;
    --status-resolved:#102018;  --status-resolved-fg:#5AB07A;
    --status-closed:  #1E1E22;  --status-closed-fg: #8A8AA1;

    --prio-low:    #72A472;
    --prio-medium: #C49A4A;
    --prio-high:   #E07040;
    --prio-urgent: #FF4D2E;

    --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px;

    --r-sm: 6px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-pill: 999px;

    --shadow-xs: 0 1px 0 rgba(0,0,0,.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,.5);
    --shadow-lg: 0 16px 56px rgba(0,0,0,.7);
    --shadow-coral: 0 0 0 3px var(--coral-dim);

    --sidebar-w: 232px;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --dur-fast: 120ms;
    --dur-med: 220ms;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--paper);
    background: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--coral); color: var(--ink); }

h1, h2, h3, h4 {
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--paper);
    margin: 0;
    line-height: 1.1;
}
h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 700; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 var(--s-3); color: var(--muted-2); }
a { color: var(--coral); text-decoration: none; transition: opacity var(--dur-fast); }
a:hover { opacity: .8; }
code {
    font-family: var(--mono);
    font-size: .85em;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 2px 6px;
    color: var(--paper-2);
}
hr { border: 0; height: 1px; background: var(--line); margin: var(--s-7) 0; }

/* ---- App shell ---- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    background: var(--ink);
    border-right: 1px solid var(--line);
    padding: var(--s-6) var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: var(--s-3);
    padding: var(--s-2);
}
.brand .rex-mark-icon {
    width: 30px; height: 30px;
    background: var(--coral);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 30px;
}
.brand .rex-mark-icon img {
    width: 80%; height: 80%;
    object-fit: contain;
    display: block;
}
.brand .wm {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--paper);
}
.brand .wm .pre { font-weight: 400; opacity: .45; }
.brand .wm .rex { font-weight: 800; color: var(--coral); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.sidebar-section {
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    padding: var(--s-3) var(--s-3) var(--s-2);
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--muted-2);
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--dur-fast), color var(--dur-fast);
    position: relative;
}
.sidebar-link:hover { background: var(--ink-3); color: var(--paper); opacity: 1; }
.sidebar-link.active { background: var(--ink-3); color: var(--paper); border: 1px solid var(--line); }
.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px; bottom: 6px;
    width: 2px;
    background: var(--coral);
    border-radius: 0 2px 2px 0;
}
.sidebar-link .icon { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.5; opacity: .55; }
.sidebar-link:hover .icon, .sidebar-link.active .icon { opacity: 1; }

.sidebar-foot {
    padding-top: var(--s-4);
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.user-chip { display: flex; align-items: center; gap: var(--s-3); }
.avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--coral);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    flex: 0 0 28px;
}
.lang-switch select {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 3px 8px;
    font-size: .7rem;
    color: var(--muted-2);
    cursor: pointer;
    font-family: var(--mono);
    letter-spacing: .06em;
}
.btn-text {
    background: none; border: 0;
    color: var(--muted);
    cursor: pointer; padding: 4px 6px;
    font-size: .78rem;
    font-family: var(--font);
    border-radius: var(--r-sm);
}
.btn-text:hover { color: var(--coral); }

/* ---- Main content ---- */
.main {
    background: var(--ink-2);
    padding: var(--s-7) var(--s-8);
    min-height: 100vh;
}
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-5);
    margin-bottom: var(--s-6);
    padding-bottom: var(--s-5);
    border-bottom: 1px solid var(--line);
}
.page-head h2 { font-size: 1.5rem; color: var(--paper); }
.page-head .lead { color: var(--muted-2); font-size: .88rem; margin-top: var(--s-2); }
.page-actions { display: flex; gap: var(--s-3); align-items: center; }

/* ---- Buttons (REX pattern) ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 8px 14px;
    border-radius: var(--r-sm);
    font-family: var(--mono);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--dur-fast), opacity var(--dur-fast);
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); opacity: 1; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

.btn.primary, button.primary {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    cursor: pointer;
}
.btn.primary:hover, button.primary:hover { background: var(--paper-2); }

.btn.accent {
    background: var(--coral);
    color: var(--ink);
    border-color: var(--coral);
    font-weight: 600;
}
.btn.accent:hover { background: var(--coral-dark); border-color: var(--coral-dark); }

.btn.ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--muted-2);
}
.btn.ghost:hover { border-color: var(--muted); color: var(--paper); background: var(--ink-3); }

.btn.danger {
    background: transparent;
    color: var(--coral);
    border-color: var(--line);
}
.btn.danger:hover { border-color: var(--coral); background: var(--coral-dim); }

.btn.sm { padding: 5px 9px; font-size: .68rem; }
.btn.block { width: 100%; justify-content: center; }

button.link {
    background: none; border: 0;
    color: var(--coral);
    cursor: pointer; padding: 0;
    font: inherit;
}

/* ---- Cards ---- */
.card {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.card-pad { padding: var(--s-6); }
.card-head {
    padding: var(--s-4) var(--s-6);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
}
.card-head h3 {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 500;
}
.card-grid {
    display: grid;
    gap: var(--s-5);
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card-link {
    display: block;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--s-5);
    text-decoration: none;
    color: var(--paper);
    transition: border-color var(--dur-med), transform var(--dur-med);
    position: relative;
}
.card-link::after {
    content: "→";
    position: absolute;
    top: var(--s-5); right: var(--s-5);
    color: var(--muted);
    font-family: var(--mono);
    transition: transform var(--dur-fast), color var(--dur-fast);
}
.card-link:hover { border-color: var(--coral); transform: translateY(-2px); opacity: 1; box-shadow: var(--shadow-md); }
.card-link:hover::after { transform: translateX(3px); color: var(--coral); }
.card-link strong { display: block; font-weight: 600; font-size: .95rem; margin-bottom: var(--s-2); letter-spacing: -.01em; }
.card-link small { color: var(--muted-2); font-size: .82rem; }

/* ---- Forms ---- */
label {
    display: block;
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-family: var(--font);
    font-size: .92rem;
    color: var(--paper);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: var(--shadow-coral);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B6B72' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}
.hint { display: block; color: var(--muted); font-size: .75rem; font-family: var(--mono); margin-top: 4px; letter-spacing: .04em; }
.err, .field-validation-error { color: var(--coral); font-size: .82rem; margin: var(--s-2) 0; }
.err:empty { display: none; }
.input-validation-error { border-color: var(--coral) !important; }

.form-stack { display: flex; flex-direction: column; gap: var(--s-4); }
.form-card {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--s-6);
}

/* Legacy .login-card shim */
.login-card {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--s-6);
    margin: 0;
}
.login-card label { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); margin-top: var(--s-4); }
.login-card input { margin-top: 4px; }
.login-card small { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }

/* ---- Tables ---- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
thead { background: var(--ink-2); }
th {
    text-align: left;
    padding: 10px 16px;
    font-family: var(--mono);
    font-size: .64rem;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-soft);
    font-size: .9rem;
    vertical-align: middle;
    color: var(--paper-2);
}
tbody tr { transition: background var(--dur-fast); }
tbody tr:hover { background: var(--ink-4); }
tbody tr:last-child td { border-bottom: 0; }
tr.row-new { background: rgba(255,77,46,.07); animation: row-flash .5s var(--ease-out); }
@keyframes row-flash { 0% { background: rgba(255,77,46,.18); } 100% { background: rgba(255,77,46,.07); } }
td a { color: var(--paper); font-weight: 500; }
td a:hover { color: var(--coral); opacity: 1; }

.filters {
    display: flex;
    gap: var(--s-3);
    align-items: center;
    margin-bottom: var(--s-5);
}
.filters input, .filters select { flex: 0 0 auto; width: auto; min-width: 180px; }
.filters input[type="text"], .filters input[type="search"] { min-width: 260px; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    font-family: var(--mono);
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.badge::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .7;
}
.badge.b-New     { background: var(--status-new);     color: var(--status-new-fg); }
.badge.b-Open    { background: var(--status-open);    color: var(--status-open-fg); }
.badge.b-Pending { background: var(--status-pending); color: var(--status-pending-fg); }
.badge.b-Resolved{ background: var(--status-resolved);color: var(--status-resolved-fg); }
.badge.b-Closed  { background: var(--status-closed);  color: var(--status-closed-fg); }
.badge.plain { background: var(--ink-3); color: var(--muted-2); border-color: var(--line); }
.badge.plain::before { display: none; }

.priority { font-weight: 600; font-size: .85rem; font-family: var(--mono); }
.priority.p-Low    { color: var(--prio-low); }
.priority.p-Medium { color: var(--prio-medium); }
.priority.p-High   { color: var(--prio-high); }
.priority.p-Urgent { color: var(--prio-urgent); }

.ticket-num { font-family: var(--mono); font-size: .82rem; color: var(--muted); font-weight: 500; letter-spacing: .04em; }

/* ---- Alerts ---- */
.alert {
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    margin-bottom: var(--s-5);
    background: var(--ink-3);
    color: var(--muted-2);
    font-size: .88rem;
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
}
.alert::before { content: ""; width: 2px; align-self: stretch; border-radius: 2px; background: var(--muted); flex: 0 0 2px; }
.alert.success { background: rgba(0,209,122,.07); border-color: rgba(0,209,122,.25); color: #6ABA6A; }
.alert.success::before { background: #00D17A; }
.alert.warn { background: rgba(255,196,0,.07); border-color: rgba(255,196,0,.25); color: var(--prio-medium); }
.alert.warn::before { background: #FFC400; }
.alert.danger { background: var(--coral-dim); border-color: rgba(255,77,46,.3); color: #FF8066; }
.alert.danger::before { background: var(--coral); }
.alert.info { background: var(--coral-dim); border-color: rgba(255,77,46,.2); }
.alert.info::before { background: var(--coral); }

/* ---- Auth pages ---- */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--ink);
}
.auth-aside {
    background: var(--ink-2);
    border-right: 1px solid var(--line);
    padding: var(--s-9) var(--s-8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.auth-aside::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 25% 25%, var(--coral-glow), transparent 55%),
        radial-gradient(circle at 75% 75%, rgba(255,77,46,.06), transparent 60%);
    pointer-events: none;
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    padding: 0;
}
.auth-aside .rex-icon {
    width: 38px; height: 38px;
    background: var(--coral);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.auth-aside .rex-icon img { width: 80%; height: 80%; object-fit: contain; }
.auth-aside h1 {
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    line-height: .95;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: var(--s-7) 0 var(--s-5);
    color: var(--paper);
    max-width: 16ch;
}
.auth-aside h1 .accent { color: var(--coral); }
.auth-aside .lede { color: var(--muted-2); max-width: 38ch; line-height: 1.5; font-size: .92rem; }
.auth-aside .meta {
    font-family: var(--mono);
    font-size: .65rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
}
.auth-main {
    display: grid;
    place-items: center;
    padding: var(--s-7);
    background: var(--ink);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.6rem; margin-bottom: var(--s-2); }
.auth-card .lead { color: var(--muted-2); margin-bottom: var(--s-6); font-size: .88rem; }
.auth-card .form-row { margin-top: var(--s-4); }
.auth-card .switch { text-align: center; font-size: .85rem; color: var(--muted); margin-top: var(--s-6); }
.auth-card .switch a { color: var(--coral); }
@media (max-width: 880px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
}

/* ---- Message thread ---- */
.thread { display: flex; flex-direction: column; gap: var(--s-4); margin: var(--s-6) 0; }
.msg {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--s-5);
}
.msg.from-customer { border-left: 2px solid #6ABA6A; }
.msg.from-agent { border-left: 2px solid var(--coral); }
.msg.internal { background: rgba(255,196,0,.05); border-color: rgba(255,196,0,.18); border-left-color: #FFC400; }
.msg-meta {
    display: flex; align-items: center; gap: var(--s-3);
    margin-bottom: var(--s-3);
    font-family: var(--mono); font-size: .7rem; letter-spacing: .04em; color: var(--muted);
}
.msg-meta .who { color: var(--paper); font-size: .9rem; font-family: var(--font); font-weight: 600; }
.msg-body { font-size: .92rem; line-height: 1.65; color: var(--paper-2); }

.ticket-msg {
    background: var(--ink-3); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: var(--s-5); margin: var(--s-3) 0;
}
.ticket-msg.customer { border-left: 2px solid #6ABA6A; }
.ticket-msg.user, .ticket-msg.agent { border-left: 2px solid var(--coral); }
.ticket-msg small { display: block; color: var(--muted); font-size: .7rem; font-family: var(--mono); margin-bottom: var(--s-2); }

.reply-composer {
    background: var(--ink-3); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: var(--s-5); margin-top: var(--s-5);
}
.reply-composer h3 {
    font-family: var(--mono); font-size: .65rem;
    text-transform: uppercase; letter-spacing: .16em;
    color: var(--muted-2); font-weight: 500; margin-bottom: var(--s-3);
}

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-4); margin: var(--s-5) 0; }
.stat { background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5); }
.stat .stat-label { font-family: var(--mono); font-size: .65rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-2); }
.stat .stat-value { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--paper); }
.stat .stat-value.mono { font-family: var(--mono); font-size: 1.5rem; font-weight: 500; }
.stat .stat-value.danger { color: var(--coral); }
.stat .stat-value.success { color: #00D17A; }
.stat .stat-sub { color: var(--muted); font-size: .75rem; font-family: var(--mono); margin-top: var(--s-2); }

.progress-bar { height: 3px; background: var(--ink-4); border-radius: var(--r-pill); overflow: hidden; margin: var(--s-3) 0; }
.progress-bar > span { display: block; height: 100%; background: var(--coral); border-radius: var(--r-pill); transition: width .5s var(--ease-out); }

/* ---- Two-column ---- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-7); align-items: flex-start; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-3) var(--s-4); font-size: .88rem; }
dl.meta dt { font-family: var(--mono); font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); align-self: center; }
dl.meta dd { margin: 0; color: var(--paper-2); }

.empty-state { text-align: center; padding: var(--s-9) var(--s-5); color: var(--muted); }
.empty-state h3 { color: var(--paper-2); margin-bottom: var(--s-2); font-size: 1rem; }
.empty-state p { max-width: 42ch; margin: 0 auto var(--s-4); color: var(--muted); }

/* ---- Stagger ---- */
.stagger > * { opacity: 0; transform: translateY(5px); animation: stagger-in .35s var(--ease-out) forwards; }
.stagger > *:nth-child(1) { animation-delay: 30ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 90ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 150ms; }
.stagger > *:nth-child(6) { animation-delay: 180ms; }
.stagger > *:nth-child(7) { animation-delay: 210ms; }
.stagger > *:nth-child(8) { animation-delay: 240ms; }
@keyframes stagger-in { to { opacity: 1; transform: translateY(0); } }

/* ---- Helpers ---- */
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.dot.online { background: #00D17A; box-shadow: 0 0 0 3px rgba(0,209,122,.15); }
.dot.idle { background: #FFC400; }
.dot.offline { background: var(--muted); }

.muted { color: var(--muted-2); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-3 { margin-top: var(--s-3); }
.mt-5 { margin-top: var(--s-5); }
.mb-3 { margin-bottom: var(--s-3); }
.flex { display: flex; gap: var(--s-3); align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.tag-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); vertical-align: middle; margin-right: 6px; }

@media (max-width: 880px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -240px; transition: left var(--dur-med) var(--ease-out); }
    .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
    .main { padding: var(--s-5); }
}
