:root {
    color-scheme: dark;
    --ink-950: #080b12;
    --ink-900: #0d1119;
    --surface-1: rgba(17, 21, 31, 0.82);
    --surface-2: rgba(23, 29, 42, 0.92);
    --surface-3: rgba(255, 255, 255, 0.04);
    --line: rgba(162, 175, 201, 0.18);
    --line-strong: rgba(255, 143, 90, 0.3);
    --text-strong: #eff4ff;
    --text-base: #dbe4f5;
    --text-muted: #97a3b6;
    --accent: #ff8f5a;
    --accent-strong: #ffb06e;
    --accent-soft: rgba(255, 143, 90, 0.14);
    --success: #74d3a4;
    --danger: #ff7d7d;
    --shadow-soft: 0 24px 80px -32px rgba(0, 0, 0, 0.72);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Manrope', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-base);
    background:
        radial-gradient(circle at top left, rgba(255, 143, 90, 0.18), transparent 32%),
        radial-gradient(circle at top right, rgba(94, 234, 212, 0.12), transparent 25%),
        linear-gradient(180deg, var(--ink-950) 0%, var(--ink-900) 50%, #090c13 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 38%);
    opacity: 0.85;
}

img {
    max-width: 100%;
    display: block;
}

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

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

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

::selection {
    background: rgba(255, 143, 90, 0.24);
}

:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 143, 90, 0.18), 0 0 0 1px var(--accent);
}

.app-shell {
    position: relative;
    min-height: 100vh;
}

.shell-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 143, 90, 0.12), transparent 20%),
        radial-gradient(circle at 88% 20%, rgba(94, 234, 212, 0.08), transparent 18%),
        radial-gradient(circle at 75% 78%, rgba(59, 130, 246, 0.08), transparent 24%);
}

.shell-wrap {
    position: relative;
    z-index: 1;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

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

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 143, 90, 0.3), rgba(94, 234, 212, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-strong);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    font-weight: 700;
}

.page-title {
    margin: 0;
    color: var(--text-strong);
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 5vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.page-copy {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.75;
    font-size: 1rem;
}

.panel {
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.panel-inner {
    padding: 28px;
}

.panel-title {
    margin: 0;
    color: var(--text-strong);
    font-family: var(--font-display);
    font-size: 1.45rem;
    letter-spacing: -0.03em;
}

.panel-copy {
    margin: 10px 0 0;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.96rem;
}

.stack-sm > * + * {
    margin-top: 10px;
}

.stack-md > * + * {
    margin-top: 16px;
}

.stack-lg > * + * {
    margin-top: 24px;
}

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

.field-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.76rem;
    font-weight: 700;
}

.input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
    color: var(--text-strong);
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.input:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
}

.input::placeholder {
    color: rgba(219, 228, 245, 0.35);
}

.helper-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.inline-error {
    min-height: 20px;
    color: var(--danger);
    font-size: 0.88rem;
    line-height: 1.45;
}

.segmented {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.segmented button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.segmented button[aria-pressed='true'] {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-strong);
}

.segmented button:not(:disabled):hover {
    color: var(--text-strong);
    transform: translateY(-1px);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button--primary {
    color: #130d07;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 18px 38px -24px rgba(255, 143, 90, 0.9);
}

.button--secondary {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-strong);
}

.button--secondary:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
}

.button--danger {
    border-color: rgba(255, 125, 125, 0.24);
    background: rgba(255, 125, 125, 0.08);
    color: #ffd4d4;
}

.button--danger:hover:not(:disabled) {
    background: rgba(255, 125, 125, 0.12);
}

.button--small {
    min-height: 38px;
    padding: 10px 14px;
    font-size: 0.88rem;
}

.pill,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    color: var(--text-base);
    font-size: 0.84rem;
    font-weight: 700;
}

.pill--accent,
.status-badge--accent {
    border-color: var(--line-strong);
    background: var(--accent-soft);
    color: #ffd9c3;
}

.status-badge--success {
    border-color: rgba(116, 211, 164, 0.32);
    background: rgba(116, 211, 164, 0.12);
    color: #d4ffe9;
}

.status-badge--danger {
    border-color: rgba(255, 125, 125, 0.3);
    background: rgba(255, 125, 125, 0.1);
    color: #ffd6d6;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.metric-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.metric-value {
    margin-top: 10px;
    color: var(--text-strong);
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
}

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

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.list-row-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.list-row-title {
    color: var(--text-strong);
    font-weight: 700;
}

.list-row-copy {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.utility-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.utility-link {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.utility-link:hover {
    color: var(--text-strong);
}

.empty-state {
    padding: 24px;
    border: 1px dashed rgba(162, 175, 201, 0.22);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    text-align: center;
    line-height: 1.7;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 40;
    transform: translate(-50%, 120px);
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(15, 19, 28, 0.96);
    color: var(--text-strong);
    box-shadow: var(--shadow-soft);
    transition: transform 220ms ease;
}

.toast.is-visible {
    transform: translate(-50%, 0);
}

.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;
}

@media (max-width: 900px) {
    .shell-wrap {
        width: min(calc(100% - 24px), 1240px);
        padding-top: 20px;
    }

    .panel-inner {
        padding: 22px;
    }

    .list-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

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