*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f8fafc; color: #1e293b; font-size: 15px; }
a { color: inherit; text-decoration: none; }

/* Layout */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 230px; min-height: 100vh;
    background: #1e1b4b;
    display: flex; flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease;
}
.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1rem; border-bottom: 1px solid #312e81;
}
.logo { font-size: 1.2rem; font-weight: 800; color: #a5b4fc; letter-spacing: 3px; }
.sidebar-close { display: none; background: none; border: none; color: #a5b4fc; cursor: pointer; font-size: 1.1rem; }

nav { flex: 1; padding: 0.75rem 0; }
.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 1.25rem; color: #c7d2fe;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: #312e81; color: #e0e7ff; }
.nav-item.active { background: #312e81; color: #fff; border-left-color: #818cf8; font-weight: 500; }
.nav-icon { width: 1.25rem; text-align: center; }

.sidebar-footer { padding: 1rem; border-top: 1px solid #312e81; display: flex; flex-direction: column; gap: 0.5rem; }
.lang-toggle, .logout-btn {
    text-align: center; padding: 0.45rem; border-radius: 6px;
    font-size: 0.82rem; cursor: pointer; display: block;
}
.lang-toggle { color: #a5b4fc; border: 1px solid #312e81; }
.lang-toggle:hover { background: #312e81; color: #e0e7ff; }
.logout-btn { color: #fca5a5; background: rgba(239,68,68,0.1); }
.logout-btn:hover { background: rgba(239,68,68,0.2); }

/* Main */
.main { margin-left: 230px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* Topbar */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: #fff; border-bottom: 1px solid #e2e8f0;
    padding: 0.8rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
}
.menu-btn { display: none; background: none; border: none; cursor: pointer; font-size: 1.25rem; color: #475569; }
.topbar-title { flex: 1; font-weight: 600; color: #1e293b; font-size: 0.95rem; text-transform: capitalize; }
.user-info { font-size: 0.82rem; color: #64748b; background: #f1f5f9; padding: 0.3rem 0.75rem; border-radius: 100px; }

/* Content */
.content { padding: 1.5rem; flex: 1; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.page-title { font-size: 1.2rem; font-weight: 700; color: #1e293b; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: 10px; padding: 1.25rem; border: 1px solid #e2e8f0; }
.stat-num { font-size: 2rem; font-weight: 700; color: #4f46e5; line-height: 1; }
.stat-num.green { color: #10b981; }
.stat-num.red { color: #ef4444; }
.stat-num.blue { color: #3b82f6; }
.stat-label { font-size: 0.78rem; color: #64748b; margin-top: 0.3rem; text-transform: uppercase; letter-spacing: 0.3px; }

/* Cards */
.card { background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; padding: 1.25rem; margin-bottom: 1rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title { font-size: 0.95rem; font-weight: 600; color: #1e293b; }

/* Projects grid */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.project-card { background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.project-card-title { font-size: 1rem; font-weight: 600; }
.project-card-desc { font-size: 0.84rem; color: #64748b; line-height: 1.5; flex: 1; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.project-card-meta { font-size: 0.78rem; color: #94a3b8; }

/* Progress bar */
.progress-wrap { margin: 0.25rem 0; }
.progress-bar { height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: #4f46e5; border-radius: 3px; transition: width 0.3s; }
.progress-label { font-size: 0.75rem; color: #64748b; margin-top: 0.2rem; }

/* Badges */
.badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 100px;
    font-size: 0.73rem; font-weight: 500; white-space: nowrap;
}
.badge-todo { background: #f1f5f9; color: #475569; }
.badge-inprogress { background: #dbeafe; color: #1d4ed8; }
.badge-done { background: #d1fae5; color: #065f46; }
.badge-active { background: #dbeafe; color: #1d4ed8; }
.badge-paused { background: #fef9c3; color: #854d0e; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-low { background: #f1f5f9; color: #475569; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-high { background: #fee2e2; color: #991b1b; }
.badge-admin { background: #ede9fe; color: #5b21b6; }
.badge-member { background: #f1f5f9; color: #475569; }

/* Tasks */
.tasks-list { display: flex; flex-direction: column; gap: 0.5rem; }
.task-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.875rem 1rem; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 8px;
    border-left: 4px solid #e2e8f0;
}
.task-item.priority-high { border-left-color: #ef4444; }
.task-item.priority-medium { border-left-color: #f59e0b; }
.task-item.priority-low { border-left-color: #10b981; }
.task-item.priority-none { border-left-color: #cbd5e1; }
.task-title { flex: 1; font-weight: 500; font-size: 0.9rem; }
.task-meta { font-size: 0.78rem; color: #94a3b8; display: flex; flex-direction: column; gap: 0.1rem; text-align: right; }
.task-actions { display: flex; gap: 0.4rem; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.kanban-col { background: #f8fafc; border-radius: 10px; padding: 1rem; min-height: 200px; }
.kanban-col-header {
    font-weight: 600; font-size: 0.78rem; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 0.75rem; color: #475569;
    display: flex; align-items: center; justify-content: space-between;
}
.kanban-count { background: #e2e8f0; color: #64748b; border-radius: 100px; padding: 0.1rem 0.5rem; font-size: 0.72rem; }
.kanban-task {
    background: #fff; border-radius: 8px; border: 1px solid #e2e8f0;
    padding: 0.875rem; margin-bottom: 0.5rem;
}
.kanban-task-title { font-weight: 500; font-size: 0.88rem; margin-bottom: 0.5rem; }
.kanban-task-meta { font-size: 0.75rem; color: #94a3b8; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.25rem; }
.kanban-task-actions { display: flex; gap: 0.35rem; margin-top: 0.5rem; }

/* Deadline colors */
.deadline-ok { color: #059669; }
.deadline-soon { color: #d97706; }
.deadline-overdue { color: #dc2626; font-weight: 500; }

/* Forms */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: 0.84rem; font-weight: 500; color: #374151; margin-bottom: 0.35rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
select, textarea {
    width: 100%; padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 0.9rem; color: #1e293b; background: #fff;
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.5rem 1rem; border-radius: 6px; border: none;
    font-size: 0.85rem; font-weight: 500; cursor: pointer;
    text-decoration: none; transition: all 0.15s; font-family: inherit;
    white-space: nowrap;
}
.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: #d1fae5; color: #065f46; }
.btn-success:hover { background: #a7f3d0; }
.btn-warning { background: #fef3c7; color: #92400e; }
.btn-warning:hover { background: #fde68a; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn-full { width: 100%; justify-content: center; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.75rem 1rem; font-size: 0.75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 2px solid #e2e8f0; }
td { padding: 0.75rem 1rem; font-size: 0.875rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* Filter bar */
.filter-bar { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar select { width: auto; min-width: 140px; }

/* Modal */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45); z-index: 200;
    align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff; border-radius: 12px; padding: 1.5rem;
    width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: #6b7280; padding: 0.25rem; }
.modal-close:hover { color: #1e293b; }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state-text { font-size: 0.9rem; }

/* Project header info */
.project-info { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.75rem; }
.project-info-item { font-size: 0.84rem; color: #64748b; }
.project-info-item strong { color: #1e293b; }

/* Section heading */
.section-title { font-size: 0.85rem; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.75rem; }

/* Login */
.login-body { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-card { background: #fff; border-radius: 16px; padding: 2rem; width: 100%; max-width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-logo { font-size: 2rem; font-weight: 800; color: #4f46e5; text-align: center; letter-spacing: 4px; margin-bottom: 0.25rem; }
.login-subtitle { text-align: center; font-size: 0.88rem; color: #64748b; margin-bottom: 1.75rem; }
.lang-toggle-login { color: #6366f1; font-size: 0.82rem; }

/* Divider */
.divider { height: 1px; background: #e2e8f0; margin: 1.25rem 0; }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.two-col-wide { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }

/* Responsive */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .main { margin-left: 0; }
    .menu-btn { display: block; }
    .kanban { grid-template-columns: 1fr; }
    .two-col, .two-col-wide { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .content { padding: 1rem; }
    .filter-bar { flex-direction: column; }
    .filter-bar select { width: 100%; }
    .task-meta { display: none; }
}