/* ══════════════════════════════════════════════════════
   Financial Audit Check Assistant — Stylesheet
   Clean, professional internal business tool
   ══════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────── */
:root {
    --primary:       #1e40af;
    --primary-light: #3b82f6;
    --primary-dark:  #1e3a8a;
    --accent:        #0ea5e9;
    --danger:        #dc2626;
    --warning:       #d97706;
    --success:       #16a34a;
    --gray-50:       #f8fafc;
    --gray-100:      #f1f5f9;
    --gray-200:      #e2e8f0;
    --gray-300:      #cbd5e1;
    --gray-400:      #94a3b8;
    --gray-500:      #64748b;
    --gray-600:      #475569;
    --gray-700:      #334155;
    --gray-800:      #1e293b;
    --gray-900:      #0f172a;
    --radius:        8px;
    --shadow-sm:     0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Navbar ──────────────────────────────────────────── */
.navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 0.75rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.brand-text {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-links a {
    display: block;
    padding: 0.45rem 0.9rem;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-links a.active { color: #fff; background: rgba(99,102,241,0.25); }

/* ── Nav right section ───────────────────────────────── */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* ── Main ────────────────────────────────────────────── */
main {
    padding: 2rem 0 3rem;
    min-height: calc(100vh - 120px);
}

/* ── Page header ─────────────────────────────────────── */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.page-header p {
    margin-top: 0.25rem;
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* ── Cards ───────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-body { padding: 1.5rem; }
.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-700);
}

/* ── Upload cards grid ───────────────────────────────── */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) { .upload-grid { grid-template-columns: 1fr; } }

.upload-card {
    background: #fff;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.upload-card:hover {
    border-color: var(--primary-light);
    background: var(--gray-50);
}

.upload-card.has-file {
    border-color: var(--success);
    border-style: solid;
    background: #f0fdf4;
}

.upload-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--gray-100);
    color: var(--gray-500);
}

.upload-card.excel .upload-card-icon { background: #dbeafe; color: var(--primary); }
.upload-card.pdf .upload-card-icon { background: #fce7f3; color: #db2777; }

.upload-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.upload-card p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.upload-card input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-selected-label {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ── Form elements ───────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-group .hint {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.2rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-sm); }

.btn-secondary {
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-50); }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #15803d; }

.btn-danger {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-danger:hover { background: #fef2f2; }

.btn-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #f59e0b;
}
.btn-warning:hover { background: #fef3c7; }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Badges / Tags ──────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Status badges — map status names to CSS classes via | lower | replace(' ', '-') */
.badge-new                         { background: #dbeafe; color: #1e40af; }
.badge-sent-to-job-owner           { background: #fef3c7; color: #92400e; }
.badge-in-review                   { background: #fffbeb; color: #92400e; }
.badge-resolved                    { background: #f0fdf4; color: #166534; }
.badge-unresolved                  { background: #fef2f2; color: #991b1b; }
.badge-accepted---no-action-required { background: var(--gray-100); color: var(--gray-500); }
.badge-escalated-to-manager        { background: #fdf2f8; color: #9d174d; }

/* Confidence-level badges */
.badge-confidence-high   { background: #f0fdf4; color: #166534; }
.badge-confidence-medium { background: #fffbeb; color: #92400e; }
.badge-confidence-low    { background: #fef2f2; color: #991b1b; }
.badge-confidence-none   { background: var(--gray-100); color: var(--gray-500); }

/* ── Tables ──────────────────────────────────────────── */
.table-container {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th,
table.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    white-space: nowrap;
}

table.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--gray-200);
}

table.data-table td {
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--gray-50); }

/* Truncated column (long text like root cause) */
td.col-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* ── Stats grid (Dashboard) ──────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stat-card-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-card-value.primary   { color: var(--primary); }
.stat-card-value.danger    { color: var(--danger); }
.stat-card-value.warning   { color: var(--warning); }
.stat-card-value.success   { color: var(--success); }

/* ── Detail sections ─────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
}

@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-item {}
.detail-item-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}
.detail-item-value {
    font-size: 0.9rem;
    color: var(--gray-800);
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

/* ── Filters bar ─────────────────────────────────────── */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filters-bar label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-600);
}

.filter-select {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--gray-700);
    background: #fff;
}

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-400);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state p { font-size: 0.9rem; }

/* ── Analysis result ─────────────────────────────────── */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-header-left h1 { margin-bottom: 0.25rem; }
.result-header-left p { color: var(--gray-500); font-size: 0.85rem; }

/* ── Analysis layout (two-column) ────────────────────── */
.analysis-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .analysis-layout { grid-template-columns: 1fr; }
}

.analysis-main {
    min-width: 0;
}

/* ── Toggle switch ──────────────────────────────────── */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--gray-300);
    border-radius: 12px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--warning);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(20px);
}

.toggle-text {
    font-size: 0.9rem;
    color: var(--gray-700);
}

/* ── Radio button group ────────────────────────────── */
.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--gray-700);
    cursor: pointer;
}

.radio-label input[type="radio"] {
    accent-color: var(--primary);
}

/* ── AI calculation badge ──────────────────────────── */
.badge-ai {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ── Manager View ──────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-open .stat-card-value       { color: var(--primary); }
.stat-overdue .stat-card-value    { color: var(--danger); }
.stat-unresolved .stat-card-value { color: var(--danger); }
.stat-resolved .stat-card-value   { color: var(--success); }
.stat-escalated .stat-card-value  { color: var(--warning); }

.stat-card-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Manager columns */
.manager-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.manager-panel .card { height: 100%; }

/* Owner bar chart */
.owner-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.owner-bar-label {
    width: 140px;
    font-size: 0.85rem;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.owner-bar-count {
    width: 28px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    flex-shrink: 0;
}

.owner-bar {
    height: 24px;
    background: var(--primary-light);
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.4s ease;
}

/* Overdue list */
.overdue-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.overdue-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}

.overdue-item:hover {
    border-color: var(--gray-300);
}

.overdue-ticket-id {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    font-family: monospace;
}

.overdue-job-ref {
    font-size: 0.85rem;
    color: var(--gray-700);
}

.overdue-owner {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.overdue-date {
    font-size: 0.8rem;
    color: var(--danger);
    font-weight: 600;
}

/* ── Chat panel ──────────────────────────────────────── */
.analysis-chat {
    position: sticky;
    top: 80px;
}

.chat-container {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    max-height: 700px;
}

.chat-header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-bubble {
    max-width: 100%;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-bubble-user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-bubble-assistant {
    background: var(--gray-100);
    color: var(--gray-800);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-bubble-text {
    white-space: pre-wrap;
}

.use-draft-btn {
    margin-top: 0.5rem;
    font-size: 0.72rem !important;
    padding: 0.25rem 0.6rem !important;
}

.chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.chat-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.chat-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.chat-send-btn {
    flex-shrink: 0;
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
    background: #fff;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    padding: 1rem 0;
    color: var(--gray-400);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════
   Platform — AI Review Platform
   ═══════════════════════════════════════════════════════ */

/* ── Platform Navbar ─────────────────────────────────── */
.platform-navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.platform-navbar .nav-links-right {
    margin-left: auto;
}

/* ── Nav dropdown ────────────────────────────────────── */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    color: var(--gray-300);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    white-space: nowrap;
}

.nav-dropdown-trigger:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 280px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
    z-index: 200;
    overflow: hidden;
}

.nav-dropdown-item {
    display: block;
    padding: 0.7rem 1.1rem;
    font-size: 0.85rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 450;
    transition: background 0.1s, color 0.1s;
    line-height: 1.4;
}

.nav-dropdown-item:hover {
    background: var(--gray-50);
    color: #4f46e5;
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 0.25rem 0;
}

/* ── User trigger ────────────────────────────────────── */
.user-trigger {
    gap: 0.5rem;
    padding: 0.3rem 0.65rem 0.3rem 0.45rem;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
}

/* ── User menu ───────────────────────────────────────── */
.nav-user-menu {
    min-width: 260px;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.user-avatar-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-menu-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--gray-800);
}

.user-menu-email {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

.user-role-badge {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #e0e7ff;
    color: #3730a3;
}

.nav-logout-form { margin: 0; }

.nav-logout-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--gray-600);
    padding: 0.65rem 1rem;
    font-family: inherit;
    font-weight: 450;
}

.nav-logout-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ── Platform Landing ────────────────────────────────── */
.platform-landing {
    padding: 1rem 0;
}

.platform-landing .page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.platform-landing .page-header h1 {
    font-size: 2rem;
    color: var(--gray-900);
}

.platform-landing .page-header p {
    font-size: 1rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

/* ── Assistant Grid ──────────────────────────────────── */
.assistant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .assistant-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Assistant Card ──────────────────────────────────── */
.assistant-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.assistant-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--card-accent, var(--primary));
}

.assistant-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--card-accent, var(--primary-light));
}

.assistant-card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--gray-100);
    color: var(--card-accent, var(--primary));
    margin-bottom: 1.25rem;
}

.assistant-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.assistant-card p {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1.25rem;
}

.assistant-card-arrow {
    font-size: 1.2rem;
    color: var(--gray-300);
    transition: color 0.2s, transform 0.2s;
    align-self: flex-end;
}

.assistant-card:hover .assistant-card-arrow {
    color: var(--card-accent, var(--primary));
    transform: translateX(4px);
}

/* ── Auth (Login) ────────────────────────────────────── */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.auth-card h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.auth-form {
    text-align: left;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.btn-block {
    display: block;
    width: 100%;
    justify-content: center;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: left;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ═══════════════════════════════════════════════════════
   Shared Components
   ═══════════════════════════════════════════════════════ */

/* ── Risk Badge ──────────────────────────────────────── */
.risk-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.risk-badge-sm { font-size: 0.68rem; padding: 0.1rem 0.45rem; }
.risk-badge-lg { font-size: 0.8rem; padding: 0.25rem 0.75rem; }

/* ── Status Badge (shared) ───────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge-sm { font-size: 0.68rem; padding: 0.1rem 0.45rem; }
.status-badge-lg { font-size: 0.8rem; padding: 0.25rem 0.75rem; }

.status-badge-neutral  { background: var(--gray-100); color: var(--gray-600); }
.status-badge-info     { background: #dbeafe; color: #1e40af; }
.status-badge-success  { background: #f0fdf4; color: #166534; }
.status-badge-warning  { background: #fef3c7; color: #92400e; }
.status-badge-danger   { background: #fef2f2; color: #991b1b; }

/* ── Evidence Viewer ─────────────────────────────────── */
.evidence-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.evidence-item {
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
}

.evidence-item-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
}

.evidence-item-value {
    font-size: 0.9rem;
    color: var(--gray-800);
}

.evidence-item-source {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.no-evidence {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-400);
    font-size: 0.85rem;
}
