/* ── Reset & Variables ─────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Base Backgrounds (Soft Saffron -> White -> Green) */
    --bg-base: #f8fafc;
    --bg-gradient: linear-gradient(135deg, rgba(255, 153, 51, 0.08) 0%, #ffffff 50%, rgba(19, 136, 8, 0.08) 100%);
    
    /* Frosted Glass Panels */
    --bg-card: rgba(255, 255, 255, 0.75);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.16);
    
    /* Brand Accents */
    --accent-saffron: #ff9933;
    --accent-green: #138808;
    --accent-navy: #000080;
    
    --accent-color: #000080;
    --accent-hover: #000066;
    --accent-dim: rgba(0, 0, 128, 0.05);
    
    /* Text Colors (Slate Palette) */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --success: #138808;
    --success-bg: rgba(19, 136, 8, 0.08);
    --warning: #ff9933;
    --error: #ef4444;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.3);
}

html, body {
    width: 100%;
    min-height: 100vh;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    /* Radial Indian flag gradient: saffron glow top-left, green glow bottom-right */
    background-color: #fdfaf5;
    background-image:
        radial-gradient(ellipse 80% 60% at 15% 10%, rgba(255, 153, 51, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 80% 60% at 85% 90%, rgba(19, 136, 8, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 255, 255, 0.9) 0%, transparent 70%);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    /* Tricolor accent stripe at the very top */
    border-top: 4px solid transparent;
    border-image: linear-gradient(90deg, #ff9933 0%, #ff9933 33.3%, #ffffff 33.3%, #ffffff 66.6%, #138808 66.6%, #138808 100%) 1;
}

/* ── Minimal Grid Background ───────────────────── */
body::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(15, 23, 42, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    pointer-events: none;
}

/* Blueprint Accents */
.blueprint-axis {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.blueprint-line-x {
    position: absolute;
    top: 30%; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.03), transparent);
}

.blueprint-line-y {
    position: absolute;
    left: 45%; top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.03), transparent);
}

.blueprint-circle {
    position: absolute;
    left: 45%; top: 30%;
    width: 900px; height: 900px;
    border: 1px solid rgba(15, 23, 42, 0.007);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.hidden {
    display: none !important;
}

.sample-paper-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.sample-auth-row {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 0.7rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 0;
    margin-top: 1rem;
}

.sample-auth-form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.sample-auth-row label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
}

.sample-auth-row input {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.55rem 0.65rem;
    font: inherit;
}

.sample-paper-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
}

.sample-paper-grid select,
.sample-paper-grid input,
.sample-paper-grid textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    font: inherit;
    padding: 0.7rem 0.75rem;
}

.sample-paper-grid select:disabled {
    color: var(--text-muted);
}

.sample-paper-grid textarea {
    resize: vertical;
}

.sample-wide {
    grid-column: 1 / -1;
}

.sample-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.provider-picker {
    border: 0;
    padding: 0;
    margin: 0;
}

.provider-picker legend {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.provider-cards,
.model-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.provider-card,
.model-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.65rem 0.8rem;
    text-align: left;
    font: inherit;
}

.provider-card.active,
.model-card.active {
    border-color: var(--accent-saffron);
    box-shadow: 0 0 0 2px rgba(255, 153, 51, 0.12);
}

.model-card:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.provider-card span,
.model-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 400;
    margin-top: 0.2rem;
}

.model-cards {
    margin-top: 0.55rem;
}

.provider-status {
    margin: 0.55rem 0 0;
}

.workflow-stages {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 1rem 0;
}

.workflow-stages div {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.65rem;
    background: rgba(255, 255, 255, 0.55);
}

.workflow-stages span,
.workflow-stages strong {
    display: block;
}

.workflow-stages span {
    color: var(--text-secondary);
    font-size: 0.62rem;
}

.workflow-stages strong {
    margin-top: 0.25rem;
    font-size: 0.72rem;
}

.sample-batch-list {
    display: grid;
    gap: 0.45rem;
    margin: 1rem 0;
}

.sample-batch-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding: 0.45rem 0;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.sample-version-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

@media (max-width: 720px) {
    .sample-paper-grid {
        grid-template-columns: 1fr;
    }

    .workflow-stages {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sample-wide {
        grid-column: auto;
    }

    .sample-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ── Utility classes ─────────────────────────── */
.section-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    margin-bottom: 0;
}

.active-badge {
    font-size: 0.72rem;
    color: var(--accent-green);
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 4px;
}

.flex-half {
    flex: 1;
}

.single-drop {
    min-height: 140px;
    margin-bottom: 1.25rem;
}

.watcher-actions {
    margin-bottom: 1rem;
}

.external-arrow {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* ── Main Layout Container ─────────────────────── */
.page {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

.workspace {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
    box-sizing: border-box;
}

@media (min-width: 1280px) {
    .workspace {
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 2.5rem;
    }
}

/* ── Left Workspace Column ────────────────────── */
.workspace-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.app-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    height: 28px;
    /* removed brightness filter to preserve original blue/saffron brand colors */
}

.badge-v {
    font-size: 0.62rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

/* ── Live System Metrics Hub ──────────────────── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 0.25rem;
}

@media (min-width: 576px) {
    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.metric-tile {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.m-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m-value {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.m-indicator.active {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.m-indicator.idle {
    background: var(--warning);
}

.m-indicator.offline {
    background: var(--error);
}

/* Navigation Tabs */
.main-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: rgba(255, 255, 255, 0.7);
    padding: 6px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    width: 100%;
}

.tab-btn {
    flex: 1 1 auto;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tab-btn svg {
    opacity: 0.6;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.02);
}

.tab-btn.active {
    background: rgba(0, 0, 128, 0.06);
    color: var(--accent-navy);
    border: 1px solid rgba(0, 0, 128, 0.1);
}

.tab-btn.active svg {
    opacity: 1;
}

/* Status Indicator Dot on Tab */
.status-indicator-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
    flex-shrink: 0;
}

.status-indicator-dot.running {
    background: var(--success);
}

.status-indicator-dot.offline {
    background: var(--error);
}

/* Panel Containers */
.panel-container {
    position: relative;
    min-height: 400px;
}

.panel-content {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    animation: fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.panel-content.active {
    display: flex;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Premium Cards ────────────────────────────── */
.card {
    border-radius: 6px;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

.scrollable-card {
    max-height: 480px;
    overflow-y: auto;
}

/* Generator Subtabs */
.generator-subtabs {
    display: flex;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    gap: 20px;
}

.subtab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 0;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}

.subtab:hover {
    color: var(--text-primary);
}

.subtab.active {
    color: var(--text-primary);
}

.subtab.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-saffron);
}

/* File Upload Zones */
.upload-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.drop-zone {
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    padding: 1.5rem 0.75rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.005);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.15s ease;
    cursor: pointer;
}

.drop-zone:hover {
    background: rgba(15, 23, 42, 0.02);
    border-color: var(--border-hover);
}

.drop-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.drop-empty svg {
    color: var(--text-secondary);
    opacity: 0.6;
}

.drop-empty strong {
    font-size: 0.76rem;
    font-weight: 600;
}

.drop-empty span {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

/* Filled File Badges */
.drop-filled {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.file-badge {
    font-size: 0.58rem;
    font-weight: 800;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: 6px;
    background: var(--accent-dim);
    color: var(--accent-navy);
    border: 1px solid rgba(0, 0, 128, 0.15);
}

.fname {
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 90%;
    margin-bottom: 2px;
}

.fsize {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.x-btn {
    position: absolute;
    top: -8px;
    right: 0;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.x-btn:hover {
    color: var(--text-primary);
}

/* Action Buttons */
.btn-primary {
    background: var(--accent-navy);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 128, 0.15);
}

.btn-primary:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-secondary:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.02);
}

/* Process Loader State */
.loader-animation {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 8px;
}

.loader-label {
    text-align: center;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}

.process-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.process-steps li {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.process-steps li::before {
    content: '○';
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.process-steps li.active {
    color: var(--text-primary);
    font-weight: 600;
}

.process-steps li.active::before {
    content: '●';
}

.process-steps li.done {
    color: var(--text-primary);
}

.process-steps li.done::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

/* Done Success State */
.success-icon {
    font-size: 1.75rem;
    color: var(--success);
    text-align: center;
    margin-bottom: 8px;
}

.success-label {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.download-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: background 0.15s;
}

.download-btn:hover {
    background: rgba(15, 23, 42, 0.08);
}

.dl-badge-icon {
    font-size: 0.58rem;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.08);
    font-family: var(--font-mono);
}

/* ── Panel 2: Schema Guide ─────────────────────── */
.schema-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.btn-download-template {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-download-template:hover {
    background: rgba(15, 23, 42, 0.1);
    border-color: var(--border-hover);
}

.schema-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    text-align: left;
    margin-bottom: 1rem;
}

.schema-table th, .schema-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.schema-table th {
    color: var(--text-primary);
    font-weight: 700;
    background: rgba(15, 23, 42, 0.01);
}

.interactive-row {
    cursor: pointer;
    transition: background 0.15s;
}

.interactive-row:hover {
    background: rgba(15, 23, 42, 0.03);
}

.interactive-row.selected {
    background: rgba(0, 0, 128, 0.04);
    border-left: 2px solid var(--accent-saffron);
}

.req-yes {
    color: var(--text-primary);
    font-weight: 800;
    background: rgba(15, 23, 42, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.62rem;
}

.schema-table code {
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.05);
    padding: 1px 3px;
    border-radius: 3px;
}

.note-box {
    background: rgba(15, 23, 42, 0.015);
    border-left: 2px solid var(--accent-saffron);
    padding: 10px 12px;
    border-radius: 0 4px 4px 0;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.note-box strong {
    font-size: 0.78rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.note-box ul {
    list-style: none;
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.note-box li::before {
    content: '→';
    margin-right: 6px;
    color: var(--accent-saffron);
}

/* ── Panel 3: Watcher Dashboard ────────────────── */
.watcher-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.watcher-status-pill {
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 3px 8px;
    border-radius: 4px;
}

.watcher-status-pill.active {
    background: var(--success-bg);
    color: var(--accent-green);
    border: 1px solid rgba(19, 136, 8, 0.25);
}

.watcher-status-pill.offline {
    background: rgba(220, 38, 38, 0.15);
    color: #ef4444;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.watcher-folders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.folder-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s;
}

.folder-link:hover {
    border-color: var(--border-hover);
    background: rgba(15, 23, 42, 0.02);
}

.folder-icon {
    font-size: 1.1rem;
}

.folder-link div {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.folder-link strong {
    font-size: 0.78rem;
    font-weight: 600;
}

.folder-id {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.processed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
    text-align: left;
}

.processed-table th, .processed-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.processed-table th {
    font-weight: 600;
    color: var(--text-secondary);
}

.processed-table td.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem 0;
}

/* Service Console Log */
.console-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.console-clear-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.68rem;
    cursor: pointer;
}

.console-clear-btn:hover {
    color: #ffffff;
}

.console-body {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: #e2e8f0;
    height: 110px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.35;
}

/* ── Technical Footer ──────────────────────────── */
.tech-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.spec-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
}

.spec-card h5 {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.spec-card p {
    font-size: 0.68rem;
    color: var(--text-primary);
}

/* ── Right Workspace (Interactive Preview Window) ─ */
.workspace-right {
    display: flex;
    justify-content: center;
    align-items: start;
    min-width: 0;
}

.preview-sheet {
    width: 100%;
    max-width: 440px;
    aspect-ratio: 1 / 1.414;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    box-shadow: 0 15px 45px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* OS Window Header Accent */
.preview-sheet::before {
    content: '● ● ●';
    font-size: 0.6rem;
    letter-spacing: 3px;
    color: rgba(15, 23, 42, 0.2);
    display: block;
    margin-bottom: 0.75rem;
    font-family: sans-serif;
    line-height: 1;
}

.sheet-paper {
    background: #ffffff;
    flex-grow: 1;
    border-radius: 4px;
    padding: 1rem;
    color: #000000;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.01), 0 4px 12px rgba(15, 23, 42, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000000;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.sheet-logo-placeholder {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.sheet-meta-placeholder {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 60px;
}

.sheet-meta-placeholder .line {
    height: 3px;
    background: #cbd5e1;
    border-radius: 1.5px;
}

.sheet-meta-placeholder .line.short {
    width: 40px;
}

.sheet-cover-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
    position: relative;
    background: #fafafa;
}

.sheet-cover-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #64748b;
}

.cover-placeholder-icon {
    font-size: 1.2rem;
}

.sheet-cover-empty p {
    font-size: 0.6rem;
    font-weight: 600;
}

.sheet-cover-filled {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-cover-filled img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.pdf-attached-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #dc2626;
}

.pdf-icon-big {
    font-size: 0.75rem;
    font-weight: 800;
    background: rgba(220, 38, 38, 0.05);
    padding: 2px 4px;
    border-radius: 2px;
    border: 1px solid rgba(220, 38, 38, 0.15);
}

.pdf-attached-text {
    font-size: 0.58rem;
    font-weight: 700;
}

.sheet-content-mock {
    height: 100px;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: #fafafa;
}

.sheet-empty-prompt {
    font-size: 0.58rem;
    color: #64748b;
    text-align: center;
}

.sheet-filled-questions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mock-question {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.q-title {
    display: flex;
    align-items: center;
    gap: 4px;
}

.q-title .bullet {
    font-size: 0.55rem;
    font-weight: 800;
}

.q-title .q-text-line {
    height: 4px;
    background: #94a3b8;
    border-radius: 2px;
    flex-grow: 1;
}

.q-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    padding-left: 10px;
}

.opt-line {
    height: 3px;
    background: #cbd5e1;
    border-radius: 1.5px;
}

.sheet-content-mock.2col-mock {
    height: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.col-grid-mock {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.col-half-mock {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mock-answer-key-tbl {
    margin-top: 16px;
    border-top: 1px solid #cbd5e1;
    padding-top: 8px;
}

.mock-ak-title {
    font-size: 0.5rem;
    font-weight: 800;
    color: #1F4E9D;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.mock-ak-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 2px;
}

.ak-cell {
    background: #ffffff;
    font-size: 0.45rem;
    text-align: center;
    padding: 2px 0;
    font-weight: 600;
}

.ak-cell.hdr {
    background: #1F4E9D;
    color: #ffffff;
    font-weight: 700;
}

.sheet-watermark {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.4rem;
    color: #cbd5e1;
    text-transform: uppercase;
    font-weight: 700;
}

/* ── Academic Generation Loader ───────────────────────── */
.generation-loader-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 12px 0 16px 0;
}

.spinner-ring {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #1F4E9D;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-content {
    flex: 1;
    min-width: 0;
}



.loader-content h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.loader-content p {
    margin: 0 0 8px 0;
    font-size: 0.82rem;
    color: #64748b;
}

.loader-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.loader-progress-fill {
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, #1F4E9D, #3b82f6);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ═══════════════════════════════════════════════════════════
   AUTHENTICATION PORTAL (MATCHING ORIGINAL SPARK THEME)
   ═══════════════════════════════════════════════════════════ */

.auth-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #fdfaf5;
    background-image:
        radial-gradient(ellipse 80% 60% at 15% 10%, rgba(255, 153, 51, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 80% 60% at 85% 90%, rgba(19, 136, 8, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 255, 255, 0.9) 0%, transparent 70%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 4px solid transparent;
    border-image: linear-gradient(90deg, #ff9933 0%, #ff9933 33.3%, #ffffff 33.3%, #ffffff 66.6%, #138808 66.6%, #138808 100%) 1;
}

.auth-gate-card {
    position: relative;
    width: 100%;
    max-width: 490px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 
        0 20px 50px rgba(15, 23, 42, 0.08),
        0 4px 12px rgba(15, 23, 42, 0.03);
    padding: 32px 30px;
    color: #0f172a;
    box-sizing: border-box;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-gate-header {
    text-align: center;
    margin-bottom: 22px;
}

.auth-gate-header .logo-container {
    display: inline-block;
    margin-bottom: 12px;
}

.auth-gate-header .logo {
    height: 32px;
    width: auto;
}

.auth-gate-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
}

.auth-gate-header p {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
}

.auth-pills-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.auth-pills-label span.badge-hint {
    font-size: 0.72rem;
    color: #1F4E9D;
    font-weight: 500;
}

.auth-team-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
}

.auth-pill-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    box-sizing: border-box;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.auth-pill-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.auth-pill-btn.selected {
    background: #eff6ff;
    border-color: #1F4E9D;
    box-shadow: 0 0 0 2px rgba(31, 78, 157, 0.18);
    transform: translateY(-1px);
}

.auth-pill-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.auth-pill-btn.selected .auth-pill-avatar {
    background: #dbeafe;
    border-color: #bfdbfe;
}

.auth-pill-info {
    min-width: 0;
    flex: 1;
}

.auth-pill-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-pill-role {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 1px;
}

.auth-form-group {
    margin-bottom: 14px;
}

.auth-form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 5px;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 12px;
    font-size: 0.9rem;
    color: #94a3b8;
    pointer-events: none;
}

.auth-form-group input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.auth-form-group input::placeholder {
    color: #94a3b8;
}

.auth-form-group input:focus {
    border-color: #1F4E9D;
    box-shadow: 0 0 0 3px rgba(31, 78, 157, 0.12);
}

.auth-error-box {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 14px;
}

.btn-auth-submit {
    width: 100%;
    padding: 11px 18px;
    background: #1F4E9D;
    border: 1px solid #1F4E9D;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(31, 78, 157, 0.2);
    transition: all 0.15s ease;
    margin-top: 2px;
}

.btn-auth-submit:hover {
    background: #163e80;
    border-color: #163e80;
    box-shadow: 0 4px 12px rgba(31, 78, 157, 0.3);
}

.btn-auth-submit:active {
    transform: translateY(1px);
}

.btn-auth-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
