/* =========================================
   BUKETLY — Main Stylesheet
   ========================================= */

:root {
    --purple:       #7c3aed;
    --purple-light: #a78bfa;
    --purple-pale:  #f3eeff;
    --purple-dark:  #5b21b6;
    --accent:       #f59e0b;
    --success:      #10b981;
    --danger:       #ef4444;
    --info:         #3b82f6;
    --text:         #1e1b2e;
    --text-muted:   #7c7c99;
    --border:       #e9e4f8;
    --bg:           #f7f5ff;
    --white:        #ffffff;
    --sidebar-w:    240px;
    --radius:       16px;
    --radius-sm:    10px;
    --shadow:       0 4px 24px rgba(124,58,237,.10);
    --shadow-lg:    0 8px 40px rgba(124,58,237,.18);
    --font-body:    'Nunito', sans-serif;
    --font-display: 'Sora', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--purple-pale); }
::-webkit-scrollbar-thumb { background: var(--purple-light); border-radius: 3px; }

/* =========================================
   AUTH PAGES (login / register)
   ========================================= */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ede9fe 0%, #f3eeff 50%, #fdf4ff 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124,58,237,.12) 0%, transparent 70%);
    top: -150px; right: -100px;
    pointer-events: none;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167,139,250,.10) 0%, transparent 70%);
    bottom: -80px; left: -60px;
    pointer-events: none;
}

.auth-card {
    background: var(--white);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: slideUp .5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    justify-content: center;
}

.auth-logo .logo-icon {
    width: 42px; height: 42px;
    background: var(--purple);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 22px;
}

.auth-logo .logo-text {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--purple);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-card h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
    color: var(--text);
}


.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(124,58,237,.12);
    background: var(--white);
}

.form-control::placeholder { color: var(--text-muted); }

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .form-control {
    padding-left: 44px;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all .2s;
}

.btn-primary {
    background: var(--purple);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--purple-dark);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--purple);
    color: var(--purple);
}

.btn-outline:hover {
    background: var(--purple-pale);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    border-radius: 8px;
    font-size: 15px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--purple);
    font-weight: 700;
}

.auth-link a:hover { text-decoration: underline; }

.forgot-link {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--purple);
    margin-top: -8px;
    margin-bottom: 12px;
}


.app-layout {
    display: flex;
    min-height: 100vh;
}


.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform .3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    margin-bottom: 40px;
}

.brand-icon {
    width: 36px; height: 36px;
    background: var(--purple);
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 18px;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--purple);
}

.sidebar-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    transition: all .2s;
}

.nav-item i { font-size: 18px; }

.nav-item:hover {
    background: var(--purple-pale);
    color: var(--purple);
}

.nav-item.active {
    background: var(--purple);
    color: white;
    box-shadow: 0 4px 16px rgba(124,58,237,.3);
}

.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border); }


.sidebar-theme {
    padding: 16px 8px 10px;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}
.sidebar-theme-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}
.theme-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 8px;
    list-style: none;
}
.theme-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    padding: 0;
    margin: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    flex-shrink: 0;
    line-height: 1;
    font-size: 0;          /* hide any stray text/bullets */
}
.theme-swatch:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.theme-swatch.active {
    border-color: #1e1b2e;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1e1b2e;
}
.theme-swatch-custom {
    background: conic-gradient(#ff6b6b, #ffd93d, #6bcb77, #4d96ff, #db2777, #ff6b6b);
    color: #fff;
    font-size: 12px !important;
    overflow: hidden;
}
.theme-swatch-custom i {
    pointer-events: none;
    font-size: 12px;
    position: relative;
    z-index: 1;
}

.logout-btn { color: var(--danger) !important; }
.logout-btn:hover { background: #fff0f0 !important; }


.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 32px;
    min-height: 100vh;
}

/* ── MOBILE HEADER ── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 200;
}

.mobile-menu-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text);
    cursor: pointer;
}

.mobile-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--purple);
    color: white;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
}

.mobile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 99;
}

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

.page-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}

.page-title span {
    color: var(--purple);
}

.greeting-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 22px;
}

.stat-icon.purple { background: var(--purple-pale); color: var(--purple); }
.stat-icon.green  { background: #d1fae5; color: var(--success); }
.stat-icon.amber  { background: #fef3c7; color: var(--accent); }
.stat-icon.blue   { background: #dbeafe; color: var(--info); }

.stat-info .stat-number {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.stat-info .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.progress-card {
    margin-bottom: 28px;
}

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

.progress-title {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-pct {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--purple);
}

.progress-track {
    height: 12px;
    background: var(--purple-pale);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--purple), var(--purple-light));
    transition: width .6s ease;
}

.progress-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.tasks-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    padding-left: 40px;
    border-radius: 999px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.filter-select {
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 13px;
    background: var(--white);
    color: var(--text);
    outline: none;
    cursor: pointer;
}

.filter-select:focus { border-color: var(--purple); }

.date-strip {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.date-chip {
    min-width: 58px;
    text-align: center;
    padding: 10px 12px;
    border-radius: 14px;
    border: 2px solid var(--border);
    cursor: pointer;
    background: var(--white);
    transition: all .2s;
    flex-shrink: 0;
    position: relative; /* anchor for the absolute-positioned badge */
}

.date-chip:hover { border-color: var(--purple); }

.date-chip.active {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
    box-shadow: 0 4px 14px rgba(124,58,237,.3);
}

.date-chip .day-num { font-size: 18px; font-weight: 700; }
.date-chip .day-name { font-size: 11px; text-transform: uppercase; opacity: .7; }


.task-list { display: flex; flex-direction: column; gap: 10px; }

.task-item {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 10px rgba(124,58,237,.06);
    transition: box-shadow .2s, transform .2s;
    border-left: 4px solid transparent;
}

.task-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(2px);
}

.task-item.completed { opacity: .6; }

.task-item.completed .task-title { color: var(--text-muted); }

.task-check {
    width: 22px; height: 22px;
    border: 2px solid var(--purple);
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: all .2s;
    background: transparent;
    opacity: 1;
}

.task-check.checked {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
}

.task-check:hover { border-color: var(--purple); }

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

.subtask-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* collapsed state — must come after .subtask-list and use !important to win specificity */
.subtask-list.subtask-list-collapsed {
    display: none !important;
}

/* ── Subtask toggle button ── */
.subtask-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 12px 4px 8px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg, #f8f7ff);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s, color .2s, background .2s;
    font-family: var(--font-body);
    line-height: 1;
    user-select: none;
    outline: none;
}
.subtask-toggle-btn:hover,
.subtask-toggle-btn:focus {
    border-color: var(--purple);
    color: var(--purple);
    background: var(--purple-pale, #ede9fe);
}
.subtask-toggle-btn i {
    font-size: 12px;
    line-height: 1;
}
.subtask-toggle-count {
    background: var(--purple-pale, #ede9fe);
    color: var(--purple);
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .2px;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    padding: 4px 8px;
    border-left: 2px solid var(--border);
}

.subtask-item.completed .subtask-title {
    opacity: 0.5;
}

.subtask-check {
    width: 17px;
    height: 17px;
    border: 2px solid var(--purple);
    border-radius: 4px;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: all .2s;
    background: transparent;
    font-size: 11px;
    opacity: 1;
}

.subtask-check.checked {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
}

.subtask-check:hover { border-color: var(--purple); }

.subtask-title {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-title {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search result highlight */
mark.search-hl {
    background: rgba(245, 158, 11, 0.28);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
    font-weight: 700;
}

.task-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.task-time, .task-cat {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--purple-pale);
    color: var(--purple);
}

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

.task-action-btn {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 14px;
    transition: all .2s;
}

.edit-btn   { background: #ede9fe; color: var(--purple); }
.delete-btn { background: #fee2e2; color: var(--danger); }
.edit-btn:hover   { background: var(--purple); color: white; }
.delete-btn:hover { background: var(--danger); color: white; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 48px; opacity: .3; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }


.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30,27,46,.45);
    backdrop-filter: blur(3px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.open { display: flex; }

.modal-box {
    background: var(--white);
    border-radius: 24px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalIn .3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.94) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    transition: all .2s;
}

.modal-close:hover { background: #fee2e2; color: var(--danger); }


.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.cat-chip {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--white);
}

.cat-chip:hover { border-color: var(--purple); background: var(--purple-pale); }

.cat-chip.selected {
    border-color: var(--purple);
    background: var(--purple);
    color: white;
}

.cat-chip i { font-size: 22px; display: block; margin-bottom: 4px; }
.cat-chip span { font-size: 11px; font-weight: 600; }

/* Edit pencil overlaid on user-owned cat-chips — matches task-action-btn + edit-btn */
.cat-chip { position: relative; }
.cat-chip .chip-edit-btn {
    display: none;
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    border: none; border-radius: 6px;
    background: #ede9fe;
    color: var(--purple);
    font-size: 8px;
    cursor: pointer;
    padding: 0;
    z-index: 2;
    place-items: center;
    transition: all .2s;
}
.cat-chip:hover .chip-edit-btn { display: grid; }
.cat-chip.selected .chip-edit-btn { background: rgba(255,255,255,.25); color: #fff; }
.cat-chip .chip-edit-btn:hover { background: var(--purple); color: #fff; }
.cat-chip.selected .chip-edit-btn:hover { background: rgba(255,255,255,.55); color: var(--purple); }


.time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}


.day-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.day-pill {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    background: var(--white);
    color: var(--text-muted);
}

.day-pill.active {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
}


.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.toggle-label { font-size: 13px; font-weight: 600; }

.toggle {
    position: relative;
    width: 44px; height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: .3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: white;
    border-radius: 50%;
    transition: .3s;
}

.toggle input:checked + .toggle-slider { background: var(--purple); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }


.cat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.cat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform .2s, box-shadow .2s;
    position: relative;
}

.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.cat-card-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 26px;
    margin: 0 auto 12px;
}

.cat-card-name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.cat-card-count { font-size: 12px; color: var(--text-muted); }

.cat-card-actions {
    position: absolute;
    top: 12px; right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity .2s;
}

.cat-card:hover .cat-card-actions { opacity: 1; }


.profile-card {
    max-width: 520px;
}

.avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.avatar-preview {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--purple-pale);
    border: 3px solid var(--purple);
    overflow: hidden;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--purple);
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--purple-pale);
    color: var(--purple);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    border: 2px dashed var(--purple-light);
    transition: all .2s;
}

.avatar-upload-btn:hover { background: var(--purple); color: white; border-style: solid; }


.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--white);
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    animation: toastIn .3s ease;
    border-left: 4px solid var(--purple);
}

.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}


.mini-cal { width: 100%; }


@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-overlay.open { display: block; }

    .mobile-header { display: flex; }

    .main-content {
        margin-left: 0;
        padding: 80px 16px 24px;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .cat-grid { grid-template-columns: repeat(2, 1fr); }

    .auth-card { padding: 32px 20px; }

    .modal-box { padding: 24px 16px; }
}

@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .time-row { grid-template-columns: 1fr; }
}


.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-purple { color: var(--purple); }
.text-sm { font-size: 13px; }
.fw-bold { font-weight: 700; }
.w-100 { width: 100%; }


.spinner {
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.section-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border);
    border-radius: 999px;
}


.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}


.theme-page-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 900px) {
    .theme-page-grid { grid-template-columns: 1fr; }
}

/* ── Picker Panel ── */
.theme-picker-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.theme-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin-bottom: 14px;
    margin-top: 4px;
}

.theme-section-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* ── Preset swatches grid ── */
.theme-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.tp-swatch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--white);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: var(--font-body);
    position: relative;
    overflow: hidden;
}

.tp-swatch:hover {
    border-color: var(--c, var(--purple));
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.tp-swatch.tp-active {
    border-color: var(--c, var(--purple));
    background: var(--purple-pale);
    box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}

.tp-swatch-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--c, var(--purple));
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

.tp-swatch-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.tp-swatch-check {
    font-size: 15px;
    color: var(--c, var(--purple));
    opacity: 0;
    transition: opacity .15s;
}

.tp-swatch.tp-active .tp-swatch-check { opacity: 1; }

/* ── Custom color row ── */
.theme-custom-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-custom-preview {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--purple);
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    transition: background .2s;
}

.theme-color-input {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}
.theme-color-input::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
.theme-color-input::-webkit-color-swatch { border-radius: 50%; border: 2px solid var(--border); }

.theme-hex-input {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    text-transform: uppercase;
    padding: 8px 12px;
}

.theme-apply-custom { flex-shrink: 0; }


.theme-save-btn {
    width: 100%;
    justify-content: center;
    padding: 13px;
    font-size: 15px;
    transition: background .3s;
}

.theme-reset-btn {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}


.theme-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.theme-preview-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
}

.preview-badge {
    background: var(--purple-pale);
    color: var(--purple);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: .04em;
}


.preview-shell {
    --pv-accent:  var(--purple);
    --pv-light:   var(--purple-light);
    --pv-pale:    var(--purple-pale);
    --pv-dark:    var(--purple-dark);
    --pv-rgba10:  rgba(124,58,237,.10);
    --pv-rgba20:  rgba(124,58,237,.20);

    display: flex;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    background: #f7f5ff;
    min-height: 340px;
}


.preview-sidebar {
    width: 130px;
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 0 4px;
}

.preview-brand-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--pv-accent);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
}

.preview-brand-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--pv-accent);
}

.preview-nav { display: flex; flex-direction: column; gap: 3px; }

.preview-nav-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 8px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.preview-nav-active {
    background: var(--pv-accent);
    color: #fff;
}

.preview-nav-active-current {
    background: var(--pv-pale);
    color: var(--pv-accent);
}


.preview-main {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--pv-pale);
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.preview-stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 8px var(--pv-rgba10);
}

.preview-stat-card.preview-stat-accent {
    background: var(--pv-accent);
    color: #fff;
}

.preview-stat-num {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.preview-stat-label {
    font-size: 9px;
    opacity: .7;
    margin-top: 2px;
}

.preview-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-progress-bar {
    flex: 1;
    height: 7px;
    background: var(--white);
    border-radius: 999px;
    overflow: hidden;
}

.preview-progress-fill {
    height: 100%;
    background: var(--pv-accent);
    border-radius: 999px;
    transition: width .4s ease;
}

.preview-progress-pct {
    font-size: 11px;
    font-weight: 700;
    color: var(--pv-accent);
    white-space: nowrap;
}

.preview-tasks { display: flex; flex-direction: column; gap: 6px; }

.preview-task {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 1px 4px var(--pv-rgba10);
    border-left: 3px solid var(--pv-accent);
}

.preview-task-done { opacity: .55; }

.preview-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 10px;
}

.preview-check-done {
    background: var(--pv-accent);
    border-color: var(--pv-accent);
    color: #fff;
}

.preview-task-text {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}

.preview-task-badge {
    font-size: 9px;
    font-weight: 700;
    background: var(--pv-pale);
    color: var(--pv-accent);
    padding: 2px 7px;
    border-radius: 999px;
}

.preview-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.preview-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--pv-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    box-shadow: 0 3px 10px var(--pv-rgba20);
}

.preview-btn-outline {
    display: inline-flex;
    align-items: center;
    background: var(--white);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
}


.theme-color-info {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    box-shadow: var(--shadow);
}

.tci-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    transition: background .3s;
}

.tci-details { flex: 1; }

.tci-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.tci-hex {
    font-size: 12px;
    font-family: monospace;
    color: var(--text-muted);
}

.tci-shades {
    display: flex;
    gap: 6px;
}

.tci-shade {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    transition: background .3s;
}


.sidebar-theme { display: none; }
/* ═══════════════════════════════════════
   DRUM / SCROLL WHEEL TIME PICKER
═══════════════════════════════════════ */
.drum-picker {
    display: flex;
    align-items: center;
    background: var(--white, #fff);
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 14px;
    overflow: hidden;
    height: 132px;         /* exactly 3 rows × 44px */
    position: relative;
    user-select: none;
}

/* full-width pill highlight at vertical centre */
.drum-picker-highlight {
    position: absolute;
    top: 50%; left: 8px; right: 8px;
    transform: translateY(-50%);
    height: 44px;
    background: #f1f0f5;
    border-radius: 11px;
    pointer-events: none;
    z-index: 1;
}

/* top & bottom fade masks */
.drum-picker::before,
.drum-picker::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 44px;
    pointer-events: none;
    z-index: 2;
}
.drum-picker::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,.92) 0%, transparent 100%);
}
.drum-picker::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,.92) 0%, transparent 100%);
}

/* each column */
.drum-col {
    flex: 1;
    overflow: hidden;
    height: 100%;
    position: relative;
    cursor: grab;
    z-index: 3;
}
.drum-col.drum-col-period { flex: 0 0 64px; }
.drum-col:active { cursor: grabbing; }

/* scrollable list */
.drum-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: transform;
    padding: 44px 0;   /* centres first item in the highlight band */
}

.drum-item {
    height: 44px;
    line-height: 44px;
    font-size: 17px;
    font-weight: 400;
    color: #c0bdc8;
    text-align: center;
    width: 100%;
    pointer-events: none;
    transition: color .12s, font-size .12s, font-weight .12s;
}

.drum-item.active {
    color: #1a1523;
    font-size: 22px;
    font-weight: 700;
}

.drum-done-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--purple, #7c3aed);
    background: var(--purple-pale, #f1f0f5);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}
.drum-done-btn:hover {
    background: var(--purple-pale, #e8e5f8);
}
.drum-done-btn.drum-done-confirmed {
    background: var(--purple, #7c3aed);
    color: #fff;
}

/* ═══════════════════════════════════════
   DASHBOARD TOPBAR — Bell + Profile
═══════════════════════════════════════ */
.dash-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ── Profile chip ── */
.dash-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border-radius: 50px;
    padding: 5px 16px 5px 5px;
    box-shadow: 0 2px 12px rgba(124,58,237,.13), 0 0 0 1.5px var(--border);
    cursor: pointer;
    transition: box-shadow .2s, transform .2s, background .2s;
}
.dash-profile:hover {
    background: var(--purple-pale);
    box-shadow: 0 4px 20px rgba(124,58,237,.22);
    transform: translateY(-1px);
}

.dash-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2.5px solid var(--purple-pale);
    box-shadow: 0 0 0 2px var(--purple-light);
    transition: box-shadow .2s;
}
.dash-profile:hover .dash-avatar {
    box-shadow: 0 0 0 2.5px var(--purple);
}
.dash-avatar-initials {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .02em;
}

.dash-fullname {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.dash-chevron {
    font-size: 10px;
    color: var(--purple);
    transition: transform .2s;
}
.dash-profile:hover .dash-chevron {
    transform: translateY(1px);
}
/* ══════════════════════════════════════════
   DASHBOARD — pinned header / scroll layout
══════════════════════════════════════════ */
.dash-scroll-layout {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
}
.dash-pinned {
    flex-shrink: 0;
    padding: 32px 32px 0;
    background: var(--bg);
}
.dash-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px 32px 32px;
}

/* ══════════════════════════════════════════
   TASKS PAGE — pinned header / scroll layout
══════════════════════════════════════════ */
.tasks-scroll-layout {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
}
.tasks-pinned {
    flex-shrink: 0;
    padding: 32px 32px 0;
    background: var(--bg);
}
.tasks-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 32px 32px;
}

/* ── Mobile overrides ── */
@media (max-width: 768px) {
    .dash-pinned,
    .tasks-pinned {
        padding: 80px 16px 0;
    }
    .dash-scroll-area,
    .tasks-scroll-area {
        padding: 12px 16px 24px;
    }
}
