:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --bg: #F1F5F9;
    --bg-white: #FFFFFF;
    --sidebar-bg: #1E293B;
    --sidebar-hover: #334155;
    --sidebar-active: #4F46E5;
    --text: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --priority-low: #9CA3AF;
    --priority-medium: #F59E0B;
    --priority-high: #EF4444;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --sidebar-width: 240px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Login Page ────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E293B 0%, #334155 50%, #4F46E5 100%);
}

.login-container { width: 100%; max-width: 420px; padding: 20px; }

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header { text-align: center; margin-bottom: 32px; }

.login-logo {
    width: 64px; height: 64px;
    background: var(--primary);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin-bottom: 16px;
}

.login-header h1 { font-size: 24px; font-weight: 700; color: var(--text); }
.login-header p { color: var(--text-muted); margin-top: 4px; }

.login-form .form-group { margin-bottom: 20px; }

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.login-form label i { margin-right: 4px; width: 14px; }

/* ── Form Elements ─────────────────────────── */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="date"],
select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea { resize: vertical; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.checkbox-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text); cursor: pointer;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all 0.2s;
}
.checkbox-label:has(input:checked) { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.checkbox-label input[type="checkbox"] { accent-color: var(--primary); }

/* ── Buttons ───────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline { background: var(--bg-white); color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-outline.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }

.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Layout ────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.25s ease;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

.sidebar-brand i:first-child { color: #818CF8; font-size: 22px; flex-shrink: 0; }

.sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    font-size: 14px;
    border-radius: 4px;
    transition: color 0.2s, transform 0.25s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover { color: white; }

.sidebar-nav { flex: 1; padding: 12px 8px; }

.nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    padding: 20px 12px 8px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active { background: var(--sidebar-active); color: white; }
.nav-item i { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    overflow: hidden;
}

.user-avatar {
    width: 36px; height: 36px;
    background: #818CF8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.5); white-space: nowrap; }

.logout-btn { color: rgba(255,255,255,0.5) !important; }
.logout-btn:hover { color: var(--danger) !important; background: rgba(239,68,68,0.1) !important; }

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

/* ── Sidebar Collapsed State ──────────────── */
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .user-details,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .logout-btn span { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 20px 8px 16px; gap: 0; }
.sidebar.collapsed .sidebar-brand i:first-child { margin: 0; }
.sidebar.collapsed .sidebar-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .user-info { justify-content: center; }
.sidebar.collapsed + .main-content { margin-left: 64px; }

/* ── Board Toolbar (left-aligned) ──────────── */
.board-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.search-input {
    padding: 9px 14px 9px 36px !important;
    width: 240px;
    border-radius: 20px !important;
    border: 1.5px solid var(--border) !important;
    background: var(--bg-white) !important;
    font-size: 13px !important;
}

.filter-wrapper { display: flex; gap: 6px; }

/* ── Filter Panel ──────────────────────────── */
.filter-panel {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filter-panel-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-panel .filter-group { flex: 1; min-width: 160px; }
.filter-panel .filter-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.filter-panel .filter-group select,
.filter-panel .filter-group input { font-size: 13px; padding: 7px 10px; }
.filter-actions { display: flex; align-items: flex-end; }

/* ── Kanban Board ──────────────────────────── */
.board-container { overflow-x: auto; padding-bottom: 20px; }

.board {
    display: flex;
    gap: 16px;
    min-height: calc(100vh - 200px);
    align-items: flex-start;
}

.column {
    min-width: 300px;
    max-width: 320px;
    flex-shrink: 0;
    background: var(--bg);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.column-header h3 { font-size: 14px; font-weight: 600; color: var(--text); }

.card-count {
    background: var(--border-light);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.column-cards {
    padding: 8px;
    flex: 1;
    min-height: 100px;
    overflow-y: auto;
    max-height: calc(100vh - 260px);
}

.column-cards::-webkit-scrollbar { width: 4px; }
.column-cards::-webkit-scrollbar-track { background: transparent; }
.column-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Ticket Cards ──────────────────────────── */
.ticket-card {
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 1.5px solid var(--border);
    transition: all 0.2s;
    position: relative;
    background: var(--bg-white);
}

.ticket-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.ticket-card.priority-low {
    background: #F3F4F6;
    border-color: #D1D5DB;
}
.ticket-card.priority-low:hover { border-color: #9CA3AF; }

.ticket-card.priority-medium {
    background: #FEF3C7;
    border-color: #FCD34D;
}
.ticket-card.priority-medium:hover { border-color: #F59E0B; }

.ticket-card.priority-high {
    background: #FEE2E2;
    border-color: #FCA5A5;
}
.ticket-card.priority-high:hover { border-color: #EF4444; }

.ticket-card.sortable-ghost {
    opacity: 0.4;
    border: 2px dashed var(--primary);
}

.ticket-card.sortable-chosen { box-shadow: var(--shadow-lg); }

.card-priority-bar { display: none; }

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-ticket-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.card-company {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.card-product {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.card-amount {
    font-size: 13px;
    font-weight: 700;
}

.priority-low .card-amount { color: #6B7280; }
.priority-medium .card-amount { color: #B45309; }
.priority-high .card-amount { color: #DC2626; }

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-group {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.card-indicators {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-light);
}

.card-indicators i { margin-right: 2px; }

.card-qty {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* ── Modals ────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-large { max-width: 900px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 10;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-header-actions { display: flex; gap: 8px; align-items: center; }

.modal-close {
    width: 32px; height: 32px;
    border: none;
    background: var(--border-light);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.modal-close:hover { background: var(--danger); color: white; }

.modal-body { padding: 24px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Detail Modal ──────────────────────────── */
.detail-layout { display: grid; grid-template-columns: 1fr 240px; gap: 24px; }

.detail-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border-light); }

.tab-btn {
    padding: 10px 16px;
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--border-light);
    color: var(--text-muted);
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-field .value { font-size: 14px; font-weight: 500; }
.detail-field.full-width { grid-column: 1 / -1; }

.detail-sidebar { border-left: 1px solid var(--border); padding-left: 24px; }

.sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-section:last-child { border-bottom: none; }
.sidebar-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}

/* ── Comments ──────────────────────────────── */
.comments-list { margin-bottom: 20px; }

.comment-item {
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--bg);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.comment-name { font-size: 13px; font-weight: 600; }
.comment-group { font-size: 11px; color: var(--text-muted); }
.comment-time { font-size: 11px; color: var(--text-light); }
.comment-content { font-size: 13px; line-height: 1.6; color: var(--text); }
.comment-content .mention { color: var(--primary); font-weight: 600; background: var(--primary-light); padding: 1px 4px; border-radius: 3px; }

.comment-actions { display: flex; gap: 8px; margin-top: 8px; }
.comment-actions button { background: none; border: none; font-size: 11px; color: var(--text-light); cursor: pointer; font-family: var(--font); }
.comment-actions button:hover { color: var(--primary); }

.comment-form { border-top: 1px solid var(--border-light); padding-top: 16px; }
.comment-form textarea { margin-bottom: 10px; font-size: 13px; }

.mention-suggestions {
    position: absolute;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    width: 200px;
}

.mention-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mention-item:hover { background: var(--primary-light); }
.mention-type { font-size: 10px; color: var(--text-light); background: var(--border-light); padding: 1px 6px; border-radius: 8px; }

/* ── Activity Timeline ─────────────────────── */
.activity-timeline { position: relative; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
}

.activity-content { flex: 1; }
.activity-text { color: var(--text); line-height: 1.4; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ── Attachments ───────────────────────────── */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area i { font-size: 28px; margin-bottom: 8px; display: block; }

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.attachment-info { display: flex; align-items: center; gap: 10px; }
.attachment-icon { font-size: 20px; color: var(--primary); }
.attachment-name { font-size: 13px; font-weight: 500; }
.attachment-meta { font-size: 11px; color: var(--text-light); }

/* ── Admin Pages ───────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 i { color: var(--primary); }

.data-table-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.role-admin { background: #FEE2E2; color: #991B1B; }
.role-manager { background: #DBEAFE; color: #1E40AF; }
.role-team_user { background: #D1FAE5; color: #065F46; }
.role-viewer { background: var(--border-light); color: var(--text-muted); }

.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--text-light); }

.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
}

.column-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.admin-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.admin-card-header h3 { font-size: 16px; font-weight: 600; }
.admin-card-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); }

/* ── Alerts ────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ── Empty States ──────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 48px; color: var(--border); margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 6px; color: var(--text); }

/* ── Utility ───────────────────────────────── */
.text-muted { color: var(--text-muted); font-size: 13px; }
.priority-low-text { color: var(--priority-low); }
.priority-medium-text { color: var(--priority-medium); }
.priority-high-text { color: var(--priority-high); }

.search-form-inline { display: flex; }

/* ── Toast Notifications ───────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
    min-width: 280px;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Tagged Users on Cards ──────────────────── */
.card-tagged-users {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 0 8px;
}

.card-user-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #EDE9FE;
    color: #6D28D9;
    font-weight: 500;
}

.card-user-tag i { font-size: 9px; }

.tagged-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.tagged-user-chip i { font-size: 10px; }

.tagged-user-chip button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.6;
}

.tagged-user-chip button:hover { opacity: 1; }

.tagged-user-chip-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #EDE9FE;
    color: #6D28D9;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin: 1px 0;
}

.tagged-user-chip-sm i { font-size: 9px; }

/* ── Tag User Input ────────────────────────── */
.tag-users-select { position: relative; }

.tagged-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tagged-users-list:empty { margin-bottom: 0; }

.tag-user-input-wrapper { position: relative; }

.tag-user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 20;
}

.tag-user-option {
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.tag-user-option:hover { background: var(--primary-light); color: var(--primary); }

/* ── Comment Replies / Threading ───────────── */
.comment-replies {
    margin-top: 8px;
    padding-left: 20px;
    border-left: 2px solid var(--border);
}

.comment-reply {
    background: var(--bg-white) !important;
    margin-bottom: 6px;
}

.reply-original {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* ── Comments Page ─────────────────────────── */
.comments-ticket-group {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.comments-ticket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.comments-ticket-info { display: flex; align-items: center; gap: 8px; }
.comments-ticket-info strong { font-size: 14px; color: var(--primary); }

.comments-ticket-body { padding: 16px 20px; }

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

.loading-state i { margin-right: 8px; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 20px; }
}

@media (max-width: 768px) {
    .sidebar { width: 64px; }
    .sidebar span, .sidebar-brand span, .user-details, .nav-section { display: none; }
    .sidebar-brand { justify-content: center; padding: 16px 8px; }
    .sidebar-toggle { display: none; }
    .nav-item { justify-content: center; padding: 10px; }
    .main-content { margin-left: 64px; padding: 16px; }
    .board-toolbar { flex-direction: column; align-items: stretch; }
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}
