/**
 * FABIQ Steel Takeoff Module — Styles
 * Matching newquote design system
 */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #1a2b4a;
    --primary-light: #2d4a7c;
    --primary-dark: #0f1a2e;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #60a5fa;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --bg-color: #f0f4f8;
    --bg-dark: #e2e8f0;
    --card-bg: #ffffff;
    --sidebar-bg: #1a2b4a;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #ffffff;
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --sidebar-width: 240px;
    --header-height: 64px;

    /* Takeoff-specific */
    --column-highlight: #ec4899;
    --beam-highlight: #3b82f6;
    --arrow-color: #ef4444;
    --unmatched-highlight: #f59e0b;
    --toolbar-height: 48px;
    --ws-sidebar-width: 260px;
    --properties-width: 280px;
    --stats-panel-width: 360px;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}
a { color: var(--accent-color); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--accent-hover); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }

/* ===== Layout (Dashboard / List pages) ===== */
.app-container { display: flex; min-height: 100vh; }

/* ===== Sidebar (shared for dashboard/list) ===== */
.sidebar {
    position: fixed; left: 0; top: 0;
    width: var(--sidebar-width); height: 100vh;
    background: var(--sidebar-bg); color: var(--text-light);
    display: flex; flex-direction: column; z-index: 1000;
    transition: var(--transition);
}
.sidebar-header {
    padding: 20px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo-img { height:44px; width:auto; object-fit:contain; }
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-section { margin-bottom: 24px; }
.nav-section-title {
    padding: 0 20px; margin-bottom: 8px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: rgba(255,255,255,0.4);
}
.nav-item {
    display: flex; align-items: center; padding: 12px 20px;
    color: rgba(255,255,255,0.7); transition: var(--transition-fast);
    cursor: pointer; gap: 12px;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: var(--text-light); }
.nav-item.active {
    background: rgba(59,130,246,0.2); color: var(--accent-light);
    border-right: 3px solid var(--accent-color);
}
.nav-item i { width: 20px; text-align: center; font-size: 16px; }
.sidebar-footer {
    padding: 16px; border-top: 1px solid rgba(255,255,255,0.1);
}
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent-color); display: flex; align-items: center;
    justify-content: center; font-weight: 600; font-size: 14px; color: white;
}
.user-details { flex: 1; }
.user-name { font-weight: 500; font-size: 13px; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.5); }

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width); flex: 1;
    display: flex; flex-direction: column;
}
.main-header {
    height: var(--header-height); padding: 0 24px;
    background: var(--card-bg); border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 20px; font-weight: 600; }
.mobile-menu-btn { display: none; background: none; font-size: 20px; color: var(--text-primary); }
.header-btn {
    width: 36px; height: 36px; border-radius: 8px;
    background: none; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition-fast);
}
.header-btn:hover { background: var(--bg-color); color: var(--text-primary); }
.user-dropdown-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 8px; cursor: pointer;
    transition: var(--transition-fast);
}
.user-dropdown-btn:hover { background: var(--bg-color); }

.page-content { padding: 24px; flex: 1; }

/* ===== Cards ===== */
.card {
    background: var(--card-bg); border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
    padding: 16px 20px; display: flex; align-items: center;
    justify-content: space-between; border-bottom: 1px solid var(--border-color);
}
.card-title { font-size: 16px; font-weight: 600; }

/* ===== Stats Grid ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--card-bg); border-radius: var(--border-radius-lg);
    padding: 20px; box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.stat-icon.blue { background: rgba(59,130,246,0.1); color: var(--accent-color); }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--success-color); }
.stat-icon.orange { background: rgba(245,158,11,0.1); color: var(--warning-color); }
.stat-icon.purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-secondary); }

/* ===== Table ===== */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 12px 16px; text-align: left;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-secondary);
    background: var(--bg-color); border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--border-color);
    font-size: 13px; vertical-align: middle;
}
.data-table tbody tr:hover { background: rgba(59,130,246,0.04); }
.data-table-compact th { padding: 8px 10px; font-size: 10px; }
.data-table-compact td { padding: 8px 10px; font-size: 12px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.actions-cell { white-space: nowrap; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 6px; font-weight: 500;
    font-size: 13px; transition: var(--transition-fast); border: none;
}
.btn-primary { background: var(--accent-color); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-color); border-color: var(--accent-color); }
.btn-danger { background: var(--danger-color); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon {
    width: 32px; height: 32px; border-radius: 6px;
    background: none; color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center;
    transition: var(--transition-fast);
}
.btn-icon:hover { background: var(--bg-color); color: var(--accent-color); }
.btn-danger-icon:hover { color: var(--danger-color); }
.btn-icon-sm {
    width: 28px; height: 28px; border-radius: 4px;
    background: none; color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon-sm:hover { background: var(--bg-color); color: var(--text-primary); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.form-input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-color);
    border-radius: 6px; font-size: 13px; background: var(--card-bg);
    transition: var(--transition-fast);
}
.form-input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-select {
    padding: 8px 12px; border: 1px solid var(--border-color);
    border-radius: 6px; font-size: 13px; background: var(--card-bg);
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex; align-items: center; padding: 4px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 600;
}
.status-draft { background: rgba(148,163,184,0.15); color: #64748b; }
.status-processing { background: rgba(245,158,11,0.15); color: #d97706; }
.status-completed { background: rgba(16,185,129,0.15); color: #059669; }
.status-archived { background: rgba(107,114,128,0.15); color: #6b7280; }
.status-ready { background: rgba(16,185,129,0.15); color: #059669; }
.status-error { background: rgba(239,68,68,0.15); color: var(--danger-color); }

/* Page type badges */
.page-badge { font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 2px 5px; border-radius: 3px; }
.page-badge-plan { background: rgba(59,130,246,0.2); color: #2563eb; }
.page-badge-section { background: rgba(16,185,129,0.2); color: #059669; }
.page-badge-schedule { background: rgba(245,158,11,0.2); color: #d97706; }
.page-badge-detail { background: rgba(139,92,246,0.2); color: #7c3aed; }
.page-badge-cover { background: rgba(148,163,184,0.2); color: #64748b; }
.page-badge-unknown { background: rgba(148,163,184,0.1); color: #94a3b8; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: none; align-items: center; justify-content: center;
    z-index: 2000; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--card-bg); border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg); width: 100%; max-height: 90vh;
    display: flex; flex-direction: column;
}
.modal-fullwidth { max-width: 95vw; }
.modal-header {
    padding: 16px 20px; display: flex; align-items: center;
    justify-content: space-between; border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px; border-radius: 6px;
    background: none; font-size: 20px; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg-color); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 12px 20px; display: flex; justify-content: flex-end;
    gap: 8px; border-top: 1px solid var(--border-color);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 8px;
    background: var(--card-bg); box-shadow: var(--shadow-lg);
    min-width: 300px; animation: slideIn 0.3s ease;
}
.toast.hiding { animation: slideOut 0.3s ease forwards; }
.toast-icon { font-size: 18px; }
.toast-success .toast-icon { color: var(--success-color); }
.toast-error .toast-icon { color: var(--danger-color); }
.toast-warning .toast-icon { color: var(--warning-color); }
.toast-info .toast-icon { color: var(--info-color); }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 13px; }
.toast-message { font-size: 12px; color: var(--text-secondary); }
.toast-close { background: none; font-size: 18px; color: var(--text-muted); padding: 0 4px; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ===== Loading ===== */
.loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,0.8);
    display: flex; align-items: center; justify-content: center; z-index: 9000;
}
.spinner {
    width: 40px; height: 40px; border: 3px solid var(--border-color);
    border-top-color: var(--accent-color); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Pagination ===== */
.pagination { padding: 16px 20px; display: flex; align-items: center; gap: 4px; justify-content: center; }
.pagination-btn {
    width: 32px; height: 32px; border-radius: 6px;
    background: none; border: 1px solid var(--border-color);
    color: var(--text-primary); font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.pagination-btn.active { background: var(--accent-color); color: white; border-color: var(--accent-color); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-info { font-size: 12px; color: var(--text-secondary); margin-left: 8px; }

/* ===== Not-auth Banner ===== */
.no-auth-banner {
    margin: 0 24px; padding: 12px 20px; border-radius: 8px;
    background: var(--danger-color); color: white;
    display: flex; align-items: center; gap: 12px; font-size: 13px;
    margin-top: 16px;
}

/* ===== Filter Bar ===== */
.filter-bar { padding: 16px 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-box {
    position: relative; flex: 1; min-width: 200px;
}
.search-box i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted);
}
.search-box input {
    width: 100%; padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color); border-radius: 6px; font-size: 13px;
}
.search-box input:focus { border-color: var(--accent-color); }
.link-primary { color: var(--accent-color); font-weight: 500; }
.link-primary:hover { color: var(--accent-hover); text-decoration: underline; }

/* ===== Progress Bar ===== */
.progress-bar-container {
    width: 100%; height: 8px; background: var(--bg-dark);
    border-radius: 4px; overflow: hidden;
}
.progress-bar {
    height: 100%; background: var(--accent-color);
    border-radius: 4px; transition: width 0.3s ease;
}

/* ============================================ */
/*       WORKSPACE-SPECIFIC STYLES              */
/* ============================================ */

/* Workspace Layout */
.workspace-container { display: flex; height: 100vh; overflow: hidden; }

/* Workspace Sidebar */
.workspace-sidebar {
    width: var(--ws-sidebar-width); background: var(--sidebar-bg);
    color: var(--text-light); display: flex; flex-direction: column;
    flex-shrink: 0; z-index: 100;
}
.ws-sidebar-header {
    padding: 14px 16px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.ws-project-name {
    font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-section { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.ws-section-grow { flex: 1; overflow-y: auto; }
.ws-section-title {
    padding: 0 16px; margin-bottom: 8px;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: rgba(255,255,255,0.4);
}

/* Tool Buttons */
.ws-tool-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 8px 16px;
    background: none; color: rgba(255,255,255,0.65);
    font-size: 13px; transition: var(--transition-fast);
}
.ws-tool-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.ws-tool-btn.active {
    background: rgba(59,130,246,0.2); color: var(--accent-light);
    border-left: 3px solid var(--accent-color);
}
.ws-tool-btn i { width: 18px; text-align: center; font-size: 14px; }

/* Document List */
.ws-doc-list { max-height: 150px; overflow-y: auto; }
.ws-doc-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 16px; font-size: 12px;
    color: rgba(255,255,255,0.65); cursor: pointer;
    transition: var(--transition-fast);
}
.ws-doc-item:hover { background: rgba(255,255,255,0.06); }
.ws-doc-item.active { background: rgba(59,130,246,0.15); color: var(--accent-light); }
.ws-doc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-doc-badge {
    font-size: 10px; padding: 2px 6px; border-radius: 10px;
    background: rgba(255,255,255,0.15);
}
.ws-upload-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: calc(100% - 32px); margin: 8px 16px;
    padding: 8px; border-radius: 6px; font-size: 12px;
    background: rgba(59,130,246,0.15); color: var(--accent-light);
    border: 1px dashed rgba(59,130,246,0.3);
    transition: var(--transition-fast);
}
.ws-upload-btn:hover { background: rgba(59,130,246,0.25); }

/* Thumbnails */
.ws-thumbnail-list { padding: 4px 12px; }
.ws-thumbnail {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 4px; cursor: pointer;
    font-size: 12px; color: rgba(255,255,255,0.6);
    transition: var(--transition-fast); margin-bottom: 2px;
}
.ws-thumbnail:hover { background: rgba(255,255,255,0.06); }
.ws-thumbnail.active { background: rgba(59,130,246,0.2); color: var(--accent-light); }
.ws-thumbnail-num { width: 24px; text-align: center; font-weight: 600; font-size: 11px; }
.ws-thumbnail-type { margin-left: auto; }

/* Sidebar Footer */
.ws-sidebar-footer {
    padding: 10px 16px; border-top: 1px solid rgba(255,255,255,0.1);
}
.user-info-compact {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; color: rgba(255,255,255,0.6);
}

/* ===== Workspace Main Area ===== */
.workspace-main {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; position: relative;
}

/* Toolbar */
.workspace-toolbar {
    height: var(--toolbar-height); padding: 0 12px;
    background: var(--card-bg); border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-shrink: 0;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 6px; }
.toolbar-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 10px; border-radius: 5px;
    background: none; color: var(--text-secondary);
    font-size: 12px; transition: var(--transition-fast); white-space: nowrap;
}
.toolbar-btn:hover { background: var(--bg-color); color: var(--text-primary); }
.toolbar-btn-primary {
    background: var(--accent-color); color: white;
}
.toolbar-btn-primary:hover { background: var(--accent-hover); }
.toolbar-divider { width: 1px; height: 24px; background: var(--border-color); margin: 0 4px; }
.toolbar-page-info { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.page-input {
    width: 40px; text-align: center; padding: 4px;
    border: 1px solid var(--border-color); border-radius: 4px; font-size: 12px;
}
.toolbar-zoom-level { font-size: 11px; color: var(--text-muted); min-width: 40px; text-align: center; }
.toolbar-select {
    padding: 4px 8px; border: 1px solid var(--border-color);
    border-radius: 4px; font-size: 12px; background: var(--card-bg);
}
.save-status { font-size: 11px; color: var(--success-color); display: flex; align-items: center; gap: 4px; }
.save-status.unsaved { color: var(--warning-color); }

/* ===== Canvas Viewport ===== */
.canvas-viewport {
    flex: 1; position: relative; overflow: hidden;
    background: #4a5568;
    /* Checkered pattern for transparency indication */
    background-image: linear-gradient(45deg, #3d4554 25%, transparent 25%),
                      linear-gradient(-45deg, #3d4554 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #3d4554 75%),
                      linear-gradient(-45deg, transparent 75%, #3d4554 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    cursor: grab;
}
.canvas-viewport.panning { cursor: grabbing; }
.canvas-viewport.tool-mark { cursor: crosshair; }
.canvas-viewport.tool-length { cursor: crosshair; }
.canvas-viewport.tool-scale { cursor: crosshair; }
.canvas-viewport.tool-roi { cursor: crosshair; }

#pdfCanvas {
    position: absolute; transform-origin: 0 0;
}
#annotationCanvas {
    position: absolute; transform-origin: 0 0;
    pointer-events: none;
}

.viewport-empty {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 16px; color: rgba(255,255,255,0.6);
    background: rgba(0,0,0,0.2);
}
.viewport-empty i { font-size: 64px; opacity: 0.3; }
.viewport-empty h3 { font-size: 18px; }
.viewport-empty p { font-size: 13px; }

/* ===== Properties Panel ===== */
.properties-panel {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: var(--properties-width); background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    display: flex; flex-direction: column; z-index: 50;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}
.panel-header {
    padding: 12px 16px; display: flex; align-items: center;
    justify-content: space-between; border-bottom: 1px solid var(--border-color);
}
.panel-header h3 { font-size: 14px; font-weight: 600; }
.panel-body { padding: 16px; overflow-y: auto; flex: 1; }

.prop-row { margin-bottom: 12px; }
.prop-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.prop-value { font-size: 13px; font-weight: 500; }
.prop-input {
    width: 100%; padding: 6px 8px; border: 1px solid var(--border-color);
    border-radius: 4px; font-size: 12px;
}

/* ===== Statistics Panel ===== */
.statistics-panel {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: var(--stats-panel-width); background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    display: flex; flex-direction: column; z-index: 60;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}
.stats-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats-summary-item {
    padding: 10px; border-radius: 6px; background: var(--bg-color);
}
.stats-summary-item.highlight { grid-column: 1 / -1; background: rgba(59,130,246,0.08); }
.stats-label { font-size: 11px; color: var(--text-secondary); display: block; }
.stats-value { font-size: 18px; font-weight: 700; color: var(--text-primary); }

/* ===== Upload Zone ===== */
.upload-zone {
    border: 2px dashed var(--border-color); border-radius: 12px;
    padding: 40px 20px; text-align: center; cursor: pointer;
    transition: var(--transition-fast);
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent-color); background: rgba(59,130,246,0.04);
}
.upload-zone i { font-size: 48px; color: var(--accent-color); margin-bottom: 12px; }
.upload-zone h4 { margin-bottom: 4px; }
.upload-file-list { margin-top: 12px; }
.upload-file-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; font-size: 13px; color: var(--text-secondary);
}

/* ===== Processing Modal ===== */
.process-stage { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.process-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }
.process-log {
    margin-top: 12px; max-height: 200px; overflow-y: auto;
    background: var(--primary-dark); color: #a5f3fc; border-radius: 6px;
    padding: 12px; font-family: 'Courier New', monospace; font-size: 11px;
    line-height: 1.6;
}
.process-log-line { }

/* ===== Context Menu ===== */
.context-menu {
    position: fixed; background: var(--card-bg); border-radius: 8px;
    box-shadow: var(--shadow-lg); z-index: 3000; min-width: 180px;
    padding: 4px 0; border: 1px solid var(--border-color);
}
.context-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; font-size: 13px;
    color: var(--text-primary); cursor: pointer;
    transition: var(--transition-fast);
}
.context-menu-item:hover { background: var(--bg-color); }
.context-menu-item i { width: 16px; color: var(--text-secondary); }
.context-menu-item.danger { color: var(--danger-color); }
.context-menu-item.danger i { color: var(--danger-color); }
.context-menu-divider { height: 1px; background: var(--border-color); margin: 4px 0; padding: 0; }

/* ===== Annotation confidence borders ===== */
.ann-confidence-high { border: 2px solid var(--success-color); }
.ann-confidence-medium { border: 2px solid var(--warning-color); }
.ann-confidence-low { border: 2px solid var(--danger-color); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: flex; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .workspace-sidebar { position: fixed; height: 100vh; transform: translateX(-100%); z-index: 200; }
    .workspace-sidebar.open { transform: translateX(0); }
    .toolbar-right .toolbar-btn span { display: none; }
}
