/*
 * Orbit — Main Stylesheet
 * v1.0.1 — Premium dark theme
 *
 * Colour philosophy: Near-black base (#0d0d0f) with very subtle warm-gray
 * borders. No blue-tinted backgrounds. Clean, high-contrast text.
 * Accent: soft cyan-blue (#2FAFFB) kept from original.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Accent palette — kept */
    --light-blue: #0088CE;
    --medium-blue: #0C54A0;
    --dark-blue: #244082;
    --dark-theme: #213356;
    --light-blue-theme: #2FAFFB;
    --theme-rgb: 47, 175, 251;
    --lightest-blue: #D9F2FF;
    --bright-green: #92FE65;

    /* ── Dark mode palette ──────────────────────────────────
       Near-black, neutral-warm.  Matches Synerque / ChronoTask ref.
       No blue tint in backgrounds. Borders are warm dark gray.
    ──────────────────────────────────────────────────────── */
    --bg-body: #0a0a0c;
    --bg-primary: #0f0f12;
    --bg-secondary: #131316;
    --bg-card: #161619;
    --bg-elevated: #1a1a1e;
    --bg-hover: #1e1e23;
    --bg-input: #111114;

    /* Text */
    --text-primary: #ececef;
    --text-secondary: #87878f;
    --text-tertiary: #505058;
    --text-inverse: #0a0a0c;

    /* Borders — warm dark gray, NOT blue */
    --border-primary: #1e1e23;
    --border-secondary: #28282f;
    --border-focus: var(--light-blue-theme);

    /* Status */
    --color-success: #92FE65;
    --color-warning: #f5a623;
    --color-danger: #ef4444;
    --color-info: var(--light-blue-theme);

    /* Priority */
    --priority-low: #3B82F6;
    --priority-medium: #F59E0B;
    --priority-high: #F97316;
    --priority-urgent: #EF4444;

    /* Shadows — multi-layer depth */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.2), 0 6px 16px rgba(0,0,0,0.25);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.2), 0 12px 32px rgba(0,0,0,0.3);
    --shadow-xl: 0 8px 16px rgba(0,0,0,0.2), 0 24px 64px rgba(0,0,0,0.35);

    /* Radius — bubble feel */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.12s ease;
    --transition-normal: 0.22s cubic-bezier(0.16, 1, 0.3, 1);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 54px;
}

/* ========== LIGHT MODE ========== */
[data-theme="light"] {
    --bg-body: #EAEBEF;
    --bg-primary: #ffffff;
    --bg-secondary: #F0F1F3;
    --bg-card: #ffffff;
    --bg-elevated: #E4E5EA;
    --bg-hover: #DBDCE2;
    --bg-input: #ECEDF0;

    --text-primary: #111116;
    --text-secondary: #4A4A55;
    --text-tertiary: #7A7A8C;
    --text-inverse: #ffffff;

    --border-primary: #C8C9D0;
    --border-secondary: #B0B1BC;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 8px 16px rgba(0,0,0,0.06), 0 24px 64px rgba(0,0,0,0.14);
}

[data-theme="light"] .user-avatar { border-color: #ffffff; }
[data-theme="light"] .header { background: #ffffff; border-bottom-color: var(--border-primary); }
[data-theme="light"] .modal { background: #ffffff; border: 2px solid #9B9BA8; box-shadow: 0 16px 48px rgba(0,0,0,0.18); }
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
[data-theme="light"] .dropdown-menu { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05); }
[data-theme="light"] .btn-ghost { color: var(--text-secondary); }
[data-theme="light"] .btn-ghost:hover { background: var(--bg-elevated); }

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

html { font-size: 14px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--light-blue-theme); text-decoration: none; }
a:hover { color: var(--lightest-blue); }
img { max-width: 100%; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

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

/* ========== SIDEBAR — Floating Card-Based Navigation ========== */
.sidebar {
    width: var(--sidebar-width); position: fixed;
    left: 12px; top: 12px; bottom: 12px; z-index: 100;
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: 16px;
    background: rgba(30, 32, 38, 0.65);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.04), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), left 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform var(--transition-normal);
}

/* ── Header ── */
.sidebar-header {
    padding: 16px 16px 12px; display: flex; align-items: center; justify-content: space-between;
    gap: 8px; min-height: 56px; position: relative; overflow: hidden;
    flex-shrink: 0; margin-bottom: 6px;
}

/* Animated gradient orb behind sidebar brand */
.sidebar-header::before {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 300px; height: 300px; transform: translate(-50%, -50%);
    background: radial-gradient(circle,
        rgba(var(--theme-rgb), 0.25) 0%,
        rgba(var(--theme-rgb), 0.12) 30%,
        rgba(167, 139, 250, 0.05) 55%,
        rgba(236, 72, 153, 0.02) 70%,
        transparent 80%
    );
    animation: sidebarOrbPulse 8s ease-in-out infinite alternate;
    pointer-events: none; z-index: 0;
}
.sidebar-header::after {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(2.5px 2.5px at 20% 30%, rgba(var(--theme-rgb), 0.55), transparent),
        radial-gradient(2px 2px at 50% 50%, rgba(var(--theme-rgb), 0.4), transparent),
        radial-gradient(2px 2px at 75% 60%, rgba(167, 139, 250, 0.2), transparent),
        radial-gradient(1.5px 1.5px at 45% 70%, rgba(52, 211, 153, 0.18), transparent),
        radial-gradient(2px 2px at 85% 25%, rgba(var(--theme-rgb), 0.35), transparent),
        radial-gradient(1.5px 1.5px at 10% 65%, rgba(251, 191, 36, 0.15), transparent),
        radial-gradient(2px 2px at 60% 15%, rgba(var(--theme-rgb), 0.3), transparent);
    animation: sidebarParticleDrift 12s ease-in-out infinite alternate;
    pointer-events: none; z-index: 0; opacity: 0.9;
}
.sidebar-header > * { position: relative; z-index: 1; }

@keyframes sidebarOrbPulse {
    0%   { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
    50%  { transform: translate(-45%, -55%) scale(1.1); opacity: 1; }
    100% { transform: translate(-55%, -45%) scale(1); opacity: 0.8; }
}
@keyframes sidebarParticleDrift {
    0%   { transform: translateX(0) translateY(0); }
    33%  { transform: translateX(6px) translateY(-3px); }
    66%  { transform: translateX(-4px) translateY(4px); }
    100% { transform: translateX(2px) translateY(-2px); }
}

/* ── Brand area ── */
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; flex: 1; min-width: 0; transition: opacity 0.15s;
}
.sidebar-brand:hover { opacity: 0.85; }
.sidebar-brand-icon {
    width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.sidebar-brand-icon .sidebar-logo { height: 26px; max-width: 30px; object-fit: contain; }
.sidebar-brand-fallback {
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, var(--light-blue-theme), var(--medium-blue));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; color: white;
}
.sidebar-brand-name {
    font-size: 15px; font-weight: 800; color: var(--text-primary);
    letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand-logo-wide {
    display: flex; align-items: center; overflow: hidden; flex: 1; min-width: 0;
}
.sidebar-brand-version {
    font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 6px;
    flex-shrink: 0; line-height: 1.6;
}

/* ── Toggle button ── */
.sidebar-toggle-btn {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.85);
    cursor: pointer; padding: 4px; border-radius: 8px; display: flex; align-items: center;
    justify-content: center; transition: all 0.15s; flex-shrink: 0; width: 28px; height: 28px;
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); border-color: rgba(255,255,255,0.12); }
.sidebar-toggle-expand { display: none; }

/* ── Nav sections — card stack ── */
.sidebar-nav {
    flex: 1; min-height: 0; padding: 14px 6px 8px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.10); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.20); }
[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb { background: #C0C1CA; }
[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb:hover { background: #A8A9B4; }

/* ── Nav cards ── */
.nav-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px; overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}
.nav-card:hover {
    border-color: var(--border-secondary);
}

.nav-card-header {
    padding: 8px 12px; display: flex; align-items: center; justify-content: space-between;
    user-select: none;
}
.nav-card-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-tertiary); transition: color 0.15s;
}
.nav-card:hover .nav-card-label { color: var(--text-secondary); }
.nav-card-count {
    font-size: 10px; font-weight: 700;
    background: rgba(var(--theme-rgb), 0.1); color: var(--light-blue-theme);
    padding: 1px 6px; border-radius: 6px;
}
.nav-card-chevron {
    color: var(--text-tertiary); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}
.nav-card.collapsed .nav-card-chevron { transform: rotate(-90deg); }
.nav-card-header.clickable { cursor: pointer; }
.nav-card-header.clickable:hover .nav-card-label { color: var(--text-primary); }

.nav-card-items {
    padding: 0 6px 6px; display: flex; flex-direction: column; gap: 1px;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, padding 0.25s ease;
    max-height: 600px; overflow: hidden;
}

.nav-card.collapsed .nav-card-items {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease 0.05s, padding 0.25s ease;
}

/* ── Search card ── */
.nav-card-search {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px; padding: 6px 10px;
    display: flex; align-items: center; gap: 8px;
    transition: all 0.2s ease; position: relative;
    flex-shrink: 0;
}
.nav-card-search:focus-within {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(var(--theme-rgb), 0.3);
    box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.06);
}
.nav-card-search svg { color: var(--text-tertiary); flex-shrink: 0; }
.nav-card-search input {
    flex: 1; background: transparent; border: none; color: var(--text-primary);
    font-family: inherit; font-size: 12px; padding: 4px 0; min-width: 0;
}
.nav-card-search input:focus { outline: none; }
.nav-card-search input::placeholder { color: var(--text-tertiary); }
.nav-card-search kbd {
    font-family: inherit; font-size: 10px; font-weight: 600;
    color: var(--text-tertiary); background: rgba(255,255,255,0.06);
    padding: 1px 5px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.08);
    line-height: 1.5; pointer-events: none; flex-shrink: 0;
}

/* ── Nav items — pill-shaped active ── */
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px;
    border-radius: 8px; color: var(--text-secondary);
    font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1); position: relative;
}
.nav-item:hover {
    background: rgba(var(--theme-rgb), 0.06); color: var(--text-primary);
}
.nav-item.active {
    background: rgba(var(--theme-rgb), 0.1);
    color: var(--light-blue-theme); font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(var(--theme-rgb), 0.15);
}
@keyframes navItemGlow {
    0%, 100% { box-shadow: inset 0 0 0 1px rgba(var(--theme-rgb), 0.15); }
    50% { box-shadow: inset 0 0 0 1px rgba(var(--theme-rgb), 0.3); }
}
.nav-item.active { animation: navItemGlow 3s ease-in-out infinite; }

.nav-item .icon, .nav-item > svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.45; transition: opacity 0.15s; }
.nav-item:hover .icon, .nav-item:hover > svg { opacity: 0.75; }
.nav-item.active .icon, .nav-item.active > svg { opacity: 1; }

.nav-item span:not(.nav-badge):not(.nav-soon):not(.nav-board-dot) {
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-badge {
    font-size: 10px; font-weight: 700; margin-left: auto;
    background: rgba(var(--theme-rgb), 0.1); color: var(--light-blue-theme);
    padding: 1px 6px; border-radius: 6px; flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    animation: badge-pulse 2s ease-in-out infinite;
}
.nav-item.active .nav-badge { background: rgba(var(--theme-rgb), 0.2); }

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.badge-new {
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes badge-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.nav-soon {
    margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: 0.3px;
    color: var(--light-blue-theme); background: rgba(var(--theme-rgb), 0.08);
    padding: 2px 7px; border-radius: 6px; flex-shrink: 0; text-transform: uppercase;
}

.nav-item.disabled {
    opacity: 0.4; cursor: default;
}
.nav-item.disabled:hover { background: transparent; color: var(--text-secondary); }

/* Board items inside nav cards */
.nav-board-logo {
    width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex-shrink: 0;
}
.nav-board-dot {
    width: 20px; min-width: 20px; height: 20px; min-height: 20px; border-radius: 5px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; color: white;
}

/* Board category dots */
.nav-cat-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* ── Sidebar footer — user presence card ── */
.sidebar-footer {
    padding: 14px; border-top: 1px solid rgba(255, 255, 255, 0.10);
    flex-shrink: 0;
}
.sf-user-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
    position: relative; overflow: hidden;
}
.sf-user-card::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 50%,
        rgba(var(--theme-rgb), 0.06) 0%,
        rgba(167, 139, 250, 0.03) 40%,
        transparent 70%
    );
    opacity: 0; transition: opacity 0.3s ease;
    pointer-events: none;
}
.sf-user-card:hover::before { opacity: 1; }
.sf-user-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(var(--theme-rgb), 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.sf-user-card > * { position: relative; z-index: 1; }
.sf-user-card .user-avatar {
    width: 36px; height: 36px; font-size: 13px; flex-shrink: 0;
}
.sf-user-card .user-avatar .presence-dot {
    width: 9px; height: 9px; border-width: 2px;
}
.sf-user-details { flex: 1; min-width: 0; }
.sf-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.sf-user-role {
    font-size: 11px; color: var(--text-tertiary); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
    display: flex; align-items: center; gap: 5px;
}
.sf-user-role::before {
    content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: rgba(var(--theme-rgb), 0.5); flex-shrink: 0;
}
.sf-quick-actions { display: flex; gap: 4px; flex-shrink: 0; }
.sf-action-btn {
    display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
    border-radius: 8px; color: var(--text-tertiary); text-decoration: none;
    transition: all var(--transition-fast);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.sf-action-btn:hover { background: rgba(var(--theme-rgb), 0.12); color: var(--light-blue-theme); border-color: rgba(var(--theme-rgb), 0.15); }
.sf-action-danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); border-color: rgba(239, 68, 68, 0.12); }

/* ── Presence pulse on user avatar in footer ── */
.sidebar-footer .presence-dot.presence-active {
    animation: presencePulse 2s ease-in-out infinite;
}
@keyframes presencePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0); }
}

/* ── Collapsed state ── */
.sidebar.collapsed .sidebar-toggle-collapse { display: none; }
.sidebar.collapsed .sidebar-toggle-expand { display: block; }
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .sidebar-header { padding: 14px 0; justify-content: center; }
.sidebar.collapsed .sidebar-header::before,
.sidebar.collapsed .sidebar-header::after { display: none; }
.sidebar.collapsed .sidebar-brand-name,
.sidebar.collapsed .sidebar-brand-version,
.sidebar.collapsed .sidebar-brand-logo-wide { display: none; }
.sidebar.collapsed .sidebar-brand { display: none; }
.sidebar.collapsed .nav-card-search { display: none; }
.sidebar.collapsed .sidebar-toggle-btn { width: 36px; height: 36px; margin: 0 auto; }
.sidebar.collapsed .sidebar-nav { padding: 8px 6px; gap: 4px; }
.sidebar.collapsed .nav-card { background: transparent; border-color: transparent; }
.sidebar.collapsed .nav-card-header { display: none; }
.sidebar.collapsed .nav-card-items { padding: 2px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; gap: 0; }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item .icon, .sidebar.collapsed .nav-item > svg { width: 20px; height: 20px; }
.sidebar.collapsed .nav-badge, .sidebar.collapsed .nav-soon { display: none; }
.sidebar.collapsed .nav-item.active { animation: none; box-shadow: none; }
.sidebar.collapsed .nav-board-logo,
.sidebar.collapsed .nav-board-dot { display: none; }
.sidebar.collapsed .nav-card-boards { display: none; }
.sidebar.collapsed .sf-user-details { display: none; }
.sidebar.collapsed .sf-user-card { justify-content: center; padding: 8px; gap: 0; }
.sidebar.collapsed .sf-user-card .user-avatar { width: 32px; height: 32px; font-size: 11px; }
.sidebar.collapsed .sf-quick-actions { display: none; }
.sidebar.collapsed .sidebar-footer { padding: 8px 6px; }
.sidebar.collapsed .sf-user-card::before { display: none; }
.sidebar.collapsed ~ .main-content { margin-left: 92px; }


/* Tooltips on collapsed sidebar icons */
.sidebar-tooltip {
    position: fixed; z-index: 10000;
    background: rgba(15, 15, 18, 0.95); color: var(--text-primary);
    padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 500;
    white-space: nowrap; pointer-events: none;
    border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    opacity: 0; transition: opacity 0.12s;
    backdrop-filter: blur(12px);
}
.sidebar-tooltip.visible { opacity: 1; }

/* ── Logo theme switching ── */
.sidebar-logo { height: 24px; }
.sidebar-logo-light { display: none !important; }
.sidebar-logo-dark { display: block !important; }
/* Sidebar header stays dark in light mode, so keep the dark (white) logo */
[data-theme="light"] .sidebar-logo-dark { display: block !important; }
[data-theme="light"] .sidebar-logo-light { display: none !important; }

/* ── Light mode sidebar ── */
[data-theme="light"] .sidebar {
    background: #E8E9ED;
    border: 2px solid #9B9BA8;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* Keep sidebar header dark in light mode — same orb + particles as dark mode */
[data-theme="light"] .sidebar-header {
    background: rgba(30, 32, 38, 0.85);
    border-radius: 14px 14px 0 0;
}
[data-theme="light"] .sidebar-header::before { /* inherits dark mode values */ }
[data-theme="light"] .sidebar-header::after { opacity: 0.9; }
[data-theme="light"] .sidebar-brand-name { color: #ececef; }
[data-theme="light"] .sidebar-brand-version { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.08); }
[data-theme="light"] .sidebar-toggle-btn { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); }
[data-theme="light"] .sidebar-toggle-btn:hover { background: rgba(255,255,255,0.08); color: #ececef; border-color: rgba(255,255,255,0.12); }
[data-theme="light"] .nav-card { background: #DDDEE3; border: 1px solid #9B9BA8; }
[data-theme="light"] .nav-card:hover { border-color: #9B9BA8; }
[data-theme="light"] .nav-card-search { border: 1px solid #9B9BA8; }
[data-theme="light"] .nav-card-search:focus-within { background: #D5D6DC; }
[data-theme="light"] .nav-card-search kbd { background: #D8D9DF; border-color: #9B9BA8; }
[data-theme="light"] .sidebar-footer { border-top: 1px solid #9B9BA8; }
[data-theme="light"] .sf-user-card { background: #D5D6DC; border: 1px solid #9B9BA8; }
[data-theme="light"] .sf-user-card:hover { background: #CDCED5; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
[data-theme="light"] .sf-user-card::before { display: none; }
[data-theme="light"] .sf-action-btn { background: #DDDEE3; border-color: #9B9BA8; }
[data-theme="light"] .sf-action-btn:hover { background: rgba(var(--theme-rgb),0.1); border-color: rgba(var(--theme-rgb),0.14); }
[data-theme="light"] .sf-user-role::before { background: rgba(var(--theme-rgb),0.4); }
[data-theme="light"] .sidebar-tooltip { background: #ffffff; border: 1px solid #9B9BA8; box-shadow: 0 8px 24px rgba(0,0,0,0.14); backdrop-filter: none; }

/* ── Light mode: floating main content ── */
[data-theme="light"] .main-content {
    background: #E0E2E7;
    border: 2px solid #9B9BA8;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
[data-theme="light"] .top-header {
    background: rgba(30, 32, 38, 0.85);
    border-bottom: 2px solid #9B9BA8;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
/* Topbar pseudo-elements removed — clean header */
[data-theme="light"] .header-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}
[data-theme="light"] .header-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #ececef;
}
[data-theme="light"] .header-breadcrumb-item { color: rgba(255, 255, 255, 0.85); }
[data-theme="light"] .header-breadcrumb-current { color: #ececef; }
[data-theme="light"] .header-title { color: #ececef; }
[data-theme="light"] .header-search-trigger { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
[data-theme="light"] .header-search-trigger:hover { border-color: rgba(255,255,255,0.14); color: rgba(255,255,255,0.7); }
[data-theme="light"] .header-search-trigger kbd { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }

/* ═══════════════════════════════════════════════════════════
   SLEEK LAYOUT — Edge-to-edge, no floating panels
   Sidebar + main share a seamless background with no gaps.
   ═══════════════════════════════════════════════════════════ */

/* Dark mode sleek */
[data-layout="sleek"] .sidebar {
    left: 0; top: 0; bottom: 0;
    border-radius: 0;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    background: var(--bg-primary);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
[data-layout="sleek"] .sidebar-header {
    border-radius: 0;
}
[data-layout="sleek"] .main-content {
    margin-left: var(--sidebar-width);
    margin-top: 0; margin-right: 0; margin-bottom: 0;
    border-radius: 0;
    border: none;
    min-height: 100vh;
    box-shadow: none;
    background: var(--bg-primary);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
[data-layout="sleek"] .top-header {
    border-radius: 0;
}

/* Sleek collapsed sidebar */
[data-layout="sleek"] .sidebar.collapsed ~ .main-content {
    margin-left: 68px;
}

/* Sleek + Light mode */
[data-layout="sleek"][data-theme="light"] .sidebar {
    background: #E8E9ED;
    border: none;
    border-right: 1px solid #9B9BA8;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
[data-layout="sleek"][data-theme="light"] .sidebar-header {
    border-radius: 0;
}
[data-layout="sleek"][data-theme="light"] .main-content {
    background: #E0E2E7;
    border-radius: 0;
    border: none;
    box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
[data-layout="sleek"][data-theme="light"] .top-header {
    border-radius: 0;
}

/* Sleek — make body background match so no color seams */
[data-layout="sleek"] body {
    background: var(--bg-primary);
}
[data-layout="sleek"][data-theme="light"] body {
    background: #E0E2E7;
}

/* Sleek — square off all internal sidebar elements */
[data-layout="sleek"] .nav-card {
    border-radius: 0;
}
[data-layout="sleek"] .nav-card-search {
    border-radius: 0;
}
[data-layout="sleek"] .sf-user-card {
    border-radius: 0;
}
[data-layout="sleek"] .nav-item {
    border-radius: 0;
}
[data-layout="sleek"] .nav-item.active {
    box-shadow: none;
    animation: none;
}
[data-layout="sleek"] .sidebar-toggle-btn {
    border-radius: 0;
}
[data-layout="sleek"] .sidebar-brand-version {
    border-radius: 0;
}
[data-layout="sleek"] .nav-badge,
[data-layout="sleek"] .nav-soon {
    border-radius: 0;
}
[data-layout="sleek"] .header-btn {
    border-radius: 0;
}
[data-layout="sleek"] .sf-action-btn {
    border-radius: 0;
}
[data-layout="sleek"] .filter-btn {
    border-radius: 0;
}
[data-layout="sleek"] .header-separator {
    border-radius: 0;
}
/* Sleek — square off presence dots and board dots in sidebar */
[data-layout="sleek"] .nav-board-dot {
    border-radius: 0;
}
[data-layout="sleek"] .nav-board-logo {
    border-radius: 0;
}
[data-layout="sleek"] .nav-cat-dot {
    border-radius: 0;
}

/* ── Backward compat — old class aliases ── */
.sidebar-link { /* alias for .nav-item — kept for JS tooltip handler */
    display: flex; align-items: center; gap: 10px; padding: 7px 10px;
    border-radius: 8px; color: var(--text-secondary);
    font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1); position: relative;
}
.sidebar-link:hover { background: rgba(var(--theme-rgb), 0.06); color: var(--text-primary); }
.sidebar-link.active { background: rgba(var(--theme-rgb), 0.1); color: var(--light-blue-theme); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(var(--theme-rgb), 0.15); animation: navItemGlow 3s ease-in-out infinite; }
.sidebar-link .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.45; transition: opacity 0.15s; }
.sidebar-link:hover .icon { opacity: 0.75; }
.sidebar-link.active .icon { opacity: 1; }
.sidebar-link-badge { margin-left: auto; font-size: 10px; font-weight: 700; background: rgba(var(--theme-rgb), 0.1); color: var(--light-blue-theme); padding: 1px 6px; border-radius: 6px; flex-shrink: 0; }
.sidebar-link.active .sidebar-link-badge { background: rgba(var(--theme-rgb), 0.2); }
.sidebar-link.disabled { opacity: 0.4; cursor: default; }
.sidebar-link.disabled:hover { background: transparent; color: var(--text-secondary); }
.sidebar-soon-badge { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: 0.3px; color: var(--light-blue-theme); background: rgba(var(--theme-rgb), 0.08); padding: 2px 7px; border-radius: 6px; flex-shrink: 0; text-transform: uppercase; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 10px; gap: 0; }
.sidebar.collapsed .sidebar-link span { display: none; }
.sidebar.collapsed .sidebar-link .icon { width: 20px; height: 20px; }
.sidebar.collapsed .sidebar-link-badge, .sidebar.collapsed .sidebar-soon-badge { display: none; }
.sidebar.collapsed .sidebar-link.active::before { display: none; }
.sidebar-board-logo { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.sidebar-board-dot { width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: white; }
.sidebar.collapsed .sidebar-board-logo, .sidebar.collapsed .sidebar-board-dot { display: none; }

.main-content {
    flex: 1; margin-left: calc(var(--sidebar-width) + 24px); display: flex; flex-direction: column;
    min-height: calc(100vh - 24px); transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 12px; margin-right: 12px; margin-bottom: 12px;
    background: var(--section-bg, rgba(30, 32, 38, 0.65));
    border: 1px solid var(--section-border, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ========== HEADER / TOPBAR ========== */
.top-header {
    height: var(--section-height, var(--header-height));
    background: var(--section-bg, rgba(255, 255, 255, 0.02));
    border-bottom: 1px solid var(--section-border, rgba(255, 255, 255, 0.06));
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}
/* Clean topbar — no nebula/particles */
.top-header::before,
.top-header::after {
    display: none;
}
.top-header > * { position: relative; z-index: 1; }

.header-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.header-title { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Presence status rings — works on any .user-avatar or .usr-card-avatar with data-presence */
[data-presence="online"] { box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px #22c55e !important; }
[data-presence="idle"] { box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px #eab308 !important; }
[data-presence="offline"] { box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px #374151 !important; }
[data-theme="light"] [data-presence="online"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #16a34a !important; }
[data-theme="light"] [data-presence="idle"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ca8a04 !important; }
[data-theme="light"] [data-presence="offline"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #9ca3af !important; }

/* Small dot indicator for tiny avatars (22px and below) */
.presence-dot { position:absolute;bottom:0;right:0;width:7px;height:7px;border-radius:50%;border:1.5px solid var(--bg-secondary);z-index:1; }
.presence-dot.presence-online { background:#22c55e; }
.presence-dot.presence-idle { background:#eab308; }
.presence-dot.presence-offline { background:#6b7280; }
[data-theme="light"] .presence-dot { border-color:#fff; }

/* Legacy support for .presence-ring class on users.php cards */
.presence-ring { position: relative; display: inline-flex; }
.presence-ring.online { box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px #22c55e; }
.presence-ring.idle { box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px #eab308; }
.presence-ring.offline { box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px #374151; }
[data-theme="light"] .presence-ring.online { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #16a34a; }
[data-theme="light"] .presence-ring.idle { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ca8a04; }
[data-theme="light"] .presence-ring.offline { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #9ca3af; }

.header-btn {
    width: 34px; height: 34px; border-radius: 10px; background: var(--section-btn-bg, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--section-btn-border, rgba(255, 255, 255, 0.06)); color: var(--section-btn-color, rgba(255,255,255,0.85)); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast); position: relative;
}
.header-btn:hover { background: var(--section-btn-hover-bg, rgba(255, 255, 255, 0.08)); color: var(--section-btn-hover-color, var(--text-primary)); border-color: rgba(255, 255, 255, 0.12); }
.header-btn .badge { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; background: var(--color-danger); border-radius: 50%; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: white; }

.user-avatar {
    width: 30px; height: 30px; border-radius: 50%; overflow: hidden; cursor: pointer;
    background: linear-gradient(135deg, var(--light-blue-theme), var(--medium-blue));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 11px; color: white; flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.user-avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.user-avatar.xl { width: 64px; height: 64px; font-size: 20px; }

.user-avatar { position: relative; overflow: visible; }
.user-avatar img { border-radius: 50%; }
.presence-dot { position: absolute; bottom: -1px; right: -1px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--bg-primary); z-index: 1; }
.presence-active { background: #22C55E; }
.presence-idle { background: #EAB308; }
.presence-offline { background: #525259; }
[data-theme="light"] .presence-dot { border-color: #ffffff; }
.user-avatar.sm .presence-dot { width: 7px; height: 7px; bottom: -1px; right: -1px; border-width: 1.5px; }

/* ========== PAGE CONTENT ========== */
.page-content {
    padding: var(--section-padding, 24px); flex: 1;
    max-width: var(--section-max-width, none); overflow-y: auto;
    position: relative;
    animation: pageContentIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}
[data-theme="light"] .page-content {
    background:
        linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
}
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--section-spacing, 24px); }
.page-title { font-size: var(--section-title-size, 20px); font-weight: var(--section-title-weight, 800); letter-spacing: var(--section-title-tracking, -0.3px); color: var(--section-title-color, var(--text-primary)); }
.page-subtitle { color: var(--section-subtitle-color, var(--text-secondary)); font-size: var(--section-subtitle-size, 13px); margin-top: 2px; }

/* ========== BUTTONS ========== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border: none; border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--light-blue-theme) 0%, color-mix(in srgb, var(--light-blue-theme) 80%, #000) 100%); color: #000; font-weight: 600; box-shadow: 0 2px 8px rgba(var(--theme-rgb),0.2); }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(var(--theme-rgb),0.35); transform: translateY(-1px); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(0) scale(0.97); box-shadow: 0 1px 4px rgba(var(--theme-rgb),0.2); filter: brightness(0.95); transition: all 0.06s ease; }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-secondary); }
.btn-secondary:hover { background: var(--bg-hover); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0) scale(0.97); transition: all 0.06s ease; }
.btn-success { background: linear-gradient(135deg, #92FE65 0%, #6ad43e 100%); color: var(--text-inverse); box-shadow: 0 2px 8px rgba(146,254,101,0.15); }
.btn-success:hover { box-shadow: 0 4px 16px rgba(146,254,101,0.25); transform: translateY(-1px); filter: brightness(1.06); }
.btn-success:active { transform: translateY(0) scale(0.97); filter: brightness(0.95); transition: all 0.06s ease; }
.btn-danger { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.18); transform: translateY(-1px); }
.btn-danger:active { transform: translateY(0) scale(0.97); transition: all 0.06s ease; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-ghost:active { transform: scale(0.97); transition: all 0.06s ease; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.6px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border-primary); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 13px; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.15), 0 0 16px rgba(var(--theme-rgb), 0.08); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-tertiary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23505058' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--light-blue-theme); cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ========== UI CARDS ========== */
.ui-card { background: var(--section-bg, var(--bg-secondary)); border: 1px solid var(--section-border, var(--border-primary)); border-radius: var(--section-radius, var(--radius-lg)); padding: var(--section-padding, 22px); box-shadow: var(--section-shadow, none); transition: box-shadow var(--transition-normal), transform var(--transition-normal); }
.ui-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ui-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ui-card-title { font-size: var(--section-title-size, 14px); font-weight: var(--section-title-weight, 700); }

/* ========== BOARD GRID ========== */
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

.board-card { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--radius-lg); padding: 20px; cursor: pointer; transition: all var(--transition-normal); position: relative; overflow: hidden; }
.board-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--light-blue-theme), var(--medium-blue)); opacity: 0; transition: opacity 0.2s; }
.board-card:hover::before { opacity: 1; }
.board-card:hover { border-color: var(--border-secondary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.board-card-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.board-card-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-card-meta { display: flex; align-items: center; justify-content: space-between; }
.board-card-members { display: flex; align-items: center; }
.board-card-members .user-avatar { margin-left: -6px; border: 2px solid var(--bg-card); }
.board-card-members .user-avatar:first-child { margin-left: 0; }
.board-star { background: none; border: none; cursor: pointer; color: var(--text-tertiary); font-size: 16px; padding: 4px; transition: color var(--transition-fast); }
.board-star:hover, .board-star.active { color: #f5a623; }

.board-card-create { background: transparent; border: 2px dashed var(--border-primary); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; min-height: 140px; color: var(--text-tertiary); font-weight: 600; }
.board-card-create:hover { border-color: var(--light-blue-theme); color: var(--light-blue-theme); background: rgba(var(--theme-rgb), 0.03); }

/* ========== KANBAN BOARD ========== */
.board-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.board-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--bg-primary); border-bottom: 1px solid var(--border-primary); }
.board-toolbar-left { display: flex; align-items: center; gap: 12px; }
.board-name-input { font-size: 16px; font-weight: 700; background: transparent; border: none; color: var(--text-primary); padding: 4px 8px; border-radius: var(--radius-sm); }
.board-name-input:focus { outline: none; background: var(--bg-input); }
.board-toolbar-right { display: flex; align-items: center; gap: 8px; }

.filter-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 10px; color: var(--text-secondary); font-size: 12px; font-weight: 500; cursor: pointer; transition: all var(--transition-fast); }
.filter-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); border-color: rgba(255, 255, 255, 0.12); }
[data-theme="light"] .filter-btn { background: #D8D9DF; border-color: #9B9BA8; }
[data-theme="light"] .filter-btn:hover { background: #CDCED5; border-color: #9B9BA8; }

/* ── Light mode: black borders on page-level cards and elements ── */
[data-theme="light"] .ui-card,
[data-theme="light"] .dash-stat,
[data-theme="light"] .dash-panel,
[data-theme="light"] .dash-board-card,
[data-theme="light"] .dash-team-member,
[data-theme="light"] .dash-qa-btn,
[data-theme="light"] .task-card,
[data-theme="light"] .tasks-summary-pill,
[data-theme="light"] .tasks-filter-btn,
[data-theme="light"] .tasks-search,
[data-theme="light"] .mod-settings-card,
[data-theme="light"] .mod-header-card,
[data-theme="light"] .mod-overview-card,
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea,
[data-theme="light"] .data-table,
[data-theme="light"] .label-tag,
[data-theme="light"] .btn,
[data-theme="light"] .toast { border-color: #9B9BA8; }

[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer,
[data-theme="light"] .dropdown-divider,
[data-theme="light"] .dash-activity-item { border-color: #9B9BA8; }
.filter-btn.active { background: rgba(var(--theme-rgb), 0.08); border-color: rgba(var(--theme-rgb), 0.2); color: var(--light-blue-theme); }

/* kanban styles moved to board.css */

/* .kanban-list base styles in board.css */
.kanban-list-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px; }
.kanban-list-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.kanban-list-count { background: var(--bg-elevated); color: var(--text-tertiary); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; margin-left: 6px; }
.kanban-list-menu { background: none; border: none; color: var(--text-tertiary); cursor: pointer; padding: 4px; border-radius: var(--radius-sm); transition: all var(--transition-fast); }
.kanban-list-menu:hover { background: var(--bg-hover); color: var(--text-primary); }

.kanban-cards { flex: 1; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 20px; }

.kanban-card { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer; transition: all var(--transition-fast); position: relative; }
.kanban-card:hover { border-color: var(--border-secondary); box-shadow: var(--shadow-sm); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); }
.kanban-card-labels { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.kanban-card-label { height: 5px; border-radius: 3px; min-width: 28px; }
.kanban-card-title { font-size: 13px; font-weight: 500; line-height: 1.4; margin-bottom: 8px; word-wrap: break-word; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.kanban-card-badges { display: flex; align-items: center; gap: 8px; }
.card-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-tertiary); }
.card-badge svg { width: 12px; height: 12px; }
.card-badge.due-soon { color: var(--color-warning); }
.card-badge.overdue { color: var(--color-danger); }
.card-badge.complete { color: var(--color-success); }
.kanban-card-members { display: flex; align-items: center; }
.kanban-card-members .user-avatar { width: 22px; height: 22px; font-size: 9px; margin-left: -4px; border: 2px solid var(--bg-card); }
.kanban-card-members .user-avatar:first-child { margin-left: 0; }
.kanban-card-priority { width: 3px; position: absolute; top: 8px; bottom: 8px; left: 0; border-radius: 0 3px 3px 0; }
.priority-low { background: var(--priority-low); }
.priority-medium { background: var(--priority-medium); }
.priority-high { background: var(--priority-high); }
.priority-urgent { background: var(--priority-urgent); }
.kanban-card-cover { margin: -10px -12px 8px; height: 100px; border-radius: var(--radius-md) var(--radius-md) 0 0; overflow: hidden; }
.kanban-card-cover img { width: 100%; height: 100%; object-fit: cover; }

.kanban-add-card { padding: 8px; }
.add-card-btn { width: 100%; padding: 8px; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--text-tertiary); font-family: inherit; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all var(--transition-fast); }
.add-card-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.add-card-form { display: none; }
.add-card-form.active { display: block; }
.add-card-input { width: 100%; padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--border-focus); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 13px; resize: none; min-height: 60px; margin-bottom: 8px; }
.add-card-input:focus { outline: none; }
.add-card-actions { display: flex; gap: 8px; }

.kanban-add-list { width: 280px; min-width: 280px; }
.add-list-btn { width: 100%; padding: 12px; background: rgba(var(--theme-rgb), 0.04); border: 2px dashed var(--border-primary); border-radius: var(--radius-md); color: var(--text-tertiary); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all var(--transition-fast); }
.add-list-btn:hover { border-color: var(--light-blue-theme); color: var(--light-blue-theme); background: rgba(var(--theme-rgb), 0.06); }

/* ========== MODAL ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 1000; display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: var(--radius-xl); width: 100%; max-width: 700px; box-shadow: var(--shadow-xl); animation: modalIn 0.2s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-sm { max-width: 440px; }
.modal-lg { max-width: 900px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-primary); }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-elevated); border: none; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all var(--transition-fast); }
.modal-close:hover { background: var(--color-danger); color: white; }
.modal-body { padding: 22px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border-primary); }

/* ========== CARD DETAIL ========== */
.card-detail { display: grid; grid-template-columns: 1fr 200px; gap: 22px; }
.card-detail-main { min-width: 0; }
.card-detail-section { margin-bottom: 22px; }
.card-detail-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.card-description { padding: 12px; background: var(--bg-input); border: 1px solid var(--border-primary); border-radius: var(--radius-sm); min-height: 80px; cursor: pointer; color: var(--text-secondary); font-size: 13px; transition: border-color var(--transition-fast); }
.card-description:hover { border-color: var(--border-secondary); }
.card-description.has-content { color: var(--text-primary); }

.checklist-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.checklist-progress-bar { flex: 1; height: 5px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; }
.checklist-progress-fill { height: 100%; background: var(--bright-green); border-radius: 3px; transition: width 0.3s ease; }
.checklist-progress-text { font-size: 11px; font-weight: 600; color: var(--text-tertiary); min-width: 30px; text-align: right; }
.checklist-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; }
.checklist-item input[type="checkbox"] { margin-top: 2px; accent-color: var(--bright-green); width: 16px; height: 16px; cursor: pointer; }
.checklist-item-text { flex: 1; font-size: 13px; }
.checklist-item.completed .checklist-item-text { text-decoration: line-through; color: var(--text-tertiary); }

.comment-item { display: flex; gap: 10px; margin-bottom: 16px; }
.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-author { font-size: 13px; font-weight: 700; }
.comment-time { font-size: 11px; color: var(--text-tertiary); }
.comment-content { font-size: 13px; color: var(--text-secondary); background: var(--bg-input); padding: 10px 14px; border-radius: var(--radius-sm); line-height: 1.5; }
.comment-actions { display: flex; gap: 8px; margin-top: 4px; }
.comment-action-btn { font-size: 11px; color: var(--text-tertiary); background: none; border: none; cursor: pointer; }
.comment-action-btn:hover { color: var(--light-blue-theme); }

.card-sidebar-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--bg-elevated); border: none; border-radius: var(--radius-sm); color: var(--text-secondary); font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; margin-bottom: 4px; transition: all var(--transition-fast); }
.card-sidebar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.card-sidebar-btn svg { width: 14px; height: 14px; }

/* ========== DROPDOWN ========== */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 4px); right: 0; background: rgba(22, 22, 25, 0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-md); box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04); min-width: 180px; padding: 6px; z-index: 200; display: none; animation: ctxIn 0.15s cubic-bezier(0.16, 1, 0.3, 1); transform-origin: top right; }
.dropdown-menu.active { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; cursor: pointer; transition: all var(--transition-fast); border: none; background: none; width: 100%; font-family: inherit; text-decoration: none; }
.dropdown-item:hover { background: rgba(var(--theme-rgb), 0.1); color: var(--text-primary); }
.dropdown-item.danger { color: var(--color-danger); }
.dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.08); }
.dropdown-divider { height: 1px; background: var(--border-primary); margin: 5px 0; }

/* ========== LABELS ========== */
.label-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; color: white; }

/* ========== TABLE ========== */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th { background: var(--bg-elevated); padding: 10px 16px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-tertiary); border-bottom: 1px solid var(--border-primary); }
.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-primary); font-size: 13px; }
.data-table tr:hover td { background: var(--bg-hover); }

/* ========== STATUS BADGE ========== */
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-badge.active { background: rgba(146, 254, 101, 0.08); color: var(--bright-green); }
.status-badge.inactive { background: rgba(239, 68, 68, 0.08); color: #f87171; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ========== NOTIFICATION PANEL ========== */
.notifications-panel { position: fixed; top: 0; right: -380px; width: 380px; height: 100%; background: var(--bg-secondary); border-left: 1px solid var(--border-primary); z-index: 500; transition: right var(--transition-normal); display: flex; flex-direction: column; }
.notifications-panel.open { right: 0; }
.notification-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-primary); cursor: pointer; transition: background var(--transition-fast); }
.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { background: rgba(var(--theme-rgb), 0.03); }
.notification-content { flex: 1; }
.notification-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notification-message { font-size: 12px; color: var(--text-secondary); }
.notification-time { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-tertiary); }
.empty-state-icon { width: 64px; height: 64px; margin: 0 auto 16px; opacity: 0.25; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-text { font-size: 13px; margin-bottom: 20px; }

/* ========== TOAST ========== */
.toast-container {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column-reverse; align-items: center; gap: 10px;
    pointer-events: none; width: 100%; max-width: 440px; padding: 0 16px; box-sizing: border-box;
}
.toast {
    pointer-events: auto; position: relative; width: 100%;
    background: rgba(26, 26, 30, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 14px 40px 14px 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    display: flex; align-items: center; gap: 12px; overflow: hidden;
    animation: toastSlideUp 0.35s cubic-bezier(0.16,1,0.3,1);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.toast.exiting {
    animation: toastSlideDown 0.3s cubic-bezier(0.55,0,1,0.45) forwards;
}
@keyframes toastSlideUp { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastSlideDown { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(16px) scale(0.96); } }
.toast-icon {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.toast-icon svg { width: 14px; height: 14px; }
.toast.success .toast-icon { background: rgba(34,197,94,0.15); color: #22C55E; }
.toast.error .toast-icon { background: rgba(239,68,68,0.15); color: #EF4444; }
.toast.info .toast-icon { background: rgba(59,130,246,0.15); color: #3B82F6; }
.toast.warning .toast-icon { background: rgba(234,179,8,0.15); color: #EAB308; }
.toast-body { flex: 1; min-width: 0; line-height: 1.45; }
.toast-dismiss {
    position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
    width: 24px; height: 24px; border-radius: 6px; border: none;
    background: transparent; color: var(--text-tertiary); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.toast-dismiss:hover { background: var(--bg-input); color: var(--text-secondary); }
.toast-progress {
    position: absolute; bottom: 0; left: 0; height: 2px; border-radius: 0 0 12px 12px;
    animation: toastCountdown linear forwards;
}
.toast.success .toast-progress { background: #22C55E; }
.toast.error .toast-progress { background: #EF4444; }
.toast.info .toast-progress { background: #3B82F6; }
.toast.warning .toast-progress { background: #EAB308; }
@keyframes toastCountdown { from { width: 100%; } to { width: 0%; } }

/* ========== LOADING ========== */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border-primary); border-top-color: var(--light-blue-theme); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.loading-overlay { position: absolute; inset: 0; background: rgba(10, 10, 12, 0.7); display: flex; align-items: center; justify-content: center; z-index: 10; border-radius: inherit; }

/* ========== DRAG STATES ========== */
.drag-over { background: rgba(var(--theme-rgb), 0.05) !important; border-color: var(--light-blue-theme) !important; }
.drag-ghost { opacity: 0.4; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar { left: 0; top: 0; bottom: 0; border-radius: 0; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin: 0 !important; border-radius: 0; border: none; min-height: 100vh; }
    .card-detail { grid-template-columns: 1fr; }
    .kanban-list { width: 260px; min-width: 260px; }
    .page-content { padding: 16px; }
    .boards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .header-search-trigger { display: none; }
    .header-breadcrumb-item { display: none; }
    .header-breadcrumb svg { display: none; }
}

/* ========== LOGIN PAGE ========== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-body); position: relative; overflow: hidden; }
.login-page::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(ellipse at 30% 20%, rgba(var(--theme-rgb), 0.04) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(12, 84, 160, 0.03) 0%, transparent 50%); animation: bgPulse 15s ease-in-out infinite; }
@keyframes bgPulse { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-2%, -2%); } }
.login-container { width: 100%; max-width: 400px; padding: 20px; position: relative; z-index: 1; }
.login-card { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: var(--radius-xl); padding: 36px 28px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 32px; margin-bottom: 12px; }
.login-logo h1 { font-size: 18px; font-weight: 800; }
.login-logo p { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* ========== ADMIN PAGES ========== */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: var(--radius-lg); padding: 20px; }
.stat-card-icon { width: 38px; height: 38px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 18px; }
.stat-card-value { font-size: 26px; font-weight: 800; margin-bottom: 2px; }
.stat-card-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ========== TABS ========== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-primary); margin-bottom: 24px; }
.tab { padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--text-tertiary); cursor: pointer; border-bottom: 2px solid transparent; transition: all var(--transition-fast); background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--light-blue-theme); border-bottom-color: var(--light-blue-theme); }

/* ========== SEARCH ========== */
.search-box { position: relative; }
.search-box input { width: 100%; padding: 8px 14px 8px 34px; background: var(--bg-input); border: 1px solid var(--border-primary); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 13px; }
.search-box input:focus { outline: none; border-color: var(--border-focus); }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-tertiary); }

/* ========== POPOVER ========== */
.popover { position: absolute; background: var(--bg-elevated); border: 1px solid var(--border-secondary); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 300; padding: 12px; min-width: 240px; display: none; }
.popover.active { display: block; }
.popover-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-primary); }

/* ========== UPDATE DROPZONE ========== */
.update-dropzone { border: 2px dashed var(--border-secondary); border-radius: var(--radius-lg); padding: 48px 24px; text-align: center; transition: all var(--transition-normal); cursor: pointer; }
.update-dropzone:hover, .update-dropzone.dragover { border-color: var(--light-blue-theme); background: rgba(var(--theme-rgb), 0.03); }
.update-dropzone-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.3; }
.update-dropzone-text { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.update-dropzone-hint { font-size: 12px; color: var(--text-tertiary); }

/* ========== HEADER BOARD LOGO ========== */
.header-board-logo { width: 28px !important; height: 28px !important; max-width: 28px; max-height: 28px; min-width: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.header-board-logo-fallback { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: white; }

/* ── Breadcrumb header ── */
.header-breadcrumb {
    display: flex; align-items: center; gap: 6px;
}
.header-breadcrumb-item {
    font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85);
}
.header-breadcrumb-current {
    font-size: 14px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px;
}

/* ── Command palette search trigger ── */
.header-search-trigger {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px 6px 10px; background: var(--bg-input);
    border: 1px solid var(--border-primary); border-radius: var(--radius-sm);
    color: var(--text-tertiary); font-family: inherit; font-size: 12px;
    cursor: pointer; transition: all var(--transition-fast); min-width: 160px;
}
.header-search-trigger:hover { border-color: var(--border-secondary); color: var(--text-secondary); }
.header-search-trigger span { flex: 1; text-align: left; }
.header-search-trigger kbd {
    font-family: inherit; font-size: 10px; font-weight: 600;
    background: var(--bg-elevated); padding: 1px 5px; border-radius: 4px;
    border: 1px solid var(--border-primary); line-height: 1.5;
}

/* ── Header avatar / user menu ── */
.header-avatar-btn {
    background: none; border: none; cursor: pointer; padding: 2px;
    border-radius: 50%; transition: all var(--transition-fast);
}
.header-avatar-btn:hover { opacity: 0.8; }
.header-user-menu { position: relative; }
.header-user-menu .dropdown-menu { top: calc(100% + 8px); }

/* ========== PAGE TRANSITION ========== */
@keyframes pageContentIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== STAGGER ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.stagger-in > * {
    opacity: 0;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.09s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.12s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.18s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.21s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.24s; }
.stagger-in > *:nth-child(9) { animation-delay: 0.27s; }
.stagger-in > *:nth-child(10) { animation-delay: 0.30s; }
.stagger-in > *:nth-child(11) { animation-delay: 0.33s; }
.stagger-in > *:nth-child(12) { animation-delay: 0.36s; }

/* ========== GLOBAL CONTEXT MENU ========== */
.orbit-ctx { position: fixed; z-index: 9500; pointer-events: none; }
.orbit-ctx.active { pointer-events: auto; }
.orbit-ctx-menu {
    background: rgba(22, 22, 25, 0.92);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 6px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
    animation: ctxIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top left;
}
@keyframes ctxIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.orbit-ctx-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px;
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    cursor: pointer; transition: background 0.1s; user-select: none;
}
.orbit-ctx-item:hover { background: rgba(var(--theme-rgb), 0.1); }
.orbit-ctx-item.danger { color: #f87171; }
.orbit-ctx-item.danger:hover { background: rgba(239,68,68,0.1); }
.orbit-ctx-sep { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 8px; }
.orbit-ctx-item svg { width: 16px; height: 16px; opacity: 0.6; flex-shrink: 0; }
.orbit-ctx-item .ctx-shortcut { margin-left: auto; font-size: 11px; color: var(--text-tertiary); font-weight: 500; }

/* Light mode overrides — context menu */
[data-theme="light"] .orbit-ctx-menu {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
}
[data-theme="light"] .orbit-ctx-item:hover { background: rgba(var(--theme-rgb), 0.08); }
[data-theme="light"] .orbit-ctx-sep { background: rgba(0,0,0,0.08); }

/* Light mode overrides — toast */
[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04);
}

/* ========== LOADING SKELETONS ========== */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: skeleton-shimmer 1.5s infinite;
}

[data-theme="light"] .skeleton::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 65%; }
.skeleton-text.long { width: 90%; }

.skeleton-title {
    height: 22px;
    width: 50%;
    margin-bottom: 12px;
    border-radius: 6px;
}

.skeleton-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.skeleton-stat {
    height: 80px;
    border-radius: var(--radius-md);
}

.skeleton-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
}

/* ========== KEYBOARD SHORTCUTS OVERLAY ========== */
.shortcut-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.shortcut-overlay-panel {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    padding: 0;
    width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

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

.shortcut-overlay-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.shortcut-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.shortcut-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.shortcut-overlay-body {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.shortcut-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin: 0 0 8px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shortcut-keys kbd {
    display: inline-block;
    padding: 2px 7px;
    font-size: 11px;
    font-family: inherit;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 5px;
    color: var(--text-primary);
    min-width: 20px;
    text-align: center;
}

@media (max-width: 620px) {
    .shortcut-overlay-panel {
        width: 90vw;
        max-width: none;
    }
    .shortcut-overlay-body {
        grid-template-columns: 1fr;
    }
}

/* ========== ONBOARDING TOUR ========== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    pointer-events: all;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: onboarding-fade-in 0.3s ease;
}

.onboarding-spotlight {
    position: fixed;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    border-radius: var(--radius-sm);
    z-index: 10003;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-tooltip {
    position: fixed;
    z-index: 10004;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    width: 320px;
    box-shadow: var(--shadow-xl);
    animation: onboarding-fade-in 0.3s ease;
}

@keyframes onboarding-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.onboarding-tooltip h4 {
    margin: 0 0 6px;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.onboarding-tooltip p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.onboarding-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.onboarding-dots {
    display: flex;
    gap: 5px;
}

.onboarding-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg-secondary);
    transition: background 0.2s;
}

.onboarding-dot.active {
    background: var(--light-blue-theme);
}

.onboarding-skip {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    transition: color 0.2s;
    font-family: inherit;
}

.onboarding-skip:hover {
    color: var(--text-primary);
}

.onboarding-next {
    background: var(--light-blue-theme);
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    transition: filter 0.2s;
    font-family: inherit;
}

.onboarding-next:hover {
    filter: brightness(1.1);
}

.onboarding-next:active {
    filter: brightness(0.95);
}

/* ========== NOTIFICATION BADGES POLISH ========== */
.badge {
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.badge-new {
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badge-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Nav badge styling */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    margin-left: auto;
    background: rgba(var(--theme-rgb), 0.1);
    color: var(--light-blue-theme);
    padding: 1px 6px;
    border-radius: 6px;
    flex-shrink: 0;
    min-width: 20px;
    height: 18px;
    animation: badge-pulse 2s ease-in-out infinite;
}

.nav-item.active .nav-badge {
    background: rgba(var(--theme-rgb), 0.2);
}

/* ========== EMPTY STATE ILLUSTRATIONS ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 300px;
}

.empty-state-illustration {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    opacity: 0.5;
    color: var(--text-tertiary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-illustration svg {
    width: 100%;
    height: 100%;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.empty-state-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 24px;
    max-width: 400px;
    line-height: 1.5;
}

.empty-state-cta {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 20px;
    background: var(--light-blue-theme);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.2s;
    font-family: inherit;
}

.empty-state-cta:hover {
    filter: brightness(1.1);
}

.empty-state-cta:active {
    filter: brightness(0.95);
}

/* ========== FOCUS MODE ========== */
body.focus-mode .sidebar {
    transform: translateX(-100%);
    pointer-events: none;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

body.focus-mode .main-header {
    transform: translateY(-100%);
    pointer-events: none;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

body.focus-mode .page-content {
    margin-left: 0 !important;
    padding-top: 20px !important;
}

body.focus-mode .focus-exit-btn {
    display: flex;
}

.focus-exit-btn {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 10001;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    font-weight: 500;
}

.focus-exit-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}

.focus-exit-btn kbd {
    font-size: 10px;
    padding: 1px 5px;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-left: 4px;
    font-family: monospace;
}

/* ========== AJAX PAGE TRANSITIONS ========== */
.ajax-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--light-blue-theme);
    z-index: 10005;
    width: 0%;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 0 8px rgba(var(--theme-rgb), 0.4);
    display: none;
}

main.main-content {
    transition: opacity 0.15s ease;
}

/* Compact Mode */
body.compact-mode {
    font-size: 13px;
}

body.compact-mode .sidebar {
    width: 220px;
    --sidebar-width: 220px;
}

body.compact-mode .sidebar .nav-item {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 32px;
}

body.compact-mode .sidebar .nav-card-header {
    padding: 8px 12px;
    font-size: 10px;
}

body.compact-mode .page-content {
    padding: 12px 16px;
}

body.compact-mode .stat-card,
body.compact-mode .dashboard-stat {
    padding: 12px;
}

body.compact-mode .kanban-card {
    padding: 8px 10px;
}

body.compact-mode .kanban-list-header {
    padding: 8px 10px;
}

body.compact-mode .top-header {
    height: 44px;
    --header-height: 44px;
}

body.compact-mode h1,
body.compact-mode .page-title {
    font-size: 20px;
}

body.compact-mode h2 {
    font-size: 16px;
}

body.compact-mode .table td,
body.compact-mode .table th {
    padding: 6px 10px;
    font-size: 12px;
}

/* ========== DASHBOARD WIDGET SYSTEM ========== */
.dashboard-widgets-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.dashboard-widget.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
}

.dashboard-widget-half {
    grid-column: span 1;
}

/* For half-width widgets in a 2-column grid */
@media (min-width: 1200px) {
    .dashboard-widgets-container {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-widget {
        grid-column: span 1;
    }

    .dashboard-widget[data-widget-id*="full"],
    .dashboard-widget:has(.dashboard-widget-full) {
        grid-column: 1 / -1;
    }
}

.dashboard-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    cursor: move;
}

.dashboard-widget-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-widget-title svg {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
}

.dashboard-widget-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0;
}

.dashboard-widget-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dashboard-widget-menu-btn::before {
    content: '⋯';
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-widget-context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10005;
    min-width: 180px;
    padding: 4px;
}

.dashboard-widget-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.dashboard-widget-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dashboard-customize-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(var(--theme-rgb), 0.1);
    border: 1px solid rgba(var(--theme-rgb), 0.2);
    color: var(--light-blue-theme);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dashboard-customize-btn:hover {
    background: rgba(var(--theme-rgb), 0.15);
    border-color: rgba(var(--theme-rgb), 0.35);
}

/* ========== SIDEBAR FAVOURITES ========== */
.sidebar-favourites-section {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-primary);
    display: none;
}

.sidebar-favourites-section:empty {
    display: none !important;
}

.sidebar-favourites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sidebar-favourites-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    font-weight: 600;
}

.sidebar-favourites-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-favourite-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: move;
    transition: background var(--transition-fast);
    user-select: none;
}

.sidebar-favourite-item:hover {
    background: var(--bg-hover);
}

.sidebar-favourite-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.sidebar-favourite-dot {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

.sidebar-favourite-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast);
}

.sidebar-favourite-item:hover .sidebar-favourite-name {
    color: var(--text-primary);
}

.sidebar-favourite-star {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--light-blue-theme);
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.sidebar-favourite-star:hover {
    opacity: 1;
}

.sidebar-favourite-star svg {
    width: 14px;
    height: 14px;
}

.toggle-favourite-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color var(--transition-fast);
    border-radius: 6px;
    flex-shrink: 0;
}

.toggle-favourite-star:hover {
    color: var(--light-blue-theme);
    background: rgba(var(--theme-rgb), 0.08);
}

.toggle-favourite-star svg {
    width: 16px;
    height: 16px;
}

/* ========== KANBAN DRAG-TO-SELECT ========== */
.kanban-select-rect {
    position: absolute;
    border: 2px solid var(--light-blue-theme);
    background: rgba(var(--theme-rgb), 0.08);
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
    display: none;
}

.kanban-card.selected {
    outline: 2px solid var(--light-blue-theme);
    outline-offset: -2px;
}

.kanban-card.selected::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(var(--theme-rgb), 0.06);
    border-radius: inherit;
    pointer-events: none;
}

.kanban-bulk-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    font-size: 13px;
    animation: slide-up 0.2s ease;
}

@keyframes slide-up {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.kanban-bulk-bar button {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.kanban-bulk-bar button:hover {
    background: var(--bg-hover);
    border-color: var(--border-secondary);
}

.kanban-bulk-bar button:active {
    transform: scale(0.98);
}

.kanban-bulk-bar .bulk-count {
    font-weight: 600;
    color: var(--light-blue-theme);
    margin-right: 8px;
}

/* ========== HELP TOOLTIPS ========== */
.help-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    font-size: 10px;
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
    border: 1px solid var(--border-primary);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.help-trigger:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.help-popover {
    position: absolute;
    z-index: 10000;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    width: 260px;
    box-shadow: var(--shadow-lg);
    animation: help-fade-in 0.15s ease;
}

@keyframes help-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.help-popover-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.help-popover-content {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========== COMMAND PALETTE ========== */
/* ══════════════════════════════════════════════════════════
   Command Palette v2 — Unified search overlay
   ══════════════════════════════════════════════════════════ */

/* Overlay */
.cp-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.cp-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Modal */
.cp-modal {
    position: fixed;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 640px;
    max-width: 92vw;
    z-index: 10002;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    max-height: 72vh;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.cp-modal.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Search bar */
.cp-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
}
.cp-search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    opacity: 0.6;
}
.cp-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    font-family: inherit;
    letter-spacing: -0.01em;
}
.cp-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}
.cp-esc {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 5px;
    padding: 2px 6px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

/* Category tabs */
.cp-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-primary);
    overflow-x: auto;
    scrollbar-width: none;
}
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    font-family: inherit;
}
.cp-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}
.cp-tab.active {
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.cp-tab-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(var(--theme-rgb), 0.15);
    color: var(--light-blue-theme);
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Results body */
.cp-body {
    flex: 1;
    overflow-y: auto;
    min-height: 120px;
    max-height: calc(72vh - 160px);
}
.cp-body::-webkit-scrollbar { width: 5px; }
.cp-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
.cp-body::-webkit-scrollbar-track { background: transparent; }
.cp-results {
    padding: 8px;
}

/* Group */
.cp-group {
    margin-bottom: 4px;
}
.cp-group-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    padding: 10px 12px 6px;
    font-weight: 700;
    opacity: 0.7;
}

/* Result item */
.cp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
}
.cp-item:hover,
.cp-item.selected {
    background: var(--bg-hover);
}
.cp-item.selected {
    background: rgba(var(--theme-rgb), 0.08);
}

/* Item icon */
.cp-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-elevated);
    color: var(--text-tertiary);
}
.cp-item-icon svg {
    width: 16px;
    height: 16px;
}
.cp-item-icon.pages {
    background: rgba(var(--theme-rgb), 0.1);
    color: var(--light-blue-theme);
}
.cp-item-icon.boards {
    background: rgba(139, 92, 246, 0.1);
    color: #A78BFA;
}
.cp-item-icon.cards {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}
.cp-item-icon.documents {
    background: rgba(251, 191, 36, 0.1);
    color: #FBBF24;
}
.cp-item-icon.actions {
    background: rgba(236, 72, 153, 0.1);
    color: #EC4899;
}

/* Item body */
.cp-item-body {
    flex: 1;
    min-width: 0;
}
.cp-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.cp-item-name mark {
    background: rgba(var(--theme-rgb), 0.25);
    color: var(--light-blue-theme);
    border-radius: 2px;
    padding: 0 1px;
}
.cp-item-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.cp-item-meta {
    margin-left: 6px;
    opacity: 0.6;
}
.cp-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Priority & due badges */
.cp-item-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cp-item-badge.high, .cp-item-badge.urgent {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}
.cp-item-badge.medium {
    background: rgba(234, 179, 8, 0.12);
    color: #EAB308;
}
.cp-item-badge.low {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}
.cp-item-due {
    font-size: 10px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Empty & loading states */
.cp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: var(--text-tertiary);
    font-size: 13px;
    text-align: center;
}
.cp-empty svg { opacity: 0.3; }

.cp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: var(--text-tertiary);
    font-size: 13px;
}
.cp-loading-dots {
    display: flex;
    gap: 6px;
}
.cp-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--light-blue-theme);
    animation: cp-dot-pulse 1.2s ease-in-out infinite;
}
.cp-loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.cp-loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cp-dot-pulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.1); }
}

/* Footer hints */
.cp-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-elevated);
    border-radius: 0 0 20px 20px;
}
.cp-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-tertiary);
    opacity: 0.6;
}
.cp-hint kbd {
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: inherit;
    line-height: 1.4;
}

/* ── Light mode overrides ── */
[data-theme="light"] .cp-modal {
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .cp-overlay {
    background: rgba(0, 0, 0, 0.3);
}
[data-theme="light"] .cp-item.selected {
    background: rgba(var(--theme-rgb), 0.06);
}
[data-theme="light"] .cp-footer {
    background: #f8f8fa;
}
[data-theme="light"] .cp-item-icon.boards { background: rgba(139, 92, 246, 0.07); }
[data-theme="light"] .cp-item-icon.cards { background: rgba(34, 197, 94, 0.07); }
[data-theme="light"] .cp-item-icon.documents { background: rgba(251, 191, 36, 0.07); }
[data-theme="light"] .cp-item-icon.actions { background: rgba(236, 72, 153, 0.07); }
[data-theme="light"] .cp-item-name mark {
    background: rgba(var(--theme-rgb), 0.15);
}
[data-theme="light"] .cp-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
}

/* ── Responsive ── */
@media (max-width: 680px) {
    .cp-modal {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .cp-modal.visible {
        transform: none;
    }
    .cp-footer { border-radius: 0; }
}

/* ========== AVATAR SYSTEM ========== */
.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-initials.small {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.avatar-initials.medium {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.avatar-initials.large {
    width: 64px;
    height: 64px;
    font-size: 22px;
}

.avatar-image {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
