/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    height: 100vh;
    overflow: hidden;
}

.main-layout {
    display: flex;
    height: 100%;
}

/* Main Bar */
.main-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}

/* Timer Section */
.timer-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-container {
    text-align: center;
}

.timer-display {
    margin-bottom: 20px;
}

.timer-progress {
    position: relative;
    display: inline-block;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.progress-ring-circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 722.5;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.5s ease;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-time {
    font-size: 48px;
    font-weight: 700;
    color: var(--text);
    display: block;
}

.timer-time.overtime {
    color: var(--danger);
}

.timer-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timer-task {
    margin: 16px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.task-name {
    font-weight: 600;
    color: var(--text);
}

.timer-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

/* Balance Section */
.balance-section {
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

.balance-container {
    text-align: center;
}

.balance-display {
    margin-bottom: 16px;
}

.balance-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.balance-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
}

.balance-value.negative {
    color: var(--danger);
}

.balance-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
}

.balance-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 16px;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    color: var(--text);
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease;
}

.sidebar.collapsed {
    width: 0;
}

.sidebar-toggle {
    position: absolute;
    right: 350px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 4px 0 0 4px;
    padding: 8px 4px;
    cursor: pointer;
    transition: right 0.3s ease;
    z-index: 10;
    color: var(--text);
}

.sidebar.collapsed+.sidebar-toggle,
.sidebar.collapsed .sidebar-toggle {
    right: 0;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.sidebar.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* Timer running state */
body.timer-running .sidebar {
    width: 0;
    pointer-events: none;
}

body.timer-running .sidebar-toggle {
    right: 0;
    pointer-events: none;
    opacity: 0.5;
}

/* Sidebar Sections */
.sidebar-section {
    border-bottom: 1px solid var(--border);
}

.section-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: var(--bg);
}

.section-header:hover {
    background: var(--border);
}

.section-header h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
}

.collapse-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.section-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.section-content {
    padding: 12px 16px;
    max-height: 300px;
    overflow-y: auto;
}

.section-content.collapsed {
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-hover);
}

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

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

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

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 4px 8px;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-large {
    padding: 12px 32px;
    font-size: 16px;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-circle {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-add {
    width: 100%;
    padding: 8px;
    margin-bottom: 12px;
    background: var(--bg);
    border: 2px dashed var(--border);
    color: var(--text-muted);
}

.btn-add:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Task/Toad/Reward Items */
.item-card {
    background: var(--bg);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-expand {
    width: 16px;
    cursor: pointer;
    color: var(--text-muted);
}

.item-expand.hidden {
    visibility: hidden;
}

.item-title {
    flex: 1;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
}

.item-title:hover {
    color: var(--primary);
}

.item-balance {
    font-size: 12px;
    padding: 2px 6px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
}

.item-balance.cost {
    background: var(--warning);
}

.item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.item-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.08);
}

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

.item-action {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 12px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
}

.item-action:hover {
    background: var(--border);
    color: var(--text);
}

.item-subtasks {
    margin-left: 24px;
    margin-top: 8px;
}

.item-subtasks.collapsed {
    display: none;
}

.item-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-left: 24px;
}

/* Category badge */
.category-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    color: var(--text);
    border: 1px solid var(--border);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--text);
}

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

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select option {
    background: var(--surface);
    color: var(--text);
}

.form-group input[type="range"] {
    width: calc(100% - 40px);
}

.range-value {
    display: inline-block;
    width: 30px;
    text-align: center;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Stats Section */
.stats-section {
    display: block;
    width: 100%;
}

/* Stats */
.stats-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stats-container.hidden {
    display: none;
}

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

.stats-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 16px;
    background: var(--bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.stats-view {
    display: none;
}

.stats-view.active {
    display: block;
}

.time-filter {
    margin-bottom: 16px;
}

.time-filter select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}

.charts-row {
    display: flex;
    gap: 24px;
}

.chart-container {
    flex: 1;
    text-align: center;
}

.chart-container h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.chart-container canvas {
    max-width: 200px;
    margin: 0 auto;
}

.chart-placeholder {
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

.timeline-chart-container {
    margin-bottom: 20px;
}

.timeline-notes {
    max-height: 200px;
    overflow-y: auto;
}

.note-item {
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.note-time {
    color: var(--text-muted);
    font-size: 11px;
}

.stats-summary {
    display: flex;
    justify-content: space-around;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.summary-stat {
    text-align: center;
}

.summary-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.summary-value.earned {
    color: var(--success);
}

.summary-value.spent {
    color: var(--warning);
}

.summary-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Tooltip */
[title] {
    position: relative;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: toast-slide-in 0.3s ease;
}

.toast-info {
    background: var(--primary);
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

.toast-warning {
    background: var(--warning);
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Repeat badge */
.repeat-badge {
    font-size: 14px;
    color: var(--primary);
}

/* Categories Modal */
.modal-content-wide {
    max-width: 500px;
}

.categories-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 8px;
}

.category-item:hover .category-actions {
    opacity: 1;
}

.category-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-weight: 500;
}

.category-default-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--border);
    color: var(--text-muted);
    border-radius: 4px;
}

.category-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.category-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.category-form-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}

.category-form-row input[type="color"] {
    width: 40px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

/* Task/Item styling updates */
.item-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.item-hashtag {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.8;
}

.item-details {
    padding: 8px 12px 8px 24px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.item-details.collapsed {
    display: none;
}

.item-balance-inline {
    display: inline-block;
    padding: 2px 8px;
    background: var(--success);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    margin-right: 8px;
}

.item-description-text {
    margin: 6px 0 0 0;
    line-height: 1.4;
}

/* Stats - Week Navigation */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.week-label {
    font-size: 14px;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
}

/* Stats - Timeline Bars */
.timeline-bars-container {
    margin-bottom: 20px;
}

/* Stats - Timeline Notes List */
.timeline-notes-list {
    max-height: 300px;
    overflow-y: auto;
}

.timeline-day-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.timeline-day-section.empty {
    opacity: 0.5;
}

.timeline-day-section:last-child {
    border-bottom: none;
}

.day-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.day-section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.today-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
}

.timeline-day-section.today .day-section-label {
    color: var(--primary);
}

.day-section-notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.note-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 6px 8px;
    background: var(--bg);
    border-radius: 6px;
    flex-wrap: wrap;
}

.note-time {
    color: var(--text-muted);
    font-size: 11px;
    min-width: 45px;
}

.note-category {
    padding: 2px 8px;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-balance {
    font-weight: 600;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
}

.note-balance.earned {
    background: #dcfce7;
    color: #15803d;
}

.note-balance.spent {
    background: #fee2e2;
    color: #dc2626;
}

.note-metric {
    font-size: 10px;
    color: var(--text-muted);
    padding: 2px 4px;
    background: var(--border);
    border-radius: 4px;
}

.note-metric-icon {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 4px;
}

.note-text {
    flex: 1;
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
}

.empty-day {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

/* Resizable Sidebar */
.sidebar-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: ew-resize;
    background: transparent;
    z-index: 20;
    transition: background 0.2s ease;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: var(--primary);
}

.sidebar.resizable {
    position: relative;
    min-width: 280px;
    max-width: 600px;
}

/* Sidebar Section Proportions */
.sidebar-section.toads-section {
    flex: 0 0 20%;
    min-height: 80px;
    display: flex;
    flex-direction: column;
}

.sidebar-section.tasks-section {
    flex: 0 0 50%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-section.rewards-section {
    flex: 0 0 30%;
    min-height: 100px;
    display: flex;
    flex-direction: column;
}

.sidebar-section .section-content {
    flex: 1;
    max-height: none;
    overflow-y: auto;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 8px 16px;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 8px);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
}

.mobile-nav-item:hover {
    color: var(--primary);
}

.mobile-nav-icon {
    font-size: 20px;
}

.mobile-nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* Mobile Views */
.mobile-view {
    display: none;
}

.mobile-view.active {
    display: block;
}

/* Mobile Task Picker */
.mobile-task-picker {
    display: none;
    margin-top: 16px;
    padding: 12px;
    background: var(--surface);
    border-radius: 8px;
    text-align: center;
}

@media (max-width: 768px) {
    .mobile-task-picker {
        display: block;
    }
}

.mobile-task-picker .current-task {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.mobile-task-picker .task-name {
    color: var(--primary);
    font-weight: 600;
}

.mobile-task-picker .btn {
    margin-top: 8px;
}

/* Mobile Task List */
.mobile-tasks-container {
    padding: 16px;
    padding-bottom: 80px;
}

.mobile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.mobile-section-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.mobile-section-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--bg);
    border-radius: 8px;
}

.mobile-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-tab.active {
    background: var(--primary);
    color: white;
}

.mobile-tab-content {
    display: none;
    overflow-y: auto;
    height: calc(100vh - 160px);
    /* Fill available space minus tabs and nav */
    padding-bottom: 20px;
}

.mobile-tab-content.active {
    display: block;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {

    /* Hide desktop sidebar */
    .sidebar {
        display: none;
    }

    .sidebar-toggle {
        display: none;
    }

    /* Show mobile navigation */
    .mobile-nav {
        display: block;
    }

    /* Adjust main layout */
    .main-layout {
        flex-direction: column;
    }

    .main-bar {
        padding: 16px;
        padding-bottom: 80px;
    }

    /* Mobile timer adjustments */
    .timer-section {
        flex: none;
        padding: 20px 0;
    }

    .progress-ring {
        width: 200px !important;
        height: 200px !important;
    }

    .progress-ring circle {
        r: 92;
        cx: 100;
        cy: 100;
    }

    .timer-time {
        font-size: 36px;
    }

    .timer-label {
        font-size: 12px;
    }

    /* Balance section adjustments */
    .balance-section {
        padding: 16px 0;
    }

    .balance-value {
        font-size: 36px;
    }

    .balance-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    /* Stats section adjustments */
    .stats-section {
        display: none;
        /* Controlled by JS in mobile nav */
        padding: 0;
        margin: 0;
    }

    .stats-container {
        margin-top: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 16px;
        min-height: calc(100vh - 120px);
    }

    .charts-row {
        flex-direction: column;
        gap: 20px;
    }

    .stats-header h2 {
        font-size: 1.25rem;
    }

    /* Modal adjustments */
    .modal {
        padding: 0;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .modal-content h2 {
        margin-top: 10px;
    }

    .form-actions {
        margin-top: auto;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    /* Toast adjustments */
    #toast-container {
        top: auto;
        bottom: 90px;
        left: 16px;
        right: 16px;
    }

    .toast {
        text-align: center;
    }

    /* Item cards touch-friendly */
    .item-card {
        padding: 12px 14px;
    }

    .item-actions {
        opacity: 1;
    }

    .item-action {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Buttons touch-friendly */
    .btn {
        min-height: 44px;
        padding: 10px 20px;
    }

    .btn-circle {
        width: 48px;
        height: 48px;
    }

    .btn-small {
        min-height: 36px;
        padding: 6px 14px;
    }
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 300px;
    }

    .sidebar-toggle {
        right: 300px;
    }

    .sidebar.collapsed+.sidebar-toggle {
        right: 0;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .sidebar {
        width: 400px;
    }

    .sidebar-toggle {
        right: 400px;
    }

    .sidebar.collapsed+.sidebar-toggle {
        right: 0;
    }
}

/* Guest Mode Warning Banner */
.guest-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: var(--text);
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.guest-banner-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}

.guest-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.guest-icon {
    font-size: 22px;
    flex-shrink: 0;
    animation: guest-pulse 2s ease-in-out infinite;
}

@keyframes guest-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.guest-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.guest-text-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--warning);
    letter-spacing: 0.01em;
}

.guest-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.guest-text strong {
    color: var(--warning);
    font-weight: 600;
}

.guest-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Ghost button variant */
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--text-muted);
}

/* Auth Pages */
.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-separator span {
    padding: 0 10px;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Guest banner responsive */
@media (max-width: 768px) {
    .guest-banner {
        flex-direction: column;
        padding: 12px 16px;
        gap: 12px;
    }

    .guest-banner-actions {
        width: 100%;
    }

    .guest-banner-actions .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .guest-text-title {
        font-size: 13px;
    }

    .guest-text {
        font-size: 12px;
    }
}

/* ─── Walkthrough Overlay ─────────────────────────────────────────────────── */

/* Dark backdrop */
.wt-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(10, 15, 30, 0.72);
    backdrop-filter: blur(2px);
    animation: wt-fade-in 0.35s ease forwards;
    cursor: pointer;
}

.wt-overlay.wt-fade-out {
    animation: wt-fade-out 0.35s ease forwards;
    pointer-events: none;
}

/* Spotlight ring – highlights the target element */
.wt-spotlight {
    position: fixed;
    z-index: 9001;
    border-radius: 12px;
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.6),
        0 0 0 9000px rgba(10, 15, 30, 0.72);
    pointer-events: none;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    opacity: 0;
}

.wt-spotlight--active {
    opacity: 1;
    animation: wt-pulse 2.4s ease-in-out infinite;
}

/* Tooltip card */
.wt-tooltip {
    position: fixed;
    z-index: 9002;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 24px 18px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.22),
        0 6px 20px rgba(99, 102, 241, 0.12);
    opacity: 0;
    transform: scale(0.94) translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.wt-tooltip--visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.wt-tooltip.wt-fade-out {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.wt-step-counter {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 9px;
    border-radius: 20px;
}

.wt-close {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--surface-hover);
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}

.wt-close:hover {
    background: var(--border);
    color: var(--text);
}

/* Tooltip title */
.wt-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Tooltip body */
.wt-body {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 20px;
}

.wt-body strong {
    color: var(--text);
    font-weight: 600;
}

/* Footer */
.wt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Progress dots */
.wt-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.wt-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s ease, transform 0.3s ease;
}

.wt-dot--active {
    background: var(--primary);
    transform: scale(1.3);
}

/* Nav buttons */
.wt-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wt-btn--primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.wt-btn--primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.wt-btn--ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.wt-btn--ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* Animations */
@keyframes wt-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes wt-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes wt-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.6), 0 0 0 9000px rgba(10, 15, 30, 0.72); }
    50%       { box-shadow: 0 0 0 7px rgba(99, 102, 241, 0.35), 0 0 0 9000px rgba(10, 15, 30, 0.72); }
}

/* ─── Help button (always visible to re-trigger tour) ─────────────────────── */
.wt-help-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 8999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
}

.wt-help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .wt-tooltip {
        width: calc(100vw - 32px);
        bottom: 120px;
        top: auto !important;
        left: 16px !important;
        right: 16px;
        transform: scale(0.94) translateY(12px);
    }
    .wt-tooltip--visible {
        transform: scale(1) translateY(0);
    }
    .wt-help-btn {
        bottom: 80px; /* above mobile nav */
    }
}