:root {
    color-scheme: dark;
    --bg: #05080d;
    --bg-soft: #08111a;
    --surface: rgba(12, 23, 34, 0.86);
    --surface-strong: rgba(16, 31, 45, 0.96);
    --border: rgba(137, 168, 191, 0.18);
    --border-bright: rgba(32, 211, 255, 0.36);
    --text: #eef7ff;
    --muted: #8fa2b5;
    --muted-2: #617486;
    --cyan: #19cfff;
    --lime: #93f943;
    --amber: #f8b931;
    --red: #ff4d5c;
    --purple: #a78bfa;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(25, 207, 255, 0.12), transparent 30%),
        linear-gradient(135deg, #05080d 0%, #07121b 48%, #05080d 100%);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

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

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-width: 0;
    padding: 22px;
    border-right: 1px solid var(--border);
    background: rgba(4, 9, 14, 0.82);
    backdrop-filter: blur(20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(25, 207, 255, 0.22), rgba(147, 249, 67, 0.08));
    color: var(--cyan);
    font-weight: 800;
}

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

.brand strong {
    font-size: 18px;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.nav-stack {
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #b7c5d2;
    font-size: 14px;
    font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
    border-color: var(--border-bright);
    background: rgba(25, 207, 255, 0.12);
    color: var(--text);
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: var(--cyan);
}

.sidebar-card {
    position: absolute;
    right: 22px;
    bottom: 22px;
    left: 22px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.sidebar-card p {
    margin: 10px 0 6px;
    color: var(--muted);
    font-size: 13px;
}

.sidebar-card strong {
    font-size: 22px;
}

.pulse-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--lime);
    box-shadow: 0 0 0 8px rgba(147, 249, 67, 0.12);
}

.main-content {
    width: min(1420px, 100%);
    min-width: 0;
    margin: 0 auto;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: 0;
    margin-bottom: 26px;
}

.topbar > div,
.hero-copy {
    min-width: 0;
    max-width: 100%;
}

.eyeline,
.section-kicker {
    margin: 0 0 8px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar h1 {
    max-width: 820px;
    width: 100%;
    margin: 0;
    font-size: clamp(28px, 4vw, 52px);
    line-height: 1.02;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

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

.primary-button,
.ghost-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
}

.primary-button {
    background: linear-gradient(135deg, var(--cyan), #0ca8ff);
    color: #021018;
    box-shadow: 0 14px 34px rgba(25, 207, 255, 0.22);
}

.ghost-button {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.danger-button {
    background: rgba(255, 77, 92, 0.12);
    border-color: rgba(255, 77, 92, 0.42);
    color: #ffb6bd;
}

.large {
    min-height: 50px;
    padding-inline: 20px;
}

.compact {
    min-height: 38px;
}

.hero-grid,
.content-grid {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 22px;
    min-width: 0;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(13, 26, 39, 0.9), rgba(6, 12, 18, 0.92));
    box-shadow: var(--shadow);
}

.hero-copy h2,
.panel-heading h2,
.side-intel h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 42px);
    line-height: 1.06;
}

.hero-copy p:not(.section-kicker),
.side-intel p {
    max-width: 680px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
}

.signal-board,
.panel,
.metric-card,
.feature-strip article,
.danger-zone form {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.signal-board {
    padding: 18px;
    align-self: stretch;
}

.signal-header {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.signal-header strong {
    color: var(--lime);
}

.signal-wave {
    display: flex;
    align-items: end;
    gap: 10px;
    height: 230px;
    margin: 24px 0;
    padding: 16px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(25, 207, 255, 0.08), rgba(147, 249, 67, 0.04));
}

.signal-wave span {
    flex: 1;
    min-width: 10px;
    border-radius: 999px 999px 4px 4px;
    background: linear-gradient(180deg, var(--cyan), var(--lime));
}

.preview-ticket {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.18);
}

.preview-ticket small {
    color: var(--muted);
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.feature-strip article {
    padding: 22px;
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 900;
}

.feature-icon.cyan {
    background: rgba(25, 207, 255, 0.14);
    color: var(--cyan);
}

.feature-icon.lime {
    background: rgba(147, 249, 67, 0.14);
    color: var(--lime);
}

.feature-icon.amber {
    background: rgba(248, 185, 49, 0.14);
    color: var(--amber);
}

.feature-strip h3 {
    margin: 0 0 8px;
}

.feature-strip p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.two-column {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
}

.detail-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
}

.panel {
    padding: 22px;
    min-width: 0;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.panel-heading h2 {
    font-size: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid.single {
    grid-template-columns: 1fr;
}

.full-span {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 8px;
}

label span {
    color: #c6d3de;
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(3, 10, 16, 0.76);
    color: var(--text);
    outline: none;
}

input,
select {
    height: 48px;
    padding: 0 14px;
}

textarea {
    min-height: 168px;
    resize: vertical;
    padding: 14px;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-bright);
    box-shadow: 0 0 0 3px rgba(25, 207, 255, 0.12);
}

.form-actions {
    justify-content: flex-end;
    margin-top: 20px;
}

.side-intel {
    display: flex;
    flex-direction: column;
}

.intel-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.intel-list div,
.detail-list div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
}

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

.intel-list span,
.detail-list span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    padding: 18px;
    overflow: hidden;
    position: relative;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: var(--border-bright);
}

.metric-card.cyan::after {
    background: var(--cyan);
}

.metric-card.lime::after {
    background: var(--lime);
}

.metric-card.amber::after {
    background: var(--amber);
}

.metric-card.red::after {
    background: var(--red);
}

.metric-card span,
.metric-card small {
    color: var(--muted);
}

.metric-card span {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin: 10px 0 6px;
    font-size: 34px;
}

.metric-card small {
    font-size: 13px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 15px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

tbody tr:hover {
    background: rgba(25, 207, 255, 0.05);
}

.ticket-link {
    color: var(--cyan);
    font-weight: 900;
}

.requester-cell {
    display: grid;
    gap: 5px;
}

.requester-cell span {
    color: var(--muted);
    font-size: 12px;
}

.status-chip,
.priority-chip {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    align-self: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-chip.open {
    color: #82dcff;
    background: rgba(25, 207, 255, 0.13);
}

.status-chip.in-progress {
    color: #ffd586;
    background: rgba(248, 185, 49, 0.14);
}

.status-chip.resolved {
    color: #b9ff84;
    background: rgba(147, 249, 67, 0.14);
}

.status-chip.closed {
    color: #c5cfda;
    background: rgba(143, 162, 181, 0.16);
}

.priority-chip.high {
    color: #ffb6bd;
    background: rgba(255, 77, 92, 0.16);
}

.priority-chip.medium {
    color: #ffe09a;
    background: rgba(248, 185, 49, 0.16);
}

.priority-chip.low {
    color: #b9ff84;
    background: rgba(147, 249, 67, 0.14);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 30px;
}

.empty-state span {
    color: var(--muted);
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.description-block {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
}

.description-block span {
    display: block;
    margin-bottom: 8px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.description-block p {
    margin: 0;
    color: #d9e5ef;
    line-height: 1.7;
}

.description-block.notes span {
    color: var(--lime);
}

.danger-zone {
    margin-top: 18px;
}

.danger-zone form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
}

.danger-zone span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

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

    .sidebar {
        position: static;
        height: auto;
        display: grid;
        gap: 16px;
    }

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

    .sidebar-card {
        position: static;
    }

    .hero-panel,
    .two-column,
    .detail-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 720px) {
    body {
        overflow-x: hidden;
    }

    .main-content,
    .sidebar {
        padding: 16px;
    }

    .topbar,
    .panel-heading,
    .danger-zone form {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar h1 {
        max-width: calc(100vw - 32px);
        font-size: 26px;
        line-height: 1.12;
    }

    .topbar-actions,
    .hero-actions,
    .form-actions {
        width: 100%;
        flex-direction: column;
    }

    .primary-button,
    .ghost-button,
    .danger-button {
        width: 100%;
    }

    .nav-stack,
    .feature-strip,
    .form-grid,
    .detail-list,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel,
    .panel {
        padding: 18px;
    }

    .hero-copy h2,
    .panel-heading h2,
    .side-intel h2 {
        width: calc(100vw - 100px);
        max-width: 100%;
        font-size: 24px;
        line-height: 1.12;
        overflow-wrap: anywhere;
    }

    .signal-wave {
        height: 160px;
    }
}
