/* ============================================================
   CSS Variables & Theme
   ============================================================ */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --sidebar-width: 240px;
    --detail-width: 400px;
    --header-height: 56px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* ============================================================
   Header
   ============================================================ */

.header {
    height: var(--header-height);
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.header-search {
    flex: 1;
    max-width: 360px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 7px 12px 7px 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-color);
    outline: none;
    transition: border-color 0.2s;
}

.header-search input:focus {
    border-color: var(--primary-color);
}

.header-search::before {
    content: '\1F50D';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    font-size: 13px;
    color: var(--text-muted);
    position: relative;
    cursor: pointer;
}

.user-info .user-name {
    font-weight: 500;
    color: var(--text-color);
}

.user-info-card {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px;
    min-width: 200px;
    z-index: 500;
}

.user-info-card.open {
    display: block;
}

.user-info-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.user-info-card-email {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.user-info-card-role {
    display: flex;
}

/* ============================================================
   Layout: Dashboard Row + 3-Column
   ============================================================ */

.dashboard-row {
    display: flex;
    gap: 8px;
    padding: 6px 16px;
    background: #eef2f7;
    border-bottom: 1px solid var(--border-color);
    margin-top: var(--header-height);
    align-items: center;
}

.dashboard-row .stat-card {
    flex: 1;
    padding: 6px 10px;
    text-align: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.dashboard-row .stat-number { font-size: 18px; font-weight: 700; color: var(--primary-color); }
.dashboard-row .stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }

.columns-container {
    display: flex;
    height: calc(100vh - var(--header-height) - 52px);
    overflow: hidden;
}

.column {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    min-width: 0;
    overflow: hidden;
}

.column:last-child { border-right: none; }

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.column-search {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    width: 120px;
    outline: none;
}

.column-search:focus { border-color: var(--primary-color); }

.column-filter {
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    outline: none;
}

.column-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.column-detail {
    flex: 1;
    overflow-y: auto;
    border-top: 2px solid var(--primary-color);
    background: var(--surface-color);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.column-list.has-detail { flex: 0 0 40%; max-height: 40%; }

.col-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-color);
}

.col-detail-header h4 { font-size: 14px; font-weight: 600; }

/* Column item list */
.column-item-list { list-style: none; }

.col-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-color);
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
}

.col-item:hover { background: var(--bg-color); }

.col-item.active {
    background: #eff6ff;
    color: var(--primary-color);
    font-weight: 500;
}

.col-item .count-badge {
    font-size: 11px;
    background: var(--bg-color);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.col-item.active .count-badge {
    background: var(--primary-color);
    color: white;
}

.col-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-item-meta { font-size: 11px; color: var(--text-muted); }

/* Breadcrumb bar inside document column */
.doc-breadcrumb-bar {
    padding: 6px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* Group detail panel */
.group-detail-content { padding: 12px; }
.group-detail-field { margin-bottom: 8px; }
.group-detail-field .field-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.group-detail-field .field-value { font-size: 13px; color: var(--text-color); }

/* Expanded asset with case sub-items */
.asset-expanded {
    background: var(--bg-color);
    border-left: 3px solid var(--primary-color);
}

.case-sub-item {
    padding: 6px 12px 6px 32px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    gap: 6px;
}

.case-sub-item:hover { background: #f1f5f9; }
.case-sub-item.active { background: #eff6ff; color: var(--primary-color); }

.case-sub-item .case-sub-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-sub-loading {
    padding: 8px 32px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.case-sub-empty {
    padding: 10px 32px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.case-sub-actions {
    padding: 4px 12px 6px 32px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

/* Inline case detail in column panel */
.case-inline-info {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 30%;
}

.case-inline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 4px;
}

.case-inline-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 60px;
    font-size: 11px;
    text-transform: uppercase;
}

.inline-dialogue-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inline-dialogue-thread {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.inline-dialogue-footer {
    border-top: 1px solid var(--border-color);
    padding: 8px 12px;
    flex-shrink: 0;
}

.inline-dialogue-input {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.inline-dialogue-input textarea {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 32px;
    max-height: 80px;
}

.inline-dialogue-input textarea:focus { border-color: var(--primary-color); }

.inline-dialogue-action-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1;
}

.inline-dialogue-action-btn:hover { background: var(--bg-color); }

.inline-file-preview {
    padding: 4px 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-file-preview img { width: 32px; height: 32px; object-fit: cover; border-radius: 3px; }

/* Document thumbnail in column detail */
.doc-thumbnail-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.doc-thumbnail-wrapper:hover { background: var(--bg-color); }

.doc-thumbnail {
    width: 56px;
    height: 56px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-color);
}

.doc-thumbnail-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: var(--bg-color);
}

.doc-thumbnail-hint {
    font-size: 11px;
    color: var(--primary-color);
    margin-top: 2px;
}

/* Full document preview overlay */
.doc-full-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.doc-full-preview-container {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.doc-full-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.doc-full-preview-header h3 {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.doc-full-preview-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    min-height: 300px;
}

.doc-full-preview-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.doc-full-preview-body iframe {
    width: 100%;
    height: 70vh;
    border: none;
}

.doc-full-preview-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Legacy sidebar header (still used by admin panel) */
.sidebar-header {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--surface-color);
    color: var(--text-color);
    transition: all 0.15s;
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

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

.btn-icon {
    padding: 6px;
    min-width: 32px;
    justify-content: center;
}

/* ============================================================
   Forms
   ============================================================ */

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* ============================================================
   Tables
   ============================================================ */

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

.data-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

.data-table tbody tr:hover {
    background: #f1f5f9;
}

.data-table tbody tr.selected {
    background: #eff6ff;
}

/* ============================================================
   Status Badges
   ============================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.ordered { background: #fef3c7; color: #92400e; }
.status-badge.installing { background: #dbeafe; color: #1e40af; }
.status-badge.approved { background: #d1fae5; color: #065f46; }
.status-badge.operational { background: #a7f3d0; color: #064e3b; }
.status-badge.inservice { background: #ffedd5; color: #9a3412; }
.status-badge.offline { background: #fee2e2; color: #991b1b; }

.status-badge.open { background: #fef3c7; color: #92400e; }
.status-badge.inprogress { background: #dbeafe; color: #1e40af; }
.status-badge.resolved { background: #d1fae5; color: #065f46; }
.status-badge.closed { background: #f1f5f9; color: #475569; }

/* ============================================================
   Role Badges
   ============================================================ */

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.role-badge.admin { background: #fee2e2; color: #991b1b; }
.role-badge.editor { background: #dbeafe; color: #1e40af; }
.role-badge.engineer { background: #dbeafe; color: #1e40af; }
.role-badge.viewer { background: #f1f5f9; color: #475569; }
.role-badge.guest { background: #f5f3ff; color: #6d28d9; }

/* ============================================================
   Toolbar
   ============================================================ */

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    flex-wrap: wrap;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-right: auto;
}

/* Detail tabs and content (used inside column-detail) */
.detail-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    padding: 0 8px;
    flex-shrink: 0;
}

.detail-tab {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    white-space: nowrap;
}

.detail-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.detail-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.detail-info {
    flex-shrink: 0;
}

.toolbar select {
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    outline: none;
    background: var(--surface-color);
}

/* ============================================================
   Modals
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-content.modal-lg {
    max-width: 700px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
   Toast Notifications
   ============================================================ */

.toast-container {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: white;
    background: var(--text-color);
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast.success { background: var(--success-color); }
.toast.error { background: var(--danger-color); }
.toast.warning { background: var(--warning-color); color: #1e293b; }
.toast.info { background: var(--info-color); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   Slide-in Panels (Worklist, Dashboard)
   ============================================================ */

.slide-panel {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: 420px;
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.slide-panel.open {
    transform: translateX(0);
}

.slide-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.slide-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.slide-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

/* ============================================================
   Stat Cards (used in dashboard row)
   ============================================================ */

.stat-cards {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* ============================================================
   Admin Panel
   ============================================================ */

.admin-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-panel-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.admin-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    padding: 0 16px;
}

.admin-tab {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.admin-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.admin-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.pagination .page-info {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   Empty & Loading States
   ============================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state .empty-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.empty-state .empty-text {
    font-size: 13px;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Context Menu
   ============================================================ */

.context-menu {
    position: fixed;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    min-width: 180px;
    padding: 4px 0;
}

.context-menu-item {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.1s;
}

.context-menu-item:hover {
    background: var(--bg-color);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ============================================================
   Scrollbar
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
    .columns-container {
        flex-direction: column;
        height: auto;
    }

    .column {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 200px;
    }

    .slide-panel {
        width: 100%;
    }

    .dashboard-row {
        flex-wrap: wrap;
    }

    .dashboard-row .stat-card {
        min-width: 80px;
    }
}
