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

:root {
    --primary:       #4A90D9;
    --primary-dark:  #357ABD;
    --success:       #27AE60;
    --success-dark:  #219A52;
    --warning:       #F39C12;
    --danger:        #E74C3C;
    --light:         #F4F6F8;
    --dark:          #2C3E50;
    --gray:          #7F8C8D;
    --border:        #DDE1E7;
    --shadow:        0 2px 10px rgba(0,0,0,0.08);
    --radius:        10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #EEF2F7;
    color: var(--dark);
    line-height: 1.55;
    min-height: 100vh;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-brand {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.3px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nav-user {
    font-size: 0.9rem;
    color: var(--gray);
}

/* ── Container ───────────────────────────────────────────────────────────── */
.container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 7px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    text-align: center;
    white-space: nowrap;
    font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(74,144,217,0.35); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: var(--success-dark); }
.btn-outline { background: white; border: 1.5px solid var(--border); color: var(--gray); }
.btn-outline:hover { background: var(--light); border-color: #bbb; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.82rem; border-radius: 6px; }
.btn-full { width: 100%; display: block; }
.btn-row { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 7px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
.alert-error   { background: #FDECEA; color: #C0392B; border: 1px solid #F5C6CB; }
.alert-success { background: #D5F5E3; color: #1A7A42; border: 1px solid #A9DFBF; }
.alert-info    { background: #D6EAF8; color: #1A5276; border: 1px solid #AED6F1; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--dark);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 0.97rem;
    font-family: inherit;
    color: var(--dark);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.hint { font-size: 0.78rem; color: var(--gray); margin-top: 0.3rem; }

/* ── Auth card ───────────────────────────────────────────────────────────── */
.auth-card {
    max-width: 420px;
    margin: 4rem auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.auth-header h1 { font-size: 1.7rem; color: var(--primary); margin-bottom: 0.3rem; font-weight: 800; }
.auth-header p { color: var(--gray); font-size: 0.95rem; }

/* ── Setup card ──────────────────────────────────────────────────────────── */
.setup-card {
    max-width: 660px;
    margin: 2.5rem auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 2.5rem 2.5rem;
}
.setup-header { margin-bottom: 1.75rem; }
.setup-header h1 { font-size: 1.5rem; color: var(--primary); font-weight: 800; margin-bottom: 0.3rem; }
.setup-header p { color: var(--gray); font-size: 0.95rem; }

.step-indicator {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 1.75rem;
}
.step-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.2s;
}
.step-dot.active { background: var(--primary); }
.step-dot.done   { background: var(--success); }

.user-form-block {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 0.25rem;
    margin-bottom: 1rem;
    background: var(--light);
}
.user-form-block h3 {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
}
.zone-tasks-block {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 0.5rem;
    margin-bottom: 1rem;
    background: var(--light);
}
.zone-tasks-block h3 {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card-other {
    background: #FAFBFC;
    border: 1.5px solid var(--border);
    box-shadow: none;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid var(--light);
}
.card-title    { font-size: 1rem; font-weight: 700; color: var(--dark); }
.card-subtitle { font-size: 0.8rem; color: var(--gray); margin-top: 0.15rem; }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.week-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius);
    padding: 1.1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 14px rgba(74,144,217,0.3);
}
.week-date  { font-size: 0.82rem; opacity: 0.85; margin-bottom: 0.1rem; }
.week-label { font-size: 1rem; font-weight: 700; }
.week-counter { text-align: right; }
.week-counter-label { font-size: 0.78rem; opacity: 0.8; }
.week-counter-num   { font-size: 2.2rem; font-weight: 800; line-height: 1; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 640px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .setup-card { padding: 1.5rem 1.25rem; }
    .auth-card  { margin: 2rem auto; padding: 2rem 1.25rem; }
}

/* ── Task items ──────────────────────────────────────────────────────────── */
.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--light);
    gap: 0.5rem;
}
.task-item:last-child { border-bottom: none; }
.task-item form { margin: 0; flex-shrink: 0; }
.task-info  { flex: 1; min-width: 0; }
.task-name  { font-weight: 500; font-size: 0.95rem; }
.task-done  { text-decoration: line-through; color: var(--gray); }
.task-zone  { font-size: 0.78rem; color: var(--gray); margin-top: 0.1rem; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-pending { background: #FEF3CD; color: #7D5A00; }
.badge-done    { background: #D5F5E3; color: #1A7A42; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 1.75rem 0;
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ── Details toggle ──────────────────────────────────────────────────────── */
.completed-toggle {
    margin-top: 0.75rem;
    border-top: 1px dashed var(--border);
    padding-top: 0.5rem;
}
.completed-toggle summary {
    font-size: 0.82rem;
    color: var(--gray);
    cursor: pointer;
    user-select: none;
    padding: 0.3rem 0;
}
.completed-toggle summary:hover { color: var(--dark); }
