:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-muted: #eef1f5;
    --border: #d9dee7;
    --text: #17202a;
    --muted: #667085;
    --primary: #2457c5;
    --primary-hover: #1d469e;
    --drop: #117a45;
    --drop-bg: #e7f5ed;
    --rise: #b42318;
    --rise-bg: #fdecec;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.top-nav .brand {
    color: var(--text);
    font-weight: 700;
}

.top-nav div {
    display: flex;
    gap: 18px;
}

.shell {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.landing-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.landing-panel {
    width: min(760px, 100%);
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.landing-panel h1,
.page-header h1 {
    margin: 0 0 10px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
    font-weight: 700;
}

.page-header h1 {
    font-size: clamp(28px, 3vw, 38px);
}

.lead,
.page-header p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
}

.section-label {
    margin: 0 0 12px;
    color: var(--muted);
    font-weight: 600;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.btn {
    border-radius: 6px;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

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

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.metric-card,
.import-form,
.table-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.metric-card {
    padding: 16px;
}

.metric-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.metric-card strong {
    display: block;
    font-size: 24px;
    line-height: 1.1;
}

.import-form {
    padding: 22px;
    margin-bottom: 22px;
}

.import-form h2 {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 700;
}

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

.form-section {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 600;
}

textarea.form-control,
input.form-control {
    border-radius: 6px;
}

.table-section {
    padding: 16px;
}

.section-title {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 700;
}

.url-cell {
    max-width: 520px;
    white-space: normal !important;
    word-break: break-word;
}

.setup-alert {
    border-radius: 8px;
    border-color: #e4c369;
}

.setup-detail {
    margin-top: 8px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.table {
    font-size: 14px;
}

.table thead th {
    white-space: nowrap;
    color: #394150;
}

.table tbody td {
    white-space: nowrap;
}

.delta-drop,
.delta-rise,
.delta-neutral {
    font-weight: 600;
}

.delta-drop {
    color: var(--drop) !important;
    background: var(--drop-bg) !important;
}

.delta-rise {
    color: var(--rise) !important;
    background: var(--rise-bg) !important;
}

.delta-neutral {
    color: var(--muted) !important;
}

.dt-buttons .btn {
    margin-right: 8px;
}

@media (max-width: 760px) {
    .top-nav {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    .page-header {
        display: block;
    }

    .page-header .btn {
        margin-top: 16px;
    }

    .landing-panel {
        padding: 26px;
    }
}
