/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Login ──────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 32px rgba(0,0,0,.07);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-brand {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -.5px;
}

.logo-sub {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 3px;
}

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.form-group textarea { resize: vertical; min-height: 72px; }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background .12s, opacity .12s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2563eb; }

.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover:not(:disabled) { background: #16a34a; }

.btn-danger  { background: #ef4444; color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #dc2626; }

.btn-ghost {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.btn-ghost:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }

.btn-sm  { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ── Header ─────────────────────────────────────────────── */
.app-header {
    background: #1e293b;
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}

.header-logo {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-nav { display: flex; gap: 2px; }

.nav-btn {
    padding: 6px 13px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all .12s;
    white-space: nowrap;
}
.nav-btn:hover  { color: #fff; background: rgba(255,255,255,.08); }
.nav-btn.active { color: #fff; background: rgba(255,255,255,.13); }

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    flex-shrink: 0;
}
.header-user .user-name { color: #e2e8f0; font-weight: 500; }

/* ── Timer Bar ──────────────────────────────────────────── */
.timer-bar {
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    padding: 9px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.timer-bar.hidden { display: none; }
.timer-label  { color: #64748b; }
.timer-task   { color: #1e293b; font-weight: 500; }
.timer-display {
    font-size: 17px;
    font-weight: 700;
    color: #3b82f6;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    margin-left: auto;
}

/* ── Layout ─────────────────────────────────────────────── */
.app-main {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.view { display: none; }
.view.active { display: block; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    font-size: 19px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -.3px;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 20px;
}

/* ── Task List ──────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 9px; }

.task-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: box-shadow .12s;
}
.task-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.task-item.done  { opacity: .58; }
.task-item.overdue { border-left: 3px solid #ef4444; }

.task-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    margin-top: 1px;
    user-select: none;
}
.task-check:hover { border-color: #22c55e; background: #f0fdf4; }
.task-check.done  { background: #22c55e; border-color: #22c55e; }
.task-check.done::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 700; }

.task-body { flex: 1; min-width: 0; }

.task-title { font-weight: 500; color: #1e293b; }
.task-item.done .task-title { text-decoration: line-through; color: #94a3b8; }

.task-desc { font-size: 13px; color: #64748b; margin: 4px 0; }

.task-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.task-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
}
.badge-pending     { background: #f1f5f9; color: #64748b; }
.badge-in-progress { background: #eff6ff; color: #3b82f6; }
.badge-done        { background: #f0fdf4; color: #16a34a; }
.badge-overdue     { background: #fef2f2; color: #ef4444; }
.badge-admin       { background: #faf5ff; color: #7c3aed; }

/* ── Kanban Board ───────────────────────────────────────── */
.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
}

.board-col {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
}

.board-col-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #64748b;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.board-col-count {
    background: #e2e8f0;
    color: #64748b;
    border-radius: 100px;
    padding: 1px 7px;
    font-size: 11px;
}

.board-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: box-shadow .12s;
}
.board-card:last-child { margin-bottom: 0; }
.board-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.board-card.overdue { border-left: 3px solid #ef4444; }

.board-card-title  { font-weight: 500; font-size: 13px; color: #1e293b; margin-bottom: 8px; }
.board-card-meta   { font-size: 12px; color: #94a3b8; display: flex; flex-direction: column; gap: 3px; }

/* ── Create Form ────────────────────────────────────────── */
.create-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.toggle-form-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.toggle-form-btn:hover { color: #2563eb; }

.collapsible { display: none; padding-top: 16px; }
.collapsible.open { display: block; }

/* ── Dashboard ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label { font-size: 12px; color: #94a3b8; font-weight: 500; }

/* ── Table ──────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #64748b;
    padding: 8px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #f8fafc; }

/* ── Empty / Loading ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #94a3b8;
    font-size: 14px;
}

.loading { text-align: center; padding: 32px; color: #94a3b8; font-size: 13px; }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #fff;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(6px);
    transition: all .2s;
    z-index: 9999;
    pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .board { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .app-main { padding: 14px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .header-nav .nav-btn { padding: 5px 8px; font-size: 12px; }
    .app-header { padding: 0 14px; }
    .header-logo { font-size: 13px; }
}
