:root {
    --ssd-bg: #07101c;
    --ssd-panel: rgba(12, 19, 34, 0.92);
    --ssd-card: rgba(15, 24, 42, 0.96);
    --ssd-card-2: rgba(16, 28, 48, 0.96);
    --ssd-border: rgba(255, 255, 255, 0.10);
    --ssd-border-strong: rgba(128, 168, 255, 0.22);
    --ssd-text: #eef4ff;
    --ssd-muted: rgba(238, 244, 255, 0.72);
    --ssd-blue: #1c4cb3;
    --ssd-blue-2: #0f2b66;
    --ssd-green: #2db36e;
    --ssd-amber: #ef9f38;
    --ssd-red: #cf473d;
    --ssd-cyan: #58d3ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ssd-text);
    background:
        radial-gradient(circle at top left, rgba(28, 76, 179, 0.24), transparent 28%),
        radial-gradient(circle at bottom right, rgba(207, 71, 61, 0.18), transparent 26%),
        var(--ssd-bg);
}

.ssd-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.ssd-hero,
.ssd-main-card,
.ssd-side-card,
.ssd-dashboard,
.ssd-card,
.ssd-table-card {
    border: 1px solid var(--ssd-border);
    border-radius: 24px;
    background: var(--ssd-panel);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px);
}

.ssd-hero {
    padding: 26px 28px;
}

.ssd-eyebrow {
    margin: 0 0 6px;
    color: #92aef0;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ssd-hero h2,
.ssd-step h2,
.ssd-preview-header h2,
.ssd-card-head h3,
.ssd-side-section h3 {
    margin: 0;
    line-height: 1.15;
}

.ssd-intro,
.ssd-help,
.ssd-status,
.ssd-file-name,
.ssd-tag-summary,
.ssd-info-box p,
.ssd-meta {
    color: var(--ssd-muted);
    line-height: 1.55;
}

.ssd-layout {
    display: grid;
    grid-template-columns: 1.55fr 0.95fr;
    gap: 20px;
    margin-top: 20px;
}

.ssd-main-card,
.ssd-side-card,
.ssd-dashboard {
    padding: 24px;
}

.ssd-step + .ssd-step {
    margin-top: 26px;
    padding-top: 26px;
    border-top: 1px solid var(--ssd-border);
}

.ssd-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    margin: 0 0 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(92, 137, 255, 0.12);
    color: #b9cbff;
    font-weight: 800;
}

.ssd-upload {
    display: block;
    padding: 24px;
    border: 2px dashed rgba(144, 167, 220, 0.34);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.ssd-upload input { display: none; }

.ssd-upload-title {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
}

.ssd-upload-subtitle {
    display: block;
    margin-top: 6px;
    color: var(--ssd-muted);
}

.ssd-filter-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    margin-top: 12px;
}

.ssd-filter-grid label,
.ssd-side-card label {
    display: grid;
    gap: 8px;
}

.ssd-filter-grid span,
.ssd-side-card label span {
    font-size: 0.85rem;
    color: var(--ssd-muted);
}

.ssd-filter-grid input,
.ssd-filter-grid select {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--ssd-border-strong);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ssd-text);
    font: inherit;
}

.ssd-tags-panel {
    margin-top: 16px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--ssd-border);
    background: rgba(255, 255, 255, 0.02);
}

.ssd-tags-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 800;
}

.ssd-link-button {
    border: 0;
    background: transparent;
    color: #ffccc6;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    padding: 0;
}

.ssd-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.ssd-chip {
    border: 1px solid rgba(128, 168, 255, 0.24);
    background: rgba(22, 57, 132, 0.18);
    color: var(--ssd-text);
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.ssd-chip:hover {
    transform: translateY(-1px);
}

.ssd-chip.is-active {
    background: linear-gradient(135deg, rgba(207, 71, 61, 0.92), rgba(239, 159, 56, 0.9));
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.ssd-primary-button,
.ssd-secondary-button,
.ssd-ghost-button {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.ssd-primary-button:hover,
.ssd-secondary-button:hover,
.ssd-ghost-button:hover {
    transform: translateY(-1px);
}

.ssd-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.ssd-trend-builder {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.ssd-primary-button {
    width: 100%;
    background: linear-gradient(135deg, var(--ssd-red), #dd6a50);
    color: #fff;
    box-shadow: 0 12px 28px rgba(207, 71, 61, 0.28);
}

.ssd-secondary-button {
    width: 100%;
    margin-top: 0;
    background: rgba(22, 57, 132, 0.18);
    color: var(--ssd-text);
    border: 1px solid rgba(144, 167, 220, 0.24);
}

.ssd-ghost-button {
    width: 100%;
    background: rgba(88, 211, 255, 0.12);
    color: #daf8ff;
    border: 1px solid rgba(88, 211, 255, 0.28);
}

.ssd-excel-button {
    width: 100%;
    border: 1px solid rgba(45, 179, 110, 0.28);
    border-radius: 16px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    color: #e8fff2;
    background: linear-gradient(135deg, rgba(45, 179, 110, 0.26), rgba(28, 76, 179, 0.18));
    transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.ssd-excel-button:hover {
    transform: translateY(-1px);
}

.ssd-excel-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.ssd-trend-button {
    width: 100%;
    border: 1px solid rgba(239, 159, 56, 0.32);
    border-radius: 16px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    color: #fff4df;
    background: linear-gradient(135deg, rgba(239, 159, 56, 0.24), rgba(207, 71, 61, 0.18));
    transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.ssd-trend-button:hover {
    transform: translateY(-1px);
}

.ssd-trend-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.ssd-side-section + .ssd-side-section {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--ssd-border);
}

.ssd-info-box {
    padding: 16px;
    border-radius: 18px;
    margin-top: 12px;
    border: 1px solid var(--ssd-border);
}

.info-blue { background: rgba(28, 76, 179, 0.16); }
.info-green { background: rgba(45, 179, 110, 0.16); }
.info-amber { background: rgba(239, 159, 56, 0.14); }
.info-neutral { background: rgba(255, 255, 255, 0.04); }

.ssd-dashboard {
    margin-top: 20px;
}

.ssd-viewbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 4px;
}

.ssd-view-button {
    border: 1px solid rgba(128, 168, 255, 0.24);
    background: rgba(22, 57, 132, 0.18);
    color: var(--ssd-text);
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.ssd-view-button:hover {
    transform: translateY(-1px);
}

.ssd-view-button.is-active {
    background: linear-gradient(135deg, rgba(207, 71, 61, 0.92), rgba(239, 159, 56, 0.9));
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.ssd-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ssd-stat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.ssd-stat {
    padding: 14px;
    border: 1px solid var(--ssd-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.ssd-stat-label {
    display: block;
    color: var(--ssd-muted);
    font-size: 0.84rem;
}

.ssd-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 1.35rem;
}

.ssd-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.ssd-focus-card {
    min-height: 380px;
}

.ssd-card,
.ssd-table-card {
    padding: 18px;
}

.ssd-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ssd-card-head span {
    color: var(--ssd-muted);
    font-size: 0.85rem;
}

.ssd-chart-wrap {
    margin-top: 12px;
    position: relative;
    height: 300px;
}

.ssd-table-card {
    margin-top: 18px;
}

.ssd-table-wrap {
    margin-top: 12px;
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--ssd-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
}

.ssd-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.01);
}

.ssd-table th,
.ssd-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    white-space: nowrap;
}

.ssd-table th {
    color: #9eb3df;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(8, 16, 28, 0.88);
    position: sticky;
    top: 0;
    z-index: 1;
}

.ssd-table tr.is-total,
.ssd-table tr.is-highlight {
    background: rgba(144, 167, 220, 0.1);
    font-weight: 800;
}

.ssd-table .risk-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 800;
    color: #fff;
}

.risk-high { background: linear-gradient(135deg, #cf473d, #f06a4f); }
.risk-med { background: linear-gradient(135deg, #ef9f38, #ffbd63); }
.risk-low { background: linear-gradient(135deg, #2db36e, #5ddf95); }

.ssd-status {
    margin-top: 10px;
    color: var(--ssd-muted);
}

.ssd-status.is-error {
    color: #ffb4ab;
}

.ssd-file-name {
    margin: 10px 0 0;
}

code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 8px;
}

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

    .ssd-filter-grid {
        grid-template-columns: 1fr;
    }

    .ssd-preview-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

@media (max-width: 720px) {
    .ssd-shell {
        padding: 18px 14px 40px;
    }

    .ssd-main-card,
    .ssd-side-card,
    .ssd-dashboard,
    .ssd-card,
    .ssd-table-card {
        padding: 18px;
    }

    .ssd-chart-wrap {
        height: 260px;
    }

    .ssd-table-wrap {
        max-height: 360px;
    }
}


.ssd-coaching-grid .ssd-chart-wrap {
    height: 320px;
}

.ssd-performance-grid .ssd-chart-wrap {
    height: 290px;
}


.ssd-filter-mode-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0 16px;
}

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

.ssd-field span,
.ssd-inline-control span {
    font-size: 0.82rem;
    color: var(--ssd-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ssd-select {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--ssd-border-strong);
    background: rgba(255, 255, 255, 0.05);
    color: var(--ssd-text);
    font: inherit;
}

.ssd-card-head-wrap {
    align-items: center;
}

.ssd-inline-control {
    display: grid;
    gap: 6px;
    min-width: 190px;
}

.ssd-select-inline {
    min-height: 40px;
}

@media (max-width: 720px) {
    .ssd-filter-mode-row {
        grid-template-columns: 1fr;
    }

    .ssd-inline-control {
        min-width: 100%;
        width: 100%;
    }
}
