/* Nirals Desk — layout and components on top of Bootstrap 5.3. Light + dark themes. */

:root {
    --desk-font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --desk-primary: #4f46e5;
    --desk-primary-rgb: 79, 70, 229;
    --desk-primary-soft: #eef2ff;
    --desk-bg: #f5f6fa;
    --desk-surface: #ffffff;
    --desk-surface-2: #f8fafc;
    --desk-border: #e5e7eb;
    --desk-text: #0f172a;
    --desk-muted: #64748b;
    --desk-muted-2: #94a3b8;
    --desk-sidebar: #0f172a;
    --desk-sidebar-text: #cbd5e1;
    --desk-sidebar-hover: rgba(255, 255, 255, .06);
    --desk-sidebar-active: rgba(99, 102, 241, .22);
    --desk-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --desk-shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
    --desk-radius: 12px;
    --sidebar-w: 248px;

    --bs-body-font-family: var(--desk-font);
    --bs-body-bg: var(--desk-bg);
    --bs-body-color: var(--desk-text);
    --bs-primary: var(--desk-primary);
    --bs-primary-rgb: var(--desk-primary-rgb);
    --bs-link-color: var(--desk-primary);
    --bs-link-color-rgb: var(--desk-primary-rgb);
    --bs-link-hover-color: #4338ca;
    --bs-border-color: var(--desk-border);
    --bs-secondary-color: var(--desk-muted);
    --bs-card-bg: var(--desk-surface);
}

[data-bs-theme="dark"] {
    --desk-primary: #818cf8;
    --desk-primary-rgb: 129, 140, 248;
    --desk-primary-soft: rgba(129, 140, 248, .14);
    --desk-bg: #0b1120;
    --desk-surface: #111827;
    --desk-surface-2: #0f172a;
    --desk-border: #1f2937;
    --desk-text: #e5e7eb;
    --desk-muted: #94a3b8;
    --desk-muted-2: #64748b;
    --desk-sidebar: #070b16;
    --desk-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --desk-shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);

    --bs-body-bg: var(--desk-bg);
    --bs-body-color: var(--desk-text);
    --bs-border-color: var(--desk-border);
    --bs-link-hover-color: #a5b4fc;
    --bs-secondary-color: var(--desk-muted);
    --bs-card-bg: var(--desk-surface);
    --bs-tertiary-bg: #1f2937;
}

body { background: var(--desk-bg); color: var(--desk-text); font-size: .925rem; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn, .nav-link, .list-group-item, .card a, .dropdown-item, .user-chip, .kpi-card, .team-card, .project-card, .channel, .nav-item, .brand { text-decoration: none !important; }
h1, .h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.tiny { font-size: .75rem; }
.text-muted-2 { color: var(--desk-muted-2) !important; }
.min-w-0 { min-width: 0; }
.fw-medium { font-weight: 500; }
code { color: inherit; }

/* ---------- buttons & forms ---------- */
.btn-primary {
    --bs-btn-bg: var(--desk-primary); --bs-btn-border-color: var(--desk-primary);
    --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
    --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
    --bs-btn-disabled-bg: var(--desk-primary); --bs-btn-disabled-border-color: var(--desk-primary);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0b1120; --bs-btn-hover-color: #0b1120; --bs-btn-active-color: #0b1120; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; }
.btn-outline-primary { --bs-btn-color: var(--desk-primary); --bs-btn-border-color: var(--desk-primary); --bs-btn-hover-bg: var(--desk-primary); --bs-btn-hover-border-color: var(--desk-primary); }
.btn-light { --bs-btn-bg: var(--desk-surface); --bs-btn-border-color: var(--desk-border); --bs-btn-hover-bg: var(--desk-surface-2); --bs-btn-hover-border-color: #cbd5e1; --bs-btn-color: var(--desk-text); --bs-btn-hover-color: var(--desk-text); --bs-btn-active-bg: var(--desk-primary-soft); --bs-btn-active-border-color: var(--desk-primary); }
[data-bs-theme="dark"] .btn-light { --bs-btn-hover-border-color: #374151; --bs-btn-active-color: var(--desk-text); }
.btn { border-radius: 8px; font-weight: 500; }
.btn-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--desk-muted); border: 0; background: transparent; font-size: 1.15rem; }
.btn-icon:hover { background: var(--desk-surface-2); color: var(--desk-text); }
.form-control, .form-select { border-radius: 8px; border-color: var(--desk-border); background-color: var(--desk-surface); }
.form-control:focus, .form-select:focus { border-color: var(--desk-primary); box-shadow: 0 0 0 .2rem rgba(var(--desk-primary-rgb), .15); }
.form-check-input:checked { background-color: var(--desk-primary); border-color: var(--desk-primary); }
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .35rem; }
.form-label.small { font-size: .75rem; color: var(--desk-muted); }
.alert { border-radius: 10px; }

/* ---------- app shell ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--desk-sidebar); color: var(--desk-sidebar-text);
    display: flex; flex-direction: column; z-index: 1040; transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.25rem; color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.brand-mark img { height: 24px; width: auto; }
.nav-list { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 1rem .75rem .4rem; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: 8px; color: var(--desk-sidebar-text); font-weight: 500; margin-bottom: 2px; }
.nav-item i { font-size: 1.05rem; opacity: .85; width: 20px; text-align: center; }
.nav-item:hover { background: var(--desk-sidebar-hover); color: #fff; }
.nav-item.active { background: var(--desk-sidebar-active); color: #fff; }
.nav-item.active i { color: #a5b4fc; opacity: 1; }
.nav-badge { margin-left: auto; background: #ef4444; color: #fff; border-radius: 999px; font-size: .68rem; font-weight: 700; padding: .1rem .45rem; line-height: 1.3; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding: .85rem 1.25rem; color: #e2e8f0; }
.sidebar-foot .text-muted-2 { color: #64748b !important; }
.sidebar-foot .text-truncate { max-width: 160px; }
.sidebar-backdrop { display: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1030; height: 64px; display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
    background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--desk-border);
}
[data-bs-theme="dark"] .topbar { background: rgba(17, 24, 39, .85); }
.topbar-search { position: relative; flex: 1; max-width: 520px; }
.topbar-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--desk-muted-2); }
.topbar-search input { width: 100%; height: 40px; border: 1px solid var(--desk-border); background: var(--desk-surface-2); border-radius: 10px; padding: 0 2.5rem 0 2.4rem; color: var(--desk-text); outline: none; }
.topbar-search input:focus { border-color: var(--desk-primary); background: var(--desk-surface); box-shadow: 0 0 0 .2rem rgba(var(--desk-primary-rgb), .12); }
.topbar-search kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: var(--desk-surface); color: var(--desk-muted); border: 1px solid var(--desk-border); font-size: .7rem; padding: .05rem .4rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.bell-badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--desk-surface); }
.timer-pill { display: flex; align-items: center; gap: .5rem; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: .3rem .75rem; border-radius: 999px; font-size: .85rem; }
[data-bs-theme="dark"] .timer-pill { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .35); color: #6ee7b7; }
.timer-pill a { color: inherit; }
.timer-pill .btn-link { color: #dc2626; font-size: 1.1rem; line-height: 1; }
.timer-clock { font-variant-numeric: tabular-nums; font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); } 70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

.content { padding: 1.75rem 1.75rem 3rem; flex: 1; width: 100%; max-width: 1600px; }
.crumbs { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--desk-muted); margin-bottom: .75rem; flex-wrap: wrap; }
.crumbs a { color: var(--desk-muted); }
.crumbs a:hover { color: var(--desk-primary); }
.crumbs i { font-size: .65rem; }
.crumbs span { color: var(--desk-text); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .2rem; }

/* notifications dropdown */
.notif-menu { width: 380px; max-width: calc(100vw - 24px); border-radius: 12px; border-color: var(--desk-border); box-shadow: var(--desk-shadow-lg); overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--desk-border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-foot { display: block; text-align: center; padding: .7rem; border-top: 1px solid var(--desk-border); font-size: .85rem; font-weight: 500; }
.notif-item { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 1rem; color: var(--desk-text); border-bottom: 1px solid var(--desk-border); font-size: .85rem; }
.notif-item:hover { background: var(--desk-surface-2); color: var(--desk-text); }
.notif-item.unread { background: var(--desk-primary-soft); }
.notif-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--desk-surface-2); color: var(--desk-primary); border: 1px solid var(--desk-border); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--desk-primary); flex-shrink: 0; margin-top: .45rem; }
.notif-group-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--desk-muted); padding: .9rem 1rem .4rem; background: var(--desk-surface-2); border-bottom: 1px solid var(--desk-border); }

/* ---------- cards ---------- */
.card { border-color: var(--desk-border); border-radius: var(--desk-radius); box-shadow: var(--desk-shadow); background: var(--desk-surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--desk-border); padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.card-header:first-child { border-radius: var(--desk-radius) var(--desk-radius) 0 0; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; }
.card-subtitle { font-size: .8rem; color: var(--desk-muted); margin-top: .15rem; }
.card-footer { background: transparent; border-top-color: var(--desk-border); }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--desk-muted); margin-bottom: .85rem; }
.count { display: inline-block; background: var(--desk-surface-2); border: 1px solid var(--desk-border); border-radius: 999px; font-size: .7rem; padding: 0 .45rem; margin-left: .25rem; color: var(--desk-muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--desk-border); }
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--desk-surface-2); --bs-table-color: var(--desk-text); margin: 0; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--desk-muted); font-weight: 600; background: var(--desk-surface-2); border-bottom-width: 1px; white-space: nowrap; padding-top: .7rem; padding-bottom: .7rem; }
.table td { border-color: var(--desk-border); }
tr.clickable { cursor: pointer; }
.nav-underline .nav-link { color: var(--desk-muted); font-weight: 500; white-space: nowrap; }
.nav-underline .nav-link.active { color: var(--desk-primary); border-bottom-color: var(--desk-primary); }
.nav-tabs .nav-link { color: var(--desk-muted); font-weight: 500; border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--desk-primary); background: transparent; border-bottom-color: var(--desk-primary); }
.nav-tabs { border-bottom-color: var(--desk-border); }
.modal-content { border-radius: 14px; border-color: var(--desk-border); box-shadow: var(--desk-shadow-lg); }
.dropdown-menu { border-radius: 10px; border-color: var(--desk-border); box-shadow: var(--desk-shadow-lg); }
.progress-thin { height: 6px; border-radius: 3px; background: var(--desk-surface-2); }

/* KPI cards */
.kpi-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--desk-surface); border: 1px solid var(--desk-border); border-radius: var(--desk-radius); box-shadow: var(--desk-shadow); color: var(--desk-text); height: 100%; transition: transform .15s, box-shadow .15s; }
a.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--desk-shadow-lg); color: var(--desk-text); }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.kpi-value { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.kpi-label { display: block; font-size: .8rem; color: var(--desk-muted); margin-top: .15rem; }
.kpi-indigo .kpi-icon { background: #eef2ff; color: #4f46e5; }
.kpi-green .kpi-icon { background: #ecfdf5; color: #059669; }
.kpi-amber .kpi-icon { background: #fffbeb; color: #d97706; }
.kpi-red .kpi-icon { background: #fef2f2; color: #dc2626; }
.kpi-red .kpi-value { color: #dc2626; }
.kpi-slate .kpi-icon { background: #f1f5f9; color: #475569; }
[data-bs-theme="dark"] .kpi-icon { background: rgba(255, 255, 255, .06) !important; }
[data-bs-theme="dark"] .kpi-indigo .kpi-icon { color: #a5b4fc; }
[data-bs-theme="dark"] .kpi-green .kpi-icon { color: #6ee7b7; }
[data-bs-theme="dark"] .kpi-amber .kpi-icon { color: #fcd34d; }
[data-bs-theme="dark"] .kpi-red .kpi-icon, [data-bs-theme="dark"] .kpi-red .kpi-value { color: #fca5a5; }
[data-bs-theme="dark"] .kpi-slate .kpi-icon { color: #cbd5e1; }

/* ---------- ticket bits ---------- */
.ticket-row { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.25rem; color: var(--desk-text); }
a.ticket-row:hover { background: var(--desk-surface-2); color: var(--desk-text); }
.ticket-key { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .78rem; color: var(--desk-muted); font-weight: 600; white-space: nowrap; }
a.ticket-key:hover { color: var(--desk-primary); }
.ticket-title { flex: 1; min-width: 0; font-weight: 500; }
.ticket-meta { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.ticket-title-cell { max-width: 420px; }
.ticket-ref { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--desk-primary-soft); padding: 0 .3rem; border-radius: 4px; }
.mention { color: var(--desk-primary); font-weight: 600; background: var(--desk-primary-soft); border-radius: 4px; padding: 0 .2rem; }

.status-badge { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; padding: .22rem .6rem; border-radius: 6px; white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
.st-open { background: #f1f5f9; color: #475569; }
.st-progress { background: #dbeafe; color: #1d4ed8; }
.st-review { background: #ede9fe; color: #6d28d9; }
.st-hold { background: #fef3c7; color: #b45309; }
.st-resolved { background: #d1fae5; color: #047857; }
.st-closed { background: #e5e7eb; color: #6b7280; }
[data-bs-theme="dark"] .st-open { background: rgba(148, 163, 184, .16); color: #cbd5e1; }
[data-bs-theme="dark"] .st-progress { background: rgba(59, 130, 246, .18); color: #93c5fd; }
[data-bs-theme="dark"] .st-review { background: rgba(139, 92, 246, .2); color: #c4b5fd; }
[data-bs-theme="dark"] .st-hold { background: rgba(245, 158, 11, .18); color: #fcd34d; }
[data-bs-theme="dark"] .st-resolved { background: rgba(16, 185, 129, .18); color: #6ee7b7; }
[data-bs-theme="dark"] .st-closed { background: rgba(107, 114, 128, .22); color: #9ca3af; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.st-open { background: #94a3b8; }
.status-dot.st-progress { background: #3b82f6; }
.status-dot.st-review { background: #8b5cf6; }
.status-dot.st-hold { background: #f59e0b; }
.status-dot.st-resolved { background: #10b981; }
.status-dot.st-closed { background: #9ca3af; }
.status-select { font-weight: 600; }

.priority { display: inline-flex; align-items: center; gap: .25rem; font-size: .85rem; font-weight: 600; }
.pr-low { color: #0ea5e9; }
.pr-medium { color: #f59e0b; }
.pr-high { color: #f97316; }
.pr-critical { color: #dc2626; }
.type-icon { width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; font-size: .72rem; color: #fff; flex-shrink: 0; }
.ty-task { background: #3b82f6; }
.ty-bug { background: #ef4444; }
.ty-story { background: #10b981; }
.ty-support { background: #8b5cf6; }
.ty-improvement { background: #f59e0b; }
.team-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.team-badge .dot, .board-card-team .dot, .route-node .dot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.due { font-size: .78rem; color: var(--desk-muted); white-space: nowrap; }
.due.today { color: #d97706; font-weight: 600; }
.due.overdue { color: #dc2626; font-weight: 600; }

/* avatars */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 600; font-size: .8rem; flex-shrink: 0; letter-spacing: .02em; user-select: none; }
.avatar-xs { width: 24px; height: 24px; font-size: .62rem; }
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar-xl { width: 76px; height: 76px; font-size: 1.6rem; }
.avatar-empty { background: var(--desk-surface-2); color: var(--desk-muted-2); border: 1px dashed var(--desk-muted-2); }
.avatar-more { background: var(--desk-surface-2); color: var(--desk-muted); border: 1px solid var(--desk-border); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--desk-surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.user-chip { display: inline-flex; align-items: center; gap: .45rem; color: var(--desk-text); font-weight: 500; font-size: .875rem; white-space: nowrap; }
a.user-chip:hover { color: var(--desk-primary); }

.empty-state { text-align: center; padding: 2.5rem 1.5rem; }
.empty-state .empty-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto .9rem; display: grid; place-items: center; font-size: 1.5rem; background: var(--desk-primary-soft); color: var(--desk-primary); }
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: .3rem; }
.empty-state p { color: var(--desk-muted); font-size: .875rem; margin-bottom: 1rem; }

.chart-box { position: relative; height: 280px; }
.chart-box-sm { height: 220px; }
.feed { list-style: none; margin: 0; padding: .5rem 1.25rem; }
.feed li { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--desk-border); }
.feed li:last-child { border-bottom: 0; }
.feed-icon { width: 24px; text-align: center; font-size: 1.05rem; }
.sprint-mini { display: block; color: var(--desk-text); padding: .75rem; border: 1px solid var(--desk-border); border-radius: 10px; }
.sprint-mini:hover { border-color: var(--desk-primary); color: var(--desk-text); }

/* ---------- ticket page ---------- */
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.ticket-title-h { font-size: 1.6rem; font-weight: 700; letter-spacing: -.015em; margin: 0; word-break: break-word; }
.route-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .85rem 1.1rem; margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--desk-primary-soft), var(--desk-surface)); border: 1px solid var(--desk-border); border-radius: var(--desk-radius); }
.route-now { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.route-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--desk-muted); }
.route-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.rich-text { line-height: 1.65; word-break: break-word; }
.details { display: grid; grid-template-columns: 96px 1fr; gap: .7rem .75rem; margin: 0; align-items: center; }
.details dt { font-weight: 500; color: var(--desk-muted); font-size: .8rem; }
.details dd { margin: 0; min-width: 0; }
.timer-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--desk-surface-2); color: var(--desk-muted); }
.timer-icon.running { background: #ecfdf5; color: #059669; animation: pulse 1.6s infinite; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.file-tile { position: relative; border: 1px solid var(--desk-border); border-radius: 10px; overflow: hidden; background: var(--desk-surface); }
.file-thumb { display: grid; place-items: center; height: 100px; background: var(--desk-surface-2); color: var(--desk-muted); font-size: 2rem; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-info { padding: .5rem .65rem; }
.file-name { display: block; font-size: .8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--desk-text); }
.file-del { position: absolute; top: 6px; right: 8px; }
.file-del .btn { background: var(--desk-surface); border-radius: 50%; line-height: 1; }

/* discussion / chat bubbles (ticket + team chat) */
.chat-thread { padding: 1.25rem; max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.chat-msg { display: flex; gap: .65rem; align-items: flex-start; max-width: 88%; }
.chat-msg.mine { flex-direction: row-reverse; margin-left: auto; }
.chat-bubble { background: var(--desk-surface-2); border: 1px solid var(--desk-border); border-radius: 4px 14px 14px 14px; padding: .6rem .85rem; min-width: 0; }
.chat-msg.mine .chat-bubble { background: var(--desk-primary-soft); border-color: rgba(var(--desk-primary-rgb), .25); border-radius: 14px 4px 14px 14px; }
.chat-meta { display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: var(--desk-muted); margin-bottom: .2rem; }
.chat-meta strong { color: var(--desk-text); font-size: .8rem; }
.chat-text { word-break: break-word; line-height: 1.55; }
.chat-del { color: var(--desk-muted-2); font-size: .75rem; opacity: 0; }
.chat-msg:hover .chat-del { opacity: 1; }
.chat-image { display: block; margin-top: .5rem; }
.chat-image img { max-width: 280px; max-height: 220px; border-radius: 8px; border: 1px solid var(--desk-border); }
.chat-file { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; padding: .45rem .65rem; border: 1px solid var(--desk-border); border-radius: 8px; background: var(--desk-surface); color: var(--desk-text); font-size: .85rem; max-width: 320px; }
.chat-file span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file small { color: var(--desk-muted); }
.chat-file i { font-size: 1.2rem; color: var(--desk-primary); }
.composer { border-top: 1px solid var(--desk-border); padding: .9rem 1.25rem; background: var(--desk-surface); border-radius: 0 0 var(--desk-radius) var(--desk-radius); position: relative; }
.composer textarea { resize: none; border-radius: 10px; }
.composer-bar { display: flex; align-items: center; gap: .6rem; margin-top: .55rem; }

.route-path { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.route-node { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .75rem; border: 1px solid var(--desk-border); border-radius: 10px; background: var(--desk-surface); }
.route-node.current { border-color: var(--desk-primary); box-shadow: 0 0 0 3px rgba(var(--desk-primary-rgb), .12); }
.route-arrow { color: var(--desk-muted-2); }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--desk-border); }
.timeline li { display: flex; gap: .85rem; position: relative; padding-bottom: 1.1rem; }
.tl-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--desk-surface); border: 2px solid var(--desk-border); color: var(--desk-muted); z-index: 1; font-size: .9rem; }
.tl-create .tl-icon { border-color: #94a3b8; }
.tl-assign .tl-icon { border-color: #3b82f6; color: #3b82f6; }
.tl-handback .tl-icon { border-color: #f59e0b; color: #d97706; }
.tl-transfer .tl-icon { border-color: var(--desk-primary); color: #fff; background: var(--desk-primary); }
.tl-body { padding-top: .3rem; min-width: 0; flex: 1; }
.tl-note { margin-top: .4rem; padding: .55rem .75rem; background: var(--desk-surface-2); border-left: 3px solid var(--desk-primary); border-radius: 0 8px 8px 0; font-size: .875rem; }

.pick-list { display: grid; gap: .4rem; max-height: 340px; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border: 1px solid var(--desk-border); border-radius: 10px; cursor: pointer; margin: 0; }
.pick-item:hover { background: var(--desk-surface-2); }
.pick-item:has(input:checked) { border-color: var(--desk-primary); background: var(--desk-primary-soft); }
.pick-item input { margin: 0; }
.transfer-visual { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; background: var(--desk-surface-2); border-radius: 10px; font-size: .875rem; }
.workflow-hint { display: flex; gap: .75rem; padding: .75rem .9rem; background: var(--desk-primary-soft); border-radius: 10px; font-size: .8rem; color: var(--desk-text); }
.workflow-hint i { color: var(--desk-primary); font-size: 1.2rem; }

/* ---------- board ---------- */
.board-filters { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.board-filters .form-select { width: auto; min-width: 150px; }
.sprint-progress { display: flex; align-items: center; gap: .6rem; }
.board { display: grid; grid-template-columns: repeat(6, minmax(250px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.board-col { background: var(--desk-surface-2); border: 1px solid var(--desk-border); border-radius: var(--desk-radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
[data-bs-theme="dark"] .board-col { background: #0d1424; }
.board-col-head { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.board-count { margin-left: auto; background: var(--desk-surface); border: 1px solid var(--desk-border); border-radius: 999px; font-size: .72rem; padding: 0 .5rem; font-weight: 600; color: var(--desk-muted); }
.board-cards { padding: 0 .65rem .65rem; overflow-y: auto; display: flex; flex-direction: column; gap: .55rem; min-height: 80px; flex: 1; border-radius: 0 0 var(--desk-radius) var(--desk-radius); transition: background .15s; }
.board-cards.drag-over { background: rgba(var(--desk-primary-rgb), .08); outline: 2px dashed rgba(var(--desk-primary-rgb), .5); outline-offset: -4px; }
.board-card { background: var(--desk-surface); border: 1px solid var(--desk-border); border-radius: 10px; padding: .75rem .8rem; box-shadow: var(--desk-shadow); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.board-card[draggable="true"] { cursor: grab; }
.board-card:hover { box-shadow: var(--desk-shadow-lg); border-color: rgba(var(--desk-primary-rgb), .4); }
.board-card.dragging { opacity: .45; transform: rotate(2deg); }
.board-card-title { font-weight: 500; font-size: .875rem; line-height: 1.4; margin-bottom: .6rem; word-break: break-word; }
.board-card-foot { display: flex; align-items: center; gap: .45rem; }
.board-card-team { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--desk-muted); margin-top: .55rem; padding-top: .5rem; border-top: 1px dashed var(--desk-border); }
.board-empty { text-align: center; font-size: .8rem; color: var(--desk-muted-2); padding: 1.25rem 0; border: 1px dashed var(--desk-border); border-radius: 10px; }

/* ---------- team chat ---------- */
.chat-layout { display: grid; grid-template-columns: 250px 1fr; height: calc(100vh - 64px - 3.5rem); min-height: 480px; overflow: hidden; }
.chat-channels { border-right: 1px solid var(--desk-border); padding: .75rem; overflow-y: auto; background: var(--desk-surface-2); }
.chat-channels-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--desk-muted); padding: .5rem .6rem .6rem; }
.channel { display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border-radius: 8px; color: var(--desk-text); font-weight: 500; font-size: .9rem; }
.channel:hover { background: var(--desk-surface); color: var(--desk-text); }
.channel.active { background: var(--desk-primary-soft); color: var(--desk-primary); }
.channel-hash { font-weight: 700; font-size: 1.05rem; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1.25rem; border-bottom: 1px solid var(--desk-border); }
.chat-stream { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .9rem; min-height: 0; }
.chat-day { text-align: center; font-size: .72rem; color: var(--desk-muted); position: relative; margin: .5rem 0; }
.chat-day span { background: var(--desk-surface); padding: 0 .75rem; position: relative; z-index: 1; }
.chat-day::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--desk-border); }
.chat-composer { border-radius: 0; }

.mention-menu { position: absolute; bottom: calc(100% - .5rem); left: 1.25rem; z-index: 1060; background: var(--desk-surface); border: 1px solid var(--desk-border); border-radius: 10px; box-shadow: var(--desk-shadow-lg); min-width: 260px; overflow: hidden; }
.mention-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; cursor: pointer; font-size: .875rem; }
.mention-item.active, .mention-item:hover { background: var(--desk-primary-soft); }

/* ---------- projects, teams, people ---------- */
.project-card, .team-card { color: var(--desk-text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.project-card:hover, .team-card:hover { transform: translateY(-2px); box-shadow: var(--desk-shadow-lg); color: var(--desk-text); border-color: rgba(var(--desk-primary-rgb), .35); }
.project-key { display: inline-grid; place-items: center; min-width: 48px; height: 48px; padding: 0 .5rem; border-radius: 12px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .04em; flex-shrink: 0; }
.project-key-lg { min-width: 58px; height: 58px; font-size: .95rem; }
.project-desc, .team-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.sprint-card.active { border-color: rgba(16, 185, 129, .5); box-shadow: 0 0 0 3px rgba(16, 185, 129, .08); }
.plan-form .form-select { width: 150px; }
.team-card { border-top: 4px solid var(--team-color, var(--desk-primary)); }
.team-swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--team-color, var(--desk-primary)); display: inline-block; }
.team-swatch-lg { width: 44px; height: 44px; border-radius: 12px; }
.role-badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 6px; white-space: nowrap; }
.role-admin { background: #fee2e2; color: #b91c1c; }
.role-manager { background: #ede9fe; color: #6d28d9; }
.role-team_head { background: #dbeafe; color: #1d4ed8; }
.role-member { background: #f1f5f9; color: #475569; }
[data-bs-theme="dark"] .role-admin { background: rgba(239, 68, 68, .18); color: #fca5a5; }
[data-bs-theme="dark"] .role-manager { background: rgba(139, 92, 246, .2); color: #c4b5fd; }
[data-bs-theme="dark"] .role-team_head { background: rgba(59, 130, 246, .18); color: #93c5fd; }
[data-bs-theme="dark"] .role-member { background: rgba(148, 163, 184, .16); color: #cbd5e1; }
.role-help { display: grid; gap: .35rem; font-size: .8rem; color: var(--desk-muted); padding: .85rem 1rem; background: var(--desk-surface-2); border-radius: 10px; }
.alloc-wrap { max-height: calc(100vh - 280px); }
.alloc-table thead th { position: sticky; top: 0; z-index: 2; text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--desk-text); }
.sticky-col { position: sticky; left: 0; background: var(--desk-surface); z-index: 1; min-width: 240px; }
.alloc-table thead .sticky-col { z-index: 3; background: var(--desk-surface-2); }
.alloc-check { width: 1.2em; height: 1.2em; cursor: pointer; }
.timesheet td.today, .timesheet th.today { background: var(--desk-primary-soft); }
.audit-details { font-size: .75rem; white-space: pre-wrap; word-break: break-all; }

/* ---------- auth & error pages ---------- */
body.guest, body.error-page { background: var(--desk-bg); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at 0% 0%, #312e81 0%, #0f172a 55%); color: #e2e8f0; padding: 3.5rem; display: flex; flex-direction: column; justify-content: center; }
.auth-hero h1 { font-size: 2.4rem; color: #fff; margin: 2.5rem 0 1rem; line-height: 1.15; max-width: 520px; font-weight: 800; letter-spacing: -.02em; }
.auth-hero p { color: #a5b4fc; font-size: 1.05rem; max-width: 480px; }
.brand-lg { padding: 0; font-size: 1.3rem; }
.brand-lg .brand-mark { width: 46px; height: 46px; }
.brand-lg .brand-mark img { height: 32px; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; }
.auth-points li { display: flex; align-items: center; gap: .75rem; }
.auth-points i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: #a5b4fc; }
.auth-form { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-weight: 700; font-size: 1.6rem; letter-spacing: -.01em; }
.error-page { display: grid; place-items: center; min-height: 100vh; }
.error-card { text-align: center; max-width: 440px; padding: 2rem; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--desk-primary); line-height: 1; margin-bottom: .75rem; letter-spacing: -.03em; }

/* ---------- responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--desk-shadow-lg); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035; }
    .main { margin-left: 0; }
    .topbar { padding: 0 .75rem; gap: .5rem; }
    .content { padding: 1.25rem 1rem 2.5rem; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .chat-layout { grid-template-columns: 1fr; }
    .chat-channels { display: flex; gap: .35rem; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--desk-border); padding: .5rem; }
    .chat-channels-head { display: none; }
    .channel { white-space: nowrap; }
    .board { grid-template-columns: repeat(6, 82vw); scroll-snap-type: x mandatory; }
    .board-col { scroll-snap-align: start; }
}
@media (max-width: 575.98px) {
    .topbar-search kbd, .timer-pill .timer-clock { display: none; }
    .ticket-meta .due, .ticket-meta .status-badge { display: none; }
    .chat-msg { max-width: 100%; }
    .details { grid-template-columns: 84px 1fr; }
}

@media print {
    .sidebar, .topbar, .route-actions, .composer, .btn { display: none !important; }
    .main { margin: 0; }
}

/* desktop notification opt-in inside the bell menu */
.desktop-alert-bar { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; background: var(--desk-primary-soft); border-bottom: 1px solid var(--desk-border); font-size: .8rem; }
.desktop-alert-bar.d-none { display: none; }
.desktop-alert-bar i { color: var(--desk-primary); font-size: 1.1rem; }
.kpi-indigo-bg { background: var(--desk-primary-soft); color: var(--desk-primary); width: 42px; height: 42px; font-size: 1.15rem; }

/* Nirals animated logo loader */
.nl-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1.5rem; color: var(--desk-muted); }
.nl-loader img { width: 56px; height: auto; }
.nl-loader-sm { padding: 1.25rem; }
.nl-loader-sm img { width: 36px; }
.nl-loader-lg img { width: 88px; }
.nl-loader-label { font-size: .85rem; }
.page-loader { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: rgba(245, 246, 250, .72); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; }
[data-bs-theme="dark"] .page-loader { background: rgba(11, 17, 32, .72); }
.page-loader.show { opacity: 1; visibility: visible; }

/* bulk employee upload */
.import-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.import-steps li { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 999px; background: var(--desk-surface); border: 1px solid var(--desk-border); color: var(--desk-muted); font-size: .85rem; font-weight: 500; }
.import-steps li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--desk-surface-2); font-size: .75rem; font-weight: 700; }
.import-steps li.current { border-color: var(--desk-primary); color: var(--desk-primary); background: var(--desk-primary-soft); }
.import-steps li.current span { background: var(--desk-primary); color: #fff; }
.import-steps li.done span { background: #10b981; color: #fff; }
.drop-zone { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; padding: 2.25rem 1rem; border: 2px dashed var(--desk-border); border-radius: 14px; cursor: pointer; background: var(--desk-surface-2); transition: border-color .15s, background .15s; }
.drop-zone:hover { border-color: var(--desk-primary); background: var(--desk-primary-soft); }
.drop-zone i { font-size: 2.2rem; color: var(--desk-primary); }
.import-table tr.row-error td { background: rgba(239, 68, 68, .06); }

/* bulk ticket creation */
.bulk-textarea { min-height: 320px; font-size: .95rem; line-height: 1.6; resize: vertical; tab-size: 2; }
.tag-chip { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .78rem; padding: .15rem .5rem; }
.bulk-help { padding: .85rem 1rem; background: var(--desk-surface-2); border: 1px solid var(--desk-border); border-radius: 10px; display: grid; gap: .3rem; }
.bulk-help .table { --bs-table-bg: transparent; font-size: .8rem; }
.bulk-desc { white-space: pre-line; max-width: 520px; margin-top: .15rem; }
.bulk-preview tr.row-error td { background: rgba(239, 68, 68, .06); }
