:root {
    /* 2026 Ultra-Premium Palette */
    --bg-primary: #f0f4f8;
    --bg-secondary: rgba(255, 255, 255, 0.65);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: rgba(226, 232, 240, 0.6);
    
    /* Neon / Glow Accents */
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: #e0e7ff;
    --accent-glow: rgba(79, 70, 229, 0.25);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Modern Measurements & Radii */
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    
    /* 2026 Shadows */
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.03);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.08);
    --shadow-neon: 0 0 20px var(--accent-glow);
    
    /* Blur Base */
    --glass-blur: blur(16px);
}

[data-theme="dark"] {
    --bg-primary: #09090b;
    --bg-secondary: rgba(24, 24, 27, 0.65);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --border-color: rgba(63, 63, 70, 0.5);
    
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-light: rgba(99, 102, 241, 0.15);
    --accent-glow: rgba(99, 102, 241, 0.3);
    
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.05), transparent 25%), radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 25%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout */
.app-container { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; display: flex; flex-direction: column; width: 100%; margin-top: 70px; }

/* Header */
.top-header {
    height: 70px; background: var(--bg-secondary); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: fixed; top: 0; left: 0; right: 0; z-index: 1000; box-shadow: var(--shadow-sm);
}

.header-left, .header-right { display: flex; align-items: center; gap: 16px; }

.user-profile {
    display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 6px 14px; border-radius: 50px;
    background: rgba(0,0,0,0.03); border: 1px solid transparent; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.user-profile:hover { background: var(--bg-primary); border-color: var(--border-color); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.user-avatar {
    width: 32px; height: 32px; background: var(--accent); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem;
}
.user-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }

.theme-btn {
    background: var(--border-color); border: none; border-radius: 50px; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s;
}
.theme-btn:hover { background: var(--accent-light); transform: scale(1.1); }

/* Kanban Columns */
.kanban-columns-container { flex: 1; display: flex; gap: 24px; overflow-x: auto; padding: 24px; }
.kanban-column {
    min-width: 320px; max-width: 320px; background: var(--bg-secondary); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg); display: flex; flex-direction: column; height: 100%;
}
.column-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); }
.column-header span { font-weight: 800; font-size: 1.1rem; }
.column-header .count { font-size: 0.85rem; font-weight: 700; background: var(--accent-light); color: var(--accent); padding: 4px 12px; border-radius: 50px; }

.column-body { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; min-height: 250px; transition: background 0.2s; }
.column-body.drag-over { background: rgba(var(--accent), 0.05); }

/* Cards */
.kanban-card {
    background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius);
    padding: 12px 16px; box-shadow: var(--shadow-sm); transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); cursor: grab;
    position: relative; overflow: hidden; min-height: 80px;
}
.kanban-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.kanban-card.selected { border-color: var(--accent); background: var(--accent-light); }

.card-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.card-title { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); flex: 1; }
.card-icons-row { display: flex; gap: 8px; margin-top: 4px; height: 20px; transition: opacity 0.3s; }
.icon-indicator { font-size: 0.85rem; opacity: 0.6; }

.card-expanded-content { max-height: 0; overflow: hidden; opacity: 0; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.kanban-card:hover .card-expanded-content { max-height: 300px; opacity: 1; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-color); }
.kanban-card:hover .card-icons-row { opacity: 0; height: 0; margin: 0; }

.info-line { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; margin-bottom: 6px; }
.card-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; opacity: 0; transition: opacity 0.3s; }
.kanban-card:hover .card-actions { opacity: 1; }
.action-icon { color: var(--text-secondary); transition: 0.2s; }
.action-icon:hover { color: var(--accent); transform: scale(1.2); }

/* Modals */
.modal {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center; z-index: 3000; padding: 24px;
}
.modal-content.glass-panel {
    background: var(--bg-secondary); backdrop-filter: var(--glass-blur); border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden;
}

/* History Editor Specifics */
.btn-tool {
    width: 36px; height: 36px; border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--bg-primary); color: var(--text-primary); cursor: pointer; transition: 0.2s;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.btn-tool:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-color); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

/* Context Menu */
.context-menu {
    position: fixed; background: rgba(255,255,255,0.9); backdrop-filter: blur(16px);
    border: 1px solid var(--border-color); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 5000; min-width: 200px; padding: 8px 0;
}
[data-theme="dark"] .context-menu { background: rgba(24,24,27,0.9); }
.ctx-item { padding: 12px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 0.95rem; }
.ctx-item:hover { background: var(--accent-light); color: var(--accent); }
.ctx-item.text-danger { color: var(--danger); }

/* Bulk Popup */
.bulk-actions-popup {
    position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 20px; background: var(--text-primary);
    color: var(--bg-primary); padding: 16px 32px; border-radius: 100px;
    z-index: 2000; transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.bulk-actions-popup.active { bottom: 40px; }
.count-badge { background: var(--accent); color: white; padding: 4px 12px; border-radius: 50px; font-weight: 800; }

/* Utilities */
.btn { padding: 10px 24px; border-radius: 50px; border: 1px solid transparent; cursor: pointer; font-weight: 700; transition: 0.3s; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-secondary { background: var(--bg-primary); color: var(--text-primary); border-color: var(--border-color); }

.form-group { margin-bottom: 20px; }
.form-control { width: 100%; padding: 12px 16px; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--bg-primary); color: var(--text-primary); }
.hidden { display: none !important; }

/* Sidebar - Modern Premium Glass */
.sidebar {
    position: fixed; top: 0; left: -300px; width: 300px; height: 100%;
    background: var(--bg-secondary); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color); z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.sidebar.open { transform: translateX(300px); }

.sidebar-header {
    padding: 32px 24px; display: flex; align-items: center; justify-content: space-between;
}
.sidebar-header h2 {
    font-size: 1.4rem; font-weight: 800; background: linear-gradient(90deg, var(--accent), #10b981);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-close-btn { background: none; border: none; font-size: 1.2rem; color: var(--text-primary); cursor: pointer; }

.sidebar-nav { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

.nav-item {
    display: flex; align-items: center; padding: 14px 20px; color: var(--text-secondary);
    text-decoration: none; font-weight: 600; font-size: 1rem; border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); position: relative; overflow: hidden; z-index: 1;
}
.nav-item::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--accent); opacity: 0; transform: translateX(-100%);
    transition: transform 0.4s, opacity 0.4s; z-index: -1;
}
.nav-item:hover { color: var(--accent); background: var(--accent-light); transform: translateX(6px); }
.nav-item.active { color: white; }
.nav-item.active::before { opacity: 1; transform: translateX(0); }

.nav-item .icon { margin-right: 16px; font-size: 1.3rem; transition: transform 0.3s; }
.nav-item:hover .icon { transform: scale(1.15) rotate(5deg); }

.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3); backdrop-filter: blur(4px);
    z-index: 1900; display: none; opacity: 0; transition: opacity 0.4s;
}
.sidebar-overlay.active { display: block; opacity: 1; }

@media (min-width: 1024px) {
    .sidebar { left: 0; box-shadow: none; }
    .main-content { margin-left: 300px; }
    .top-header { left: 300px; width: calc(100% - 300px); }
    .sidebar.collapsed { width: 88px; }
    .sidebar.collapsed .text, .sidebar.collapsed h2 { display: none; }
    .sidebar.collapsed .nav-item { padding: 14px; justify-content: center; }
    .sidebar.collapsed .nav-item .icon { margin-right: 0; font-size: 1.5rem; }
    .sidebar.collapsed .sidebar-header { justify-content: center; padding: 24px 0; }
    .sidebar.collapsed ~ .main-content { margin-left: 88px; }
    .sidebar.collapsed ~ .main-content .top-header { left: 88px; width: calc(100% - 88px); }
    .collapse-toggle { display: flex !important; }
}
