/* ================================================================
   Tacton Scoping Assistant — Dashboard Styles
   ================================================================ */

:root {
    --green: #22c55e;
    --green-bg: #f0fdf4;
    --amber: #f59e0b;
    --amber-bg: #fffbeb;
    --grey: #9ca3af;
    --grey-bg: #f9fafb;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --blue: #3b82f6;
    --blue-bg: #eff6ff;
    --tacton-blue: #1e40af;
    --tacton-dark: #1e293b;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --radius: 14px;

    /* Bucket color system */
    --bucket-included-tint: #f0fdf4;
    --bucket-included-badge: #dcfce7;
    --bucket-included-text: #15803d;
    --bucket-pending-tint: #fefce8;
    --bucket-pending-badge: #fef9c3;
    --bucket-pending-text: #854d0e;
    --bucket-excluded-tint: #fef2f2;
    --bucket-excluded-badge: #fee2e2;
    --bucket-excluded-text: #991b1b;
    --bucket-not-mentioned-tint: #f3f4f6;
    --bucket-not-mentioned-badge: #e5e7eb;
    --bucket-not-mentioned-text: #4b5563;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f1f5f9;
    color: #334155;
    line-height: 1.5;
    min-width: 1200px;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 20px; }
.header-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--tacton-blue);
    letter-spacing: -0.5px;
}
.header-title {
    font-size: 15px;
    color: #64748b;
    border-left: 1px solid var(--border);
    padding-left: 20px;
}
.header-right { text-align: right; font-size: 13px; color: #64748b; }
.header-right strong { color: var(--tacton-dark); }
.logout-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.logout-form { margin: 0; }
.logout-user { color: #94a3b8; font-size: 12px; }
.logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: #64748b;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}
.logout-btn:hover { background: #f1f5f9; color: var(--tacton-dark); }

/* ================================================================
   Bucket Summary Cards
   ================================================================ */
.bucket-summary {
    display: flex;
    gap: 16px;
    padding: 20px 32px 0;
}
.bucket-summary-card {
    flex: 1;
    padding: 18px 22px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow);
}
.bucket-summary-card.included {
    background: var(--bucket-included-tint);
    border: 1px solid var(--bucket-included-badge);
}
.bucket-summary-card.pending {
    background: var(--bucket-pending-tint);
    border: 1px solid var(--bucket-pending-badge);
}
.bucket-summary-card.excluded {
    background: var(--bucket-excluded-tint);
    border: 1px solid var(--bucket-excluded-badge);
}
.bucket-summary-card.not-mentioned {
    background: var(--bucket-not-mentioned-tint);
    border: 1px solid var(--bucket-not-mentioned-badge);
}
.bucket-summary-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bucket-summary-card.included .bucket-summary-label { color: var(--bucket-included-text); }
.bucket-summary-card.pending .bucket-summary-label { color: var(--bucket-pending-text); }
.bucket-summary-card.excluded .bucket-summary-label { color: var(--bucket-excluded-text); }
.bucket-summary-card.not-mentioned .bucket-summary-label { color: var(--bucket-not-mentioned-text); }
.bucket-summary-count {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}
.bucket-summary-card.included .bucket-summary-count { color: var(--bucket-included-text); }
.bucket-summary-card.pending .bucket-summary-count { color: var(--bucket-pending-text); }
.bucket-summary-card.excluded .bucket-summary-count { color: var(--bucket-excluded-text); }
.bucket-summary-card.not-mentioned .bucket-summary-count { color: var(--bucket-not-mentioned-text); }

@keyframes summaryPulse {
    0% { transform: scale(1); box-shadow: var(--shadow); }
    50% { transform: scale(1.04); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
    100% { transform: scale(1); box-shadow: var(--shadow); }
}
.bucket-summary-card.pulse {
    animation: summaryPulse 0.4s ease;
}

/* Progress bar below summary cards */
.bucket-progress {
    padding: 12px 32px 8px;
}
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}
.progress-segment { height: 100%; transition: width 0.3s; }
.progress-segment.green { background: var(--green); }
.progress-segment.amber { background: var(--amber); }
.progress-segment.grey { background: var(--grey); }

/* Legacy stats bar (kept for wizard/other pages) */
.stats-bar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #94a3b8; }
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--tacton-dark);
}
.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.stat-value.grey { color: var(--grey); }

/* Controls */
.controls-bar {
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    color: #475569;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--tacton-blue);
    color: white;
    border-color: var(--tacton-blue);
}
.btn-primary:hover { background: #1e3a8a; }
.btn-primary:disabled { background: #93c5fd; border-color: #93c5fd; }

.btn-success {
    background: var(--green);
    color: white;
    border-color: var(--green);
}
.btn-success:hover { background: #16a34a; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Pill-shaped bucket action buttons */
.btn-pill {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-pill:hover { filter: brightness(0.95); }
.btn-include {
    background: var(--bucket-included-badge);
    color: var(--bucket-included-text);
}
.btn-exclude {
    background: var(--bucket-excluded-badge);
    color: var(--bucket-excluded-text);
}
.btn-to-pending {
    background: var(--bucket-pending-badge);
    color: var(--bucket-pending-text);
}
.btn-confirm {
    background: #e0e7ff;
    color: #3730a3;
}

.btn-group { display: flex; gap: 0; }
.btn-group .btn {
    border-radius: 0;
    margin-left: -1px;
}
.btn-group .btn:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 6px 6px 0; }
.btn-group .btn.active {
    background: var(--tacton-blue);
    color: white;
    border-color: var(--tacton-blue);
    z-index: 1;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    width: 250px;
    font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--tacton-blue); box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1); }

/* Layout */
.main-content {
    display: flex;
    padding: 0 32px 100px;
    gap: 24px;
    margin-top: 16px;
}
.scope-panel { flex: 1; min-width: 0; }
.sidebar { width: 320px; flex-shrink: 0; }

/* Analyse prompt */
.analyse-prompt {
    background: white;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    margin-bottom: 16px;
}
.analyse-prompt h2 { font-size: 18px; color: var(--tacton-dark); margin-bottom: 8px; }
.analyse-prompt p { color: #64748b; margin-bottom: 20px; font-size: 14px; }

.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   Area Groups — Minimal floating headers
   ================================================================ */
.area-group {
    margin-bottom: 20px;
}
.area-header {
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    border-radius: 8px;
    margin-bottom: 8px;
}
.area-header:hover { background: rgba(255,255,255,0.6); }
.area-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--tacton-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}
.area-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}
.area-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.area-badge.green { background: var(--bucket-included-badge); color: var(--bucket-included-text); }
.area-badge.amber { background: var(--bucket-pending-badge); color: var(--bucket-pending-text); }
.area-badge.grey { background: var(--grey-bg); color: #4b5563; }

.chevron {
    transition: transform 0.2s;
    color: #94a3b8;
}
.chevron.expanded { transform: rotate(90deg); }

/* ================================================================
   Question Cards — Standalone rounded with top band
   ================================================================ */
.question-card {
    position: relative;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}
.question-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.question-card.bucket-included { background: var(--bucket-included-tint); }
.question-card.bucket-pending { background: var(--bucket-pending-tint); }
.question-card.bucket-excluded { background: var(--bucket-excluded-tint); }

/* Top colored band — same color as card body, no separate band */
.question-card::before {
    content: '';
    display: block;
    height: 40px;
    width: 100%;
    transition: background-color 0.3s ease;
}
.question-card.bucket-included::before { background: var(--bucket-included-tint); }
.question-card.bucket-pending::before { background: var(--bucket-pending-tint); }
.question-card.bucket-excluded::before { background: var(--bucket-excluded-tint); }

/* Pulse animation for color cross-fade */
@keyframes cardPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.015); }
    100% { transform: scale(1); }
}
.question-card.card-pulse {
    animation: cardPulse 0.3s ease;
}

/* Slide-out animation */
@keyframes cardSlideOut {
    0% { opacity: 1; max-height: 500px; margin-bottom: 10px; transform: scale(1); }
    100% { opacity: 0; max-height: 0; margin-bottom: 0; transform: scale(0.95); padding: 0; overflow: hidden; }
}
.question-card.card-leaving {
    animation: cardSlideOut 0.3s ease forwards;
    pointer-events: none;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 0 20px 14px;
    margin-top: -26px;
    position: relative;
}

/* Bucket badge */
.bucket-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 60px;
    justify-content: center;
}
.bucket-badge.included { background: var(--bucket-included-badge); color: var(--bucket-included-text); }
.bucket-badge.pending { background: var(--bucket-pending-badge); color: var(--bucket-pending-text); }
.bucket-badge.excluded { background: var(--bucket-excluded-badge); color: var(--bucket-excluded-text); }

.question-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.question-body {
    padding: 0 20px 16px 20px;
}

/* Confirmed/unconfirmed indicator */
.confirm-indicator {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}
.confirm-indicator.confirmed { background: #e0e7ff; color: #3730a3; }
.confirm-indicator.unconfirmed { background: #f1f5f9; color: #94a3b8; }

/* Scope cards (legacy) */
.scope-card {
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 20px;
    transition: background 0.15s;
}
.scope-card:last-child { border-bottom: none; }
.scope-card:hover { background: #fafbfd; }

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.auto_include { background: var(--green); }
.status-dot.needs_review { background: var(--amber); }
.status-dot.not_applicable { background: var(--grey); }
.status-dot.approved { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.status-dot.rejected { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }

.card-question {
    flex: 1;
    font-size: 13px;
    color: #334155;
}
.card-option {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.confidence-bar {
    width: 60px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}
.confidence-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.confidence-fill.high { background: var(--green); }
.confidence-fill.medium { background: var(--amber); }
.confidence-fill.low { background: var(--red); }

.card-hours {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    min-width: 50px;
    text-align: right;
}

/* Card expanded content */
.card-body { padding: 12px 0 8px 22px; }

.info-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.6;
}
.info-box.reasoning { background: var(--blue-bg); color: #1e40af; border-left: 3px solid var(--blue); }
.info-box.evidence { background: #faf5ff; color: #6b21a8; border-left: 3px solid #a855f7; font-style: italic; }
.info-box.no-evidence { background: var(--amber-bg); color: #92400e; border-left: 3px solid var(--amber); }

.sow-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 10px;
    color: #334155;
}
.sow-textarea:focus { outline: none; border-color: var(--tacton-blue); box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1); }
.sow-textarea:disabled { background: #f9fafb; color: #94a3b8; }

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.card-actions .spacer { flex: 1; }

.decision-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}
.decision-badge.approved { background: var(--green-bg); color: var(--bucket-included-text); }
.decision-badge.rejected { background: var(--red-bg); color: var(--bucket-excluded-text); }

/* Sidebar — missing info */
.sidebar-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}
.sidebar-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--tacton-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.missing-item {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}
.missing-item .area { font-weight: 600; color: var(--tacton-dark); font-size: 12px; }
.missing-item .question { color: #475569; margin-top: 2px; }
.missing-item .context { color: #94a3b8; font-size: 12px; margin-top: 4px; }

/* Signal panel */
.signals-panel { margin-top: 16px; }
.signal-item {
    padding: 8px 10px;
    border-left: 3px solid var(--blue);
    background: var(--blue-bg);
    border-radius: 0 8px 8px 0;
    margin-bottom: 6px;
    font-size: 12px;
}
.signal-category {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--tacton-blue);
    letter-spacing: 0.5px;
}

/* Bottom bar — slim */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 10px 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}
.bottom-warning {
    font-size: 12px;
    color: #94a3b8;
    margin-right: auto;
}

/* SoW Preview styles */
.sow-preview {
    max-width: 900px;
    margin: 32px auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 48px;
}
.sow-preview h1 { font-size: 22px; color: var(--tacton-dark); margin-bottom: 8px; }
.sow-preview h2 { font-size: 17px; color: var(--tacton-blue); margin: 28px 0 12px; border-bottom: 2px solid var(--blue-bg); padding-bottom: 6px; }
.sow-preview h3 { font-size: 14px; color: #475569; margin: 16px 0 8px; }
.sow-preview p { font-size: 13px; margin-bottom: 8px; line-height: 1.7; }
.sow-preview .meta { font-size: 13px; color: #64748b; margin-bottom: 24px; }

.hours-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 16px 0;
}
.hours-table th, .hours-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.hours-table th { background: #f8fafc; font-weight: 600; color: var(--tacton-dark); }
.hours-table tr:last-child td { font-weight: 600; border-top: 2px solid var(--tacton-dark); }
.hours-table .num { text-align: right; }

.sow-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.exclusion-item {
    padding: 8px 12px;
    background: var(--grey-bg);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

/* ================================================================
   Question-Centric UI Components
   ================================================================ */

.question-card.unanswered {
    border-left: 3px solid var(--amber);
    background: var(--amber-bg);
}
.question-card.unanswered:hover { background: #fff8e1; }

/* Status dot — add unanswered state */
.status-dot.unanswered { background: var(--amber); border: 2px solid #fbbf24; }

/* Type badge */
.type-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Unanswered badge */
.unanswered-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--amber-bg);
    color: #92400e;
    text-transform: uppercase;
    border: 1px solid #fbbf24;
}

/* Area badge amber outline (for unanswered count) */
.area-badge.amber-outline {
    background: transparent;
    color: #92400e;
    border: 1px solid #fbbf24;
}

/* Option selector (radio-type dropdown) */
.option-selector {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.selector-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}
.option-dropdown {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    min-width: 300px;
    max-width: 100%;
    color: #334155;
    background: white;
}
.option-dropdown:focus {
    outline: none;
    border-color: var(--tacton-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Toggle switch (yes/no) */
.toggle-container {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: 0.3s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}
.toggle-hours {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-left: auto;
}

/* Checklist options */
.checklist-options {
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.checklist-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.checklist-option:hover { background: #f8fafc; }
.checklist-option.included {
    background: var(--bucket-included-tint);
    border-color: #86efac;
}
.checklist-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--tacton-blue);
    margin-top: 2px;
    flex-shrink: 0;
}
.checklist-text {
    flex: 1;
}
.checklist-reason {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}
.checklist-hours {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 2px;
}

/* Flat item details */
.flat-item-details {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.selection-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}
.selection-badge.mandatory { background: var(--blue-bg); color: #1e40af; }
.selection-badge.optional { background: var(--grey-bg); color: #4b5563; }
.flat-hours {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

/* Info-box labels */
.info-box-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    opacity: 0.7;
}
.info-box.reasoning .info-box-label { color: #1e40af; }
.info-box.evidence .info-box-label { color: #6b21a8; font-style: normal; }

.evidence-link {
    font-size: 10px;
    font-weight: 600;
    color: #a855f7;
    margin-left: 6px;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.info-box.evidence.clickable {
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.info-box.evidence.clickable:hover {
    background: #f3e8ff;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}
.info-box.evidence.clickable:hover .evidence-link {
    opacity: 1;
}

/* ================================================================
   Transcript Viewer Modal
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.modal-enter { animation: fadeIn 0.2s ease; }
.modal-leave { animation: fadeOut 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.modal-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--tacton-dark);
    margin: 0;
}
.modal-meta {
    flex: 1;
    font-size: 12px;
    color: #64748b;
}
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.modal-close:hover { background: #e2e8f0; color: #1e293b; }

.modal-body {
    overflow-y: auto;
    padding: 16px 24px 24px;
    flex: 1;
}

.transcript-turn {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    transition: background 0.2s;
}
.transcript-turn:hover { background: #f8fafc; }
.transcript-turn.highlighted {
    background: #fef3c7;
    border-left: 3px solid var(--amber);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
    animation: highlightPulse 1.5s ease;
}
@keyframes highlightPulse {
    0% { background: #fde68a; }
    100% { background: #fef3c7; }
}

.transcript-time {
    font-size: 11px;
    color: #94a3b8;
    font-family: 'SF Mono', 'Consolas', monospace;
    min-width: 60px;
    flex-shrink: 0;
    padding-top: 2px;
}
.transcript-speaker {
    font-weight: 600;
    color: var(--tacton-dark);
    min-width: 140px;
    flex-shrink: 0;
}
.transcript-text {
    color: #475569;
    flex: 1;
}

/* Utility */
.hidden { display: none !important; }
.text-muted { color: #94a3b8; }
.text-sm { font-size: 12px; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.gap-2 { gap: 8px; }

/* ================================================================
   Login page
   ================================================================ */
.login-wrapper {
    min-height: 100vh;
    background: #0f172a;        /* fallback while video loads / if it fails */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.login-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    animation: login-bg-fade-in 600ms ease-out 100ms forwards;
}
@keyframes login-bg-fade-in {
    to { opacity: 1; }
}
.login-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    /* Slight vignette + dim so any frame keeps the white card readable */
    background:
        radial-gradient(ellipse at center, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.55) 100%);
}
@media (prefers-reduced-motion: reduce) {
    .login-bg-video { display: none; }
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    padding: 40px 36px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}
.login-logo {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--tacton-blue);
    margin-bottom: 18px;
}
.login-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--tacton-dark);
    margin: 0 0 6px;
}
.login-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 28px;
}
.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.login-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.login-input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 14px;
    font-size: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.login-input:focus {
    outline: none;
    border-color: var(--tacton-blue);
    background: white;
}
.login-submit {
    margin-top: 8px;
    width: 100%;
    background: var(--tacton-blue);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.login-submit:hover {
    background: #1e3a8a;
}
