/* Admin console: the pieces only the platform admin needs, built on tokens.css
   (so light and dark come for free). Everything shared with the company dashboard lives in admin.css. */

/* ---------- shell ---------- */
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-scope {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--rz-muted);
}
.sidebar-count--danger { background: var(--rz-danger-bg); color: var(--rz-danger-fg); }
.sidebar-external { margin-inline-start: auto; font-size: 11px; opacity: .6; }

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: var(--rz-sunken);
    color: var(--rz-text);
    font-size: 12px;
    font-weight: 500;
}

/* ---------- home: work that waits on the admin ---------- */
.ac-queue {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.ac-queue-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-l);
    background: var(--rz-surface);
    color: var(--rz-text);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ac-queue-card:hover { border-color: var(--rz-line-strong); box-shadow: var(--rz-shadow-card); color: var(--rz-text); }
.ac-queue-card:focus-visible { outline: 2px solid var(--rz-focus); outline-offset: 2px; }
.ac-queue-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ac-queue-icon {
    width: 32px; height: 32px;
    display: inline-grid; place-items: center;
    border-radius: 10px;
    background: var(--rz-sunken);
    color: var(--rz-muted);
}
.ac-queue-value { font-size: 28px; font-weight: 600; color: var(--rz-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ac-queue-label { font-size: 13px; color: var(--rz-muted); }
.ac-queue-card.is-waiting { background: var(--rz-waiting-tint); border-color: var(--rz-brand); }
.ac-queue-card.is-waiting .ac-queue-icon { background: var(--rz-brand); color: var(--rz-on-brand); }
.ac-queue-card.is-alarm { border-color: var(--rz-danger-fg); }
.ac-queue-card.is-alarm .ac-queue-icon { background: var(--rz-danger-bg); color: var(--rz-danger-fg); }
.ac-queue-card.is-clear .ac-queue-value { color: var(--rz-muted); }
.ac-queue-go { font-size: 12px; color: var(--rz-brand-text); font-weight: 500; }
.ac-queue-card.is-clear .ac-queue-go { color: var(--rz-muted); }

.ac-delta { font-size: 12px; font-weight: 500; }
.ac-delta.is-up { color: var(--rz-good-fg); }
.ac-delta.is-down { color: var(--rz-danger-fg); }
.kpi-sub { font-size: 12px; color: var(--rz-muted); }
.kpi-card .kpi-value small { font-size: 14px; color: var(--rz-muted); font-weight: 500; }

/* ---------- home: 14-day activity ---------- */
.ac-chart { padding: 18px 20px 14px; }
.ac-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ac-legend { display: flex; gap: 14px; font-size: 12px; color: var(--rz-muted); }
.ac-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ac-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ac-swatch-chat { background: var(--rz-brand); }
.ac-swatch-campaign { background: var(--rz-info-fg); }
.ac-bars {
    display: grid;
    grid-template-columns: repeat(var(--days, 14), minmax(0, 1fr));
    align-items: end;
    gap: 6px;
    height: 160px;
    border-bottom: 1px solid var(--rz-line);
}
.ac-bar {
    display: flex;
    flex-direction: column-reverse;
    height: 100%;
    justify-content: flex-start;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    cursor: default;
}
.ac-bar-seg { display: block; width: 100%; min-height: 0; }
.ac-bar-seg--chat { background: var(--rz-brand); }
.ac-bar-seg--campaign { background: var(--rz-info-fg); }
.ac-bar:hover .ac-bar-seg { filter: brightness(1.08); }
.ac-bar.is-today .ac-bar-seg--chat { background: var(--rz-brand-hover); }
.ac-axis {
    display: grid;
    grid-template-columns: repeat(var(--days, 14), minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--rz-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.ac-axis span:nth-child(even) { visibility: hidden; }
.ac-chart-empty { height: 160px; display: grid; place-items: center; color: var(--rz-muted); font-size: 13px; border-bottom: 1px solid var(--rz-line); }

.ac-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 991.98px) { .ac-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.ac-stack { display: flex; flex-direction: column; gap: 16px; }
.ac-list-foot { padding: 10px 18px 14px; }
.ac-list-foot a { font-size: 13px; font-weight: 500; }

/* ---------- company profile ---------- */
.ac-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.ac-avatar {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: grid; place-items: center;
    background: var(--rz-brand-tint);
    color: var(--rz-brand-text);
    font-size: 22px;
    font-weight: 600;
    overflow: hidden;
    flex: 0 0 auto;
}
.ac-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ac-profile-text { flex: 1 1 260px; min-width: 0; }
.ac-profile-text h1 { font-size: 22px; font-weight: 600; color: var(--rz-ink); margin: 0 0 6px; }
.ac-profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--rz-muted); font-size: 13px; }
.ac-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.ac-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--rz-line);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-l);
    overflow: hidden;
    margin-bottom: 20px;
}
.ac-stat { background: var(--rz-surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.ac-stat-value { font-size: 20px; font-weight: 600; color: var(--rz-ink); font-variant-numeric: tabular-nums; }
.ac-stat-label { font-size: 12px; color: var(--rz-muted); }
.ac-stat-note { font-size: 11px; color: var(--rz-brand-text); }

.ac-flags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 18px; }
.ac-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--rz-sunken); color: var(--rz-text); }
.ac-flag.is-on { background: var(--rz-good-bg); color: var(--rz-good-fg); }

/* ---------- payments summary ---------- */
.ac-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding: 14px 18px;
    margin-bottom: 16px;
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-l);
    background: var(--rz-surface);
}
.ac-summary-item { display: flex; flex-direction: column; gap: 2px; }
.ac-summary-item strong { font-size: 18px; color: var(--rz-ink); font-variant-numeric: tabular-nums; }
.ac-summary-item span { font-size: 12px; color: var(--rz-muted); }
.ac-summary-item.is-main strong { color: var(--rz-good-fg); }
.ac-summary-item.is-alert strong { color: var(--rz-danger-fg); }

.ac-date-range { display: inline-flex; align-items: center; gap: 6px; }
.ac-date-range input[type="date"] {
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-s);
    background: var(--rz-surface);
    color: var(--rz-text);
    padding: 3px 8px;
    font-size: 13px;
    height: 32px;
}
.ac-date-range input[type="date"].is-set { border-color: var(--rz-brand); background: var(--rz-waiting-tint); }

/* ---------- logs ---------- */
.ac-code {
    margin: 0;
    padding: 16px 18px;
    max-height: 520px;
    overflow: auto;
    background: var(--rz-sunken);
    border-top: 1px solid var(--rz-line);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--rz-text);
    white-space: pre;
    direction: ltr;
    text-align: left;
    border-radius: 0 0 var(--rz-radius-l) var(--rz-radius-l);
}
.ac-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; direction: ltr; unicode-bidi: isolate; }
.ac-kv { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--rz-muted); }
.ac-kv li { display: inline-flex; gap: 4px; }
.ac-kv b { color: var(--rz-text); font-weight: 500; }
.ac-action-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--rz-muted); direction: ltr; unicode-bidi: isolate; }
.cell-message { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 560px; }

/* ---------- small helpers ---------- */
.ac-muted { color: var(--rz-muted); }
.ac-inline-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ac-thumb { width: 96px; height: 54px; object-fit: cover; border-radius: var(--rz-radius-s); border: 1px solid var(--rz-line); background: var(--rz-sunken); }
.ac-order { display: inline-flex; gap: 4px; }
.ac-order .btn { padding: 2px 8px; }

.rz-timeline-dot.is-bad { background: var(--rz-danger-bg); box-shadow: inset 0 0 0 2px var(--rz-danger-fg); }

@media (max-width: 767.98px) {
    .ac-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ac-profile-actions { width: 100%; }
    .ac-profile-actions .btn { flex: 1 1 auto; }
    .ac-bars, .ac-axis { gap: 3px; }
}

@media (max-width: 575.98px) {
    .ac-queue,
    .admin-console .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ac-queue-card { padding: 12px 14px; }
    .ac-queue-value { font-size: 24px; }
    .ac-queue-go { display: none; }
    .admin-console .kpi-card { padding: 14px; }
    .admin-console .kpi-value { font-size: 22px; }
}
