:root {
    --navy-950: #071425;
    --navy-900: #0b1b32;
    --navy-800: #102644;
    --ink: #172033;
    --muted: #687286;
    --line: #dde3ec;
    --surface: #ffffff;
    --canvas: #f3f6fa;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --cyan: #0891b2;
    --green: #0f9f6e;
    --green-soft: #e8f8f2;
    --amber: #b7791f;
    --amber-soft: #fff7df;
    --shadow: 0 16px 38px rgba(15, 32, 61, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

button,
select {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 28px 20px;
    color: #dbe7f8;
    background:
        radial-gradient(circle at 20% 15%, rgba(37, 99, 235, 0.24), transparent 32%),
        linear-gradient(165deg, var(--navy-800), var(--navy-950));
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 8px 28px;
    color: #ffffff;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: #ffffff;
    background: linear-gradient(145deg, #2f75ff, #13a6c7);
    box-shadow: 0 10px 22px rgba(17, 110, 255, 0.28);
    font-size: 21px;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 17px;
    letter-spacing: 0.01em;
}

.brand small {
    margin-top: 1px;
    color: #93a9c6;
    font-size: 12px;
}

.nav-list {
    display: grid;
    gap: 7px;
}

.nav-item {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    color: #aebed4;
    text-decoration: none;
    transition: 160ms ease;
}

.nav-item:hover,
.nav-item.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    box-shadow: inset 3px 0 #53c8e7;
}

.sidebar-note {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin-top: auto;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-note strong {
    display: block;
    color: #ffffff;
    font-size: 13px;
}

.sidebar-note p {
    margin: 3px 0 0;
    color: #93a9c6;
    font-size: 12px;
}

.pulse-dot {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: #35d69a;
    box-shadow: 0 0 0 5px rgba(53, 214, 154, 0.12);
}

.main-content {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 34px 42px 22px;
}

.topbar,
.panel-heading,
.control-row,
.proof-note,
footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar {
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

h2 {
    margin-bottom: 0;
    font-size: 19px;
    letter-spacing: -0.015em;
}

.topbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.verified-badge,
.clock,
.count-badge,
.live-indicator,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    white-space: nowrap;
}

.verified-badge {
    padding: 7px 12px;
    color: #087151;
    background: var(--green-soft);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.clock {
    min-width: 78px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: #445065;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.safety-banner {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 18px;
    border: 1px solid #a9e4ce;
    border-radius: 13px;
    color: #0c684c;
    background: linear-gradient(90deg, #eafaf4, #f7fffc);
}

.safety-banner strong {
    display: block;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.safety-banner p {
    margin: 3px 0 0;
    color: #377563;
    font-size: 13px;
}

.safety-icon {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: var(--green);
    font-size: 18px;
    font-weight: 900;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat-card,
.panel,
.proof-note {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stat-card {
    min-width: 0;
    padding: 17px 18px;
}

.stat-label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-card strong,
.stat-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card strong {
    margin-bottom: 3px;
    font-size: 15px;
}

.stat-card small {
    color: var(--muted);
    font-size: 12px;
}

.panel {
    padding: 22px;
}

.control-panel {
    margin-bottom: 16px;
}

.panel-heading {
    margin-bottom: 18px;
}

.panel-heading.compact {
    margin-bottom: 15px;
}

.status-pill {
    min-width: 84px;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 800;
}

.status-pill.ready {
    color: #0b5e96;
    background: #e7f5ff;
}

.status-pill.running {
    color: #087151;
    background: var(--green-soft);
}

.status-pill.paused {
    color: #8a5a0a;
    background: var(--amber-soft);
}

.status-pill.complete {
    color: #ffffff;
    background: var(--green);
}

.progress-track {
    height: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf4;
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), #20a7c5);
    transition: width 450ms ease;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.button {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    transition: 150ms ease;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.button.primary {
    color: #ffffff;
    background: var(--blue);
    box-shadow: 0 7px 15px rgba(37, 99, 235, 0.2);
}

.button.primary:not(:disabled):hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.button.secondary {
    color: #ffffff;
    background: var(--navy-800);
}

.button.ghost {
    border-color: var(--line);
    color: #3d485d;
    background: #ffffff;
}

.speed-control {
    display: flex;
    gap: 9px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.speed-control select {
    padding: 7px 28px 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
}

.response-box {
    margin-top: 18px;
    padding: 12px 14px;
    border-left: 4px solid var(--blue);
    border-radius: 7px;
    color: #2f4e76;
    background: #f0f6ff;
    font-size: 13px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 16px;
}

.count-badge {
    width: 31px;
    height: 31px;
    color: var(--blue);
    background: #edf3ff;
    font-size: 12px;
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

td {
    color: #465166;
    font-size: 12px;
}

td strong,
td small {
    display: block;
}

td strong {
    color: var(--ink);
    font-size: 13px;
}

td small {
    margin-top: 2px;
    color: var(--muted);
}

.recipient-status {
    display: inline-flex;
    min-width: 68px;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.recipient-status.queued {
    color: #586276;
    background: #edf0f5;
}

.recipient-status.processing {
    color: #8a5a0a;
    background: var(--amber-soft);
}

.recipient-status.simulated {
    color: #087151;
    background: var(--green-soft);
}

.live-indicator {
    gap: 7px;
    padding: 6px 9px;
    color: #527062;
    background: #f0f8f4;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.live-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.log-box {
    height: 159px;
    overflow: auto;
    padding: 13px;
    border-radius: 9px;
    color: #d8e4f7;
    background: var(--navy-950);
    font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.log-box p {
    display: grid;
    grid-template-columns: 63px 48px 1fr;
    gap: 7px;
    margin: 0 0 7px;
}

.log-box time {
    color: #778da8;
    font-variant-numeric: tabular-nums;
}

.log-info,
.log-safe,
.log-done {
    font-weight: 800;
}

.log-info {
    color: #55b8f0;
}

.log-safe,
.log-done {
    color: #4ade9f;
}

.proof-note {
    margin-top: 16px;
    padding: 22px;
}

.proof-note > div {
    max-width: 810px;
}

.proof-note p:last-child {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.text-link {
    flex: 0 0 auto;
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

footer {
    margin-top: 20px;
    padding: 15px 2px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}

footer strong {
    color: #344056;
}

@media (max-width: 1040px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
        padding: 18px;
    }

    .brand {
        padding-bottom: 14px;
    }

    .nav-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nav-item {
        justify-content: center;
        padding: 10px;
        font-size: 12px;
    }

    .sidebar-note {
        display: none;
    }

    .main-content {
        padding: 25px 18px 18px;
    }
}

@media (max-width: 600px) {
    .topbar,
    .control-row,
    .proof-note,
    footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-item span {
        display: none;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 18px;
    }

    .speed-control {
        width: 100%;
        justify-content: space-between;
    }

    .button-group,
    .button {
        width: 100%;
    }

    .button {
        justify-content: center;
    }

    .safety-banner {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
