/* ===== Nebo Tasks - Modern UI ===== */

:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.15), 0 10px 10px -5px rgba(0,0,0,0.04);
    --transition: 0.2s ease;
    --sidebar-width: 260px;
}

/* Dark Theme (default) */
[data-theme="dark"] {
    --bg: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #242836;
    --bg-hover: #2a2e3d;
    --surface: #1a1d27;
    --surface-hover: #242836;
    --border: #2e3348;
    --border-light: #363b50;
    --text: #e4e6ef;
    --text-secondary: #9ca3bf;
    --text-muted: #6b7294;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-bg: rgba(99,102,241,0.12);
    --success: #22c55e;
    --success-bg: rgba(34,197,94,0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245,158,11,0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,0.12);
    --info: #3b82f6;
    --info-bg: rgba(59,130,246,0.12);
    --input-bg: #242836;
    --scrollbar: #363b50;
    --scrollbar-hover: #4a5072;
}

/* Light Theme */
[data-theme="light"] {
    --bg: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fb;
    --bg-hover: #eef0f4;
    --surface: #ffffff;
    --surface-hover: #f8f9fb;
    --border: #e2e5ed;
    --border-light: #eef0f4;
    --text: #1a1d2d;
    --text-secondary: #5f6478;
    --text-muted: #8c91a6;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-bg: rgba(99,102,241,0.08);
    --success: #16a34a;
    --success-bg: rgba(22,163,74,0.08);
    --warning: #d97706;
    --warning-bg: rgba(217,119,6,0.08);
    --danger: #dc2626;
    --danger-bg: rgba(220,38,38,0.08);
    --info: #2563eb;
    --info-bg: rgba(37,99,235,0.08);
    --input-bg: #f8f9fb;
    --scrollbar: #d1d5e0;
    --scrollbar-hover: #b0b6c6;
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ===== Layout ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.logo .material-icons-round { font-size: 28px; }
.sidebar-close { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

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

.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.nav-item .material-icons-round { font-size: 20px; }

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px 14px 4px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.sidebar-copyright {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 10px 0 4px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-name { font-weight: 600; font-size: 0.875rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

.logout-btn { color: var(--danger) !important; }
.logout-btn:hover { background: var(--danger-bg) !important; }

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover { background: var(--bg-hover); }

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    flex: 1;
}

.top-bar-actions { display: flex; gap: 8px; align-items: center; }

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    transition: all var(--transition);
}
.theme-toggle .material-icons-round { font-size: 20px; }

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* Search box */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 16px;
}
.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--text-muted);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 7px 12px 7px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--text-muted); }
.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    z-index: 999;
    max-height: 400px;
    overflow-y: auto;
}
.search-results.open { display: block; }
.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }
.search-result-id { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; min-width: 40px; }
.search-result-title { flex: 1; font-size: 0.85rem; font-weight: 500; }
.search-result-meta { font-size: 0.75rem; color: var(--text-muted); }
.search-no-results { padding: 16px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.content-area {
    flex: 1;
    padding: 24px 28px;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.card-header h2, .card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2 .material-icons-round,
.card-header h3 .material-icons-round {
    font-size: 20px;
    color: var(--primary);
}

.card-body { padding: 20px; }

/* ===== Dashboard Stats ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .material-icons-round { font-size: 24px; }
.stat-total { background: var(--primary-bg); color: var(--primary); }
.stat-open { background: var(--info-bg); color: var(--info); }
.stat-progress { background: var(--warning-bg); color: var(--warning); }
.stat-escalated { background: var(--danger-bg); color: var(--danger); }
.stat-closed { background: var(--success-bg); color: var(--success); }

.stat-number { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* ===== Tables ===== */
.table-responsive { overflow-x: auto; }

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

.table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 14px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: none; }

.clickable-row { cursor: pointer; }
.ticket-id { color: var(--text-muted); font-weight: 600; }
.ticket-title { font-weight: 500; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-low { background: var(--info-bg); color: var(--info); }
.badge-medium { background: var(--warning-bg); color: var(--warning); }
.badge-high { background: #ff6b2b20; color: #ff6b2b; }
.badge-critical { background: var(--danger-bg); color: var(--danger); }
.badge-open { background: var(--info-bg); color: var(--info); }
.badge-progress { background: var(--warning-bg); color: var(--warning); }
.badge-escalated { background: var(--danger-bg); color: var(--danger); }
.badge-closed { background: var(--success-bg); color: var(--success); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { background: var(--surface-hover); border-color: var(--border-light); color: var(--text); }
.btn .material-icons-round { font-size: 18px; }

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

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #000;
}
.btn-warning:hover { opacity: 0.9; color: #000; }

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

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 6px; border: none; background: transparent; }
.btn-icon:hover { background: var(--bg-hover); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-group label .material-icons-round { font-size: 18px; }

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-select { cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }

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

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

/* ===== Quill Editor Theme Override ===== */
.ql-toolbar.ql-snow {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--bg-tertiary);
}

.ql-container.ql-snow {
    border: 1px solid var(--border) !important;
    border-top: none !important;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--input-bg);
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--text);
    min-height: 120px;
}

.ql-editor {
    min-height: 120px;
    color: var(--text);
    line-height: 1.6;
}

.ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
    font-style: normal !important;
}

.ql-snow .ql-stroke { stroke: var(--text-secondary) !important; }
.ql-snow .ql-fill { fill: var(--text-secondary) !important; }
.ql-snow .ql-picker-label { color: var(--text-secondary) !important; }
.ql-snow .ql-picker-options {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.ql-snow .ql-picker-item { color: var(--text) !important; }
.ql-snow .ql-picker-item:hover { color: var(--primary) !important; }

.ql-snow .ql-active .ql-stroke { stroke: var(--primary) !important; }
.ql-snow .ql-active .ql-fill { fill: var(--primary) !important; }
.ql-snow .ql-active { color: var(--primary) !important; }
.ql-snow button:hover .ql-stroke { stroke: var(--primary) !important; }
.ql-snow button:hover .ql-fill { fill: var(--primary) !important; }

.ql-snow .ql-tooltip {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
}
.ql-snow .ql-tooltip input[type=text] {
    background: var(--input-bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    border-radius: 4px;
}

.ql-editor blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    color: var(--text-secondary);
}

.ql-editor pre.ql-syntax,
.ql-editor code {
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85em;
    color: var(--primary);
}

.ql-editor pre.ql-syntax {
    padding: 12px;
    display: block;
    overflow-x: auto;
}

/* Compact editor for comments */
#editor-comment .ql-editor { min-height: 80px; }
#editor-comment { margin-bottom: 10px; }

/* Rich content display (ticket description, comments) */
.rich-content {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
    word-wrap: break-word;
}

.rich-content p { margin-bottom: 8px; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content strong { color: var(--text); }
.rich-content ul, .rich-content ol { padding-left: 24px; margin-bottom: 8px; }
.rich-content li { margin-bottom: 4px; }
.rich-content a { color: var(--primary); text-decoration: underline; }

.rich-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--text-muted);
}

.rich-content pre,
.rich-content code,
.rich-content .ql-syntax {
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
}

.rich-content code { padding: 2px 6px; color: var(--primary); }

.rich-content pre,
.rich-content .ql-syntax {
    padding: 14px 16px;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid var(--border);
    line-height: 1.5;
    color: var(--text);
    white-space: pre;
    word-wrap: normal;
}

.rich-content pre code,
.rich-content .ql-syntax code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
}

.rich-content h1, .rich-content h2, .rich-content h3 {
    color: var(--text);
    margin: 12px 0 6px;
}

.rich-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.rich-content table th,
.rich-content table td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    font-size: 0.85rem;
}

.rich-content table th {
    background: var(--bg-tertiary);
    color: var(--text);
    font-weight: 600;
}

.rich-content table td {
    color: var(--text-secondary);
}

.rich-content .ql-align-center { text-align: center; }
.rich-content .ql-align-right { text-align: right; }
.rich-content .ql-align-justify { text-align: justify; }

/* Quill native table styles */
.ql-editor table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.ql-editor td { border: 1px solid var(--border); padding: 8px 12px; font-size: 0.85rem; color: var(--text-secondary); }

/* Table context toolbar (add/remove rows, cols) */
.nebo-table-ctx {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 6px 0;
}
.nebo-table-ctx button {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, color .15s;
}
.nebo-table-ctx button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.nebo-table-ctx button.danger:hover {
    background: var(--danger, #ef4444);
    border-color: var(--danger, #ef4444);
}

/* Grid picker for table size selection */
.nebo-table-picker {
    display: none;
    position: absolute;
    z-index: 9999;
    background: var(--bg-secondary, #1e2130);
    border: 1px solid var(--border, #2e3348);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    top: 100%;
    left: 0;
}
.nebo-table-picker.open { display: block; }
.nebo-table-label {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary, #9ca3bf);
    margin-bottom: 6px;
    font-weight: 500;
}
.nebo-table-grid {
    display: grid;
    grid-template-columns: repeat(10, 22px);
    gap: 2px;
}
.nebo-table-grid-cell {
    width: 22px;
    height: 22px;
    border: 1px solid var(--border, #2e3348);
    border-radius: 3px;
    cursor: pointer;
    transition: background .1s;
}
.nebo-table-grid-cell.active { background: var(--primary, #6366f1); }

/* ===== Alerts ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert .material-icons-round { font-size: 20px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--info-bg); color: var(--info); }

/* ===== Page Actions ===== */
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.filter-bar label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.filter-bar .form-select { width: auto; }

/* ===== Ticket Detail ===== */
.ticket-detail-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    align-items: start;
}

.ticket-meta { display: flex; gap: 8px; }

.ticket-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Status quick-change buttons */
.status-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-status-open {
    background: var(--info-bg);
    border-color: var(--info);
    color: var(--info);
}
.btn-status-open:hover { background: var(--info); color: white; }

.btn-status-progress {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: var(--warning);
}
.btn-status-progress:hover { background: var(--warning); color: #000; }

.btn-status-closed {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}
.btn-status-closed:hover { background: var(--success); color: white; }

.info-list {}
.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}
.info-item:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-weight: 500; }
.info-value { font-weight: 600; }

/* ===== Comments ===== */
.comment {
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.comment-body { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }

.comment-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ===== Attachments ===== */
.attachments-list { margin-bottom: 16px; }

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all var(--transition);
}

.attachment-item:hover { background: var(--surface-hover); border-color: var(--border); }

.attachment-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attachment-icon .material-icons-round { font-size: 18px; }

.attachment-info { flex: 1; min-width: 0; }

.attachment-name {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.attachment-delete { flex-shrink: 0; }

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 16px;
}

.file-drop-zone:hover, .file-drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.file-drop-zone .material-icons-round {
    font-size: 36px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.file-drop-zone p { margin: 4px 0; font-size: 0.875rem; color: var(--text-secondary); }

.file-browse {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    display: inline !important;
}

.file-browse:hover { text-decoration: underline; }
.file-input-hidden { display: none; }

.file-preview-list { margin-top: 10px; }

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.upload-form { border-top: 1px solid var(--border); padding-top: 16px; }

/* ===== Activity Timeline ===== */
.activity-timeline { position: relative; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    font-size: 0.8rem;
    position: relative;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-content { flex: 1; }
.activity-action { color: var(--text-muted); }
.activity-details { color: var(--text-secondary); margin-top: 2px; }
.activity-time { color: var(--warning); font-weight: 600; }
.activity-date { color: var(--text-muted); font-size: 0.75rem; }

/* ===== Urgent Items ===== */
.urgent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    transition: all var(--transition);
    color: var(--text);
}

.urgent-item:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text);
}

.urgent-title { flex: 1; font-weight: 500; font-size: 0.875rem; }
.urgent-assignee { color: var(--text-muted); font-size: 0.8rem; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state .material-icons-round { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state.small { padding: 20px; }
.empty-state.small .material-icons-round { font-size: 32px; }

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

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

.modal-header h2 { font-size: 1.1rem; }
.modal-body { padding: 20px; }

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

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
}

.pagination-info { color: var(--text-muted); font-size: 0.875rem; }

/* ===== Settings Grid ===== */
.settings-grid .card { margin-bottom: 20px; }

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.login-container { position: relative; width: 100%; max-width: 420px; }

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow-xl);
}

.login-header { text-align: center; margin-bottom: 32px; }

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.login-logo .material-icons-round { font-size: 32px; }
.login-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.login-header p { color: var(--text-muted); font-size: 0.875rem; }

.login-form .form-group { margin-bottom: 20px; }
.login-form .btn-block { padding: 12px; font-size: 1rem; margin-top: 8px; }

.login-theme {
    position: absolute;
    top: -50px;
    right: 0;
}

/* ===== Text Utilities ===== */
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.link { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }
.actions-cell { white-space: nowrap; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .ticket-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .search-box { max-width: 180px; margin: 0 8px; }
    .page-title { display: none; }
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    .sidebar-close { display: block; }
    .menu-toggle { display: flex; }
    .main-content { margin-left: 0; }
    .content-area { padding: 16px; }
    .top-bar { padding: 12px 16px; }
    .page-title { font-size: 1.1rem; }
    .form-row { grid-template-columns: 1fr; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .stat-card { padding: 14px; }
    .stat-number { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .dashboard-stats { grid-template-columns: 1fr; }
    .login-card { padding: 28px 20px; }
}
