:root {
    color-scheme: light;
    --page: #f2f5f9;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-tint: #fff5ef;
    --ink: #111827;
    --text: #1d2939;
    --muted: #667085;
    --line: #d7e0ec;
    --line-strong: #b8c6d8;
    --brand: #f15a1a;
    --brand-dark: #bf3115;
    --green: #07856f;
    --green-soft: #e8fbf6;
    --red-soft: #fff1ef;
    --amber: #a15c00;
    --amber-soft: #fff7e8;
    --shadow: 0 18px 46px rgba(20, 31, 48, 0.10);
    --shadow-soft: 0 8px 24px rgba(20, 31, 48, 0.07);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 16% -12%, rgba(241, 90, 26, 0.16), transparent 34%),
        radial-gradient(circle at 100% 0, rgba(7, 133, 111, 0.11), transparent 30%),
        linear-gradient(180deg, #fbfcff 0, #f2f5f9 420px, #eaf0f7 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
}

.shell {
    width: min(1480px, calc(100% - 36px));
    margin: 0 auto;
    padding: 24px 0 46px;
}

.hero,
.login-card,
.panel-card,
.stat-card,
.control-overview article,
.alert,
.rail {
    border: 1px solid rgba(176, 190, 211, 0.78);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.hero {
    overflow: hidden;
    margin-bottom: 16px;
    background:
        linear-gradient(135deg, rgba(18, 26, 39, 0.98), rgba(42, 22, 24, 0.97)),
        var(--ink);
    color: #ffffff;
}

.hero-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 14px;
}

.brand-logo,
.login-logo,
.rail img {
    display: block;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: #180604;
    object-fit: contain;
    padding: 5px;
    box-shadow: 0 14px 36px rgba(241, 90, 26, 0.27);
}

.brand-logo {
    width: 76px;
    height: 76px;
}

.login-logo {
    width: 108px;
    height: 108px;
    margin: 0 auto 14px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #ffbd88;
}

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

h1 {
    margin-bottom: 4px;
    font-size: 31px;
    line-height: 1.08;
}

h2 {
    margin-bottom: 0;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.2;
}

.hero h1,
.hero h2 {
    color: #ffffff;
}

.brand-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

.top-actions,
.button-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 18px 17px;
}

.section-tabs a {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.76);
    font-size: 13px;
    font-weight: 850;
    padding: 8px 12px;
    text-decoration: none;
}

.section-tabs a:hover {
    background: rgba(241, 90, 26, 0.25);
    color: #ffffff;
}

.section-tabs a.active {
    border-color: rgba(255, 189, 136, 0.72);
    background: rgba(241, 90, 26, 0.34);
    color: #ffffff;
}

.alert {
    margin-bottom: 14px;
    padding: 12px 14px;
}

.alert p {
    margin: 0;
}

.alert p + p {
    margin-top: 6px;
}

.alert-error {
    border-color: #ffc8c2;
    background: var(--red-soft);
    color: var(--brand-dark);
}

.alert-success {
    border-color: #b7eadf;
    background: var(--green-soft);
    color: var(--green);
}

.alert-warning {
    border-color: #fedc9f;
    background: var(--amber-soft);
    color: var(--amber);
}

.login-card {
    width: min(440px, 100%);
    margin: 42px auto 0;
    padding: 28px;
    text-align: center;
}

.login-card h2 {
    font-size: 24px;
}

.login-form {
    margin-top: 20px;
    text-align: left;
}

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

.stat-card {
    min-height: 108px;
    position: relative;
    overflow: hidden;
    padding: 16px;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 5px rgba(241, 90, 26, 0.12);
}

.stat-card span,
.control-overview span,
.field span,
.secret-panel > div span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    color: var(--ink);
    font-size: 34px;
    line-height: 1;
}

.stat-card .stat-text {
    max-width: 230px;
    font-size: 20px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

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

.control-overview article {
    min-width: 0;
    padding: 14px;
}

.control-overview strong {
    display: block;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-top: 9px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    font-weight: 900;
    padding: 2px 9px;
}

.pill-ready {
    border-color: #9de6d4;
    background: var(--green-soft);
    color: var(--green);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.rail {
    position: sticky;
    top: 14px;
}

.rail {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.rail img {
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
}

.rail a {
    border: 1px solid transparent;
    border-radius: 6px;
    color: #344054;
    font-weight: 850;
    padding: 9px 10px;
    text-decoration: none;
}

.rail a:hover {
    border-color: #ffd1bd;
    background: var(--surface-tint);
    color: var(--brand-dark);
}

.rail a.active {
    border-color: #ffb38e;
    background: var(--surface-tint);
    color: var(--brand-dark);
    box-shadow: inset 3px 0 0 var(--brand);
}

.sections {
    display: grid;
    gap: 14px;
}

.panel-card {
    scroll-margin-top: 18px;
    padding: 18px;
}

.compact-card {
    padding: 16px;
}

.section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
}

.section-title > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.panel-form {
    display: grid;
    gap: 12px;
}

.grid {
    display: grid;
    gap: 12px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
    grid-template-columns: 0.85fr 0.85fr 1.3fr;
}

.field {
    display: grid;
    gap: 6px;
}

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

input,
textarea,
select {
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    padding: 10px 12px;
}

textarea {
    min-height: 112px;
    resize: vertical;
}

select {
    cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(241, 90, 26, 0.13);
}

.check-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: #344054;
    font-weight: 800;
}

.check-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
}

.check-danger {
    color: var(--brand-dark);
}

.security-note,
.secret-panel {
    border: 1px solid #ffd0bc;
    border-radius: 8px;
    background: var(--surface-tint);
    padding: 13px;
}

.security-note {
    display: grid;
    gap: 3px;
    margin-bottom: 14px;
}

.security-note strong {
    color: var(--brand-dark);
}

.security-note span {
    color: #6b4b3c;
}

.warning-note {
    border-color: #ffb38e;
    background: #fff2eb;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.secret-panel {
    display: grid;
    gap: 12px;
}

.secret-panel > div strong {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.secret-panel > div small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 40px;
    border: 1px solid var(--brand);
    border-radius: 6px;
    background: var(--brand);
    color: #ffffff;
    cursor: pointer;
    font-weight: 900;
    padding: 9px 14px;
    text-decoration: none;
    white-space: nowrap;
}

.button:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.button-dark {
    background: var(--ink);
    border-color: var(--ink);
}

.button-dark:hover {
    background: #293448;
    border-color: #293448;
}

.button-soft,
.button-ghost {
    border-color: #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.hero .button-soft,
.hero .button-ghost {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.button-soft:hover,
.button-ghost:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.hero .button-soft:hover,
.hero .button-ghost:hover {
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.16);
}

.button-wide {
    width: 100%;
}

.endpoint-list {
    display: grid;
    gap: 9px;
}

.endpoint-list a {
    display: block;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--ink);
    font-weight: 850;
    padding: 10px 12px;
    text-decoration: none;
}

.endpoint-list a:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
}

.endpoint-value {
    margin: 12px 0;
    border: 1px dashed var(--line-strong);
    border-radius: 6px;
    background: #ffffff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    overflow-wrap: anywhere;
    padding: 9px 10px;
}

pre {
    max-height: 520px;
    overflow: auto;
    border: 1px solid #1f2937;
    border-radius: 6px;
    background: #0f1722;
    color: #d7fbe8;
    padding: 14px;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-list article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 12px;
}

.history-list strong,
.history-list span {
    display: block;
}

.history-list span,
.muted {
    color: var(--muted);
}

.history-list span {
    font-size: 12px;
}

.history-list p {
    margin: 8px 0 0;
}

.muted {
    margin-bottom: 0;
}

.notification-card {
    padding: 14px;
}

.notification-head,
.history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.notification-head {
    margin-bottom: 14px;
}

.notification-head h2,
.history-head h2 {
    font-size: 21px;
}

.notification-head p {
    margin: 3px 0 0;
    color: #0f172a;
}

.button-send {
    min-width: 76px;
    border-color: var(--green);
    background: var(--green);
}

.button-send:hover {
    border-color: #056b59;
    background: #056b59;
}

.notification-top-grid {
    grid-template-columns: 1fr 1fr 1fr;
}

.notification-action-grid {
    grid-template-columns: 0.7fr 1fr 1fr;
}

.notification-form textarea {
    min-height: 116px;
}

.notification-preview-wrap {
    margin-top: 14px;
}

.preview-label {
    margin-bottom: 8px;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.preview-label span {
    color: var(--muted);
    font-weight: 750;
}

.phone-notification {
    width: min(420px, 100%);
    border-radius: 8px;
    background: #f4f7fa;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.10);
    padding: 13px 14px;
}

.phone-notification-top {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
}

.phone-notification-top img {
    border-radius: 50%;
    background: #0f172a;
    object-fit: contain;
    padding: 2px;
}

.phone-notification-top strong {
    font-size: 13px;
}

.phone-notification-top span {
    color: #94a3b8;
    font-size: 12px;
}

.phone-notification h3 {
    margin: 8px 0 3px;
    color: #020617;
    font-size: 15px;
}

.phone-notification p {
    margin: 0;
    color: #334155;
}

.server-json {
    margin-top: 12px;
}

.server-json summary {
    cursor: pointer;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.server-json pre {
    max-height: 280px;
    margin-top: 10px;
}

.history-head {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.history-actions form {
    margin: 0;
}

.danger-soft {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fff7f7;
}

.danger-soft:hover {
    border-color: #fca5a5;
    background: #fee2e2;
}

.empty-history {
    margin-top: 12px;
    border: 1px dashed #9edbd2;
    border-radius: 8px;
    background: #f5fffc;
    color: #47635e;
    font-weight: 850;
    padding: 13px;
}

.notification-history-table {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.history-row {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1.4fr 1fr 0.55fr 0.55fr;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 10px;
}

.history-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.history-row-head {
    background: #eef4f8;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.history-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1180px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .rail {
        position: static;
    }

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

    .rail img {
        display: none;
    }

    .control-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .shell {
        width: min(100% - 20px, 720px);
        padding-top: 12px;
    }

    .hero-main {
        display: grid;
        gap: 14px;
    }

    .brand-lockup {
        align-items: flex-start;
    }

    .brand-logo {
        width: 62px;
        height: 62px;
    }

    h1 {
        font-size: 25px;
    }

    .stats-grid,
    .control-overview,
    .rail,
    .grid.two,
    .grid.three,
    .notification-top-grid,
    .notification-action-grid,
    .history-row {
        grid-template-columns: 1fr;
    }

    .button,
    .button-row,
    .top-actions {
        width: 100%;
    }
}
