/* css/styles.css — tickyourbudget pastel/friendly theme */

/* ===== CSS Custom Properties ===== */
:root {
    /* Pastel palette - Light */
    --bg-primary: #faf5ff;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f3e8ff;
    --bg-input: #fdf4ff;
    --bg-nav: #ffffff;

    --text-primary: #1e1b2e;
    --text-secondary: #6b6280;
    --text-muted: #a09ab0;
    --text-on-accent: #ffffff;

    --accent: #a78bfa;
    --accent-hover: #8b5cf6;
    --accent-light: #ede9fe;
    --accent-bg: #f5f0ff;

    --success: #86efac;
    --success-text: #166534;
    --success-bg: #f0fdf4;

    --danger: #fca5a5;
    --danger-text: #991b1b;
    --danger-bg: #fef2f2;

    --warning: #fde68a;
    --warning-text: #92400e;

    --border: #e9e2f0;
    --border-focus: #a78bfa;

    --shadow-sm: 0 1px 3px rgba(167, 139, 250, 0.08);
    --shadow-md: 0 4px 12px rgba(167, 139, 250, 0.1);
    --shadow-lg: 0 8px 24px rgba(167, 139, 250, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: 0.2s ease;

    --nav-height: 64px;
    --header-height: 56px;
}

/* Dark theme */
[data-theme='dark'] {
    --bg-primary: #1a1625;
    --bg-secondary: #231e30;
    --bg-card: #2a2438;
    --bg-hover: #352e45;
    --bg-input: #2a2438;
    --bg-nav: #231e30;

    --text-primary: #f0ecf5;
    --text-secondary: #b8b0c8;
    --text-muted: #7a7290;

    --accent: #a78bfa;
    --accent-hover: #c4b5fd;
    --accent-light: #352e45;
    --accent-bg: #2a2438;

    --success-bg: #1a2e1e;
    --success-text: #86efac;

    --danger-bg: #2e1a1a;
    --danger-text: #fca5a5;

    --border: #3d3550;
    --border-focus: #a78bfa;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    font-size: inherit;
    color: inherit;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236b6280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ===== App Layout ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition);
}

.app-header__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-content {
    padding-top: calc(var(--header-height) + 12px);
    padding-bottom: calc(var(--nav-height) + 20px);
    padding-left: 16px;
    padding-right: 16px;
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(167, 139, 250, 0.06);
    transition: background var(--transition);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

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

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

/* ===== Profile Selector ===== */
.profile-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-selector select {
    padding: 6px 30px 6px 10px;
    font-size: 0.85rem;
    border-radius: var(--radius-full);
    background-color: var(--accent-light);
    border-color: transparent;
    font-weight: 600;
    min-width: 110px;
    max-width: 160px;
}

.profile-selector select:focus {
    border-color: var(--accent);
}

.btn-profile-manage {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    transition: background var(--transition);
}

.btn-profile-manage:hover {
    background: var(--accent);
    color: var(--text-on-accent);
}

.btn-profile-manage svg {
    width: 16px;
    height: 16px;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}

.theme-toggle:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* ===== View Container ===== */
.view {
    display: none;
    animation: fadeIn 0.2s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

/* ===== Month Navigation ===== */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.month-nav__btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    transition: background var(--transition);
}

.month-nav__btn:hover {
    background: var(--accent);
    color: var(--text-on-accent);
}

.month-nav__btn svg {
    width: 18px;
    height: 18px;
}

.month-nav__label {
    font-size: 1rem;
    font-weight: 600;
    min-width: 160px;
    text-align: center;
    color: var(--text-primary);
}

.month-nav__today {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--text-on-accent);
    font-weight: 600;
    transition: background var(--transition);
}

.month-nav__today:hover {
    background: var(--accent-hover);
}

/* ===== Summary Bar ===== */
.summary-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 16px;
    align-items: stretch;
}

.summary-chart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: var(--accent);
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
    border: none;
    padding: 0;
}

.summary-chart-btn svg {
    width: 20px;
    height: 20px;
}

.summary-chart-btn:hover {
    background: var(--accent);
    color: var(--text-on-accent);
}

.summary-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.summary-card__label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.summary-card__value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 2px;
}

.summary-card--total .summary-card__value {
    color: var(--accent);
}

.summary-card--paid .summary-card__value {
    color: var(--success-text);
}

.summary-card--pending .summary-card__value {
    color: var(--warning-text);
}

/* ===== Checklist ===== */
.checklist {
    list-style: none;
}

.checklist-group {
    margin-bottom: 12px;
}

.checklist-group__title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 4px 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.checklist-item:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-md);
}

.checklist-item:active {
    transform: scale(0.98);
}

.checklist-item.checked {
    opacity: 0.65;
}

.checklist-item.checked .checklist-item__name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checklist-item__check {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.checklist-item.checked .checklist-item__check {
    background: var(--accent);
    border-color: var(--accent);
}

.checklist-item__check svg {
    width: 14px;
    height: 14px;
    color: var(--text-on-accent);
    opacity: 0;
    transition: opacity var(--transition);
}

.checklist-item.checked .checklist-item__check svg {
    opacity: 1;
}

.checklist-item__info {
    flex: 1;
    min-width: 0;
}

.checklist-item__name {
    font-size: 0.95rem;
    font-weight: 600;
    transition: color var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checklist-item__date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.checklist-item__amount {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    margin: -2px -6px;
    transition: background var(--transition);
}

.checklist-item__amount:active {
    background: var(--accent-light);
}

.checklist-item__amount .edit-icon {
    width: 12px;
    height: 12px;
    opacity: 0.4;
    flex-shrink: 0;
}

.checklist-item.checked .checklist-item__amount {
    color: var(--text-muted);
}

/* ===== Cards (Budget Items) ===== */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.card__title {
    font-size: 1rem;
    font-weight: 700;
}

.card__amount {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.card__description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
}

.badge--category {
    background: #fce7f3;
    color: #be185d;
}

[data-theme='dark'] .badge--category {
    background: #3d1f30;
    color: #f9a8d4;
}

.badge--frequency {
    background: #e0f2fe;
    color: #0369a1;
}

[data-theme='dark'] .badge--frequency {
    background: #1e2d3d;
    color: #7dd3fc;
}

.card__actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.btn-card-action {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-card-action--edit {
    background: var(--accent-light);
    color: var(--accent);
}

.btn-card-action--edit:hover {
    background: var(--accent);
    color: var(--text-on-accent);
}

.btn-card-action--delete {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.btn-card-action--delete:hover {
    background: var(--danger);
    color: #fff;
}

/* ===== Categories Tree ===== */
.category-tree {
    list-style: none;
}

.category-node {
    margin-bottom: 6px;
}

.category-node__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: background var(--transition);
}

.category-node__header:hover {
    background: var(--bg-hover);
}

.category-node__name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.category-node__desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
    margin-right: 8px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-node__actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
    color: var(--text-muted);
}

.btn-icon:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.btn-icon--danger:hover {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.category-children {
    list-style: none;
    margin-left: 24px;
    margin-top: 4px;
}

.category-children .category-node__header {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-light);
}

/* ===== FAB (Floating Action Button) ===== */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px);
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.fab:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(167, 139, 250, 0.3);
}

.fab:active {
    transform: scale(0.95);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeOverlay 0.2s ease;
}

@keyframes fadeOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    animation: slideUp 0.25s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal__handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    margin: 0 auto 16px;
}

.modal__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.modal__close {
    position: absolute;
    top: 20px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background var(--transition);
}

.modal__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal__close svg {
    width: 18px;
    height: 18px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.btn--primary {
    background: var(--accent);
    color: var(--text-on-accent);
    width: 100%;
}

.btn--primary:hover {
    background: var(--accent-hover);
}

.btn--secondary {
    background: var(--accent-light);
    color: var(--accent);
}

.btn--secondary:hover {
    background: var(--accent);
    color: var(--text-on-accent);
}

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

.btn--danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn--sm {
    padding: 8px 16px;
    font-size: 0.82rem;
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-group .btn {
    flex: 1;
}

/* ===== Data View ===== */
.data-section {
    margin-bottom: 20px;
}

.data-section__title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.json-preview {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    resize: vertical;
    line-height: 1.5;
    color: var(--text-primary);
}

.data-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state__desc {
    font-size: 0.85rem;
}

/* ===== Toast Notification ===== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 400px;
    align-items: center;
}

.toast {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.25s ease, toastOut 0.25s ease 2.5s forwards;
    pointer-events: auto;
    white-space: normal;
    word-break: break-word;
    max-width: calc(100vw - 32px);
    text-align: center;
}

.toast--success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success);
}

.toast--error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger);
}

.toast--info {
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--accent);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ===== Confirm Dialog ===== */
.confirm-dialog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeOverlay 0.2s ease;
}

.confirm-dialog__box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 90%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
}

.confirm-dialog__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.confirm-dialog__message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ===== Profile Management Modal ===== */
.profile-list {
    list-style: none;
    margin-bottom: 16px;
}

.profile-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}

.profile-list__item:hover {
    background: var(--bg-hover);
}

.profile-list__name {
    flex: 1;
    font-weight: 600;
}

.profile-list__name input {
    padding: 4px 8px;
    font-weight: 600;
}

/* ===== Utility ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (min-width: 500px) {
    .modal {
        border-radius: var(--radius-xl);
        margin-bottom: 10vh;
    }

    .modal-overlay {
        align-items: center;
    }
}

/* ===== Profiles View ===== */
.profiles-view {
    padding-bottom: 16px;
}

.profiles-view .data-section {
    margin-bottom: 24px;
}

.profiles-view .profile-list {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 4px 0;
    margin-bottom: 16px;
}

.profiles-view .profile-list__item {
    border-bottom: 1px solid var(--border);
}

.profiles-view .profile-list__item:last-child {
    border-bottom: none;
}

/* ===== Progress Bar ===== */
.progress-bar-wrapper {
    margin-bottom: 16px;
    padding: 0 4px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
    width: 0%;
}

.progress-bar__label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
    font-weight: 600;
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    margin-bottom: 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-bar:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.search-bar svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.search-bar input {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.88rem;
    outline: none;
    box-shadow: none;
}

.search-bar input:focus {
    border-color: transparent;
    box-shadow: none;
}

/* ===== Donut Chart ===== */
/* ===== Modal Chart ===== */
.modal-chart {
    text-align: center;
}

.modal-chart .donut-chart {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    display: block;
}

.modal-chart .chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
}

.modal-chart .chart-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.modal-chart .chart-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* ===== Month Comparison ===== */
.month-comparison {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.month-comparison__arrow {
    font-size: 1rem;
}

.month-comparison__arrow--up {
    color: var(--danger-text);
}

.month-comparison__arrow--down {
    color: var(--success-text);
}

.month-comparison__arrow--same {
    color: var(--text-muted);
}

/* ===== End Date Badge ===== */
.badge--end-date {
    background: var(--warning);
    color: var(--warning-text);
}

[data-theme='dark'] .badge--end-date {
    background: #3d3520;
    color: #fde68a;
}

/* ===== Keyboard Shortcuts Overlay ===== */
.shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeOverlay 0.2s ease;
}

.shortcuts-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 90%;
    max-width: 340px;
    box-shadow: var(--shadow-lg);
}

.shortcuts-box__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    align-items: center;
}

.shortcuts-grid kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 3px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.shortcuts-grid span {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}