/*
 * 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 — very subtle */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.45);
    --shadow-lg: 0 8px 28px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.55);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    /* 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: #f2f2f4;
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-card: #ffffff;
    --bg-elevated: #ededf0;
    --bg-hover: #e6e6ea;
    --bg-input: #f2f2f4;

    --text-primary: #141418;
    --text-secondary: #5c5c66;
    --text-tertiary: #9090a0;
    --text-inverse: #ffffff;

    --border-primary: #dddde2;
    --border-secondary: #c8c8d0;

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

[data-theme="light"] .user-avatar { border-color: #ffffff; }
[data-theme="light"] .header { background: #ffffff; border-bottom-color: #dddde2; }
[data-theme="light"] .modal { background: #ffffff; border-color: #dddde2; }
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.3); }
[data-theme="light"] .dropdown-menu { background: #ffffff; border-color: #dddde2; }
[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 ========== */
.sidebar {
    width: var(--sidebar-width); background: var(--bg-primary);
    border-right: 1px solid var(--border-primary);
    display: flex; flex-direction: column; position: fixed;
    top: 0; left: 0; bottom: 0; z-index: 100;
    transition: width 0.25s ease, transform var(--transition-normal); overflow: hidden;
}

.sidebar-header {
    padding: 14px 16px; border-bottom: 1px solid var(--border-primary);
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; min-height: var(--header-height);
}

/* ── 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: var(--text-tertiary);
    background: var(--bg-elevated); padding: 1px 6px; border-radius: 6px;
    flex-shrink: 0; line-height: 1.6;
}

/* ── Sidebar search ── */
.sidebar-search {
    padding: 8px 12px; position: relative;
}
.sidebar-search input {
    width: 100%; padding: 7px 12px 7px 32px;
    background: var(--bg-input); border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: inherit; font-size: 12px; transition: border-color var(--transition-fast);
}
.sidebar-search input:focus { outline: none; border-color: var(--border-focus); }
.sidebar-search input::placeholder { color: var(--text-tertiary); }
.sidebar-search > svg {
    position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
    color: var(--text-tertiary); pointer-events: none;
}
.sidebar-search-kbd {
    position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
    font-family: inherit; font-size: 10px; font-weight: 600;
    color: var(--text-tertiary); background: var(--bg-elevated);
    padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-primary);
    line-height: 1.5; pointer-events: none;
}

.sidebar-header-logos { flex: 1; min-width: 0; }
.sidebar-logo { height: 24px; }

.sidebar-logo-light { display: none !important; }
.sidebar-logo-dark { display: block !important; }
[data-theme="light"] .sidebar-logo-dark { display: none !important; }
[data-theme="light"] .sidebar-logo-light { display: block !important; }

.sidebar-nav { flex: 1; padding: 10px; overflow-y: auto; }
.sidebar-section { margin-bottom: 20px; }

.sidebar-section-title {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-tertiary); padding: 0 10px; margin-bottom: 6px;
    display: flex; align-items: center; justify-content: space-between;
}

.sidebar-toggle-btn {
    background: none; border: 1px solid var(--border-primary); color: var(--text-tertiary);
    cursor: pointer; padding: 4px; border-radius: 6px; display: flex; align-items: center;
    justify-content: center; transition: all 0.15s; flex-shrink: 0; width: 28px; height: 28px;
}
.sidebar-toggle-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-secondary); }
.sidebar-toggle-expand { display: none; }
.sidebar.collapsed .sidebar-toggle-collapse { display: none; }
.sidebar.collapsed .sidebar-toggle-expand { display: block; }

.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .sidebar-header { padding: 12px 8px; justify-content: center; }
.sidebar.collapsed .sidebar-brand-name,
.sidebar.collapsed .sidebar-brand-version,
.sidebar.collapsed .sidebar-brand-logo-wide,
.sidebar.collapsed .sidebar-header-logos { display: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; }
.sidebar.collapsed .sidebar-search { display: none; }
.sidebar.collapsed .sidebar-toggle-btn { width: 32px; height: 32px; }
.sidebar.collapsed .sidebar-nav { padding: 8px 6px; }
.sidebar.collapsed .sidebar-section-title { display: none; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 10px; gap: 0; font-size: 0; }
.sidebar.collapsed .sidebar-link span { display: none; }
.sidebar.collapsed .sidebar-link .icon { width: 20px; height: 20px; }
.sidebar.collapsed .sidebar-link img { width: 20px; height: 20px; }
.sidebar.collapsed .sidebar-link img + span { display: none; }
.sidebar.collapsed .sidebar-link-badge { display: none; }
.sidebar.collapsed .sidebar-link.active::before { display: none; }
.sidebar.collapsed .sf-user-details { display: none; }
.sidebar.collapsed .sf-user-card { justify-content: center; }
.sidebar.collapsed .sf-quick-actions { display: none; }
.sidebar.collapsed .sidebar-footer { padding: 8px 4px; }
.sidebar.collapsed ~ .main-content { margin-left: 56px; }

.sidebar-link {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    border-radius: var(--radius-sm); color: var(--text-secondary);
    font-size: 13px; font-weight: 500; transition: all var(--transition-fast); cursor: pointer;
    position: relative; text-decoration: none;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-link.active { background: rgba(var(--theme-rgb), 0.08); color: var(--light-blue-theme); }
.sidebar-link.active::before {
    content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
    background: var(--light-blue-theme); border-radius: 0 3px 3px 0;
}
.sidebar-link .icon { width: 18px; height: 18px; opacity: 0.5; flex-shrink: 0; }
.sidebar-link:hover .icon { opacity: 0.85; }
.sidebar-link.active .icon { opacity: 1; }

/* Badge in sidebar link (e.g. board count) */
.sidebar-link-badge {
    margin-left: auto; font-size: 10px; font-weight: 700; color: var(--text-tertiary);
    background: var(--bg-elevated); padding: 1px 7px; border-radius: 8px; flex-shrink: 0;
}
.sidebar-link.active .sidebar-link-badge { background: rgba(var(--theme-rgb), 0.12); color: var(--light-blue-theme); }
.sidebar-link.disabled { opacity: 0.45; pointer-events: auto; cursor: default; }
.sidebar-link.disabled:hover { background: transparent; color: var(--text-tertiary); }
.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.1);
    padding: 2px 7px; border-radius: 6px; flex-shrink: 0; text-transform: uppercase;
}
.sidebar.collapsed .sidebar-soon-badge { display: none; }

/* Board logo / dot in sidebar */
.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-footer { padding: 12px; border-top: 1px solid var(--border-primary); }

.main-content {
    flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column;
    min-height: 100vh; transition: margin-left 0.25s ease;
}

/* ========== HEADER ========== */
.top-header {
    height: var(--header-height); background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; position: sticky; top: 0; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-title { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.header-right { display: flex; align-items: center; gap: 10px; }

.timer-widget { display: flex; align-items: center; gap: 8px; }
.timer-display { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-secondary); min-width: 50px; display: none; }
.timer-display.timer-running { color: var(--bright-green); }
[data-theme="light"] .timer-display { color: #374151; }
[data-theme="light"] .timer-display.timer-running { color: #15803d; }
.header-btn.timer-active { border-color: rgba(146,254,101,0.5); color: var(--bright-green); }
[data-theme="light"] .header-btn.timer-active { border-color: rgba(22,163,74,0.4); color: #16a34a; }
.timer-dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--bright-green); animation: pulse 2s infinite; }
[data-theme="light"] .timer-dot { background: #16a34a; }

.header-btn {
    width: 34px; height: 34px; border-radius: var(--radius-sm); background: transparent;
    border: 1px solid var(--border-primary); color: var(--text-tertiary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast); position: relative;
}
.header-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-secondary); }
.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: 24px; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.page-subtitle { color: var(--text-secondary); font-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: var(--light-blue-theme); color: #000; }
.btn-primary:hover { box-shadow: 0 4px 18px rgba(var(--theme-rgb), 0.25); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-secondary); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-success { background: var(--bright-green); color: var(--text-inverse); }
.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); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.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.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(--bg-secondary); border: 1px solid var(--border-primary); border-radius: var(--radius-lg); padding: 22px; }
.ui-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ui-card-title { font-size: 14px; font-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; overflow: hidden; }
.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: var(--bg-elevated); border: 1px solid var(--border-primary); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 12px; font-weight: 500; cursor: pointer; transition: all var(--transition-fast); }
.filter-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.filter-btn.active { background: rgba(var(--theme-rgb), 0.08); border-color: rgba(var(--theme-rgb), 0.2); color: var(--light-blue-theme); }

.kanban-container { flex: 1; display: flex; gap: 10px; padding: 14px 20px; overflow-x: auto; align-items: flex-start; }

.kanban-list { width: 280px; min-width: 280px; background: var(--bg-secondary); border-radius: var(--radius-md); border: 1px solid var(--border-primary); display: flex; flex-direction: column; max-height: calc(100vh - var(--header-height) - 90px); }
.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.65); backdrop-filter: blur(6px); 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: var(--bg-elevated); border: 1px solid var(--border-secondary); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 180px; padding: 5px; z-index: 200; display: none; }
.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: var(--bg-hover); 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: var(--bg-elevated); border: 1px solid var(--border-secondary);
    border-radius: 12px; padding: 14px 40px 14px 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.28), 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 { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .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); }

/* ========== SIDEBAR FOOTER ========== */
.sf-user-card {
    display: flex; align-items: center; gap: 10px; padding: 0 4px;
}
.sf-user-details { flex: 1; min-width: 0; }
.sf-user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.sf-user-role { font-size: 10px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-quick-actions { display: flex; gap: 2px; flex-shrink: 0; }
.sf-action-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 28px; border-radius: var(--radius-sm); color: var(--text-tertiary); text-decoration: none; transition: all var(--transition-fast); }
.sf-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.sf-action-danger:hover { background: rgba(239, 68, 68, 0.08); color: var(--color-danger); }

/* ========== 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: var(--text-tertiary);
}
.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); }
