﻿﻿/* ── Reset & Variables ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:      #2563eb;
    --primary-dark: #1d4ed8;
    --danger:       #dc2626;
    --success:      #16a34a;
    --text:         #111827;
    --muted:        #6b7280;
    --border:       #e5e7eb;
    --bg:           #f3f4f6;
    --surface:      #ffffff;
    --radius:       10px;
    --shadow:       0 4px 16px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Auth layout ─────────────────────────────────────────── */
.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
    padding: 44px 36px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.auth-logo p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.auth-step { display: none; }
.auth-step.active { display: block; }

.auth-step h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-step .subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ── Form elements ───────────────────────────────────────── */
.field { 
    margin-bottom: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s;
}

.field input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.field input::placeholder { color: #9ca3af; }

/* PIN / OTP cell rows */
.pin-row, .otp-row {
    display: flex;
    gap: 6px;
    justify-content: space-between;
    flex-wrap: wrap;
    overflow: hidden;
}

.pin-row input, .otp-row input {
    flex: 1;
    min-width: 0;
    width: 48px;
    height: 56px;
    box-sizing: border-box;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s;
}

.otp-row input { width: 44px; height: 52px; font-size: 20px; }

.pin-row input:focus, .otp-row input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    margin-top: 20px;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-ghost {
    background: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    width: auto;
    display: inline;
    padding: 0;
    margin: 0;
    border: none;
    cursor: pointer;
}
.btn-ghost:hover { text-decoration: underline; }

/* Alert */
.alert {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    display: none;
}
.alert.show { display: block; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); }

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    margin-bottom: 20px;
    background: none;
    border: none;
    padding: 0;
}


/* Auth footer */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--muted);
}
.auth-footer button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}
.auth-footer button:hover { text-decoration: underline; }

.resend-row {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
}

/* ── Dashboard nav ───────────────────────────────────────── */
.dash-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dash-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.dash-nav .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.dash-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    font-size: 13px;
    color: var(--muted);
}

.list-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.btn-create-team {
    padding: 8px 12px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-create-team:hover { background: #1d4ed8; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2); }
.create-team-icon {
    font-weight: 700;
    font-size: 16px;
}
.create-team-text {
    display: inline;
}

.btn-logout {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-logout:hover { background: var(--bg); }

/* ── Home page ───────────────────────────────────────────── */
.home-main {
    flex: 1;
    padding: 16px 5%;
    width: 100%;
    box-sizing: border-box;
}

.home-heading {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.home-sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px;
}

.home-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Draggable item list ─────────────────────────────────── */
.item-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    user-select: none;
    transition: box-shadow 0.18s, border-color 0.18s, transform 0.15s;
    position: relative;
}

.item-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.09);
    border-color: #d1d5db;
}

.item-card:active { transform: scale(0.99); }

/* drag handle */
.drag-handle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 2px;
    opacity: 0.35;
    cursor: grab;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.drag-handle:active { cursor: grabbing; }
.item-card:hover .drag-handle { opacity: 0.65; }

.drag-handle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* icon circle */
.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.item-icon.personal { background: #ede9fe; }
.item-icon.team     { background: #dbeafe; }

/* body: 2-row layout */
.item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.item-row2 {
    display: flex;
    justify-content: flex-end;
}

/* text */
.item-text { flex: 1; min-width: 0; }

.item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* role pill */
.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 99px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.role-owner  { background: #ede9fe; color: #7c3aed; }
.role-admin  { background: #dbeafe; color: #2563eb; }
.role-member { background: #dcfce7; color: #16a34a; }
.role-icon   { font-size: 13px; line-height: 1; }

/* chevron arrow */
.item-arrow {
    background: #1e3a8a;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.item-arrow:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}
.item-arrow svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

/* ── Todo count badges ────────────────────────────── */
.todo-counts {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    align-items: center;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.count-pending  { background: #fee2e2; color: #dc2626; }
.count-progress { background: #fef9c3; color: #ca8a04; }
.count-done     { background: #dcfce7; color: #16a34a; }

.count-badge svg { flex-shrink: 0; }

/* dragging state */
.item-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--primary);
    box-shadow: none;
}

.item-card.drag-over {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* loading / empty state */
.list-state {
    text-align: center;
    padding: 40px 0;
    color: var(--muted);
    font-size: 14px;
}

.list-state .spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   TODOS PAGE
   ══════════════════════════════════════════════════════════ */

/* Nav extras */
.back-link {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    margin: 0;
    border-radius: 8px;
    border: none;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
    padding: 0;
    line-height: 1;
}

.back-link:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}

.back-link:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

.back-link svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* Login back button */
.login-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
    margin-bottom: 20px;
}

.login-back-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.login-back-btn:active {
    transform: translateY(0);
}

.brand { display: flex; align-items: center; gap: 4px; }
.brand-text { font-size: 18px; font-weight: 700; color: var(--primary); }
.brand-text-link { 
    text-decoration: none; 
    display: flex; 
    align-items: center;
    transition: opacity 0.15s;
}
.brand-text-link:hover {
    opacity: 0.8;
}

/* Main layout */
.todos-main {
    flex: 1;
    padding: 28px 5%;
    width: 100%;
    box-sizing: border-box;
}

/* Page header */
.todos-header {
    margin-bottom: 20px;
}
.todos-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.todos-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.todos-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

/* Add button */
.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.18s, box-shadow 0.18s;
}
.btn-add:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(37,99,235,0.25); }

/* Filter pills */
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    align-items: center;
    justify-content: space-between;
}
.filter-pills-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s;
}
.filter-pill:hover  { border-color: var(--primary); color: var(--primary); }
.filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-pending  { background: #dc2626; }
.dot-progress { background: #ca8a04; }
.dot-done     { background: #16a34a; }
.pill-count { font-weight: 500; opacity: 0.85; }

/* Member selector */
.member-selector-wrap {
    position: relative;
    flex-shrink: 0;
}
.member-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--muted);
    white-space: nowrap;
    transition: all 0.15s;
}
.member-selector-btn:hover { border-color: var(--primary); color: var(--primary); }
.member-label { display: inline; }

.member-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 30;
    overflow: hidden;
}
.member-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s;
}
.member-option:hover { background: var(--bg); }
.member-option.is-active { background: #eff6ff; color: var(--primary); font-weight: 600; }

.hidden { display: none !important; }

/* Progress bar */
.progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.progress-track {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--success);
    border-radius: 99px;
    transition: width 0.4s ease;
    width: 0%;
}
.progress-label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

/* Task list */
.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.task-empty {
    text-align: center;
    padding: 48px 0;
    color: var(--muted);
    font-size: 14px;
}
.task-empty .spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 12px;
}

/* Task card */
.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    position: relative;
    overflow: visible;
    transition: box-shadow 0.18s, border-color 0.18s;
}
.task-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #d1d5db; }

/* Left priority stripe */
.task-priority-bar { width: 4px; flex-shrink: 0; }
.priority-high   .task-priority-bar { background: #dc2626; }
.priority-medium .task-priority-bar { background: #f59e0b; }
.priority-low    .task-priority-bar { background: #6b7280; }

.task-body { flex: 1; padding: 14px 16px; min-width: 0; position: relative; }
.task-top  { display: flex; align-items: flex-start; gap: 12px; }
.task-left { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }

/* Status toggle button */
.status-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    border-radius: 50%;
    transition: transform 0.15s;
    margin-top: 1px;
}
.status-toggle:hover { transform: scale(1.15); }
.status-toggle.st-pending  svg { stroke: #9ca3af; }
.status-toggle.st-progress svg { stroke: #ca8a04; }
.status-toggle.st-done     svg { stroke: #16a34a; }

/* Task info */
.task-info { flex: 1; min-width: 0; }
.task-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
    line-height: 1.4;
}
.done-title { text-decoration: line-through; color: var(--muted); }
.task-desc {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.5;
    word-break: break-word;
}
.task-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
    justify-content: flex-end;
}

/* Badges */
.task-badge, .status-badge, .task-assigned, .task-due {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
}
.task-badge { cursor: pointer; user-select: none; }
.pr-high   { background: #fee2e2; color: #dc2626; }
.pr-med    { background: #fef3c7; color: #d97706; }
.pr-low    { background: #f3f4f6; color: #6b7280; }
.st-pending  { background: #fef2f2; color: #dc2626; }
.st-progress { background: #fefce8; color: #ca8a04; }
.st-done     { background: #f0fdf4; color: #16a34a; }
.task-assigned { background: #eff6ff; color: #2563eb; font-weight: 500; }
.task-due      { background: #f3f4f6; color: var(--muted); font-weight: 500; }
.task-due.overdue { background: #fee2e2; color: #dc2626; }

/* Priority selector popover */
.priority-popover {
    position: fixed;
    z-index: 20;
    min-width: 170px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.14);
    padding: 10px;
}
.priority-popover-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding: 2px 6px 8px;
}
.priority-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.priority-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.priority-option:hover {
    transform: translateY(-1px);
    border-color: currentColor;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.priority-option.is-active {
    box-shadow: inset 0 0 0 1px currentColor;
}
.priority-option.pr-low { color: #6b7280; background: #f9fafb; }
.priority-option.pr-med { color: #d97706; background: #fffbeb; }
.priority-option.pr-high { color: #dc2626; background: #fff1f2; }
.priority-check { font-size: 12px; }

/* Status selector popover */
.status-popover {
    position: fixed;
    z-index: 20;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.14);
    padding: 10px;
}
.status-popover-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding: 2px 6px 8px;
}
.status-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.status-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.status-option:hover {
    transform: translateY(-1px);
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
}
.status-option.is-active {
    box-shadow: inset 0 0 0 1px #2563eb;
    background: #eff6ff;
}
.status-check { font-size: 12px; color: #16a34a; }

/* Member assignment popover */
.member-assign-btn {
    border: none;
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.member-assign-btn:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.task-info-btn {
    border: none;
    background: transparent;
    color: #6b7280;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.task-info-btn:hover {
    background: #f0fdf4;
    color: #16a34a;
}

.assign-popover {
    position: fixed;
    z-index: 20;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.14);
    padding: 10px;
}
.assign-popover-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding: 2px 6px 8px;
}
.assign-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.assign-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.assign-option:hover {
    transform: translateY(-1px);
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
}
.assign-option.assign-unassign {
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
    padding-top: 8px;
}
.assign-check {
    font-size: 12px;
    color: #16a34a;
}

/* Task information popover */
.info-popover {
    position: fixed;
    z-index: 20;
    min-width: 280px;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.14);
    padding: 12px;
}
.info-popover-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    padding: 0 0 10px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.info-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 6px 0;
}
.info-label {
    font-weight: 600;
    color: var(--muted);
    flex: 0 0 auto;
    margin-right: 8px;
}
.info-value {
    font-size: 12px;
    color: var(--text);
    text-align: right;
    flex: 1;
    word-break: break-word;
}

/* Action buttons */
.task-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.task-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border: none;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--muted);
}
.btn-edit:hover   { background: #eff6ff; color: var(--primary); }
.btn-delete:hover { background: #fee2e2; color: var(--danger); }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 16px;
}
.modal-card {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-sm { max-width: 360px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
    background: none; border: none;
    font-size: 22px; line-height: 1;
    cursor: pointer; color: var(--muted);
    padding: 4px 6px; border-radius: 6px;
}
.modal-close:hover { background: var(--bg); }

/* Form */
.form-group  { padding: 12px 24px 0; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.req { color: var(--danger); }
.form-input {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit;
    background: var(--surface); color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.form-error {
    margin: 10px 24px 0;
    padding: 8px 12px;
    background: #fee2e2;
    border-radius: 8px;
    color: var(--danger);
    font-size: 13px;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 20px;
}
.btn-ghost {
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
    font-weight: 500;
}
.btn-ghost:hover { background: var(--bg); }
.btn-primary {
    padding: 9px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
}
.btn-primary:hover    { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-danger {
    padding: 9px 20px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }

.delete-msg { padding: 12px 24px; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    white-space: nowrap;
}
.toast-in { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: var(--danger); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .count-label { display: none; }
    .count-badge { padding: 3px 6px; }
    .role-text   { display: none; }
    .role-pill   { padding: 3px 6px; }
    .todos-main  { padding: 20px 4%; }
    .form-row    { grid-template-columns: 1fr; }
    .task-btn    { width: 28px; height: 28px; }
    .member-label { display: none; }
}

@media (max-width: 480px) {
    .auth-card { padding: 32px 20px; }
    .pin-row, .otp-row { gap: 4px; }
    .pin-row input, .otp-row input { width: 40px; height: 48px; font-size: 18px; }
    .dash-nav { padding: 0 16px; }
    .home-main { padding: 20px 5%; }
    .todos-title { font-size: 18px; }
    .btn-add span { display: none; }
}

/* ══════════════════════════════════════════════════════════
   TEAM SETTINGS PAGE
   ══════════════════════════════════════════════════════════ */

.settings-main {
    flex: 1;
    padding: 28px 5%;
    width: 100%;
    box-sizing: border-box;
    background: var(--bg);
}

.settings-container {
    max-width: 700px;
    margin: 0 auto;
}

.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.settings-section h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.form-group {
    margin-bottom: 12px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #f9fafb;
    color: var(--text);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.form-group input {
    flex: 1;
    min-width: 200px;
}

.form-group select {
    flex: 0 0 130px;
}

.form-group button {
    flex: 0 0 auto;
}

.team-code-display {
    display: flex;
    gap: 8px;
}

.team-code-display input {
    flex: 1;
}

.btn-primary,
.btn-secondary {
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-danger:hover {
    background: #b91c1c;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fafb;
}

.member-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.member-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.member-role-display {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.member-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: #dbeafe;
    color: #2563eb;
    white-space: nowrap;
}

.member-role-badge.owner-badge {
    background: #ede9fe;
    color: #7c3aed;
}

.member-role-select {
    width: 100px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.member-role-select:focus {
    border-color: var(--primary);
}

.member-role-wrapper {
    flex: 0 0 130px;
}

.role-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.role-select:focus {
    border-color: var(--primary);
}

.danger-zone {
    border-color: var(--danger);
    background: #fff5f5;
}

.danger-zone h2 {
    color: var(--danger);
}

.danger-action {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.danger-action p {
    font-size: 13px;
    color: var(--text);
    margin: 0;
}

@media (max-width: 640px) {
    .settings-main {
        padding: 16px 5%;
    }
    
    .settings-section {
        padding: 16px;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .form-group input {
        flex: 1;
        min-width: auto;
    }
    
    .form-group select {
        flex: 1;
    }
}
