/* Shared parser page shell and results chrome */

.page-parser {
    --parser-bg: #0b1220;
    --parser-sheet: #ffffff;
    --parser-sheet-muted: #f8fafc;
    --parser-border: #e2e8f0;
    --parser-text: #0f172a;
    --parser-text-muted: #64748b;
    --parser-accent: #4f46e5;
    --parser-net: #1e1b4b;
    --parser-success: #059669;
    --parser-danger: #dc2626;
    --parser-label-col: minmax(132px, 15%);
}

.page-parser .site-main {
    padding: 0 0 2rem;
    background: linear-gradient(180deg, var(--parser-bg) 0%, #111827 100%);
}

.page-parser .site-header {
    background: rgba(11, 18, 32, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.page-parser .logo,
.page-parser .site-nav a {
    color: #e2e8f0;
}

.page-parser .site-nav a:hover {
    color: #fff;
}

.page-parser .logo-mark {
    background: var(--parser-accent);
}

.page-parser .site-footer {
    background: var(--parser-bg);
    border-top-color: rgba(255, 255, 255, 0.08);
}

.page-parser .site-footer p {
    color: #94a3b8;
}

.page-parser .container {
    max-width: min(100%, 1380px);
}

.page-parser .page-header {
    margin-bottom: 1rem;
}

.page-parser .page-header h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    color: #f8fafc;
}

.page-parser .page-header p {
    max-width: none;
    font-size: 0.9rem;
    color: #94a3b8;
}

.page-parser .back-link {
    margin-bottom: 0.75rem;
    color: #94a3b8;
}

.page-parser .back-link:hover {
    color: #fff;
}

.page-parser.parser-has-results .page-header,
.page-parser.parser-has-results .back-link {
    display: none;
}

.page-parser.parser-has-results .site-main {
    padding-top: 0.75rem;
}

.page-parser .upload-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.page-parser .upload-zone {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.02);
}

.page-parser .upload-zone:hover,
.page-parser .upload-zone--dragover {
    border-color: #818cf8;
    background: rgba(79, 70, 229, 0.12);
}

.page-parser .upload-zone__title {
    color: #f8fafc;
}

.page-parser .upload-zone__hint {
    color: #94a3b8;
}

.page-parser .loading {
    color: #cbd5e1;
}

.page-parser .alert--error {
    background: rgba(127, 29, 29, 0.35);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.page-parser .btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.page-parser .btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.page-parser .results-panel--visible {
    display: block;
}

.parser-board {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.parser-toolbar {
    display: flex;
    justify-content: flex-end;
}

.parser-warnings {
    list-style: none;
    margin: 0;
    padding: 0;
}

.parser-warnings li {
    padding: 0.625rem 0.875rem;
    background: rgba(180, 83, 9, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 8px;
    color: #fde68a;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

.parser-empty {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.parser-sheet {
    background: var(--parser-sheet);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.parser-summary {
    display: grid;
    grid-template-columns: var(--parser-label-col) 1fr;
    align-items: stretch;
    background: var(--parser-net);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.parser-summary__label,
.parser-summary__value {
    display: flex;
    align-items: center;
    min-height: 3.25rem;
}

.parser-summary__label {
    justify-content: center;
    padding: 0.75rem 0.875rem;
    color: #c7d2fe;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.parser-summary__value {
    justify-content: center;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.parser-summary__value--success {
    color: #34d399;
}

.parser-summary__value--danger {
    color: #f87171;
}

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

.parser-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: clamp(0.625rem, 0.82vw, 0.75rem);
    min-width: 760px;
}

.parser-table th,
.parser-table td {
    padding: 0.5rem 0.35rem;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--parser-border);
    line-height: 1.25;
}

.parser-table th {
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: normal;
}

.parser-table__name {
    text-align: left;
    font-weight: 500;
    color: var(--parser-text);
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    box-shadow: 1px 0 0 var(--parser-border);
    padding-left: 0.875rem;
}

.parser-table th.parser-table__name {
    background: #1e293b;
    color: #e2e8f0;
    font-weight: 700;
    z-index: 2;
}

.parser-table__num {
    font-variant-numeric: tabular-nums;
    color: var(--parser-text);
}

.parser-table tbody tr:nth-child(even) td {
    background: #fcfdff;
}

.parser-table tbody tr:nth-child(even) td.parser-table__name {
    background: #fcfdff;
}

.parser-table tbody tr:hover td {
    background: #eef2ff;
}

.parser-table tbody tr:hover td.parser-table__name {
    background: #eef2ff;
}

@media print {
    .page-parser .site-main {
        background: #fff;
    }

    .parser-toolbar {
        display: none;
    }

    .parser-sheet {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

@media (max-width: 600px) {
    .page-parser .container {
        padding: 0 0.5rem;
    }

    .parser-table {
        min-width: 680px;
    }

    .parser-table th,
    .parser-table td {
        padding: 0.4rem 0.2rem;
    }
}
