@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', sans-serif;
    background: #0d0d0d;
    color: #e8e8e8;
    min-height: 100vh;
}

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

/* ── Layout ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Header ── */
.site-header {
    padding: 28px 0 20px;
    border-bottom: 1px solid #1e1e1e;
    margin-bottom: 28px;
}
.site-header h1 {
    font-family: 'Space Mono', monospace;
    font-size: 1.7rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -1px;
}
.site-header p {
    font-size: 0.88rem;
    color: #666;
    margin-top: 4px;
}

/* ── Status bar ── */
.status-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 5px 14px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #999;
}
.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-green  { background: #16a34a; }
.dot-red    { background: #dc2626; }
.dot-yellow { background: #d97706; }

/* ── Nav tabs ── */
.nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #1e1e1e;
    margin-bottom: 28px;
}
.nav-tab {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #555;
    padding: 10px 20px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s;
    text-transform: uppercase;
}
.nav-tab:hover { color: #ccc; }
.nav-tab.active {
    color: #fff;
    border-bottom-color: #fff;
}

/* ── Section headings ── */
.section-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

/* ── Info box ── */
.info-box {
    background: #0f1f2e;
    border: 1px solid #1a3a52;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #7db8da;
    margin-bottom: 20px;
    line-height: 1.5;
}
.info-box strong { color: #a8d8f0; }

/* ── Checkbox row ── */
.check-row {
    display: flex;
    gap: 28px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #ccc;
    cursor: pointer;
    user-select: none;
}
.check-label input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: #fff;
    cursor: pointer;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #0a0a0a;
    border: none;
    border-radius: 7px;
    padding: 9px 20px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn:hover { background: #e0e0e0; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm {
    padding: 6px 14px;
    font-size: 10px;
}
.btn-danger {
    background: #1a0a0a;
    color: #f87171;
    border: 1px solid #3a1a1a;
}
.btn-danger:hover { background: #2a1010; }

/* ── Workflow strip ── */
.workflow {
    display: flex;
    align-items: center;
    background: #161616;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 10px 18px;
    margin-bottom: 24px;
    gap: 6px;
    flex-wrap: wrap;
}
.wf-step { display: flex; align-items: center; gap: 7px; }
.wf-num {
    width: 24px; height: 24px;
    border-radius: 50%;
    font-family: 'Space Mono', monospace;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.wf-pending  { background: #222; color: #555; }
.wf-active   { background: #fff; color: #000; }
.wf-complete { background: #16a34a; color: #fff; }
.wf-label    { font-size: 11px; color: #666; white-space: nowrap; }
.wf-arrow    { color: #333; margin: 0 2px; font-size: 12px; }

/* ── Metrics row ── */
.metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px 0;
}
@media (max-width: 700px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
.metric-box {
    background: #161616;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 14px 16px;
}
.metric-label {
    font-size: 10px;
    font-family: 'Space Mono', monospace;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.metric-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
}

/* ── Result cards ── */
.resume-card {
    background: #111;
    border: 1px solid #222;
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
}
.resume-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #161616;
    border-bottom: 1px solid #222;
    cursor: pointer;
    gap: 12px;
}
.resume-card-header h3 {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #e0e0e0;
    font-weight: 700;
}
.resume-card-header .meta {
    font-size: 11px;
    color: #555;
}
.resume-card-body { padding: 16px; }

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
@media (max-width: 600px) { .field-grid { grid-template-columns: 1fr; } }
.field-box {
    background: #0d0d0d;
    border: 1px solid #1e1e1e;
    border-radius: 6px;
    padding: 9px 12px;
}
.field-key {
    font-family: 'Space Mono', monospace;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #444;
    margin-bottom: 3px;
}
.field-val { font-size: 12px; color: #ccc; }
.field-val.na { color: #333; font-style: italic; }

/* ── Sheet status badge ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
}
.badge-saved     { background: #052e16; color: #4ade80; border: 1px solid #14532d; }
.badge-duplicate { background: #1c1917; color: #a8a29e; border: 1px solid #292524; }
.badge-skipped   { background: #1c1400; color: #fbbf24; border: 1px solid #3d2e00; }
.badge-error     { background: #1c0a0a; color: #f87171; border: 1px solid #3a1010; }

/* ── Expander ── */
.expander {
    background: #111;
    border: 1px solid #1e1e1e;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}
.expander-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 12px;
    color: #888;
}
.expander-header:hover { background: #161616; }
.expander-body {
    padding: 10px 14px 14px;
    border-top: 1px solid #1e1e1e;
    font-size: 12px;
    color: #666;
    line-height: 1.7;
    display: none;
}
.expander-body.open { display: block; }

/* ── Caption ── */
.caption {
    font-size: 11px;
    color: #444;
    margin-bottom: 14px;
    font-family: 'Space Mono', monospace;
}
.caption code {
    background: #161616;
    border: 1px solid #222;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    color: #888;
}

/* ── Alert / warning ── */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    margin: 8px 0;
}
.alert-warn  { background: #1c1400; border: 1px solid #3d2e00; color: #fbbf24; }
.alert-error { background: #1c0a0a; border: 1px solid #3a1010; color: #f87171; }
.alert-ok    { background: #052e16; border: 1px solid #14532d; color: #4ade80; }
.alert-info  { background: #0f1f2e; border: 1px solid #1a3a52; color: #7db8da; }

/* ── Divider ── */
hr { border: none; border-top: 1px solid #1e1e1e; margin: 20px 0; }

/* ── Table (dataset) ── */
.tbl-wrap {
    overflow-x: auto;
    border: 1px solid #1e1e1e;
    border-radius: 8px;
    margin: 16px 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
thead th {
    background: #161616;
    color: #555;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 14px;
    white-space: nowrap;
    text-align: left;
    border-bottom: 1px solid #222;
}
tbody tr { border-bottom: 1px solid #1a1a1a; }
tbody tr:hover { background: #111; }
tbody td {
    padding: 8px 14px;
    color: #bbb;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
tbody td.na { color: #333; font-style: italic; }

/* ── Dataset metrics ── */
.ds-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 600px) { .ds-metrics { grid-template-columns: repeat(2, 1fr); } }

/* ── Spinner ── */
#spinner {
    display: none;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: #555;
    font-size: 12px;
}
.spin {
    width: 18px; height: 18px;
    border: 2px solid #333;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress bar ── */
.progress-wrap { margin: 12px 0; }
.progress-bar {
    height: 3px;
    background: #1e1e1e;
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    transition: width 0.3s;
}
.progress-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: #555;
    margin-top: 4px;
}

/* ── Log section ── */
.log-section {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #1a1a1a;
}
