:root {
    --surface-lowest: #0e0e0e;
    --surface: #131313;
    --surface-low: #1c1b1b;
    --surface-container: #201f1f;
    --surface-high: #2a2a2a;
    --surface-highest: #353534;
    --surface-bright: #393939;
    --text: #e5e2e1;
    --text-soft: #d4c5ab;
    --text-dim: #9c8f78;
    --primary: #ffe2ab;
    --primary-container: #ffbf00;
    --secondary-container: #af8d11;
    --primary-ink: #261a00;
    --outline-ghost: rgba(80, 69, 50, 0.15);
    --shadow-soft: 0 18px 50px rgba(6, 6, 6, 0.32);
    --shadow-panel: 0 12px 32px rgba(8, 8, 8, 0.38);
    --green: #79d999;
    --green-soft: rgba(121, 217, 153, 0.14);
    --cyan: #00d9fc;
    --cyan-soft: rgba(0, 217, 252, 0.14);
    --red: #ffb4ab;
    --red-soft: rgba(255, 180, 171, 0.12);
    --warning: #e9c349;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--surface-lowest);
}

body {
    margin: 0;
    color: var(--text);
    font: 14px/1.5 "Inter", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 191, 0, 0.06), transparent 20%),
        radial-gradient(circle at top right, rgba(0, 217, 252, 0.03), transparent 18%),
        linear-gradient(180deg, #101010 0%, #0d0d0d 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
.sidebar-brand strong,
.metric strong {
    font-family: "Manrope", sans-serif;
    letter-spacing: -0.02em;
}

h1,
h2,
h3,
h4 {
    margin: 0;
}

p {
    margin-top: 0;
}

.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.app-shell {
    display: grid;
    grid-template-columns: 264px 1fr;
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
}

.standalone-shell {
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    padding: 28px 18px;
    background: linear-gradient(180deg, rgba(14, 14, 14, 0.98), rgba(15, 15, 15, 0.94));
    box-shadow: inset -1px 0 0 var(--outline-ghost);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-brand {
    padding: 18px 18px 16px;
    background: linear-gradient(180deg, rgba(28, 27, 27, 0.96), rgba(19, 19, 19, 0.96));
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.12), var(--shadow-soft);
    border-radius: 10px;
}

.platform-logo {
    display: block;
    object-fit: contain;
}

.sidebar-platform-logo {
    width: 132px;
    height: auto;
    margin-bottom: 14px;
}

.sidebar-brand strong {
    display: block;
    font-size: 21px;
    color: var(--primary);
    font-weight: 800;
}

.sidebar-brand small {
    display: block;
    margin-top: 6px;
    color: var(--text-dim);
    font-size: 10px;
    letter-spacing: 0.24em;
}

.brand-kicker,
.page-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary-container);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px 13px 16px;
    color: rgba(229, 226, 225, 0.44);
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-left: 3px solid transparent;
    border-radius: 0 10px 10px 0;
    transition: 0.18s ease;
}

.sidebar-nav a:hover {
    color: rgba(255, 226, 171, 0.84);
    background: rgba(19, 19, 19, 0.8);
    transform: translateX(4px);
}

.sidebar-nav a.is-active {
    color: var(--primary);
    background: linear-gradient(90deg, rgba(53, 53, 52, 0.9), rgba(29, 29, 29, 0.2));
    border-left-color: var(--primary-container);
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.1);
}

.nav-icon {
    font-size: 20px;
    opacity: 0.92;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(80, 69, 50, 0.1);
    display: grid;
    gap: 12px;
}

.user-card {
    padding: 14px 15px;
    background: linear-gradient(180deg, rgba(32, 31, 31, 0.96), rgba(19, 19, 19, 0.96));
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.12);
}

.user-card div {
    font-family: "Manrope", sans-serif;
    font-weight: 700;
}

.user-card small {
    color: var(--text-dim);
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    color: rgba(255, 226, 171, 0.82);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.15);
    background: rgba(53, 53, 52, 0.24);
    transition: 0.18s ease;
}

.ghost-button:hover {
    background: rgba(57, 57, 57, 0.4);
}

.main-content {
    padding: 0 28px 28px;
}

.standalone-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}

.page-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 72px;
    margin: 0 -28px 22px;
    padding: 14px 28px;
    background: rgba(19, 19, 19, 0.94);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 -1px 0 rgba(80, 69, 50, 0.15);
}

.page-header h1 {
    color: var(--primary);
    font-size: 26px;
    font-weight: 800;
}

.page-header-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.header-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 191, 0, 0.24), rgba(175, 141, 17, 0.22));
    color: var(--primary);
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.header-chip-muted {
    background: rgba(53, 53, 52, 0.45);
    color: var(--text-soft);
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.12);
}

.card,
.metric,
.detail-card,
.auth-panel,
.table-wrap,
.data-strip {
    background: linear-gradient(180deg, rgba(28, 27, 27, 0.96), rgba(18, 18, 18, 0.96));
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.12), var(--shadow-panel);
}

.card,
.metric,
.detail-card,
.auth-panel,
.data-strip {
    padding: 18px;
}

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

.grid-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-two {
    grid-template-columns: 1.35fr 1fr;
}

.stats-layout {
    grid-template-columns: 300px 1fr;
    align-items: start;
}

.metric {
    position: relative;
    overflow: hidden;
    min-height: 138px;
}

.metric::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: rgba(80, 69, 50, 0.24);
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 42px;
    line-height: 1;
    color: var(--text);
}

.metric-amber::after {
    background: var(--primary-container);
    box-shadow: 0 0 18px rgba(255, 191, 0, 0.2);
}

.metric-up::after {
    background: var(--green);
    box-shadow: 0 0 18px rgba(121, 217, 153, 0.2);
}

.metric-down::after {
    background: var(--red);
    box-shadow: 0 0 12px rgba(255, 180, 171, 0.4);
}

.metric-neutral::after {
    background: rgba(80, 69, 50, 0.4);
}

.metric .muted {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.muted {
    color: var(--text-dim);
}

.split-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.split-header h2 {
    color: var(--primary);
    font-size: 19px;
    font-weight: 800;
}

.table-wrap {
    overflow: hidden;
    padding: 0;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: rgba(53, 53, 52, 0.34);
}

th,
td {
    text-align: left;
    padding: 14px 16px;
    vertical-align: top;
}

tbody tr {
    background: transparent;
}

tbody tr + tr td {
    box-shadow: inset 0 1px 0 rgba(80, 69, 50, 0.12);
}

tbody tr:hover td {
    background: rgba(57, 57, 57, 0.16);
}

.table-row-down td {
    background: rgba(147, 0, 10, 0.16);
}

.table-row-down:hover td {
    background: rgba(147, 0, 10, 0.24);
}

.table-row-down td:first-child {
    box-shadow: inset 3px 0 0 rgba(255, 180, 171, 0.65);
}

th {
    color: var(--text-dim);
    font-family: "Manrope", sans-serif;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.badge-up,
.badge-down,
.badge-neutral {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.badge-up {
    color: #c9f7d7;
    background: var(--green-soft);
}

.badge-up::before,
.badge-down::before,
.badge-neutral::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    flex: 0 0 6px;
}

.badge-up::before {
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(121, 217, 153, 0.4);
    animation: upPulse 1.9s infinite;
}

.badge-down {
    color: var(--red);
    background: var(--red-soft);
}

.badge-down::before {
    background: var(--red);
    box-shadow: 0 0 8px rgba(255, 180, 171, 0.55);
}

.badge-neutral {
    color: var(--text-soft);
    background: rgba(53, 53, 52, 0.48);
}

.badge-neutral::before {
    background: var(--warning);
}

.actions,
.stack-md {
    display: grid;
    gap: 14px;
}

.inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

label {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

input,
textarea,
select {
    width: 100%;
    min-height: 46px;
    background: rgba(53, 53, 52, 0.68);
    color: var(--text);
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 8px;
    padding: 12px 14px;
    font: inherit;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.14);
    transition: 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
    background: rgba(57, 57, 57, 0.86);
    border-bottom-color: var(--primary-container);
    box-shadow: inset 0 0 0 1px rgba(255, 191, 0, 0.22);
}

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

.primary-button,
.secondary-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 15px;
    border-radius: 8px;
    border: 0;
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: 0.18s ease;
}

.primary-button {
    color: var(--primary-ink);
    background: linear-gradient(135deg, var(--primary-container), var(--secondary-container));
    box-shadow: 0 12px 24px rgba(255, 191, 0, 0.12);
}

.primary-button:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.secondary-button {
    color: var(--primary);
    background: rgba(53, 53, 52, 0.36);
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.15);
}

.secondary-button:hover {
    background: rgba(57, 57, 57, 0.52);
}

.danger-button {
    color: var(--red);
    background: rgba(147, 0, 10, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 180, 171, 0.14);
}

.danger-button:hover {
    background: rgba(147, 0, 10, 0.24);
}

.full-width {
    width: 100%;
}

.flash {
    margin-bottom: 18px;
    padding: 14px 15px;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.14);
}

.flash.success {
    background: rgba(121, 217, 153, 0.12);
    color: #c9f7d7;
}

.flash.error {
    background: rgba(255, 180, 171, 0.12);
    color: #ffd1cb;
}

.auth-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-panel {
    width: min(460px, 100%);
    background:
        radial-gradient(circle at top right, rgba(255, 191, 0, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(28, 27, 27, 0.98), rgba(18, 18, 18, 0.98));
}

.brand-lockup h1 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 34px;
    font-weight: 800;
}

.auth-platform-logo {
    width: 176px;
    height: auto;
    margin: 0 0 18px;
}

.brand-lockup p {
    color: var(--text-dim);
    margin: 0 0 28px;
}

.code {
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    color: var(--primary);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.monitor-list {
    display: grid;
    gap: 8px;
}

.monitor-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    flex-wrap: wrap;
}

.monitor-search-input {
    flex: 1 1 220px;
    min-width: 0;
}

.monitor-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 9px;
    background: rgba(32, 31, 31, 0.7);
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.1);
    transition: 0.18s ease;
}

.monitor-list-item:hover,
.monitor-list-item.is-active {
    background: linear-gradient(90deg, rgba(53, 53, 52, 0.92), rgba(32, 31, 31, 0.76));
    box-shadow: inset 0 0 0 1px rgba(255, 191, 0, 0.12);
}

.chart-card {
    height: 220px;
    padding-top: 8px;
}

.chart-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background:
        linear-gradient(to top, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 100%/100% 25%,
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
    border-radius: 8px;
    padding: 8px;
}

.chart-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.report-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.report-logo {
    height: 96px;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.12);
    padding: 12px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
}

.pagination-pages {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text-soft);
    background: rgba(53, 53, 52, 0.28);
    box-shadow: inset 0 0 0 1px rgba(80, 69, 50, 0.14);
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.pagination-link.is-active {
    color: var(--primary-ink);
    background: linear-gradient(135deg, var(--primary-container), var(--secondary-container));
    box-shadow: none;
}

.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

@keyframes upPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(121, 217, 153, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(121, 217, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(121, 217, 153, 0);
    }
}

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

    .sidebar {
        position: static;
        min-height: auto;
        box-shadow: inset 0 -1px 0 var(--outline-ghost);
    }

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

    .standalone-main {
        padding: 18px;
    }

    .page-header {
        position: static;
        margin: 0 -18px 18px;
        padding: 18px;
        flex-direction: column;
        align-items: flex-start;
    }

    .grid-two,
    .stats-layout {
        grid-template-columns: 1fr;
    }
}
