/* ══════════════════════════════════════════════════════════
   Todo / Task Manager — Navbar Widget + Full Page Styles
   ══════════════════════════════════════════════════════════ */

/* ── Navbar Popover ── */
.navbar-todo-popover { width: 360px; overflow: hidden; }

.navbar-todo-badge {
    position: absolute;
    top: 2px; right: 2px;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    background: #f87171; color: var(--sb-text-inverse);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
}
.navbar-todo-badge:empty,
.navbar-todo-badge.hidden { display: none; }

/* Quick Add Form */
.todo-quick-form {
    padding: 12px 16px;
    border-bottom: 1px solid var(--sb-border-light);
}
.todo-quick-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--sb-input-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--sb-input-bg);
    color: var(--sb-input-text);
    outline: none;
    margin-bottom: 8px;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.todo-quick-input:focus { border-color: var(--sb-primary, #0d6efd); }
.todo-quick-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.todo-quick-date {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--sb-input-border);
    border-radius: 8px;
    font-size: 12px;
    background: var(--sb-input-bg);
    color: var(--sb-input-text);
    outline: none;
    font-family: inherit;
}
.todo-quick-date:focus { border-color: var(--sb-primary, #0d6efd); }
.todo-quick-select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--sb-input-border);
    border-radius: 8px;
    font-size: 12px;
    outline: none;
    background: var(--sb-input-bg);
    color: var(--sb-input-text);
    cursor: pointer;
}
.todo-quick-add-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: var(--sb-primary, #0d6efd);
    color: var(--sb-text-inverse);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    white-space: nowrap;
    transition: background 0.15s;
}
.todo-quick-add-btn:hover { background: var(--sb-primary-hover); }

.todo-quick-msg {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    text-align: center;
}
.todo-quick-msg.success { background: var(--sb-success-bg); color: var(--sb-success-text); }
.todo-quick-msg.error { background: var(--sb-danger-bg); color: var(--sb-danger-text); }
.todo-quick-msg.hidden { display: none; }

/* Recent Tasks */
.todo-recent-section { padding: 0; }
.todo-recent-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--sb-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.todo-recent-list {
    max-height: 240px;
    overflow-y: auto;
}
.todo-recent-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 16px;
    transition: background 0.1s;
    cursor: default;
}
.todo-recent-item:hover { background: var(--sb-bg-secondary); }
.todo-recent-item.done .todo-recent-title {
    text-decoration: line-through;
    color: var(--sb-text-muted);
}
.todo-recent-status {
    width: 4px;
    min-height: 32px;
    border-radius: 2px;
    flex-shrink: 0;
    margin-top: 2px;
}
.todo-recent-body { flex: 1; min-width: 0; }
.todo-recent-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.todo-recent-meta {
    font-size: 11px;
    color: var(--sb-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}
.todo-recent-meta i { font-size: 11px; margin-right: 1px; }
.todo-recent-meta .overdue-text { color: var(--sb-danger); font-weight: 500; }
.todo-recent-status-label { font-weight: 500; }

/* ══════════════════════════════════════════════════════════
   FULL PAGE — Todo Manager
   ══════════════════════════════════════════════════════════ */

/* Top Toolbar */
.todo-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.todo-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}
.todo-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.todo-filter-select {
    padding: 7px 12px;
    border: 1px solid var(--sb-input-border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: var(--sb-input-bg);
    color: var(--sb-input-text);
    cursor: pointer;
    font-family: inherit;
}
.todo-filter-container .filter-dropdown {
    min-width: 320px;
}
.todo-filter-grid {
    grid-template-columns: 1fr;
    gap: 8px;
}
.todo-filter-grid .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.todo-filter-grid .filter-group label {
    margin-bottom: 0;
}
.todo-filter-grid .todo-filter-select {
    width: 100%;
}
.todo-btn-primary {
    padding: 7px 16px;
    border: none;
    border-radius: 8px;
    background: var(--sb-primary, #0d6efd);
    color: var(--sb-text-inverse);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center; gap: 6px;
    transition: background 0.15s;
    font-family: inherit;
}
.todo-btn-primary:hover { background: var(--sb-primary-hover); }
.todo-btn-secondary {
    padding: 7px 16px;
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    background: var(--sb-surface);
    color: var(--sb-text-primary);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center; gap: 6px;
    transition: background 0.15s;
    font-family: inherit;
}
.todo-btn-secondary:hover { background: var(--sb-surface-hover); }
.todo-btn-secondary.active {
    background: var(--sb-primary, #0d6efd);
    color: var(--sb-text-inverse);
    border-color: var(--sb-primary, #0d6efd);
}

.todo-view-toggle {
    display: flex;
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    overflow: hidden;
}
.todo-view-toggle button {
    padding: 6px 12px;
    border: none;
    background: var(--sb-surface);
    color: var(--sb-text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}
.todo-view-toggle button + button { border-left: 1px solid var(--sb-border); }
.todo-view-toggle button.active {
    background: var(--sb-primary, #0d6efd);
    color: var(--sb-text-inverse);
}

/* ── Kanban Board ── */
.todo-kanban {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    min-height: calc(100vh - 220px);
    overflow-x: auto;
    max-width: 100%;
}
.todo-kanban.active { display: grid; }
.todo-kanban-col {
    background: var(--sb-bg-secondary);
    border: 1px solid var(--todo-kanban-col-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    min-width: 0;
    overflow: hidden;
}
.todo-col-header {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px 10px 0 0;
    user-select: none;
}
.todo-col-header .todo-col-count {
    min-width: 22px; height: 22px;
    border-radius: 11px;
    background: var(--todo-col-count-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Column colors */
.todo-col-todo .todo-col-header { background: var(--todo-status-todo-bg); color: var(--todo-status-todo-text); }
.todo-col-in_progress .todo-col-header { background: var(--todo-status-progress-bg); color: var(--todo-status-progress-text); }
.todo-col-in_review .todo-col-header { background: var(--todo-status-review-bg); color: var(--todo-status-review-text); }
.todo-col-done .todo-col-header { background: var(--todo-status-done-bg); color: var(--todo-status-done-text); }

.todo-col-body {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    min-height: 100px;
}

/* Drag over highlight */
.todo-col-body.drag-over {
    background: var(--todo-drag-over-bg);
    border-radius: 0 0 10px 10px;
}

/* ── Kanban Card ── */
.todo-card {
    background: var(--sb-surface);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--sb-shadow-xs);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--todo-card-border);
    border-left: 3px solid transparent;
}
.todo-card:hover {
    box-shadow: var(--sb-shadow-sm);
    transform: translateY(-2px);
}
.todo-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    cursor: grabbing;
    box-shadow: var(--sb-shadow-md);
}

/* Related-to colors for left border */
.todo-card[data-related="vehicles"] { border-left-color: var(--sb-primary); }
.todo-card[data-related="bus_staff"] { border-left-color: #6f42c1; }
.todo-card[data-related="parents"] { border-left-color: #d63384; }
.todo-card[data-related="vendors"] { border-left-color: #fd7e14; }
.todo-card[data-related="other"] { border-left-color: var(--sb-text-secondary); }

.todo-card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sb-text-dark, #212529);
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.todo-card-desc {
    font-size: 12px;
    color: var(--todo-card-desc-color);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.todo-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--sb-border-light);
}

.todo-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--todo-card-meta-color);
    flex: 1;
    min-width: 0;
}
.todo-card-meta i { font-size: 11px; }
.todo-card-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: var(--todo-card-chip-default-bg);
    color: var(--todo-card-chip-default-text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.todo-card-chip.vehicles { background: var(--todo-card-chip-vehicles-bg); color: var(--todo-card-chip-vehicles-text); }
.todo-card-chip.bus_staff { background: var(--todo-card-chip-bus-staff-bg); color: var(--todo-card-chip-bus-staff-text); }
.todo-card-chip.parents { background: var(--todo-card-chip-parents-bg); color: var(--todo-card-chip-parents-text); }
.todo-card-chip.vendors { background: var(--todo-card-chip-vendors-bg); color: var(--todo-card-chip-vendors-text); }
.todo-card-chip.overdue { background: var(--todo-card-chip-overdue-bg); color: var(--todo-card-chip-overdue-text); }

.todo-card-date {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--todo-card-date-color);
}
.todo-card-date.overdue {
    color: var(--todo-card-date-overdue-color);
    font-weight: 500;
}

.todo-card-attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: var(--sb-primary, #0d6efd);
    background: var(--sb-primary-light, #e7f1ff);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s;
    flex-shrink: 0;
}
.todo-card-attach-btn:hover {
    background: var(--todo-primary-link-hover-bg);
    color: var(--sb-primary);
}

.todo-card-done .todo-card-title {
    text-decoration: line-through;
    color: var(--sb-text-muted);
}
.todo-card-done .todo-card-desc { color: var(--sb-text-muted); }
.todo-card-done .todo-card-footer { border-top-color: var(--sb-border-light); }

/* ── Calendar View ── */
.todo-calendar { display: none; }
.todo-calendar.active { display: block; }

.todo-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.todo-cal-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--sb-text-secondary);
}
.todo-cal-legend .status {
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.todo-cal-legend .status-todo { background: var(--todo-status-todo-bg); color: var(--todo-status-todo-text); }
.todo-cal-legend .status-in_progress { background: var(--todo-status-progress-bg); color: var(--todo-status-progress-text); }
.todo-cal-legend .status-in_review { background: var(--todo-status-review-bg); color: var(--todo-status-review-text); }
.todo-cal-legend .status-done { background: var(--todo-status-done-bg); color: var(--todo-status-done-text); }
.todo-cal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--sb-text-primary);
}
.todo-cal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.todo-cal-nav button {
    width: 32px; height: 32px;
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    background: var(--sb-surface);
    color: var(--sb-text-primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.todo-cal-nav button:hover { background: var(--sb-surface-hover); }

.todo-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--sb-border);
    border-radius: 10px;
    overflow: hidden;
}
.todo-cal-day-header {
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sb-text-secondary);
    text-align: center;
    background: var(--sb-bg-secondary);
    border-bottom: 1px solid var(--sb-border);
}
.todo-cal-day {
    min-height: 100px;
    padding: 6px;
    border-right: 1px solid var(--sb-border-light);
    border-bottom: 1px solid var(--sb-border-light);
    background: var(--sb-surface);
    vertical-align: top;
    position: relative;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.todo-cal-day:nth-child(7n) { border-right: none; }
.todo-cal-day.other-month { background: var(--sb-bg-tertiary); }
.todo-cal-day.today { background: var(--sb-primary-light); }
.todo-cal-day:hover {
    background: var(--sb-surface-hover);
    box-shadow: inset 0 0 0 1px var(--todo-cal-day-hover-ring);
}
.todo-cal-day:focus {
    outline: 2px solid var(--sb-primary);
    outline-offset: -2px;
}
.todo-cal-day::after {
    content: '+';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 14px;
    color: var(--sb-text-muted);
    opacity: 0;
    transition: opacity 0.15s;
}
.todo-cal-day:hover::after,
.todo-cal-day:focus::after {
    opacity: 1;
}
.todo-cal-day-num {
    font-size: 12px;
    font-weight: 500;
    color: var(--sb-text-secondary);
    margin-bottom: 4px;
}
.todo-cal-day-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}
.todo-cal-status-chip {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 18px;
    font-weight: 700;
    text-align: center;
}
.todo-cal-status-chip.status-todo { background: var(--todo-status-todo-bg); color: var(--todo-status-todo-text); }
.todo-cal-status-chip.status-in_progress { background: var(--todo-status-progress-bg); color: var(--todo-status-progress-text); }
.todo-cal-status-chip.status-in_review { background: var(--todo-status-review-bg); color: var(--todo-status-review-text); }
.todo-cal-status-chip.status-done { background: var(--todo-status-done-bg); color: var(--todo-status-done-text); }
.todo-cal-day.today .todo-cal-day-num {
    color: var(--sb-text-inverse);
    background: var(--sb-primary, #0d6efd);
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.todo-cal-item {
    padding: 3px 6px;
    margin-bottom: 2px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s;
}
.todo-cal-item:hover { opacity: 0.8; }
.todo-cal-item.status-todo { background: var(--todo-status-todo-bg); color: var(--todo-status-todo-text); }
.todo-cal-item.status-in_progress { background: var(--todo-status-progress-bg); color: var(--todo-status-progress-text); }
.todo-cal-item.status-in_review { background: var(--todo-status-review-bg); color: var(--todo-status-review-text); }
.todo-cal-item.status-done { background: var(--todo-status-done-bg); color: var(--todo-status-done-text); }

/* ── Modal ── */
.todo-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--sb-overlay-bg);
    z-index: 1070;
    align-items: center;
    justify-content: center;
}
.todo-modal-overlay.show { display: flex; }
.todo-modal {
    background: var(--sb-surface);
    border-radius: 12px;
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--sb-shadow-lg);
}
.todo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sb-border-light);
}
.todo-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--sb-text-primary);
}
.todo-modal-close {
    width: 32px; height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--sb-text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.todo-modal-close:hover { background: var(--sb-surface-hover); }
.todo-modal-body { padding: 20px; }
.todo-form-group {
    margin-bottom: 14px;
}
.todo-form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--sb-text-secondary);
    margin-bottom: 4px;
    display: block;
}
.todo-form-group input,
.todo-form-group select,
.todo-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--sb-input-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--sb-input-bg);
    color: var(--sb-input-text);
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.todo-form-group input:focus,
.todo-form-group select:focus,
.todo-form-group textarea:focus {
    border-color: var(--sb-primary, #0d6efd);
}
.todo-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.todo-quick-input::placeholder,
.todo-form-group input::placeholder,
.todo-form-group textarea::placeholder {
    color: var(--sb-input-placeholder);
}

[data-theme="dark"] .todo-quick-date,
[data-theme="dark"] .todo-form-group input[type="date"] {
    color-scheme: dark;
}
.todo-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.todo-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--sb-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Pagination ── */
.todo-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
}
.todo-pagination button {
    padding: 6px 14px;
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    background: var(--sb-surface);
    color: var(--sb-text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.todo-pagination button:hover:not(:disabled) { background: var(--sb-surface-hover); }
.todo-pagination button:disabled { opacity: 0.4; cursor: default; }
.todo-pagination span {
    font-size: 13px;
    color: var(--sb-text-secondary);
}

/* ── Empty State ── */
.todo-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--todo-empty-state-color);
}
.todo-empty-state i {
    font-size: 40px;
    margin-bottom: 10px;
}
.todo-empty-state span {
    font-size: 14px;
}

/* ── File Upload ── */
.todo-file-drop {
    position: relative;
    border: 2px dashed var(--todo-file-drop-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: var(--todo-file-drop-bg);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.todo-file-drop:hover {
    border-color: var(--sb-primary, #0d6efd);
    background: var(--sb-primary-light, #e7f1ff);
}
.todo-file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.todo-file-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--todo-file-placeholder-color);
}
.todo-file-placeholder i {
    font-size: 24px;
    color: var(--todo-file-placeholder-color);
}
.todo-file-placeholder span {
    font-size: 13px;
    font-weight: 500;
}
.todo-file-placeholder small {
    font-size: 11px;
    color: var(--todo-file-placeholder-color);
}
.todo-file-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--todo-file-selected-bg);
    border: 1px solid var(--todo-file-selected-border);
    border-radius: 8px;
    margin-top: 8px;
}
.todo-file-selected i {
    font-size: 18px;
    color: var(--sb-primary, #0d6efd);
}
.todo-file-selected span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--todo-file-selected-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.todo-file-remove {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--sb-danger);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.todo-file-remove:hover { background: var(--todo-hover-danger-bg); }
.todo-existing-file {
    margin-top: 8px;
}
.todo-existing-file a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--sb-primary-light, #e7f1ff);
    border-radius: 8px;
    color: var(--sb-primary, #0d6efd);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s;
}
.todo-existing-file a:hover { background: var(--todo-primary-link-hover-bg); }
.hidden { display: none !important; }

/* ── Detail Modal Attachment ── */
.todo-detail-attachment {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--todo-detail-attachment-border);
}
.todo-detail-attachment .label {
    font-size: 11px;
    font-weight: 600;
    color: var(--sb-text-muted, #6c757d);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.todo-detail-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--sb-primary-light, #e7f1ff);
    border: 1px solid var(--todo-primary-link-border);
    border-radius: 8px;
    color: var(--sb-primary, #0d6efd);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, box-shadow 0.15s;
}
.todo-detail-attachment-link:hover {
    background: var(--todo-primary-link-hover-bg);
    box-shadow: var(--todo-primary-link-hover-shadow);
}
.todo-detail-attachment-link .bi-box-arrow-up-right {
    font-size: 11px;
    opacity: 0.6;
}

/* ── Detail Modal ── */
.todo-detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--sb-overlay-bg);
    z-index: 1070;
    align-items: center;
    justify-content: center;
}
.todo-detail-overlay.show { display: flex; }

.todo-detail-modal {
    background: var(--sb-surface);
    border-radius: 12px;
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: detailSlideIn 0.2s ease;
}
@keyframes detailSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.todo-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sb-border-light);
}
.todo-detail-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.todo-detail-status-badge.status-todo        { background: var(--todo-status-todo-bg); color: var(--todo-status-todo-text); }
.todo-detail-status-badge.status-in_progress { background: var(--todo-status-progress-bg); color: var(--todo-status-progress-text); }
.todo-detail-status-badge.status-in_review   { background: var(--todo-status-review-bg); color: var(--todo-status-review-text); }
.todo-detail-status-badge.status-done        { background: var(--todo-status-done-bg); color: var(--todo-status-done-text); }

.todo-detail-close {
    width: 32px; height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--sb-text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.todo-detail-close:hover { background: var(--todo-surface-subtle-bg); }

.todo-detail-body { padding: 20px; }

.todo-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--sb-text-dark, #212529);
    margin: 0 0 12px 0;
    line-height: 1.4;
    word-break: break-word;
}
.todo-detail-desc {
    font-size: 14px;
    color: var(--todo-detail-desc-color);
    line-height: 1.65;
    margin: 0 0 20px 0;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 12px 14px;
    background: var(--todo-detail-desc-bg);
    border-radius: 8px;
    border-left: 3px solid var(--todo-detail-desc-border);
}
.todo-detail-desc.text-muted-placeholder {
    color: var(--sb-text-muted);
    font-style: italic;
    background: transparent;
    border-left-color: transparent;
    padding: 0;
}

.todo-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.todo-detail-item .label {
    font-size: 11px;
    font-weight: 600;
    color: var(--todo-detail-label-color);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.todo-detail-item .label i { font-size: 12px; }
.todo-detail-item .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--todo-detail-value-color);
    display: block;
    word-break: break-word;
}

.todo-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--todo-detail-attachment-border);
}
.todo-detail-btn-delete {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--sb-danger);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
    font-family: inherit;
}
.todo-detail-btn-delete:hover { background: var(--todo-hover-danger-bg); }
.todo-detail-btn-edit {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: var(--sb-primary, #0d6efd);
    color: var(--sb-text-inverse);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
    font-family: inherit;
}
.todo-detail-btn-edit:hover { background: var(--sb-primary-hover, #0b5ed7); }

/* ── Responsive ── */

/* Smaller laptops (13-14 inch, ~1280px) */
@media (max-width: 1280px) {
    .todo-kanban {
        grid-template-columns: repeat(2, 1fr);
    }
    .todo-kanban-col {
        min-height: 150px;
    }
}

/* Tablets */
@media (max-width: 991.98px) {
    .todo-toolbar {
        align-items: stretch;
        gap: 8px;
    }
    .todo-toolbar-left,
    .todo-toolbar-right {
        flex-wrap: wrap;
    }
    .todo-filter-container .filter-dropdown {
        min-width: 280px;
    }
}

/* ── Mobile Status Tabs ── */
.todo-mobile-tabs {
    display: none; /* Hidden on desktop */
}

/* Mobile — tab-based single column kanban */
@media (max-width: 767.98px) {
    .navbar-todo-popover {
        width: calc(100vw - 20px);
    }

    /* Show mobile tabs */
    .todo-mobile-tabs {
        display: flex;
        gap: 6px;
        margin-bottom: 12px;
        padding: 4px;
        background: var(--sb-bg-tertiary);
        border-radius: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .todo-mobile-tab {
        flex: 1;
        min-width: 0;
        padding: 8px 6px;
        border: none;
        border-radius: 8px;
        background: transparent;
        color: var(--sb-text-secondary);
        font-size: 12px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        white-space: nowrap;
    }
    .todo-mobile-tab.active {
        background: var(--sb-surface);
        color: var(--sb-primary, #0d6efd);
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }
    .todo-mobile-tab-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        font-size: 10px;
        font-weight: 700;
        background: var(--todo-status-todo-bg);
        color: var(--todo-status-todo-text);
    }
    .todo-mobile-tab.active .todo-mobile-tab-count {
        background: var(--sb-primary, #0d6efd);
        color: var(--sb-text-inverse);
    }

    /* Single column kanban — hide non-active columns */
    .todo-kanban {
        display: none;
        grid-template-columns: 1fr;
        gap: 0;
        min-height: auto;
        overflow-x: hidden;
    }
    .todo-kanban.active {
        display: block;
    }
    .todo-kanban-col {
        display: none;
        min-height: auto;
    }
    .todo-kanban-col.mobile-active {
        display: block;
    }
    /* Hide column header on mobile — tabs already show the status */
    .todo-kanban-col .todo-col-header {
        display: none;
    }
    .todo-col-body {
        max-height: none;
    }
    .todo-card-title {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    .todo-form-row {
        grid-template-columns: 1fr;
    }
    /* Calendar — mobile */
    .todo-cal-header { margin-bottom: 8px; }
    .todo-cal-header h3 { font-size: 14px; }
    .todo-cal-nav button { width: 28px; height: 28px; font-size: 12px; }
    .todo-cal-grid { border-radius: 8px; }
    .todo-cal-day-header {
        font-size: 10px;
        padding: 5px 2px;
        letter-spacing: 0;
    }
    .todo-cal-day {
        min-height: 62px;
        padding: 4px 3px;
    }
    .todo-cal-day-num {
        font-size: 11px;
        margin-bottom: 2px;
    }
    .todo-cal-day.today .todo-cal-day-num {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    .todo-cal-item {
        font-size: 9px;
        padding: 2px 4px;
        margin-bottom: 1px;
    }
    .todo-detail-grid {
        grid-template-columns: 1fr;
    }
    /* Swipe to Done */
    .todo-swipe-wrapper {
        position: relative;
        border-radius: 10px;
        margin-bottom: 10px;
        overflow: hidden;
    }
    .todo-swipe-bg {
        position: absolute;
        inset: 0;
        background: var(--sb-success);
        color: var(--sb-text-inverse);
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-right: 24px;
        gap: 8px;
        font-weight: 600;
        font-size: 14px;
        border-radius: 10px;
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    .todo-swipe-bg i { font-size: 20px; }
    .todo-swipe-wrapper .todo-card {
        margin-bottom: 0;
        position: relative;
        z-index: 1;
    }
}

/* ── Very small phones (≤ 420 px) ── */
@media (max-width: 420px) {
    .todo-cal-day {
        min-height: 50px;
        padding: 3px 2px;
    }
    .todo-cal-day-header {
        font-size: 9px;
        padding: 4px 1px;
    }
    .todo-cal-day-num { font-size: 9px; }
    .todo-cal-day.today .todo-cal-day-num {
        width: 17px;
        height: 17px;
        font-size: 9px;
    }
    /* Render tasks as tiny coloured dots */
    .todo-cal-item {
        font-size: 0;
        padding: 0;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        display: inline-block;
        margin: 1px 1px 0 0;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}

/* ══════════════════════════════════════════════════════════
   Holiday Styles
   ══════════════════════════════════════════════════════════ */

/* ── Modal Tabs ── */
.todo-modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--sb-border);
    padding: 0 20px;
    gap: 0;
}
.todo-modal-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--sb-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}
.todo-modal-tab:hover {
    color: var(--sb-text-primary);
    background: var(--sb-bg-secondary);
}
.todo-modal-tab.active {
    color: var(--sb-primary, #0d6efd);
    border-bottom-color: var(--sb-primary, #0d6efd);
}
.todo-modal-tab i {
    font-size: 15px;
}

/* Tab content */
.todo-tab-content {
    display: none;
}
.todo-tab-content.active {
    display: block;
}

/* ── Holiday Badge in Calendar Legend ── */
.todo-cal-legend .status-holiday {
    background: var(--todo-status-holiday-bg);
    color: var(--todo-status-holiday-text);
    font-weight: 600;
}

/* ── Holiday Calendar Item ── */
.todo-cal-item.status-holiday {
    background: var(--todo-status-holiday-bg);
    color: var(--todo-status-holiday-solid-text);
    font-weight: 600;
    border-left: 2px solid var(--todo-status-holiday-border);
}
.todo-cal-item.status-holiday:hover {
    opacity: 0.85;
}

/* Calendar day with holiday */
.todo-cal-day.has-holiday {
    background: var(--todo-holiday-day-bg);
}
.todo-cal-day.has-holiday:hover {
    background: var(--todo-holiday-day-hover-bg);
    box-shadow: inset 0 0 0 1px var(--todo-holiday-day-hover-ring);
}
.todo-cal-day.has-holiday.today {
    background: var(--todo-holiday-day-today-bg);
}

/* ── Holiday Detail Badge ── */
.todo-detail-status-badge.status-holiday {
    background: var(--todo-status-holiday-bg);
    color: var(--todo-status-holiday-text);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.todo-detail-status-badge.status-holiday i {
    font-size: 12px;
}

/* ── Holiday Calendar Status Chip ── */
.todo-cal-status-chip.status-holiday {
    background: var(--todo-status-holiday-solid-bg);
    color: var(--todo-status-holiday-solid-text);
}

/* ══════════════════════════════════════════════════════════
   Navbar Todo Popover Tabs + Mini Calendar
   ══════════════════════════════════════════════════════════ */

/* ── Popover Tabs ── */
.nav-todo-tabs {
    display: flex;
    border-bottom: 1px solid var(--sb-border);
    padding: 0 12px;
}
.nav-todo-tab {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: var(--sb-text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}
.nav-todo-tab:hover {
    color: var(--sb-text-primary);
    background: var(--sb-bg-secondary);
}
.nav-todo-tab.active {
    color: var(--sb-primary, #0d6efd);
    border-bottom-color: var(--sb-primary, #0d6efd);
}
.nav-todo-tab i { font-size: 13px; }

/* Tab content */
.nav-todo-tab-content {
    display: none;
}
.nav-todo-tab-content.active {
    display: block;
}

/* ── Mini Calendar ── */
.nav-mini-cal {
    padding: 10px 12px;
}
.nav-mini-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.nav-mini-cal-header span {
    font-size: 13px;
    font-weight: 700;
    color: var(--sb-text-primary);
}
.nav-mini-cal-header button {
    border: none;
    background: transparent;
    color: var(--sb-text-secondary);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 12px;
}
.nav-mini-cal-header button:hover {
    background: var(--sb-surface-hover);
    color: var(--sb-text-primary);
}
.nav-mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}
.nav-mini-cal-dayhead {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--sb-text-muted);
    padding: 2px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nav-mini-cal-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 2px 3px;
    border-radius: 6px;
    transition: background 0.15s;
    min-height: 34px;
}
.nav-mini-cal-day.empty {
    min-height: 0;
}
.nav-mini-cal-day:not(.empty):hover {
    background: var(--sb-surface-hover);
}
.nav-mini-cal-day.today {
    background: var(--sb-badge-blue-bg);
}
.nav-mini-cal-day.today:hover {
    background: var(--sb-primary-light);
}
.nav-mini-cal-day.holiday {
    background: var(--sb-warning-bg);
}
.nav-mini-cal-day.holiday.today {
    background: linear-gradient(135deg, var(--sb-primary-light) 50%, var(--sb-warning-bg) 100%);
}
.nav-mini-cal-num {
    font-size: 11px;
    font-weight: 500;
    color: var(--sb-text-primary);
    line-height: 1;
}
.nav-mini-cal-day.today .nav-mini-cal-num {
    color: var(--sb-primary, #0d6efd);
    font-weight: 700;
}
.nav-mini-cal-day.holiday .nav-mini-cal-num {
    color: var(--sb-danger);
    font-weight: 600;
}

/* Dots */
.nav-mini-cal-dots {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}
.nav-mini-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.nav-mini-dot.holiday { background: var(--sb-danger); }
.nav-mini-dot.todo { background: var(--sb-text-secondary); }
.nav-mini-dot.in_progress { background: var(--sb-primary); }
.nav-mini-dot.in_review { background: var(--sb-warning); }
.nav-mini-dot.done { background: var(--sb-success); }


/* ══════════════════════════════════════════════════════════
   Dashboard Action Widget — Flippable Todo List & Pie Chart
   ══════════════════════════════════════════════════════════ */

.dashboard-todo-card {
    display: none;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    position: relative;
    perspective: 1200px;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.graph-grid.has-todo-widget .dashboard-todo-card {
    display: block;
}

@media (min-width: 1024px) {
    .graph-grid.has-todo-widget .dashboard-todo-card {
        grid-column: 3;
        grid-row: 1 / span 2;
        height: 650px;
        max-height: 650px;
        min-height: 650px;
    }
    .graph-grid.has-todo-widget .chart-activity-col {
        grid-column: span 2;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .graph-grid.has-todo-widget .dashboard-todo-card {
        grid-column: 1 / -1;
        height: 320px;
        max-height: 320px;
        min-height: 320px;
    }
}

@media (max-width: 767px) {
    .graph-grid.has-todo-widget .dashboard-todo-card {
        grid-column: 1;
        height: 320px;
        max-height: 320px;
        min-height: 320px;
    }
}

/* 3D Flip Card Container */
.dash-flip-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.dash-flip-inner.is-flipped {
    transform: rotateY(180deg);
}

.dash-flip-front,
.dash-flip-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--sb-graph-border, #e2e8f0);
    background: var(--sb-card-bg, #ffffff);
    padding: 12px 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dash-flip-front {
    transform: rotateY(0deg);
    z-index: 2;
}

.dash-flip-back {
    transform: rotateY(180deg);
    z-index: 1;
}

/* Header */
.dash-todo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--sb-border-light, #f1f5f9);
    flex-shrink: 0;
}
.dash-todo-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.dash-todo-title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sb-text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 6px;
}
.dash-todo-title i {
    color: var(--sb-primary, #0d6efd);
    font-size: 15px;
}
.dash-todo-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--sb-primary, #0d6efd);
}
.dash-todo-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.dash-todo-tabs {
    display: flex;
    background: var(--sb-bg-secondary, #f1f5f9);
    padding: 2px;
    border-radius: 6px;
    gap: 2px;
}
.dash-todo-tab {
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    color: var(--sb-text-secondary, #64748b);
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.dash-todo-tab:hover {
    color: var(--sb-text-primary, #1e293b);
}
.dash-todo-tab.active {
    background: var(--sb-surface, #ffffff);
    color: var(--sb-primary, #0d6efd);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.dash-todo-flip-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sb-bg-secondary, #f1f5f9);
    border: 1px solid var(--sb-border, #e2e8f0);
    color: var(--sb-primary, #0d6efd);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.dash-todo-flip-btn:hover {
    background: rgba(13, 110, 253, 0.12);
    border-color: var(--sb-primary, #0d6efd);
}
.dash-todo-link {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sb-text-muted, #94a3b8);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.15s ease;
}
.dash-todo-link:hover {
    color: var(--sb-primary, #0d6efd);
    background: rgba(13, 110, 253, 0.08);
}

/* Pie Chart Side Layout */
.dash-chart-body {
    flex: 1 1 0px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}
.dash-pie-box {
    width: 100%;
    height: 270px;
    min-height: 220px;
    flex-shrink: 0;
    position: relative;
}
.dash-pie-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
    flex-shrink: 0;
}
.dash-pie-stat-card {
    background: var(--sb-bg-secondary, #f8fafc);
    border: 1px solid var(--sb-border-light, #f1f5f9);
    border-radius: 6px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dash-pie-stat-label {
    font-size: 11px;
    color: var(--sb-text-secondary, #64748b);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}
.dash-pie-stat-val {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sb-text-primary, #1e293b);
}
.dash-dot-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-done { background: #10b981; }
.dot-progress { background: #3b82f6; }
.dot-todo { background: #94a3b8; }
.dot-overdue { background: #ef4444; }

@media (max-width: 1023px) {
    .dash-pie-stats-grid {
        display: none;
    }
    .dash-pie-box {
        height: 100%;
        min-height: 190px;
    }
}

/* List container - strictly scrollable within fixed height */
.dash-todo-list {
    flex: 1 1 0px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}
.dash-todo-list::-webkit-scrollbar {
    width: 4px;
}
.dash-todo-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Clean Task Item */
.dash-todo-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    background: var(--sb-surface, #ffffff);
    border: 1px solid var(--sb-border-light, #f1f5f9);
    margin-bottom: 5px;
    transition: all 0.15s ease;
}
.dash-todo-item:hover {
    background: var(--sb-surface-hover, #f8fafc);
    border-color: rgba(13, 110, 253, 0.25);
}
.dash-todo-item.done {
    background: var(--sb-bg-secondary, #f8fafc);
    opacity: 0.65;
    border-color: transparent;
}
.dash-todo-item.done .dash-todo-name {
    text-decoration: line-through;
    color: var(--sb-text-muted, #94a3b8);
}

/* Custom Checkbox */
.dash-todo-check {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
}
.dash-todo-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.dash-todo-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--sb-border-strong, #cbd5e1);
    background: var(--sb-surface, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #ffffff;
    transition: all 0.15s ease;
}
.dash-todo-check input:checked ~ .dash-todo-box {
    background: var(--sb-primary, #0d6efd);
    border-color: var(--sb-primary, #0d6efd);
}
.dash-todo-box i {
    display: none;
}
.dash-todo-check input:checked ~ .dash-todo-box i {
    display: block;
}
.dash-todo-check:hover .dash-todo-box {
    border-color: var(--sb-primary, #0d6efd);
}

/* Content & Meta */
.dash-todo-body {
    flex: 1;
    min-width: 0;
}
.dash-todo-top-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}
.dash-todo-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--sb-text-primary, #1e293b);
    line-height: 1.35;
    word-break: break-word;
}
.dash-todo-del {
    border: none;
    background: transparent;
    color: var(--sb-text-muted, #94a3b8);
    cursor: pointer;
    padding: 0;
    font-size: 11px;
    opacity: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.dash-todo-item:hover .dash-todo-del {
    opacity: 1;
}
.dash-todo-del:hover {
    color: #ef4444;
}
.dash-todo-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
}
.dash-todo-tag {
    font-size: 9.5px;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.dash-todo-tag.due {
    background: var(--sb-bg-secondary, #f1f5f9);
    color: var(--sb-text-secondary, #475569);
}
.dash-todo-tag.due.overdue {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
}
.dash-todo-tag.due.today {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 600;
}
.dash-todo-tag.category {
    background: var(--sb-bg-secondary, #f1f5f9);
    color: var(--sb-text-secondary, #475569);
}
.dash-todo-tag.school {
    background: #f3e8ff;
    color: #7e22ce;
}

/* Empty State */
.dash-todo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 140px;
    padding: 16px;
    text-align: center;
}
.dash-todo-empty i {
    font-size: 28px;
    color: var(--sb-border-strong, #cbd5e1);
    margin-bottom: 6px;
}
.dash-todo-empty p {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--sb-text-secondary, #64748b);
}

/* Skeleton Loading */
.dash-todo-skeleton {
    padding: 4px 0;
}
.dash-todo-skel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    margin-bottom: 5px;
    background: var(--sb-bg-secondary, #f8fafc);
    border-radius: 6px;
}
.dash-todo-skel-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: #e2e8f0;
    animation: dashTodoPulse 1.2s infinite ease-in-out;
}
.dash-todo-skel-line {
    flex: 1;
    height: 10px;
    border-radius: 3px;
    background: #e2e8f0;
    animation: dashTodoPulse 1.2s infinite ease-in-out;
}
@keyframes dashTodoPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.25; }
}

/* Footer */
.dash-todo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--sb-border-light, #f1f5f9);
    flex-shrink: 0;
}
.dash-todo-progress-text {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--sb-text-muted, #64748b);
}
.dash-todo-view-all {
    font-size: 11px;
    font-weight: 600;
    color: var(--sb-primary, #0d6efd);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: gap 0.15s ease;
}
.dash-todo-view-all:hover {
    text-decoration: underline;
    gap: 4px;
}

/* Dark Mode Overrides */
[data-theme="dark"] .dashboard-todo-card {
    border-color: var(--sb-graph-border, #334155);
    background: var(--sb-card-bg, #1e293b);
}
[data-theme="dark"] .dash-todo-item {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .dash-todo-item:hover {
    background: #273549;
    border-color: #3b82f6;
}
[data-theme="dark"] .dash-todo-item.done {
    background: #0f172a;
}
[data-theme="dark"] .dash-todo-box {
    background: #1e293b;
    border-color: #475569;
}
[data-theme="dark"] .dash-todo-tabs {
    background: #0f172a;
}
[data-theme="dark"] .dash-todo-tab.active {
    background: #334155;
    color: #60a5fa;
}
[data-theme="dark"] .dash-todo-tag.due {
    background: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .dash-todo-tag.category {
    background: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .dash-todo-tag.school {
    background: #3b0764;
    color: #e9d5ff;
}
[data-theme="dark"] .dash-todo-skel-row {
    background: #0f172a;
}
[data-theme="dark"] .dash-todo-skel-box,
[data-theme="dark"] .dash-todo-skel-line {
    background: #334155;
}
[data-theme="dark"] .dash-flip-front,
[data-theme="dark"] .dash-flip-back {
    border-color: var(--sb-graph-border, #334155);
    background: var(--sb-card-bg, #1e293b);
}
[data-theme="dark"] .dash-todo-flip-btn {
    background: #0f172a;
    border-color: #334155;
    color: #60a5fa;
}
[data-theme="dark"] .dash-todo-flip-btn:hover {
    background: #1e293b;
    border-color: #60a5fa;
}
[data-theme="dark"] .dash-pie-stat-card {
    background: #0f172a;
    border-color: #334155;
}
[data-theme="dark"] .dash-pie-stat-val {
    color: #f8fafc;
}



