/* ═══════════════════════════════════════════
   VARIABLES
   ═══════════════════════════════════════════ */
:root {
    --primary: #1e293b;
    --primary-light: #334155;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-sec: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

button, input { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }
input { border: none; outline: none; background: none; }

/* ═══════════════════════════════════════════
   SCREENS & OVERLAYS
   ═══════════════════════════════════════════ */
.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
}
.screen.active { display: flex; }

.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--bg);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.overlay.active {
    display: flex;
}

/* ═══════════════════════════════════════════
   UPLOAD SCREEN
   ═══════════════════════════════════════════ */
.upload-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.upload-logo {
    color: var(--accent);
    margin-bottom: 1rem;
}

.upload-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.subtitle {
    color: var(--text-sec);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.upload-hint {
    color: var(--text-sec);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 1.5rem 0;
}

.upload-hint strong {
    color: var(--text);
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.82rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

/* ═══════════════════════════════════════════
   HEADER (main screen)
   ═══════════════════════════════════════════ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: #fff;
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.1rem;
    font-weight: 700;
}

.header .meta {
    font-size: 0.72rem;
    color: #94a3b8;
    display: block;
    margin-top: 1px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    transition: background 0.15s;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); }

/* ═══════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════ */
.search-container {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.search-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 0.75rem;
    transition: border-color 0.15s;
}
.search-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.search-icon { color: var(--text-light); flex-shrink: 0; }

#search-input {
    flex: 1;
    height: 44px;
    font-size: 0.95rem;
    color: var(--text);
    min-width: 0;
}
#search-input::placeholder { color: var(--text-light); }

.btn-clear {
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    color: var(--text-sec);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.btn-clear:hover { background: var(--border); }

.btn-scan {
    width: 44px;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}
.btn-scan:hover { background: var(--primary-light); }
.btn-scan:active { transform: scale(0.95); }

/* ═══════════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════════ */
.results-info {
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
    color: var(--text-sec);
    flex-shrink: 0;
}

.results-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 1rem;
}

.result-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.08);
}
.result-card:active { background: #f8fafc; }

.result-body { flex: 1; min-width: 0; }

.result-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.code-badge {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.code-badge.catalogo {
    background: #dbeafe;
    color: #1e40af;
}

.code-badge.sap {
    background: #f1f5f9;
    color: var(--text-sec);
}

.result-desc {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-right {
    text-align: right;
    flex-shrink: 0;
}

.stock-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
}

.stock-badge.positive {
    background: #dcfce7;
    color: var(--success);
}

.stock-badge.zero {
    background: #fef2f2;
    color: var(--danger);
}

.result-grupo {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    gap: 0.75rem;
}
.empty-state[hidden] { display: none; }
.empty-state p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════
   OVERLAY HEADER
   ═══════════════════════════════════════════ */
.overlay-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: #fff;
    flex-shrink: 0;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.btn-back:hover { background: rgba(255,255,255,0.1); }

.overlay-title {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════
   DETAIL VIEW
   ═══════════════════════════════════════════ */
.detail-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

.detail-header-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.detail-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.detail-desc {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.35rem;
}

.detail-grupo {
    font-size: 0.82rem;
    color: var(--text-sec);
}

.detail-stock-total {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.detail-stock-total .label {
    font-size: 0.82rem;
    color: var(--text-sec);
}

.detail-stock-total .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--success);
}

.detail-stock-total .value.zero { color: var(--danger); }

.detail-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-sec);
    margin-bottom: 0.5rem;
}

.location-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
}

.location-almacen {
    font-weight: 600;
    font-size: 0.9rem;
}

.location-qty {
    font-weight: 700;
    font-size: 1rem;
}

.location-bin {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.78rem;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.location-grid {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--text-sec);
}

.location-grid .lbl {
    color: var(--text-light);
    margin-right: 0.2rem;
}

.location-value-row {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--text-sec);
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--border);
}

.tag-sistema {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: #fef3c7;
    color: var(--warning);
}

.sin-stock-msg {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-sec);
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════
   SCANNER
   ═══════════════════════════════════════════ */
#scanner-region {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#scanner-region video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-footer {
    background: var(--card);
    padding: 1rem;
    flex-shrink: 0;
    text-align: center;
}

.scanner-hint {
    font-size: 0.85rem;
    color: var(--text-sec);
}

.scanner-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    color: var(--text-light);
    font-size: 0.8rem;
}
.scanner-divider::before,
.scanner-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

/* ═══════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════ */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
}
.loading-overlay.active {
    display: flex;
}

.loading-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loading-text {
    font-size: 0.9rem;
    color: var(--text-sec);
}

/* ═══════════════════════════════════════════
   CONTEO — formulario en location-card
   ═══════════════════════════════════════════ */
.conteo-form {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

.conteo-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.conteo-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.conteo-ubicacion-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
}

.conteo-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.conteo-field span {
    font-size: 0.7rem;
    color: var(--text-sec);
}

.conteo-main-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 0.4rem;
}

.conteo-main-row .conteo-qty-field {
    flex: 0 0 auto;
    width: 100px;
    max-width: none;
}

.conteo-main-row .btn-guardar {
    flex: 1;
    margin-top: 0;
    height: 44px;
}

.ubic-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.8rem;
}

.ubic-text {
    font-family: "SF Mono", "Fira Code", monospace;
    color: var(--text-sec);
    font-size: 0.78rem;
}

.btn-corregir {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.btn-corregir:hover { background: rgba(59,130,246,0.08); }

.ubic-edit {
    padding: 0.4rem 0;
}

.ubic-edit-header {
    display: flex;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-light);
    margin-bottom: 0.35rem;
}

.ubic-edit-label {
    font-weight: 600;
}

.ubic-edit-sap {
    font-family: "SF Mono", "Fira Code", monospace;
}

.conteo-qty-field {
    max-width: 140px;
}

.conteo-row-inline {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.conteo-row-inline .conteo-qty-field {
    max-width: none;
}

.conteo-row-inline .conteo-input {
    padding: 0.45rem 0.4rem;
    font-size: 0.85rem;
}

.conteo-row-inline .conteo-qty {
    font-size: 1rem;
}

.conteo-input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.15s;
}
.conteo-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}

.conteo-qty {
    font-weight: 700;
    font-size: 1.1rem;
}

.btn-guardar {
    display: block;
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.4rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-guardar:hover { background: var(--accent-hover); }
.btn-guardar:active { transform: scale(0.98); }

.conteo-status {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
}
.conteo-status.ok {
    background: #dcfce7;
    color: var(--success);
}
.conteo-status.diff {
    background: #fef3c7;
    color: var(--warning);
}

/* ── Acordeón (almacenes colapsables) ──── */
.accordion {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion.contado { border-left: 3px solid var(--success); }

.acc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: none;
    border: none;
    cursor: pointer;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}
.acc-header:active { background: #f8fafc; }

.acc-header-left {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.acc-almacen {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
}

.acc-header-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.acc-nums {
    font-size: 0.75rem;
    color: var(--text-sec);
    font-family: "SF Mono", "Fira Code", monospace;
}

.acc-chevron {
    font-size: 0.7rem;
    color: var(--text-light);
    transition: transform 0.2s;
}

.accordion.open .acc-chevron { transform: rotate(180deg); }

.acc-body {
    display: none;
    padding: 0 0.85rem 0.85rem;
}

.accordion.open .acc-body { display: block; }

/* ── Tres números protagonistas ─────────── */
.tres-numeros {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.25rem;
    margin: 0.6rem 0;
    text-align: center;
}

.num-col {
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.num-value {
    font-size: 1.3rem;
    font-weight: 800;
    font-family: "SF Mono", "Fira Code", monospace;
    color: var(--text);
    line-height: 1.2;
}

.num-value.conteo { color: var(--accent); }
.num-col.ok .num-value { color: var(--success); }
.num-col.diff .num-value { color: var(--danger); }

.num-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-sec);
    margin-top: 0.15rem;
}

.num-col.ok .num-label { color: var(--success); }
.num-col.diff .num-label { color: var(--danger); }

/* ── Registros (log de conteos) ────────── */
.registros-section {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
}

.registros-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.registro-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.75rem;
    color: var(--text-sec);
}

.registro-qty {
    min-width: 36px;
    font-weight: 700;
    font-family: "SF Mono", "Fira Code", monospace;
}
.registro-qty.positivo { color: var(--success); }
.registro-qty.negativo { color: var(--danger); }

.registro-user {
    font-weight: 600;
    color: var(--text);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.registro-ubic {
    color: var(--text-light);
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.68rem;
}

.registro-fecha {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* ── Modal usuario ─────────────────────── */
.user-modal {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.user-modal[hidden] { display: none; }

.user-modal-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.user-modal-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.user-modal-card p {
    font-size: 0.85rem;
    color: var(--text-sec);
    margin-bottom: 1rem;
}

.user-modal-card .conteo-input {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}


/* ── Badges de conteo en result-card ───── */
.conteo-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
    margin-left: 0.25rem;
}
.conteo-badge.ok      { background: var(--success); }
.conteo-badge.diff    { background: var(--warning); }
.conteo-badge.partial { background: var(--text-light); }

/* ── Tags sobrante ─────────────────────── */
.tag-sobrante {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: #ede9fe;
    color: #7c3aed;
    margin-bottom: 0.4rem;
}

.btn-sobrante {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ── Formulario sobrante overlay ───────── */
.sobrante-form-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sobrante-form-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.sobrante-form-card h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.sobrante-item-name {
    font-size: 0.8rem;
    color: var(--text-sec);
    margin-bottom: 0.75rem;
}

.sobrante-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.sobrante-buttons .btn { flex: 1; justify-content: center; }

/* ── Vista diferencias ─────────────────── */
.diff-card.faltante { border-left: 3px solid var(--danger); }
.diff-card.excedente { border-left: 3px solid var(--warning); }

.diff-detail {
    display: flex;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-sec);
    margin-top: 0.25rem;
}

.diff-badge {
    font-size: 1rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}
.diff-badge.faltante  { background: #fef2f2; color: var(--danger); }
.diff-badge.excedente { background: #fef3c7; color: var(--warning); }

.diff-valor {
    font-size: 0.72rem;
    color: var(--text-sec);
    margin-top: 0.2rem;
}

/* ── Header actions ────────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-header {
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255,255,255,0.1);
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-header:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════
   DESKTOP (> 640px)
   ═══════════════════════════════════════════ */
@media (min-width: 640px) {
    .upload-container h1 { font-size: 2.2rem; }

    .results-list {
        max-width: 720px;
        margin: 0 auto;
        width: 100%;
    }
    .results-info {
        max-width: 720px;
        margin: 0 auto;
        width: 100%;
    }
    .detail-content {
        max-width: 720px;
        margin: 0 auto;
        width: 100%;
    }
    .search-container {
        max-width: 720px;
        margin: 0 auto;
        width: 100%;
        border-bottom: none;
        padding-top: 1rem;
    }
}
