@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ===========================
   VARIABLES — DARK MODE (default)
   Palette: warm brown/amber
=========================== */
:root {
    --bg: #16120e;
    --bg-surface: #1f1a14;
    --bg-elevated: #28221a;
    --bg-card: #322d27;
    --bg-input: #1f1a14;
    --border: rgba(191,132,64,0.18);
    --border-strong: rgba(191,132,64,0.35);
    --text: #f0ece4;
    --text-muted: #9a8a76;
    --text-subtle: #c4b49e;
    --accent: #d4903a;
    --accent-glow: rgba(212,144,58,0.25);
    --accent-dim: rgba(212,144,58,0.12);
    --red: #f06040;
    --green: #4caf72;
    --blue: #6a9fd8;
    --purple: #b09ad0;

    --color-todo: rgba(212,144,58,0.12);
    --color-doing: rgba(106,159,216,0.13);
    --color-review: rgba(176,154,208,0.13);
    --color-done: rgba(76,175,114,0.12);
    --color-cancelled: rgba(240,96,64,0.10);
    --color-archived: rgba(154,138,118,0.10);

    --font: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --r: 10px;
    --r-sm: 6px;
    --r-lg: 16px;

    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   LIGHT MODE
   Palette: warm off-white / orange
=========================== */
:root.light {
    --bg: #f0ece4;
    --bg-surface: #faf8f4;
    --bg-elevated: #ede8df;
    --bg-card: #faf8f4;
    --bg-input: #e8e2d8;
    --border: rgba(100,76,44,0.15);
    --border-strong: rgba(100,76,44,0.30);
    --text: #1e1710;
    --text-muted: #7a6248;
    --text-subtle: #9a826a;
    --accent: #c8621a;
    --accent-glow: rgba(200,98,26,0.2);
    --accent-dim: rgba(200,98,26,0.09);
    --red: #c83820;
    --green: #2e7a42;
    --blue: #2a5a8a;
    --purple: #6a4a8a;

    --color-todo: rgba(200,98,26,0.10);
    --color-doing: rgba(42,90,138,0.09);
    --color-review: rgba(106,74,138,0.09);
    --color-done: rgba(46,122,66,0.09);
    --color-cancelled: rgba(200,56,32,0.08);
    --color-archived: rgba(122,98,72,0.08);
}

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

/* ===========================
   BASE
=========================== */
html {
    scroll-behavior: smooth;
}

html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition:
        background-color 0.4s ease,
        color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease !important;
}

html {
    height: 100%;
}

body {
    background-color: var(--bg);
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100%;
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ===========================
   LAYOUT
=========================== */
.app-wrapper {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: 24px 28px;
    background-color: var(--bg);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    animation: fadeIn 0.4s ease;
}

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

/* ===========================
   HEADER
=========================== */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 54px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    position: relative;
    z-index: 100;
    backdrop-filter: blur(12px);
}

header h1 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-subtle);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

#darkToggle {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text-subtle);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.02em;
}

#darkToggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

main header {
    background: none;
    border: none;
    padding: 0 0 20px 0;
    position: static;
    height: auto;
}

main header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* ===========================
   SIDEBAR
=========================== */
.sidebar {
    width: 210px;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 0;
    position: relative;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: width var(--transition);
    z-index: 50;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.sidebar .logo .app-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar .logo-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

#sidebarToggle {
    background: none;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--r-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1;
}

#sidebarToggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sidebar h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

.sidebar .projects ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar nav li {
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-subtle);
    transition: all var(--transition);
    background: none;
    border: none;
    box-shadow: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar nav li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border-strong);
    flex-shrink: 0;
    transition: background var(--transition);
}

.sidebar nav li:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.sidebar nav li:hover::before { background: var(--accent); }

.sidebar.collapsed { width: 52px; overflow: hidden; }
.sidebar.collapsed .projects,
.sidebar.collapsed .user,
.sidebar.collapsed h2,
.sidebar.collapsed .logo-dot { display: none; }

/* ===========================
   MAIN TOP SECTION
=========================== */
.main-top {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    margin-bottom: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.main-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), transparent);
    border-radius: 3px 0 0 3px;
}

/* ===========================
   FORM
=========================== */
form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg-elevated);
    padding: 16px;
    border-radius: var(--r);
    border: 1px solid var(--border);
}

.form-properties {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-subtle);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

button.addTask {
    width: 100%;
    padding: 11px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--r);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    letter-spacing: 0.02em;
    transition: all var(--transition);
}

button.addTask:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
    filter: brightness(1.1);
}

button.addTask:active { transform: translateY(0); }

/* ===========================
   INPUTS
=========================== */
input[type="text"],
input[type="date"],
input[type="search"],
select {
    padding: 9px 12px;
    font-size: 14px;
    font-family: var(--font);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--bg-input);
    color: var(--text);
    width: 100%;
    transition: all var(--transition);
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder { color: var(--text-muted); }
select option { background: var(--bg-surface); }

/* ===========================
   BUTTONS
=========================== */
button {
    padding: 8px 16px;
    background: var(--accent);
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font);
    transition: all var(--transition);
}

button:hover { opacity: 0.85; }

/* ===========================
   SEARCH + FILTERS
=========================== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.search-bar input {
    flex: 1;
    background: var(--bg-elevated);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 14px;
}

.filter-btn {
    padding: 5px 13px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-subtle);
    transition: all var(--transition);
    letter-spacing: 0.01em;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--text);
    background: var(--accent-dim);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
}

/* ===========================
   TASK LIST
=========================== */
.task-list-section {
    display: flex;
    flex-direction: column;
}

#taskList {
    overflow-y: auto;
    max-height: 46vh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

#taskList::-webkit-scrollbar { width: 4px; }
#taskList::-webkit-scrollbar-track { background: transparent; }
#taskList::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
#taskList::-webkit-scrollbar-thumb:hover { background: var(--accent); }

ul { list-style: none; }

li {
    background: var(--bg-card);
    padding: 12px 14px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    transition: all var(--transition);
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
}

li:hover {
    border-color: var(--border-strong);
    transform: translateX(2px);
}

li.status-to-do     { background-color: var(--color-todo);      border-left: 3px solid var(--accent); }
li.status-doing     { background-color: var(--color-doing);     border-left: 3px solid var(--blue); }
li.status-review    { background-color: var(--color-review);    border-left: 3px solid var(--purple); }
li.status-done      { background-color: var(--color-done);      border-left: 3px solid var(--green); }
li.status-cancelled { background-color: var(--color-cancelled); border-left: 3px solid var(--red); }
li.status-archived  { background-color: var(--color-archived);  border-left: 3px solid var(--text-muted); opacity: 0.7; }

/* ===========================
   TASK CARD
=========================== */
.task-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.task-main input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--accent);
}

.task-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.task-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-top strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-date {
    font-size: 12px;
    color: var(--text-subtle);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.task-meta select {
    font-weight: 600;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font);
    padding: 0;
    width: auto;
}

.task-meta select:focus {
    outline: none;
    box-shadow: none;
}

.task-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.task-stars { font-size: 11px; letter-spacing: -2px; }

.task-assigned {
    font-size: 12px;
    color: var(--text-subtle);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    font-weight: 500;
}

.task-cancel {
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    opacity: 0.35;
    font-size: 14px;
    border-radius: var(--r-sm);
    transition: all var(--transition);
    flex-shrink: 0;
}

.task-cancel:hover {
    opacity: 1;
    background: rgba(240,96,64,0.15);
}

/* ===========================
   STATISTICS
=========================== */
.stats-section {
    margin-bottom: 16px;
    padding: 22px 26px;
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 24px 32px;
}

.donut-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 18px 24px;
    flex: 0 0 auto;
}

.donut-svg-container {
    position: relative;
    width: 160px;
    height: 160px;
}

.donut-svg-container svg { transform: rotate(-90deg); }

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.donut-center-number {
    font-size: 30px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    font-family: var(--font);
    line-height: 1;
}

.donut-center-label {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
}

.stats-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 260px;
    max-width: 300px;
    min-width: 220px;
}

.stats-numbers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.stats-numbers span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-elevated);
    border-radius: var(--r);
    padding: 14px 16px;
    border: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-subtle);
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: default;
    transition: all var(--transition);
    min-height: 54px;
}

.stats-numbers span:hover {
    border-color: var(--border-strong);
    background: var(--bg-card);
}

.stats-numbers span::before {
    flex-shrink: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font);
    letter-spacing: -0.03em;
    min-width: 2ch;
    line-height: 1;
}

#numTaskCompleted::before { content: attr(data-value); }
#numTaskInProgress::before { content: attr(data-value); }
#numTotalTasks::before { content: attr(data-value); }
#numTaskTodo::before { content: attr(data-value); }

#numTaskTodo       { border-left: 3px solid var(--accent); }
#numTaskInProgress { border-left: 3px solid var(--blue); }
#numTaskCompleted  { border-left: 3px solid var(--green); }
#numTotalTasks     { border-left: 3px solid var(--text-muted); }

.donut-legend {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-start;
    justify-content: center;
    padding: 4px 0;
    min-width: 7rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-subtle);
    font-family: var(--font-mono);
    font-weight: 500;
    white-space: nowrap;
}

.legend-item--stack {
    align-items: flex-start;
    white-space: normal;
}

.legend-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.25;
}

.legend-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-subtle);
}

.legend-sub {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    text-transform: none;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.progress-bar-wrapper,
.progress-bar,
#progressLabel { display: none; }

/* ===========================
   BOTTOM SECTION
=========================== */
.bottom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.critical-tasks, .calendar-placeholder {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px 20px;
}

.critical-tasks { border-left: 3px solid var(--accent); }

.critical-tasks h3,
.calendar-placeholder h3 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.critical-summary {
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    color: var(--text);
    margin: -4px 0 14px;
    padding: 12px 14px 12px 16px;
    background: var(--accent-dim);
    border-radius: var(--r);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

:root.light .critical-summary {
    box-shadow: 0 1px 3px rgba(100, 76, 44, 0.08);
}

#criticalList {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===========================
   CALENDAR
=========================== */
.cal-month {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day-name {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 3px 0;
    font-family: var(--font-mono);
    font-weight: 600;
}

.cal-day {
    font-size: 12px;
    text-align: center;
    padding: 5px 2px;
    border-radius: var(--r-sm);
    position: relative;
    cursor: default;
    color: var(--text-subtle);
    transition: all var(--transition);
    font-family: var(--font-mono);
}

.cal-day:not(.empty):hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.cal-day.today {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

.cal-day.has-task::after {
    content: '';
    display: block;
    width: 3px;
    height: 3px;
    background: var(--accent);
    border-radius: 50%;
    margin: 2px auto 0;
}

.cal-day.today.has-task::after { background: rgba(255,255,255,0.8); }
.cal-day.empty { background: none; }

/* ===========================
   HOW IT WORKS
=========================== */
.how-it-works {
    margin-bottom: 16px;
    padding: 20px;
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
}

.how-it-works h3 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

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

.how-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: var(--bg-elevated);
    border-radius: var(--r);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.how-item:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.how-icon { font-size: 18px; }

.how-item strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.how-item p {
    font-size: 13px;
    color: var(--text-subtle);
    line-height: 1.55;
    margin: 0;
}

/* ===========================
   FOOTER
=========================== */
footer {
    flex-shrink: 0;
    text-align: center;
    padding: 14px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    font-family: var(--font-mono);
    position: relative;
    z-index: 1;
}

/* ===========================
   CONFIRM DIALOG
=========================== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 8, 6, 0.72);
    backdrop-filter: blur(6px);
}

:root.light .confirm-overlay {
    background: rgba(30, 23, 16, 0.45);
}

.confirm-dialog {
    width: 100%;
    max-width: 400px;
    padding: 22px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.confirm-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-subtle);
    margin: 0 0 16px;
    line-height: 1.5;
}

.confirm-skip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 18px;
    user-select: none;
}

.confirm-skip input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 8px 18px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
}

.confirm-btn--secondary {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
    color: var(--text-subtle);
}

.confirm-btn--secondary:hover {
    border-color: var(--accent);
    color: var(--text);
}

.confirm-btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.confirm-btn--primary:hover {
    filter: brightness(1.08);
}

body.confirm-modal-open {
    overflow: hidden !important;
}

body.confirm-modal-open main {
    overflow: hidden;
}

#confirmOverlay[hidden] {
    display: none !important;
}

footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ===========================
   ARCHIVED
=========================== */
.archived-task strong {
    text-decoration: line-through;
    opacity: 0.5;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 900px) {
    .main-top { grid-template-columns: 1fr; }
    .stats-section {
        flex-direction: column;
        align-items: stretch;
    }
    .stats-right {
        max-width: none;
        min-width: 0;
    }
    .donut-wrapper {
        flex-direction: column;
        gap: 16px;
    }
    .donut-legend {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        min-width: 0;
        gap: 8px 14px;
    }
    .stats-numbers { grid-template-columns: repeat(2, 1fr); }
    .bottom-section { grid-template-columns: 1fr; }
    .how-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    html, body {
        max-height: none;
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .app-wrapper {
        flex: 1 1 auto;
        min-height: auto;
        overflow: visible;
    }

    .sidebar {
        width: 100%;
        height: auto;
        min-height: 0;
        position: relative;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        align-self: stretch;
        overflow: visible;
    }

    .sidebar .projects { display: none; }

    main {
        padding: 16px;
        overflow: visible;
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .stats-numbers { grid-template-columns: repeat(2, 1fr); }
    .how-grid { grid-template-columns: 1fr; }
    .filters { flex-wrap: wrap; gap: 4px; }
}