:root {
    /* LIGHT THEME */
    --bg-main: #f1f5f9;
    --bg-secondary: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-primary: #6366f1;
    --accent-secondary: #3b82f6;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --input-bg: #f8fafc;
}

[data-theme="dark"] {
    /* DARK THEME */
    --bg-main: #0f172a;
    --bg-secondary: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #8b5cf6;
    --accent-secondary: #3b82f6;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --input-bg: rgba(15, 23, 42, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    font-size: 14px;
    /* Scale down entire UI */
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Glassmorphism utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* Layout */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 10;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.sidebar .logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar a:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-primary);
    transform: translateX(5px);
}

.sidebar a.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
    color: var(--accent-primary);
    border-right: 4px solid var(--accent-primary);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 3rem 4rem;
    max-width: 1400px;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

/* Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    padding: 2rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Typography */
h1,
h2,
h3 {
    color: var(--text-main);
    letter-spacing: -0.5px;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
}

h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Forms */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="color"],
select,
textarea {
    width: 100%;
    padding: 0.85rem 1.2rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Custom Checkbox */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-primary);
    border-radius: 6px;
    background: var(--input-bg);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Kanban */
.kanban-board {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
}

.kanban-column {
    min-width: 23rem;
    /* Scales with root font size */
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.5rem;
}

.kanban-column h3 {
    font-size: 1.1rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--accent-primary);
}

.kanban-item {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 12px;
    cursor: grab;
    border-left: 4px solid var(--accent-secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

[data-theme="dark"] .kanban-item {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.kanban-item:active {
    cursor: grabbing;
    transform: scale(0.98);
}

/* Utility */
.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 2rem;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.d-block {
    display: block;
}

/* Login Box */
.login-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-main) 100%);
    margin-left: -280px;
    /* offset sidebar */
}

.login-box {
    width: 450px;
    padding: 3.5rem 3rem;
    text-align: center;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: #fff;
    transform: rotate(15deg);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 1.2rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 600;
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 992px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 1.5rem;
    }

    .sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .sidebar a {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .main-content {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }

    .login-container {
        margin-left: 0;
    }

    .login-box {
        width: 90%;
        padding: 2.5rem 1.5rem;
    }

    .flex {
        flex-direction: column;
    }

    .kanban-board {
        padding-bottom: 1rem;
    }

    .card {
        padding: 1.5rem;
    }
}