:root {
    --sidebar-bg: #1f2937;
    --sidebar-fg: #cbd5e1;
    --sidebar-active: #2563eb;
    --content-bg: #f3f4f6;
    --card-bg: #ffffff;
}

body {
    background: var(--content-bg);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    flex-shrink: 0;
    display: flex; flex-direction: column;
}
.sidebar .brand {
    padding: 18px 20px;
    font-size: 1.2rem; font-weight: 700; color: #fff;
    border-bottom: 1px solid #374151;
    display: flex; align-items: center; gap: 8px;
}
.menu { padding: 12px 8px; }
.menu-section {
    padding: 12px 12px 6px;
    font-size: 0.7rem; text-transform: uppercase; color: #6b7280; letter-spacing: 0.05em;
}
.menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; margin: 2px 0;
    color: var(--sidebar-fg); text-decoration: none;
    border-radius: 8px; font-size: 0.92rem;
}
.menu-item:hover { background: #374151; color: #fff; }
.menu-item.active { background: var(--sidebar-active); color: #fff; }
.menu-item i { font-size: 1.05rem; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: #fff; padding: 12px 24px;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid #e5e7eb;
}
.content { padding: 24px; flex: 1; }

.stat-card {
    background: var(--card-bg); border-radius: 12px; padding: 18px;
    border-left: 4px solid var(--sidebar-active);
    height: 100%;
}
.stat-card .label { color: #6b7280; font-size: 0.85rem; }
.stat-card .value { font-size: 1.8rem; font-weight: 700; color: #111827; }

.stat-card.todo        { border-left-color: #6b7280; }
.stat-card.in_progress { border-left-color: #2563eb; }
.stat-card.waiting     { border-left-color: #f59e0b; }
.stat-card.review      { border-left-color: #8b5cf6; }
.stat-card.completed   { border-left-color: #10b981; }
.stat-card.overdue     { border-left-color: #ef4444; }

.card-clean {
    background: #fff; border-radius: 12px; border: 1px solid #e5e7eb;
}
.card-clean .card-header {
    background: transparent; border-bottom: 1px solid #e5e7eb; font-weight: 600;
}

/* Status / priority pills */
.pill {
    display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 500;
}
.pill-todo        { background: #e5e7eb; color: #374151; }
.pill-in_progress { background: #dbeafe; color: #1d4ed8; }
.pill-waiting     { background: #fef3c7; color: #92400e; }
.pill-review      { background: #ede9fe; color: #5b21b6; }
.pill-completed   { background: #d1fae5; color: #065f46; }
.pill-overdue     { background: #fee2e2; color: #991b1b; }
.pill-cancelled   { background: #1f2937; color: #fff; }

.pill-low      { background: #e5e7eb; color: #374151; }
.pill-medium   { background: #cffafe; color: #155e75; }
.pill-high     { background: #fed7aa; color: #9a3412; }
.pill-critical { background: #fecaca; color: #991b1b; }

/* Sheet / table */
.sheet-table {
    width: 100%; border-collapse: collapse; background: #fff; font-size: 0.9rem;
}
.sheet-table th {
    background: #f9fafb; position: sticky; top: 0; z-index: 2;
    border: 1px solid #e5e7eb; padding: 10px 8px; text-align: left;
}
.sheet-table td {
    border: 1px solid #e5e7eb; padding: 6px 8px; vertical-align: middle;
}
.sheet-table tr.row-overdue td   { background: #fef2f2; }
.sheet-table tr.row-warning td   { background: #fffbeb; }
.sheet-table tr.row-completed td { color: #6b7280; }

.sheet-table .inline-edit {
    width: 100%; border: none; background: transparent; padding: 2px 4px;
}
.sheet-table .inline-edit:focus { background: #fffbeb; outline: 1px solid #2563eb; }

.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col {
    flex: 0 0 280px; background: #f9fafb; border-radius: 10px;
    border: 1px solid #e5e7eb; max-height: 80vh; display: flex; flex-direction: column;
}
.kanban-col h6 { padding: 10px; margin: 0; border-bottom: 1px solid #e5e7eb; }
.kanban-cards { padding: 8px; overflow-y: auto; }
.kanban-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 10px; margin-bottom: 8px; font-size: 0.85rem;
}
.kanban-card .name { font-weight: 600; color: #111827; }
.kanban-card .meta { color: #6b7280; font-size: 0.75rem; margin-top: 4px; }

.login-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1f2937, #2563eb);
}
.login-card {
    background: #fff; padding: 32px; border-radius: 14px; width: 360px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s; z-index: 999; }
    .sidebar.open { transform: translateX(0); }
}
