/* ============================================================
   UNCLOCKD — Global Custom CSS
   Complète Tailwind avec des styles spécifiques au thème
   ============================================================

   TABLE OF CONTENTS
   ────────────────────────────────────────────────────────────
   01. Variables & Reset
   02. Scrollbar & Icons
   03. Typography
   04. Bloom & Decorative
   05. Cards & Panels
   06. Inputs & Selects
   07. Buttons
   08. Modals
   09. Badges & Labels
   10. Loader & Spinner
   11. Toasts & Notifications
   12. Calendar
   13. Planner
   14. Anti-Calendar
   15. Deep Work
   16. Habits
   17. Projects
   18. Stats & KPIs
   19. Weekly Review
   20. Quick-Create
   21. Tags
   22. Focus Queue
   23. Auth Pages
   24. Settings
   25. Footer & Search
   26. Responsive
   27. Animations
   ============================================================ */

/* --- 01. Variables & Reset --- */
:root {
    /* Core palette */
    --color-primary:        #b7c4ff;
    --color-secondary:      #0052fe;
    --color-surface:        #131314;
    --color-surface-low:    #1c1b1c;
    --color-surface-mid:    #201f20;
    --color-surface-high:   #2a2a2b;
    --color-outline:        #45464f;
    --color-text:           #e5e2e3;
    --color-text-muted:     #c6c5d0;
    --color-error:          #eb5757;
    --color-error-container:#93000a;
    --color-error-text:     #ffdad6;
    --font-main:            'Inter', sans-serif;

    /* Page accents */
    --planner-accent:       #2dd4bf;
    --planner-accent-dim:   rgba(45, 212, 191, 0.08);
    --planner-accent-mid:   rgba(45, 212, 191, 0.22);
    --cal-accent:           #56ccf2;
    --cal-accent-dim:       rgba(86, 204, 242, 0.08);
    --cal-accent-mid:       rgba(86, 204, 242, 0.22);
    --ac-accent:            #6fcf97;
    --ac-accent-dim:        rgba(111, 207, 151, 0.08);
    --ac-accent-mid:        rgba(111, 207, 151, 0.22);
    --proj-accent:          #9b8ef2;
    --proj-accent-dim:      rgba(155, 142, 242, 0.08);
    --proj-accent-mid:      rgba(155, 142, 242, 0.22);
    --hb-accent:            #f87171;
    --hb-accent-rgb:        248,113,113;
    --hb-accent-dim:        rgba(248, 113, 113, 0.07);
    --hb-accent-mid:        rgba(248, 113, 113, 0.15);
}

/* --- Reset global — coins droits sur tout --- */
*, *::before, *::after {
    border-radius: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-surface);
    color: var(--color-text);
    margin: 0;
}

/* --- Scrollbar personnalisée --- */
::-webkit-scrollbar         { width: 6px; height: 6px; }
::-webkit-scrollbar-track   { background: var(--color-surface); }
::-webkit-scrollbar-thumb   { background: var(--color-outline); }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* --- Material Symbols --- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
    font-size: 22px;
    vertical-align: middle;
}
.icon-filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- Typographie --- */
.tight      { letter-spacing: -0.04em; }
.editorial  { letter-spacing: 0.1em; }
.label-xs   { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }
.label-sm   { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

/* --- Bloom / glow décoratif --- */
.bloom {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(183,196,255,0.07) 0%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}

/* --- Cards / panneaux --- */
.card {
    background: var(--color-surface-mid);
    border: 1px solid var(--color-outline);
    padding: 1.5rem;
}

/* --- Inputs & Selects --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    background-color: var(--color-surface-low);
    border: 1px solid var(--color-outline);
    color: var(--color-text);
    padding: 0.6rem 0.9rem;
    font-family: var(--font-main);
    font-size: 0.875rem;
    outline: none;
    width: 100%;
    transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--color-primary);
}
input::placeholder, textarea::placeholder {
    color: #666;
}
/* Fix native date/time pickers on dark themes */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    color-scheme: dark;
}
/* Guarantee text is always readable — catches any missing type selector */
input, textarea, select {
    color: var(--color-text) !important;
    background-color: var(--color-surface-low) !important;
    color-scheme: dark;
}
/* Fix select option background (white-on-white) */
select option {
    background-color: var(--color-surface-low);
    color: var(--color-text);
}
/* Override Tailwind Forms plugin inside every container */
.modal-box input,
.modal-box textarea,
.modal-box select,
.card input,
.card textarea,
.card select,
#qc-card input,
#qc-card textarea,
[class*="bg-surface"] input,
[class*="bg-surface"] textarea,
[class*="bg-surface"] select {
    color: var(--color-text) !important;
    background-color: var(--color-surface-low) !important;
}
label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}

/* --- Boutons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}
.btn-primary {
    background-color: var(--color-primary);
    color: #1f2d5e;
}
.btn-primary:hover  { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-outline);
    color: var(--color-text);
}
.btn-secondary:hover { background-color: var(--color-surface-high); }

.btn-danger {
    background-color: var(--color-error-container);
    color: var(--color-error-text);
}
.btn-danger:hover { filter: brightness(1.2); }

.btn-confirm {
    border: none;
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.65rem 1.5rem;
}
.btn-confirm-danger {
    background: var(--color-error-container);
    color: #ffb4ab;
    border-color: var(--color-error-container);
}
.btn-confirm-info {
    background: var(--color-secondary);
    color: #dde1ff;
    border-color: var(--color-secondary);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--color-text-muted);
    padding: 0.4rem;
}
.btn-ghost:hover { color: var(--color-text); }

/* --- Modales --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }

.modal-box {
    background: var(--color-surface-mid);
    border: 1px solid var(--color-outline);
    padding: 2rem;
    min-width: 360px;
    max-width: 540px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 101;
}

/* --- Badges de priorité --- */
.badge-high   { background:#93000a; color:#ffdad6; }
.badge-medium { background:#5a4300; color:#ffdf9a; }
.badge-low    { background:#1a3a2b; color:#6fcf97; }
.badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    display: inline-block;
}

/* --- Loader spinner --- */
.spinner {
    width: 24px; height: 24px;
    border: 2px solid var(--color-outline);
    border-top-color: var(--color-primary);
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Toaster (toast notifications) --- */
.toaster-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 380px;
    width: 100%;
}
@media (max-width: 640px) {
    .toaster-container { right: 0.5rem; left: 0.5rem; max-width: none; }
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-left: 3px solid;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-icon { flex-shrink: 0; font-size: 18px; margin-top: 1px; }
.toast-body { flex: 1; min-width: 0; line-height: 1.4; }
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s;
    padding: 0;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    margin-top: 1px;
}
.toast-close:hover { opacity: 1; }
.toast-undo {
    flex-shrink: 0;
    background: none;
    border: 1px solid #fb923c;
    color: #fb923c;
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .5rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .05em;
    transition: background .15s, color .15s;
}
.toast-undo:hover { background: #fb923c; color: #fff; }
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    transform-origin: left;
    animation: toastCountdown linear forwards;
}
.toast-success  { background: #1a3a2b; color: #6fcf97; border-color: #6fcf97; }
.toast-error    { background: #93000a; color: #ffdad6; border-color: #ffb4ab; }
.toast-warning  { background: #5a4300; color: #ffdf9a; border-color: #f2c94c; }
.toast-info     { background: #0d2150; color: #b7c4ff; border-color: #b7c4ff; }
.toast-success .toast-progress { background: #6fcf97; }
.toast-error   .toast-progress { background: #ffb4ab; }
.toast-warning .toast-progress { background: #f2c94c; }
.toast-info    .toast-progress { background: #b7c4ff; }
@keyframes toastSlideIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(110%); opacity: 0; }
}
@keyframes toastCountdown {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}
.toast.removing { animation: toastSlideOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* --- Notification panel --- */
#notif-panel {
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: top right;
}
#notif-panel.notif-panel-hidden {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
    pointer-events: none;
}
#notif-panel.notif-panel-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}
.notif-group-header {
    padding: 0.5rem 1rem;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted, #c6c5d0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid color-mix(in srgb, var(--color-outline) 30%, transparent);
    background: rgba(255,255,255,0.02);
}
.notif-group-badge {
    font-size: 0.55rem;
    font-weight: 900;
    padding: 1px 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    transition: background 0.15s;
    cursor: pointer;
    border-bottom: 1px solid color-mix(in srgb, var(--color-outline) 15%, transparent);
    text-decoration: none;
    position: relative;
}
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item-accent {
    width: 3px;
    flex-shrink: 0;
    align-self: stretch;
    border-radius: 1px;
}
.notif-item-dismiss {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    margin-top: 1px;
}
.notif-item:hover .notif-item-dismiss { opacity: 0.5; }
.notif-item-dismiss:hover { opacity: 1 !important; }
.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
}
.notif-empty-icon {
    font-size: 36px;
    opacity: 0.2;
}

/* --- Calendrier --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--color-outline);
}
.calendar-cell {
    min-height: 110px;
    padding: 0.5rem;
    border: 1px solid var(--color-outline);
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
    overflow: hidden;
}
.calendar-cell:hover { background: var(--color-surface-high); }
.calendar-cell.today { border-color: var(--cal-accent); }
.calendar-cell.other-month { opacity: 0.35; }

.calendar-event {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    color: #0e0e0f;
}

/* --- Timeline planner --- */
.timeline-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    border-bottom: 1px solid var(--color-outline);
    height: 56px;
    position: relative;
}
.timeline-hour {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-text-muted);
    padding: 0.4rem 0.5rem;
    letter-spacing: 0.05em;
}
.timeline-slot {
    position: relative;
    padding: 0;
    cursor: crosshair;
}
.timeline-relative-wrap { position: relative; }
.timeline-tasks-layer {
    position: absolute;
    top: 0;
    left: 56px;
    right: 0;
    pointer-events: none;
}
.planner-block {
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border-left: 3px solid;
    transition: filter 0.15s;
    overflow: hidden;
    pointer-events: all;
}
.planner-block:hover { filter: brightness(1.15); }
.planner-block .task-time {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.55;
    overflow: hidden;
    pointer-events: none;
    padding-left: 2px;
    margin-top: 1px;
    line-height: 1.2;
}
.planner-block.completed { opacity: 0.45; text-decoration: line-through; }
/* Priority slider */
.priority-slider-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.priority-slider-wrap input[type="range"] {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    height: 6px;
    accent-color: var(--color-primary);
}
.priority-slider-track {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
}
.priority-slider-track span {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

/* Navigation calendrier */
#btn-prev:hover, #btn-next:hover, #btn-today:hover {
    color: var(--cal-accent) !important;
    border-color: var(--cal-accent) !important;
}
/* FAB Ajouter */
#fab-add {
    background: var(--cal-accent) !important;
    color: #0a1f28 !important;
}
#fab-add:hover { filter: brightness(1.1); }

/* ─── Heatmap densité journalière ─── */
.calendar-cell[data-load="1"] { background: rgba(86, 204, 242, 0.04); }
.calendar-cell[data-load="2"] { background: rgba(86, 204, 242, 0.09); }
.calendar-cell[data-load="3"] { background: rgba(86, 204, 242, 0.16); }
.calendar-cell[data-load]:hover { background: var(--color-surface-high); }
.calendar-cell.today[data-load] { background: rgba(86, 204, 242, 0.06); }

/* ─── Dot-row indicateurs ─── */
.cal-dot-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 3px;
    flex-wrap: wrap;
    min-height: 8px;
}
.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50% !important;
    flex-shrink: 0;
}
.cal-dot-event  { background: var(--cal-accent); opacity: 0.9; }
.cal-dot-task   { background: #2dd4bf; opacity: 0.9; }
.cal-dot-free   { background: #6fcf97; opacity: 0.9; }
.cal-dot-overflow {
    font-size: 0.5rem;
    font-weight: 800;
    color: var(--color-text-muted);
    letter-spacing: 0;
    line-height: 1;
    margin-left: 1px;
}

/* ─── Today's Agenda Strip ─── */
.agenda-strip {
    border: 1px solid var(--cal-accent);
    border-left: 3px solid var(--cal-accent);
    background: var(--cal-accent-dim);
    padding: 0.5rem 0.75rem;
}
.agenda-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}
.agenda-strip-body {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    overflow: hidden;
    max-height: 80px;
    transition: max-height 0.25s ease, margin 0.25s ease;
}
.agenda-strip-body.collapsed {
    max-height: 0;
    margin-top: 0;
}
.agenda-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: filter 0.15s;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agenda-pill:hover { filter: brightness(1.2); }
.agenda-pill-event  { color: #0a1f28; }
.agenda-pill-task   { background: rgba(45,212,191,0.12); border-color: #2dd4bf; color: #2dd4bf; }
.agenda-pill-free   { background: rgba(111,207,151,0.12); border-color: #6fcf97; color: #6fcf97; }

/* ─── Mini-calendrier navigateur ─── */
.cal-title-btn {
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 6px;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.15s, color 0.15s;
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    letter-spacing: inherit;
    color: var(--color-text);
}
.cal-title-btn:hover {
    border-bottom-color: var(--cal-accent);
    color: var(--cal-accent);
}
.mini-cal-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 90;
    background: var(--color-surface-mid);
    border: 1px solid var(--cal-accent);
    padding: 12px;
    width: 228px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
.mini-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.mini-cal-nav-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--cal-accent);
    text-transform: uppercase;
}
.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.mini-cal-dh {
    font-size: 0.48rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
    padding: 2px 0;
}
.mini-cal-day {
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    padding: 3px 1px;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: background 0.1s, color 0.1s;
    line-height: 1.7;
}
.mini-cal-day:hover   { background: var(--cal-accent-mid); color: var(--color-text); }
.mini-cal-day.mc-today { color: var(--cal-accent); font-weight: 900; }
.mini-cal-day.mc-cur   { background: var(--cal-accent); color: #0a1f28; font-weight: 900; }
.mini-cal-day.mc-other { opacity: 0.3; }

/* ─── Gap hint dans quick-create ─── */
.qc-gap-hint {
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--cal-accent);
    margin-bottom: 7px;
    text-transform: uppercase;
    opacity: 0.85;
}

/* Bouton primaire planner */
.planner-btn-primary {
    background: var(--planner-accent);
    color: #131314;
    font-weight: 900;
    transition: filter 0.15s;
}
.planner-btn-primary:hover { filter: brightness(1.12); }

/* Barre de progression planner */
.stat-bar-fill.planner-fill {
    background: var(--planner-accent);
}

/* Carte Focus Task */
.focus-task-card {
    border: 1px solid var(--planner-accent) !important;
    background: var(--planner-accent-dim) !important;
    position: relative;
    overflow: hidden;
}
.focus-task-card::after {
    content: 'FOCUS';
    position: absolute;
    top: 0;
    right: 0;
    background: var(--planner-accent);
    color: #0e0e0f;
    font-size: 0.5rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    padding: 3px 8px;
    line-height: 1.4;
}

/* Mini calendrier semaine */
.week-mini-nav {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    border-bottom: 1px solid var(--color-outline);
    padding-bottom: 8px;
}
.week-day-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 2px 6px;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    position: relative;
    bottom: -1px; /* overlap the border-bottom of parent */
}
.week-day-btn:hover { color: var(--planner-accent); }
.week-day-btn.is-selected {
    color: var(--planner-accent);
    border-bottom-color: var(--planner-accent);
}
.week-day-btn .wday-num {
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
    color: var(--color-text);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.week-day-btn.is-today .wday-num {
    background: var(--planner-accent);
    color: #0e0e0f;
    border-radius: 50% !important;
    font-size: 0.72rem;
}
.week-day-btn.is-selected:not(.is-today) .wday-num {
    color: var(--planner-accent);
}
.wday-dot {
    width: 4px;
    height: 4px;
    border-radius: 50% !important;
    background: var(--planner-accent);
    opacity: 0;
    transition: opacity 0.2s;
}
.week-day-btn.has-tasks .wday-dot { opacity: 0.8; }

/* Filtres priorité */
.prio-filter-btn {
    border: 1px solid var(--color-outline);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    letter-spacing: 0.04em;
}
.prio-filter-btn:hover { border-color: var(--planner-accent); }
.prio-filter-btn.active {
    border-color: var(--planner-accent);
    color: var(--planner-accent) !important;
}

/* Sections timeline (fond) */
.tl-section-night { background: rgba(0, 0, 0, 0.3); }
.timeline-slot:hover { background: rgba(45, 212, 191, 0.07); }

/* Drop highlight timeline row */
.timeline-row.drag-over .timeline-slot {
    background: rgba(45, 212, 191, 0.12);
    outline: 1px dashed var(--planner-accent);
    outline-offset: -1px;
}

/* Conflit de plage horaire */
.planner-block.has-conflict {
    outline: 2px solid var(--color-error);
    outline-offset: -2px;
}
.planner-block.has-conflict::before {
    content: '!';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.55rem;
    font-weight: 900;
    color: var(--color-error);
    line-height: 1;
}

/* Label section timeline */
.tl-section-tag {
    position: absolute;
    font-size: 0.44rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    pointer-events: none;
    left: 0;
    width: 14px;
    z-index: 2;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    line-height: 1;
    padding: 6px 1px;
    text-align: center;
}

/* --- Deep Work timer --- */
.timer-ring {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}
.timer-display {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
}

/* --- Anti-calendrier catégories --- */
.cat-leisure  { border-left-color: #b7c4ff; }
.cat-rest     { border-left-color: #6fcf97; }
.cat-social   { border-left-color: #f2c94c; }
.cat-hobby    { border-left-color: #eb5757; }
.cat-exercise { border-left-color: #56ccf2; }
.cat-other    { border-left-color: #90909a; }

/* ─── AC today cell + heatmap density ─── */
#ac-container .calendar-cell.today { border-color: var(--ac-accent) !important; }
#ac-container .calendar-cell[data-ac-heat="1"] { background: rgba(111,207,151,0.10); }
#ac-container .calendar-cell[data-ac-heat="2"] { background: rgba(111,207,151,0.18); }
#ac-container .calendar-cell[data-ac-heat="3"] { background: rgba(111,207,151,0.28); }
#ac-container .calendar-cell[data-ac-heat="4"] { background: rgba(111,207,151,0.40); }
#ac-container .calendar-cell[data-ac-heat]:hover { background: var(--color-surface-high); }

/* ─── AC bouton primaire ─── */
.ac-btn-primary {
    background: var(--ac-accent);
    color: #0e1a12;
    font-weight: 900;
    transition: filter 0.15s;
}
.ac-btn-primary:hover  { filter: brightness(1.12); }
.ac-btn-primary:active { transform: scale(0.97); }

/* ─── KPI strip ─── */
.ac-kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--color-outline);
    border: 1px solid var(--color-outline);
    margin-bottom: 1.5rem;
}
.ac-kpi-cell {
    background: var(--color-surface-mid);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ac-kpi-value {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--ac-accent);
}
.ac-kpi-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}
@media (max-width: 768px) { .ac-kpi-strip { grid-template-columns: 1fr; } }

/* ─── Streak badge ─── */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--ac-accent);
    background: var(--ac-accent-dim);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ac-accent);
}
.streak-badge .streak-count {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--ac-accent);
}
@keyframes streak-pulse {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
}
.streak-badge.is-active { position: relative; }
.streak-badge.is-active::after {
    content: '';
    position: absolute;
    inset: -3px;
    box-shadow: 0 0 0 6px rgba(111, 207, 151, 0.25);
    animation: streak-pulse 2.4s ease-in-out infinite;
    pointer-events: none;
    will-change: opacity;
}

/* ─── Balance ring SVG ─── */
.balance-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.balance-ring-svg  { overflow: visible; }
.balance-ring-track {
    fill: none;
    stroke: var(--color-surface-high);
    stroke-width: 6;
}
.balance-ring-fill-free {
    fill: none;
    stroke: var(--ac-accent);
    stroke-width: 6;
    stroke-linecap: butt;
    transition: stroke-dashoffset 0.8s ease;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}
.balance-ring-fill-work {
    fill: none;
    stroke: #f2c94c;
    stroke-width: 6;
    stroke-linecap: butt;
    transition: stroke-dashoffset 0.8s ease, transform 0.8s ease;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}
.balance-ring-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    text-align: center;
}

/* ─── Category mini bars ─── */
.cat-bar-row { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.cat-bar-header { display: flex; justify-content: space-between; align-items: center; }
.cat-bar-label  { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.cat-bar-value  { font-size: 0.6rem; font-weight: 700; color: var(--color-text-muted); }
.cat-bar-track  { height: 3px; background: var(--color-surface-high); width: 100%; }
.cat-bar-fill   { height: 3px; transition: width 0.8s ease; }

/* ─── Quick-add chips ─── */
.ac-quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border: 1px solid var(--color-outline);
    background: var(--color-surface-high);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ac-quick-chip:hover {
    border-color: var(--ac-accent);
    color: var(--ac-accent);
    background: var(--ac-accent-dim);
}
.ac-quick-chip .material-symbols-outlined { font-size: 13px; }

/* ─── Duration presets modal ─── */
.duration-preset-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 0.5rem; }
.duration-preset-btn {
    padding: 3px 9px;
    border: 1px solid var(--color-outline);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.62rem;
    font-weight: 700;
    font-family: var(--font-main);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s;
}
.duration-preset-btn:hover,
.duration-preset-btn.active {
    border-color: var(--ac-accent);
    color: var(--ac-accent);
}

/* ─── Heatmap 52 semaines ─── */
.ac-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(53, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    overflow-x: auto;
}
.ac-heatmap-col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 2px; }
.ac-heat-cell {
    width: 100%;
    aspect-ratio: 1;
    background: var(--color-surface-high);
    cursor: default;
    transition: outline 0.1s;
}
.ac-heat-cell:hover { outline: 1px solid var(--ac-accent); }
.ac-heat-cell[data-intensity="1"] { background: rgba(111, 207, 151, 0.18); }
.ac-heat-cell[data-intensity="2"] { background: rgba(111, 207, 151, 0.38); }
.ac-heat-cell[data-intensity="3"] { background: rgba(111, 207, 151, 0.60); }
.ac-heat-cell[data-intensity="4"] { background: rgba(111, 207, 151, 0.85); }
.ac-heat-cell.ac-heat-today       { outline: 1px solid var(--ac-accent); }

/* ─── AC today strip (clone agenda-strip avec --ac-accent) ─── */
.ac-agenda-strip {
    border: 1px solid var(--ac-accent);
    border-left: 3px solid var(--ac-accent);
    background: var(--ac-accent-dim);
    padding: 0.5rem 0.75rem;
}
.ac-agenda-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}
.ac-agenda-strip-body {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    overflow: hidden;
    max-height: 80px;
    transition: max-height 0.25s ease, margin 0.25s ease;
}
.ac-agenda-strip-body.collapsed { max-height: 0; margin-top: 0; }
.ac-agenda-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    background: var(--ac-accent-mid);
    border: 1px solid var(--ac-accent);
    color: var(--ac-accent);
    transition: filter 0.15s;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-agenda-pill:hover { filter: brightness(1.2); }

/* ─── AC active view button ─── */
.ac-active-view {
    color: var(--ac-accent) !important;
    border-bottom: 2px solid var(--ac-accent) !important;
}
#btn-prev-ac:hover, #btn-next-ac:hover, #btn-today-ac:hover {
    color: var(--ac-accent) !important;
    border-color: var(--ac-accent) !important;
}

/* ─── AC quick-add bar (interface principale, toutes vues) ─── */
.ac-quick-add-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-outline);
    background: var(--color-surface-mid);
    margin-bottom: 1rem;
}
.ac-quick-add-bar-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-right: 2px;
}

/* ─── AC quote block (vue stats) ─── */
.ac-quote-block {
    padding: 1.5rem 2rem;
    border-left: 3px solid var(--ac-accent);
    background: var(--ac-accent-dim);
    position: relative;
}
.ac-quote-block::before {
    content: '\201C';
    position: absolute;
    top: -0.2rem;
    left: 1.2rem;
    font-size: 4rem;
    line-height: 1;
    color: var(--ac-accent);
    opacity: 0.25;
    font-family: Georgia, serif;
    pointer-events: none;
}
.ac-quote-text {
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--color-on-surface);
    padding-left: 1rem;
}
.ac-quote-author {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ac-accent);
    margin-top: 0.6rem;
    padding-left: 1rem;
}

/* ================================================================
   HABITS — accent coral #f87171
================================================================ */
.habits-accent { color: var(--hb-accent); }

/* ── Habits banner (stats-banner override) ── */
.hb-banner { border-left-color: var(--hb-accent); border-color: var(--hb-accent-mid); }
.hb-banner .stats-banner-value { color: var(--hb-accent); }

/* ── Progress ring ── */
.hb-progress-wrap {
    position: relative; width: 96px; height: 96px; flex-shrink: 0;
}
.hb-progress-ring { transform: rotate(-90deg); }
.hb-progress-ring-bg { fill: none; stroke: var(--color-outline-variant); stroke-width: 5; }
.hb-progress-ring-fill {
    fill: none; stroke: var(--hb-accent); stroke-width: 5;
    stroke-linecap: round; transition: stroke-dashoffset .5s ease;
}
.hb-progress-text {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.hb-progress-frac { font-size: 1.25rem; font-weight: 900; color: var(--hb-accent); line-height: 1; }
.hb-progress-label { font-size: .44rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-muted); margin-top: 3px; }

/* ── Week strip ── */
.hb-week-strip {
    display: grid; grid-template-columns: auto repeat(7, 1fr) auto;
    align-items: center; gap: 0;
    background: var(--color-surface-container); border: 1px solid var(--color-outline-variant);
    padding: .5rem; overflow: hidden;
    border-left: 3px solid var(--hb-accent);
}
.hb-ws-arrow {
    background: none; border: none; color: var(--color-text-muted);
    cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center;
    transition: color .15s;
}
.hb-ws-arrow:hover { color: var(--hb-accent); }
.hb-ws-day {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: .4rem .25rem; cursor: pointer; transition: background .12s;
    border-radius: 0; position: relative;
}
.hb-ws-day:hover { background: var(--hb-accent-dim); }
.hb-ws-day.is-selected { background: var(--hb-accent-dim); }
.hb-ws-day.is-today .hb-ws-num { color: var(--hb-accent); font-weight: 900; }
.hb-ws-letter { font-size: .5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }
.hb-ws-num { font-size: .75rem; font-weight: 700; color: var(--color-text); line-height: 1; }
.hb-ws-dots { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; max-width: 48px; }
.hb-ws-dot {
    width: 6px; height: 6px; border-radius: 50%; opacity: .15;
    transition: opacity .2s, transform .2s;
}
.hb-ws-dot.done { opacity: 1; transform: scale(1.15); }
.hb-ws-day-bar {
    width: 100%; height: 3px; margin-top: 2px;
    background: var(--color-outline-variant); overflow: hidden;
}
.hb-ws-day-bar-fill { height: 100%; background: var(--hb-accent); transition: width .3s ease; }

/* ── Habit cards ── */
.habit-card {
    background: var(--color-surface-container);
    border: 1px solid var(--color-outline-variant);
    padding: 0; transition: border-color .15s, box-shadow .15s, transform .15s;
    position: relative; overflow: hidden;
}
.habit-card:hover { border-color: rgba(var(--hb-accent-rgb),0.3); }
.habit-card.is-done { background: var(--color-surface-container-high); }
.habit-card.drag-over { border-color: var(--hb-accent); box-shadow: 0 0 0 1px var(--hb-accent); }
.habit-card.dragging { opacity: .4; transform: scale(.97); }
.habit-card-inner { display: flex; align-items: stretch; position: relative; z-index: 1; }

/* Decorative backgrounds */
.habit-card-bg {
    position: absolute; inset: 0; pointer-events: none; opacity: 0.06;
    transition: opacity .3s;
}
.habit-card:hover .habit-card-bg { opacity: 0.10; }
.habit-card.is-done .habit-card-bg { opacity: 0.03; }
.habit-card-bg--glow {
    background: radial-gradient(ellipse at 95% 15%, var(--habit-color) 0%, transparent 65%);
}
.habit-card-bg--stripes {
    background: repeating-linear-gradient(
        135deg, var(--habit-color) 0px, var(--habit-color) 2px, transparent 2px, transparent 12px
    );
}
.habit-card-bg--dots {
    background-image: radial-gradient(var(--habit-color) 1.2px, transparent 1.2px);
    background-size: 14px 14px;
    background-position: 4px 4px;
}
.habit-card-stripe { width: 4px; flex-shrink: 0; }
.habit-card-body { flex: 1; padding: .85rem 1rem; min-width: 0; display: flex; align-items: center; gap: .75rem; }

/* Check button */
.habit-check-btn {
    width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--color-outline-variant);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .25s cubic-bezier(.4,0,.2,1); flex-shrink: 0; background: transparent;
    position: relative; overflow: hidden;
    box-shadow: 0 0 0 0 transparent;
}
.habit-check-btn::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: currentColor; opacity: 0; transform: scale(0);
    transition: all .3s cubic-bezier(.4,0,.2,1);
}
.habit-check-btn:hover { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(var(--hb-accent-rgb),0.12); }
.habit-check-btn:active { transform: scale(.95); }
.habit-check-btn.checked::after { opacity: 1; transform: scale(1); }
.habit-check-btn.checked { border-color: transparent; color: #0d0d0e; box-shadow: 0 0 0 3px rgba(var(--hb-accent-rgb),0.25); }
.habit-check-btn.checked .material-symbols-outlined { font-variation-settings: 'FILL' 1; position: relative; z-index: 1; }
.habit-check-btn:not(.checked) .material-symbols-outlined { transition: color .2s; }

/* Card meta */
.habit-card-info { flex: 1; min-width: 0; }
.habit-card-name { font-size: .82rem; font-weight: 800; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s; }
.habit-card.is-done .habit-card-name { opacity: .45; text-decoration: line-through; }
.habit-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.habit-freq-badge { font-size: .48rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); background: var(--color-surface-container-high); padding: 2px 6px; }
.habit-streak-badge { font-size: .52rem; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; display: inline-flex; align-items: center; gap: 3px; }
.habit-count-badge { font-size: .52rem; font-weight: 800; padding: 2px 6px; color: var(--color-text-muted); background: var(--color-surface-container-high); }

/* Card actions */
.habit-card-actions { display: flex; flex-direction: column; justify-content: center; padding: 0 .5rem; opacity: 0; transition: opacity .15s; }
.habit-card:hover .habit-card-actions { opacity: 1; }
.habit-card-actions button { background: none; border: none; cursor: pointer; padding: 4px; color: var(--color-text-muted); transition: color .15s; }
.habit-card-actions button:hover { color: var(--color-text); }
.habit-card-actions .act-delete:hover { color: var(--color-error); }

/* Drag handle */
.habit-drag-handle { display: flex; align-items: center; justify-content: center; padding: 0 6px; cursor: grab; color: var(--color-outline-variant); opacity: 0; transition: opacity .15s; }
.habit-card:hover .habit-drag-handle { opacity: .6; }
.habit-drag-handle:hover { opacity: 1 !important; color: var(--color-text-muted); }

/* ── Tip card ── */
.hb-tip-card {
    background: var(--hb-accent-dim);
    border: 1px solid rgba(var(--hb-accent-rgb),0.2);
    border-left: 3px solid var(--hb-accent);
    padding: .9rem 1rem;
}
.hb-tip-card p { font-size: .72rem; line-height: 1.55; color: var(--color-text-muted); }

/* ── Period progress (weekly / monthly) ── */
.habit-period-wrap { width: 100%; margin-top: 6px; }
.habit-period-text { font-size: .5rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1; }
.habit-period-bar { height: 3px; background: var(--color-outline-variant); overflow: hidden; margin-top: 3px; }
.habit-period-bar-fill { height: 100%; transition: width .4s ease; }
.habit-period-done { font-variation-settings: 'FILL' 1; font-size: 11px !important; vertical-align: -1px; }

/* ── Archive section ── */
.hb-archive-toggle { display: flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; padding: 6px 0; width: 100%; text-align: left; }
.hb-archive-toggle .material-symbols-outlined { transition: transform .2s; font-size: 18px; color: var(--hb-accent); }
.hb-archive-toggle.open .material-symbols-outlined { transform: rotate(180deg); }
.habit-card-archived { opacity: .5; }
.habit-card-archived:hover { opacity: .7; }

/* ── Confetti canvas ── */
#habit-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }

/* ── Icon/color pickers (modal) ── */
.habit-icon-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.habit-icon-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--color-outline-variant); background: transparent; color: var(--color-text-muted); cursor: pointer; transition: all .15s; }
.habit-icon-btn.selected { border-color: var(--hb-accent); color: var(--hb-accent); background: var(--hb-accent-dim); }

/* --- Page auth (login/register) --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--color-surface);
}
.auth-box {
    background: var(--color-surface-mid);
    border: 1px solid var(--color-outline);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

/* --- Stats bars --- */
.stat-bar-track {
    height: 4px;
    background: var(--color-surface-high);
    width: 100%;
}
.stat-bar-fill {
    height: 4px;
    background: var(--color-primary);
    transition: width 0.8s ease;
}

/* ================================================================
   MOBILE RESPONSIVE — sidebar drawer + layout
================================================================ */

/* Hamburger button (mobile only) */
#mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: var(--color-surface-mid);
    border: 1px solid var(--color-outline);
    color: var(--color-text);
    width: 40px;
    height: 40px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* Mobile overlay backdrop */
#mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 149;
    backdrop-filter: blur(2px);
}
#mobile-nav-backdrop.active { display: block; }

@media (max-width: 768px) {
    /* Show hamburger */
    #mobile-menu-btn { display: flex; }

    /* Sidebar: hidden off-canvas by default */
    aside.sidebar-nav {
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
        z-index: 150;
        width: 72px !important;
    }
    aside.sidebar-nav.open {
        transform: translateX(0);
    }

    /* Main content: full width, top bar shifted */
    main  { margin-left: 0 !important; }
    header.fixed { left: 0 !important; padding-left: 56px; }
    footer { margin-left: 0 !important; }

    /* Min font / tap target sizes */
    body { font-size: 14px; }
    .btn { min-height: 44px; }
    .btn.text-xs { min-height: 36px; }
    .nav-rail-item { min-height: 48px; }

    /* Calendar: dots instead of event blocks on month view */
    .calendar-cell { min-height: 64px; padding: 4px; }
    .calendar-event {
        width: 8px; height: 8px;
        padding: 0;
        overflow: hidden;
        font-size: 0;
        display: inline-block;
        margin: 1px;
        vertical-align: middle;
    }

    /* Dashboard KPI: 2-col grid */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Habits: responsive */
    .habit-drag-handle { display: none; }
    .habit-card-actions { opacity: 1; flex-direction: row; padding: 0 .35rem; }
    .hb-ws-dots { max-width: 32px; }
    .hb-ws-dot { width: 5px; height: 5px; }

    /* Planner: stack timeline and task list */
    .planner-layout {
        grid-template-columns: 1fr !important;
    }
    .planner-col-left  { display: none; }
    .planner-col-left.active  { display: block; }
    .planner-col-right { display: none; }
    .planner-col-right.active { display: block; }

    /* Planner mobile tabs */
    .planner-mobile-tabs { display: flex !important; }

    /* Deep work: center everything, hide secondary panels */
    .dw-layout {
        grid-template-columns: 1fr !important;
    }
    .dw-side-panel {
        display: none;
    }
    .dw-side-panel.open {
        display: block;
    }
    #dw-expand-panels {
        display: flex !important;
    }

    /* Modal: full width on mobile */
    .modal-box {
        min-width: unset;
        width: 95%;
        padding: 1.25rem;
    }

    /* Page padding */
    .p-6 { padding: 1rem !important; }
    .lg\\:p-8 { padding: 1rem !important; }
}

/* --- Animations --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }

@keyframes pulse-glow {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
}
.pulse-glow { position: relative; }
.pulse-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    box-shadow: 0 0 0 8px rgba(183,196,255,0.3);
    animation: pulse-glow 2s ease-in-out infinite;
    pointer-events: none;
    will-change: opacity;
}

/* --- Focus mode (deep work immersive) --- */
.focus-mode body > *:not(#focus-overlay) { display: none !important; }

/* ================================================================
   DAY MODAL ITEMS (calendrier → clic sur journée)
================================================================ */
.day-modal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--color-surface-high);
    border-left: 3px solid var(--color-outline);
    cursor: pointer;
    transition: background 0.1s;
}
.day-modal-item:hover { background: #323233; }

/* ================================================================
   BREATHING ANIMATION (4-7-8 pattern)
================================================================ */
.breathing-bg {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.breathing-bg.active { opacity: 1; }
.breathing-circle {
    width: 320px;
    height: 320px;
    border-radius: 50% !important;
    background: radial-gradient(circle, rgba(183,196,255,0.06) 0%, rgba(183,196,255,0.02) 50%, transparent 70%);
    border: 1px solid rgba(183,196,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.7);
    will-change: transform;
    position: relative;
}
.breathing-circle::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50% !important;
    border: 1px solid rgba(183,196,255,0.18);
    opacity: 0;
    transition: opacity 0s linear;
    pointer-events: none;
}
.breathing-label {
    position: absolute;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: rgba(183,196,255,0.5);
    text-transform: uppercase;
    margin-top: 220px;
}
/* Keyframe animations controlled by JS via inline style */
@keyframes breathe-in {
    from { transform: scale(0.7); }
    to   { transform: scale(1.2); }
}
@keyframes breathe-hold {
    from { transform: scale(1.2); }
    to   { transform: scale(1.2); }
}
@keyframes breathe-out {
    from { transform: scale(1.2); }
    to   { transform: scale(0.7); }
}

/* ================================================================
   PRODUCTIVITY TIPS TICKER
================================================================ */
.tips-container {
    overflow: hidden;
    position: relative;
    min-height: 3.8rem;
    background: var(--color-surface-high);
    border-left: 3px solid var(--color-primary);
    padding: 0.5rem 0.75rem;
}
.tips-item {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--color-text) !important;
    font-style: italic;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.tips-item.visible {
    opacity: 1;
    transform: translateY(0);
}
.tips-item.phase-tip {
    color: var(--color-primary) !important;
    font-style: normal;
    font-weight: 600;
}
/* ================================================================
   PLANNER MOBILE TABS
================================================================ */
.planner-mobile-tabs {
    gap: 0;
}
.planner-tab-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.planner-tab-btn.active-tab {
    color: var(--color-text);
    border-bottom-color: var(--color-primary);
}
/* On mobile, planner columns hidden unless .active */
@media (max-width: 768px) {
    .planner-col-left,
    .planner-col-right {
        display: none;
    }
    .planner-col-left.active,
    .planner-col-right.active {
        display: block;
    }
}

/* ================================================================
   QUICK-CREATE CARD
================================================================ */
#qc-card {
    position: fixed;
    z-index: 1000;
    width: 280px;
    background: #2a2a2b;
    border: 1px solid var(--cal-accent);
    border-top: 3px solid var(--cal-accent);
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    font-family: inherit;
}
.qc-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--color-surface-low);
    border-bottom: 1px solid var(--color-outline);
    cursor: move;
    user-select: none;
}
.qc-handle-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cal-accent);
}
.qc-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    padding: 0;
}
.qc-close:hover { color: var(--color-text); }
.qc-body { padding: 10px; }
.qc-input {
    width: 100%;
    background: var(--color-surface-low);
    border: 1px solid var(--color-outline);
    color: var(--color-text);
    font-size: 0.85rem;
    font-family: inherit;
    padding: 6px 8px;
    outline: none;
    margin-bottom: 8px;
}
.qc-input:focus { border-color: var(--cal-accent); }
.qc-input.qc-error { border-color: var(--color-error); }
.qc-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}
.qc-swatch {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .1s;
}
.qc-swatch:hover { transform: scale(1.2); }
.qc-swatch.qc-selected {
    border-color: #fff;
    box-shadow: 0 0 0 1px var(--cal-accent);
}
.qc-actions {
    display: flex;
    gap: 6px;
}
.qc-btn-save {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--cal-accent);
    color: #0a1f28;
    border: none;
    font-size: 0.7rem;
    font-weight: 800;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    cursor: pointer;
    transition: opacity .15s;
}
.qc-btn-save:hover { opacity: .85; }
.qc-btn-expand {
    background: var(--color-surface-low);
    border: 1px solid var(--color-outline);
    color: var(--color-text-muted);
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.qc-btn-expand:hover { color: var(--cal-accent); }

/* ================================================================
   SHORTCUTS HELP MODAL
================================================================ */
#shortcuts-help {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}
.sh-box {
    background: var(--color-surface-mid);
    border: 1px solid var(--color-outline);
    width: 320px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,.8);
}
.sh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-outline);
}
.sh-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
}
.sh-header button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
}
.sh-header button:hover { color: var(--color-text); }
.sh-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.sh-row { display: flex; align-items: center; gap: 14px; }
.sh-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.65rem;
    font-weight: 800;
    font-family: inherit;
    background: var(--color-surface-high);
    border: 1px solid var(--color-outline);
    color: var(--color-primary);
    flex-shrink: 0;
}
.sh-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ================================================================
   EVT DROP ZONE indicator
================================================================ */
.evt-drop-zone.drag-over { background: rgba(183,196,255,.05); }

/* Global drag-over highlight */
.drag-over {
    outline: 2px dashed #b7c4ff;
    background: rgba(183, 196, 255, 0.08) !important;
    transition: background 0.15s;
}

#focus-overlay {
    position: fixed;
    inset: 0;
    background: #0a0a0b;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#focus-overlay:not(.hidden) {
    display: flex !important;
}

/* ================================================================
   TAG PICKER — Composant cross-modules
================================================================ */
.tag-picker { margin-top: .5rem; }
.tag-picker-selected { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: .35rem; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; font-size: .6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    border: 1px solid; background: rgba(183,196,255,0.06);
}
.tag-chip-remove {
    background: none; border: none; cursor: pointer;
    font-size: .75rem; line-height: 1; padding: 0 0 0 3px;
    opacity: .6; transition: opacity .15s; color: inherit;
}
.tag-chip-remove:hover { opacity: 1; }
.tag-picker-controls { display: flex; gap: .35rem; align-items: center; }
.tag-picker-select {
    flex: 1; height: 28px; padding: 0 6px;
    font-size: .6rem; font-weight: 700; text-transform: uppercase;
    background: var(--color-surface-high, #2a2a2b);
    border: 1px solid var(--color-outline, #45464f);
    color: var(--color-text-muted, #c6c5d0); cursor: pointer;
}
.tag-picker-create-btn {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    background: var(--color-surface-high, #2a2a2b);
    border: 1px solid var(--color-outline, #45464f);
    color: var(--color-text-muted, #c6c5d0);
    cursor: pointer; transition: all .15s;
}
.tag-picker-create-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
/* Tag chips in read-only (cards) */
.tag-inline { display: inline-flex; align-items: center; gap: 3px;
    padding: 1px 6px; font-size: .5rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    border: 1px solid; background: rgba(183,196,255,0.04); }

/* ================================================================
   FOCUS QUEUE — Sidebar dans Deep Work
================================================================ */
.focus-queue-panel {
    background: var(--color-surface-low, #1c1b1c);
    border: 1px solid var(--color-outline, #45464f);
    padding: 1rem; margin-bottom: 1rem;
}
.fq-item {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .4rem; border-bottom: 1px solid rgba(69,70,79,0.3);
    font-size: .7rem; font-weight: 600; color: var(--color-text);
    transition: background .12s; cursor: grab;
}
.fq-item:last-child { border-bottom: none; }
.fq-item:hover { background: rgba(242,201,76,0.06); }
.fq-item.fq-completed { opacity: .4; text-decoration: line-through; }
.fq-item .fq-order { font-size: .55rem; font-weight: 900; color: var(--dw-primary, #f2c94c); min-width: 1rem; text-align: center; }
.fq-item .fq-remove { background: none; border: none; cursor: pointer; color: var(--color-text-muted); font-size: .7rem; opacity: .4; transition: opacity .15s; margin-left: auto; }
.fq-item .fq-remove:hover { opacity: 1; color: var(--color-error, #eb5757); }
.fq-next-badge {
    font-size: .5rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
    padding: 1px 5px; background: rgba(242,201,76,0.15); color: var(--dw-primary, #f2c94c);
}

/* ================================================================
   WEEKLY REVIEW — accent #c4b5fd
================================================================ */
.review-accent { color: #c4b5fd; }
.review-kpi-card {
    text-align: center; padding: 1rem;
    background: var(--color-surface-low, #1c1b1c);
    border: 1px solid var(--color-outline, #45464f);
}
.review-kpi-val { font-size: 1.5rem; font-weight: 900; color: #c4b5fd; line-height: 1; }
.review-kpi-label { font-size: .55rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .08em; margin-top: .25rem; }
.review-task-list { list-style: none; padding: 0; margin: 0; }
.review-task-item { padding: .35rem 0; font-size: .72rem; color: var(--color-text); border-bottom: 1px solid rgba(69,70,79,.2); }
.review-task-item:last-child { border-bottom: none; }
.review-reflection textarea {
    width: 100%; min-height: 120px; background: var(--color-surface-high, #2a2a2b);
    border: 1px solid var(--color-outline); color: var(--color-text); padding: .75rem;
    font-size: .8rem; resize: vertical; font-family: inherit;
}
.review-rating-btns { display: flex; gap: .35rem; }
.review-rating-btn {
    padding: .4rem .8rem; font-size: .6rem; font-weight: 700; text-transform: uppercase;
    background: var(--color-surface-high); border: 1px solid var(--color-outline);
    color: var(--color-text-muted); cursor: pointer; transition: all .15s;
}
.review-rating-btn:hover, .review-rating-btn.active { background: rgba(196,181,253,0.12); border-color: #c4b5fd; color: #c4b5fd; }
.review-history-item {
    padding: .75rem; border: 1px solid var(--color-outline);
    background: var(--color-surface-low); margin-bottom: .5rem;
    cursor: pointer; transition: background .12s;
}
.review-history-item:hover { background: rgba(196,181,253,0.04); }

/* ================================================================
   INSIGHTS — Stats Intelligence
================================================================ */
.insight-card {
    padding: 1rem; border-left: 3px solid #fb923c;
    background: var(--color-surface-low, #1c1b1c);
    border-top: 1px solid var(--color-outline, #45464f);
    border-right: 1px solid var(--color-outline, #45464f);
    border-bottom: 1px solid var(--color-outline, #45464f);
}
.insight-text { font-size: .75rem; color: var(--color-text); line-height: 1.5; }
.insight-icon { color: #fb923c; font-size: 18px; flex-shrink: 0; }

/* ================================================================
   FOOTER
================================================================ */
.footer-link {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-on-surface-variant, #c6c5d0);
    transition: color 0.15s;
}
.footer-link:hover { color: var(--color-primary); }
.footer-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.6rem;
    font-weight: 800;
    font-family: inherit;
    text-transform: uppercase;
    background: var(--color-surface-high);
    border: 1px solid var(--color-outline);
    color: var(--color-primary);
    letter-spacing: 0;
}

/* ================================================================
   GLOBAL SEARCH RESULTS (sidebar)
================================================================ */
.gsr-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; cursor: pointer;
    text-decoration: none; color: var(--color-on-surface);
    border-bottom: 1px solid rgba(69,70,79,0.3);
    transition: background 0.12s;
}
.gsr-item:hover, .gsr-item.gsr-focused { background: rgba(183,196,255,0.07); }
.gsr-item .gsr-icon { font-size: 16px; flex-shrink: 0; opacity: 0.7; }
.gsr-item .gsr-label { font-size: 0.8rem; font-weight: 600; flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsr-item .gsr-meta { font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; opacity: 0.5; flex-shrink: 0; }
.gsr-item.gsr-done .gsr-label { text-decoration: line-through; opacity: 0.5; }
.gsr-module-header { padding: 6px 16px 2px;
    font-size: 0.55rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--color-on-surface-variant); opacity: 0.6; }

/* ================================================================
   STATS — Classes réutilisables
================================================================ */
.kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .58rem;
    font-weight: 700;
    margin-top: .35rem;
}
.kpi-delta.up   { color: #6fcf97; }
.kpi-delta.down { color: #ffb4ab; }
.kpi-delta.flat { color: #90909a; }

.intel-card {
    border-top: 2px solid #fb923c;
}

.priority-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .45rem;
}
.priority-label {
    font-size: .55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    width: 3.5rem;
    flex-shrink: 0;
}
.priority-count {
    font-size: .6rem;
    font-weight: 700;
    min-width: 2.5rem;
    text-align: right;
    flex-shrink: 0;
}

/* ── Shared: SVG progress ring ── */
.ring-wrap {
    flex-shrink: 0;
    position: relative;
}
.ring-wrap svg {
    display: block;
    transform: rotate(-90deg);
}
.ring-bg { fill: none; stroke: var(--color-surface-high, #2a2b30); stroke-width: 4; }
.ring-fg { fill: none; stroke-width: 4; transition: stroke-dashoffset 0.5s ease; stroke-linecap: round; }
.ring-pct {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 900; letter-spacing: -0.03em;
    color: var(--color-text, #e2e8f0);
}

/* ── Shared: Status badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.status-badge.active    { background: rgba(155,142,242,0.15); color: #9b8ef2; }
.status-badge.paused    { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.status-badge.completed { background: rgba(111,207,151,0.15); color: #6fcf97; }
.status-badge.archived  { background: rgba(138,138,143,0.15); color: #8a8a8f; }

/* ── Shared: Stats banner ── */
.stats-banner {
    background: var(--color-surface-low, #1e1f24);
    border: 1px solid rgba(183,196,255,0.18);
    border-left: 3px solid var(--color-primary, #b7c4ff);
    padding: 14px 18px;
}
.stats-banner-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 640px) { .stats-banner-grid { grid-template-columns: repeat(2, 1fr); } }
.stats-banner-cell { display: flex; flex-direction: column; gap: 3px; }
.stats-banner-value {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
}
.stats-banner-key {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted, #8a8a8f);
}

/* ================================================================
   SETTINGS PAGE
================================================================ */

.settings-layout {
    display: flex;
    gap: 0;
    min-height: 60vh;
}

/* Vertical tab navigation */
.settings-tab-nav {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--color-outline);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
}

.settings-tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-right: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    text-align: left;
    width: 100%;
}

.settings-tab-btn:hover {
    color: var(--color-text);
    background: var(--color-surface-high);
}

.settings-tab-btn.active {
    color: var(--color-primary);
    background: rgba(183, 196, 255, 0.08);
    border-right-color: var(--color-primary);
}

.settings-tab-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Content area */
.settings-content {
    flex: 1;
    padding: 0 2rem;
    min-width: 0;
}

/* Panel visibility */
.settings-panel { display: block; }
.settings-panel.hidden { display: none; }

/* Section headers within panels */
.settings-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-outline);
}

.settings-section-title:not(:first-child) {
    margin-top: 2rem;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    display: inline-block;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-switch .toggle-track {
    position: absolute;
    inset: 0;
    background: var(--color-surface-high);
    border: 1px solid var(--color-outline);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.toggle-switch .toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: var(--color-text-muted);
    transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-track {
    background: rgba(183, 196, 255, 0.2);
    border-color: var(--color-primary);
}
.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(20px);
    background: var(--color-primary);
}

/* Toggle row (label + switch + description) */
.settings-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(69, 70, 79, 0.3);
}
.settings-toggle-row:last-child {
    border-bottom: none;
}
.settings-toggle-info {
    flex: 1;
}
.settings-toggle-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}
.settings-toggle-desc {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Format selector group (radio-style buttons) */
.format-group {
    display: flex;
    gap: 0;
    border: 1px solid var(--color-outline);
    width: fit-content;
}
.format-group .format-option {
    padding: 8px 18px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-right: 1px solid var(--color-outline);
    cursor: pointer;
    transition: all 0.15s;
}
.format-group .format-option:last-child {
    border-right: none;
}
.format-group .format-option.active {
    background: rgba(183, 196, 255, 0.15);
    color: var(--color-primary);
}
.format-group .format-option:hover:not(.active) {
    background: var(--color-surface-high);
    color: var(--color-text);
}

/* Date preview badge */
.date-preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-surface-low);
    border: 1px solid var(--color-outline);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.02em;
    margin-top: 0.5rem;
}

/* Danger card */
.settings-danger-card {
    border: 1px solid rgba(235, 87, 87, 0.3);
    background: rgba(147, 0, 10, 0.08);
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Delete modal */
.settings-delete-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.settings-delete-modal.hidden { display: none; }
.settings-delete-box {
    background: var(--color-surface-mid);
    border: 1px solid var(--color-outline);
    padding: 2rem;
    width: 90%;
    max-width: 420px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .settings-layout {
        flex-direction: column;
    }
    .settings-tab-nav {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-outline);
        padding: 0;
        gap: 0;
    }
    .settings-tab-btn {
        flex-shrink: 0;
        border-right: none;
        border-bottom: 2px solid transparent;
        padding: 10px 14px;
        white-space: nowrap;
        font-size: 0.62rem;
    }
    .settings-tab-btn.active {
        border-right-color: transparent;
        border-bottom-color: var(--color-primary);
    }
    .settings-tab-btn .material-symbols-outlined {
        font-size: 16px;
    }
    .settings-content {
        padding: 1rem 0;
    }
    .settings-tab-btn span:not(.material-symbols-outlined) {
        display: none;
    }
}


/* ================================================================
   28. Plans & Pricing
================================================================ */

/* --- Sidebar premium lock badge --- */
.premium-lock {
    position: absolute;
    top: 2px;
    right: 4px;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(183, 196, 255, 0.12);
    border-radius: 50%;
}
.premium-lock .material-symbols-outlined {
    font-size: 8px !important;
    color: #b7c4ff;
    font-variation-settings: 'FILL' 1, 'wght' 500;
}

/* --- Plan badges --- */
.badge-plan {
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-plan-free {
    background: var(--color-surface-high, #2a2a2b);
    color: var(--color-text-muted, #c6c5d0);
}
.badge-plan-premium {
    background: rgba(183, 196, 255, 0.15);
    color: #b7c4ff;
}
.badge-plan-trial {
    background: rgba(111, 207, 151, 0.15);
    color: #6fcf97;
}

/* --- Premium wall --- */
.premium-wall {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    min-height: 60vh;
}
.premium-wall-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}
.premium-wall-features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.premium-wall-features li {
    padding: 0.4rem 0;
    font-size: 0.8rem;
    color: var(--color-text-muted, #c6c5d0);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Pricing page cards --- */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}
.pricing-card {
    background: var(--color-surface-mid, #201f20);
    border: 1px solid var(--color-outline, #45464f);
    padding: 2rem;
}
.pricing-card.featured {
    border-color: #b7c4ff;
    position: relative;
}
.pricing-card.featured::before {
    content: 'RECOMMENDED';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #b7c4ff;
    color: #1f2d5e;
    font-size: 0.5rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    padding: 3px 14px;
    white-space: nowrap;
}
.pricing-price {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--color-text, #e5e2e3);
}
.pricing-period {
    font-size: 0.75rem;
    color: var(--color-text-muted, #c6c5d0);
    font-weight: 700;
}
.pricing-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}
.pricing-features li {
    padding: 0.35rem 0;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted, #c6c5d0);
}
.pricing-check { color: #6fcf97; }
.pricing-lock  { color: var(--color-outline, #45464f); opacity: 0.5; }

/* --- Plan comparison table --- */
.plan-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.plan-compare-table th {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-outline, #45464f);
    color: var(--color-text-muted, #c6c5d0);
}
.plan-compare-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(69, 70, 79, 0.3);
    color: var(--color-text-muted, #c6c5d0);
    vertical-align: middle;
}

/* --- Simulated payment form --- */
.payment-form {
    max-width: 400px;
}
.payment-form .card-field {
    background: var(--color-surface-low, #1c1b1c);
    border: 1px solid var(--color-outline, #45464f);
    padding: 0.65rem 0.9rem;
    font-family: 'Inter', monospace;
    font-size: 0.8rem;
    color: var(--color-text, #e5e2e3);
    width: 100%;
    transition: border-color 0.15s;
}
.payment-form .card-field:focus {
    outline: none;
    border-color: #b7c4ff;
}
.payment-form .card-field::placeholder {
    color: var(--color-text-muted, #c6c5d0);
    opacity: 0.4;
}

/* --- Upgrade modal --- */
#upgrade-modal .modal-box {
    text-align: center;
    max-width: 420px;
}

/* --- Responsive pricing --- */
@media (max-width: 640px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    .pricing-price {
        font-size: 2rem;
    }
    .premium-wall {
        padding: 2rem 1rem;
        min-height: 50vh;
    }
}
