/* ============================================
   HARCAMA TAKİP — GLOBAL STYLES
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #f5f4fb;
    --surface: #ffffff;
    --surface2: #f8f7fe;
    --border: #ede9fe;
    --text: #1a1a2e;
    --text2: #6b7280;
    --text3: #9ca3af;
    --shadow: 0 4px 24px rgba(124,58,237,0.10);
    --shadow-card: 0 2px 16px rgba(0,0,0,0.07);
    --radius: 20px;
    --radius-sm: 12px;
    --bottom-nav-h: 72px;
    --top-bar-h: 64px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-body {
    background: linear-gradient(145deg, #e0d7ff 0%, #f5f0ff 40%, #fce4ec 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
}

.login-bg { position: fixed; inset: 0; z-index: 0; }

.login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
}

.blob1 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #c4b5fd, #7c3aed);
    top: -80px; right: -80px;
}

.blob2 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, #fde68a, #f59e0b);
    bottom: -60px; left: -60px;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(124,58,237,0.18);
    border: 1px solid rgba(255,255,255,0.6);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 52px;
    margin-bottom: 12px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.login-logo h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.login-logo p {
    font-size: 14px;
    color: var(--text2);
    margin-top: 4px;
}

.login-form .form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    z-index: 1;
    line-height: 1;
}

.toggle-pass {
    position: absolute;
    right: 14px;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    opacity: 0.6;
}

.form-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    background: var(--surface2);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124,58,237,0.1);
    background: white;
}

.form-input::placeholder { color: var(--text3); }

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 24px rgba(124,58,237,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
}

.btn-login:active {
    transform: scale(0.98);
    box-shadow: 0 3px 12px rgba(124,58,237,0.25);
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ============================================
   APP LAYOUT
   ============================================ */

.app-body {
    background: var(--bg);
    min-height: 100vh;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-h);
    padding: 0 10px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding-top: var(--safe-top);
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface2);
    color: var(--text);
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.icon-btn:active { background: var(--border); }
.back-btn { color: var(--primary); }

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.avatar span {
    color: white;
    font-size: 15px;
    font-weight: 700;
}

.avatar.large {
    width: 50px;
    height: 50px;
}
.avatar.large span { font-size: 20px; }

.page-content {
    padding-top: calc(var(--top-bar-h) + 16px);
    padding-bottom: calc(var(--bottom-nav-h) + 20px);
    padding-left: 20px;
    padding-right: 20px;
    max-width: 520px;
    margin: 0 auto;
}

/* ============================================
   SLIDE MENU
   ============================================ */

.slide-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 300;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 40px rgba(0,0,0,0.12);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.slide-menu.open { left: 0; }

.slide-menu-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 48px 24px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.menu-username {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.menu-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

.slide-nav {
    padding: 16px 12px;
    flex: 1;
}

.slide-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    transition: background 0.15s;
    margin-bottom: 4px;
    text-decoration: none;
}

.slide-nav-item:active,
.slide-nav-item.active {
    background: rgba(124,58,237,0.08);
    color: var(--primary);
}

.slide-nav-item.logout { color: var(--danger); margin-top: 12px; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.overlay.open { opacity: 1; pointer-events: all; }

/* ============================================
   GREETING
   ============================================ */

.greeting { margin-bottom: 20px; }

.greeting h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.greeting p {
    font-size: 14px;
    color: var(--text2);
    margin-top: 2px;
}

/* ============================================
   MONTH SELECTOR
   ============================================ */

.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    background: var(--surface);
    border-radius: 50px;
    padding: 10px 20px;
    box-shadow: var(--shadow-card);
}

.month-nav {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    line-height: 1;
}

.month-nav:active { transform: scale(0.9); }
.month-nav.sm { width: 28px; height: 28px; font-size: 16px; }

.month-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    min-width: 120px;
    text-align: center;
}
.month-label.sm { font-size: 13px; min-width: 100px; }

/* ============================================
   BALANCE CARD
   ============================================ */

.balance-card {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 60%, #4c1d95 100%);
    border-radius: 24px;
    padding: 24px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(124,58,237,0.35);
    min-height: 160px;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.balance-card::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.card-chip {
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.card-dots {
    font-size: 12px;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.card-balance-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    z-index: 1;
}

.card-balance {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 4px 0 20px;
    position: relative;
    z-index: 1;
}

.card-meta {
    display: flex;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.card-meta-label {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 2px;
}

.card-meta-val {
    font-size: 14px;
    font-weight: 700;
    color: white;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.quick-btn span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
}

.quick-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
}

.quick-icon.add {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 26px;
    font-weight: 300;
    box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}

.quick-btn:active .quick-icon {
    transform: scale(0.93);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ============================================
   SECTION HEADERS
   ============================================ */

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

.section-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.see-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.badge-pill {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(124,58,237,0.1);
    padding: 3px 10px;
    border-radius: 50px;
}

/* ============================================
   WEEK BAR CHART
   ============================================ */

.week-chart-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 16px 16px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-card);
}

.week-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
    min-height: 100px;
}

.week-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.week-bar-amount {
    font-size: 8px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    min-height: 12px;
    text-align: center;
    overflow: hidden;
    max-width: 40px;
    text-overflow: ellipsis;
}

.week-bar-wrap {
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 80px;
}

.week-bar {
    width: 100%;
    max-width: 32px;
    border-radius: 6px 6px 0 0;
    background: rgba(124,58,237,0.2);
    min-height: 2px;
    transition: height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.week-bar.today {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}

.week-bar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
}

/* ============================================
   EXPENSE LIST
   ============================================ */

.expense-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.expense-item {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s;
    animation: slideIn 0.3s ease;
    margin-bottom: 10px;
}

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

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-100%); }
}

.expense-item:active { transform: scale(0.99); }

.expense-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(167,139,250,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.expense-info { flex: 1; min-width: 0; }

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

.expense-meta {
    font-size: 12px;
    color: var(--text3);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--danger);
    white-space: nowrap;
    flex-shrink: 0;
}

.expense-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(239,68,68,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.delete-btn:active { background: rgba(239,68,68,0.18); }

/* ============================================
   CATEGORY GRID
   ============================================ */

.category-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.cat-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-card);
}

.cat-icon {
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cat-info { flex: 1; }

.cat-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.cat-count {
    font-size: 12px;
    color: var(--text3);
    margin-top: 2px;
}

.cat-right { text-align: right; }

.cat-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.cat-pct {
    font-size: 12px;
    color: var(--text3);
    margin-top: 2px;
}

/* ============================================
   BOTTOM NAV
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    padding-bottom: var(--safe-bottom);
    background: var(--surface);
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    max-width: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    color: var(--text3);
    text-decoration: none;
    transition: color 0.15s;
    flex: 1;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
}

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

.nav-add-btn {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(124,58,237,0.4);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: -16px;
}

.nav-add-btn:active {
    transform: scale(0.93);
    box-shadow: 0 3px 12px rgba(124,58,237,0.3);
}

/* ============================================
   ADD EXPENSE MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-sheet {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: white;
    border-radius: 28px 28px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: calc(16px + var(--safe-bottom));
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.open .modal-sheet {
    transform: translateY(0);
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 12px auto 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text2);
    border: none;
    cursor: pointer;
}

.modal-body { padding: 20px 24px; }

.modal-footer {
    padding: 0 24px 8px;
}

/* Amount big input */
.amount-input-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    gap: 4px;
}

.amount-currency {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
}

.amount-input {
    font-size: 48px;
    font-weight: 800;
    color: var(--text);
    border: none;
    outline: none;
    background: transparent;
    width: 220px;
    text-align: center;
    -moz-appearance: textfield;
}

.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.amount-input::placeholder { color: var(--text3); }

/* Category chips */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.chip {
    padding: 8px 14px;
    border-radius: 50px;
    border: 2px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
    background: var(--surface2);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

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

.chip.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

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

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    background: var(--surface2);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124,58,237,0.1);
    background: white;
}

.form-textarea {
    resize: none;
    padding: 14px 16px;
}

select.form-input { cursor: pointer; }

.required { color: var(--danger); }
.optional { font-size: 11px; color: var(--text3); font-weight: 400; }

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(124,58,237,0.3);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 3px 10px rgba(124,58,237,0.2);
}

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

/* ============================================
   CONFIRM SHEET
   ============================================ */

.confirm-sheet {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: white;
    border-radius: 28px 28px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    padding: 0 24px calc(32px + var(--safe-bottom));
    text-align: center;
}

.modal-overlay.open .confirm-sheet { transform: translateY(0); }

.confirm-icon { font-size: 48px; margin: 24px 0 16px; }

.confirm-sheet h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.confirm-sheet p { font-size: 14px; color: var(--text2); line-height: 1.5; }

.confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.btn-ghost {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s;
}

.btn-ghost:active { background: var(--surface2); }

.btn-danger {
    flex: 1;
    padding: 14px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.btn-danger:active { transform: scale(0.97); }

/* ============================================
   TRANSACTIONS PAGE
   ============================================ */

.summary-bar {
    display: flex;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    gap: 8px;
}

.summary-item { flex: 1; text-align: center; }

.summary-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.summary-lbl {
    font-size: 11px;
    color: var(--text3);
    font-weight: 500;
    margin-top: 2px;
}

.summary-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
    flex-shrink: 0;
}

.filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.filter-row-2 { margin-bottom: 16px; }

.filter-month {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border-radius: 50px;
    padding: 6px 14px;
    box-shadow: var(--shadow-card);
    flex: 1;
    justify-content: center;
}

.search-wrap {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
}

.search-input {
    width: 100%;
    padding: 11px 12px 11px 36px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 14px;
    background: var(--surface);
    outline: none;
    color: var(--text);
    transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--primary); }

.filter-select {
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font-weight: 500;
    max-width: 140px;
}

/* Date groups */
.date-group { margin-bottom: 16px; }

.date-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    margin-bottom: 8px;
}

.date-group-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
}

.date-group-total {
    font-size: 13px;
    font-weight: 700;
    color: var(--danger);
}

/* ============================================
   ANALYTICS PAGE
   ============================================ */

.analytics-dark-card {
    background: #1a1a2e;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 28px;
    color: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

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

.analytics-dark-title {
    font-size: 16px;
    font-weight: 700;
}

.analytics-chip {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.analytics-totals {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.analytics-total-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.analytics-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.analytics-dot.spent { background: #a78bfa; }
.analytics-dot.count { background: #f59e0b; }
.analytics-dot.avg { background: #34d399; }

.analytics-label {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}

.analytics-val {
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto 16px;
    width: 220px;
    height: 220px;
}

.donut-center {
    position: absolute;
    text-align: center;
    pointer-events: none;
}

.donut-center-label {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}

.donut-center-val {
    font-size: 18px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
    margin-top: 2px;
}

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

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.legend-label {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.chart-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 16px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-card);
}

/* Category breakdown */
.cat-breakdown-item {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
}

.cat-bd-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cat-bd-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.cat-bd-icon { font-size: 22px; }

.cat-bd-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.cat-bd-count {
    font-size: 12px;
    color: var(--text3);
    margin-top: 1px;
}

.cat-bd-right { text-align: right; }

.cat-bd-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.cat-bd-pct {
    font-size: 12px;
    color: var(--text3);
    margin-top: 1px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   LOADING & EMPTY
   ============================================ */

.loading-placeholder {
    padding: 32px;
    text-align: center;
    color: var(--text3);
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text3);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; font-weight: 500; }

/* ============================================
   TOAST
   ============================================ */

.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a2e;
    color: white;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE — DESKTOP CENTERING
   ============================================ */

@media (min-width: 520px) {
    .page-content { padding-left: 24px; padding-right: 24px; }
    .top-bar { max-width: 520px; left: 50%; transform: translateX(-50%); right: auto; width: 100%; }
    .bottom-nav { max-width: 520px; left: 50%; transform: translateX(-50%); right: auto; width: 100%; }
    .slide-menu { border-radius: 0 16px 16px 0; }
}

/* ============================================
   CATEGORY MANAGEMENT PAGE
   ============================================ */

.add-cat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 8px;
}

.add-cat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cat-name-input {
    flex: 1;
    padding: 12px 14px;
    font-size: 15px;
}

.emoji-picker-wrap {
    position: relative;
    flex-shrink: 0;
}

.emoji-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--surface2);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
    flex-shrink: 0;
}

.emoji-btn:active { border-color: var(--primary); }

.emoji-grid {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 260px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.16);
    padding: 12px;
    z-index: 200;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    border: 1px solid var(--border);
}

.emoji-opt {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s;
    background: none;
    border: none;
}

.emoji-opt:active { background: var(--surface2); }

.btn-add-cat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.15s;
    box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}

.btn-add-cat:active { transform: scale(0.96); }

.cat-manage-item {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
    margin-bottom: 8px;
    animation: slideIn 0.25s ease;
}

.cat-manage-icon {
    font-size: 26px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cat-manage-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.delete-cat-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(239,68,68,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.delete-cat-btn:active { background: rgba(239,68,68,0.18); }

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.info-box {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(124,58,237,0.06);
    border: 1px solid rgba(124,58,237,0.15);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-top: 20px;
}

.info-icon { font-size: 18px; flex-shrink: 0; }
.info-box p { font-size: 13px; color: var(--text2); line-height: 1.5; }

.list-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    min-height: 28px;
}

.list-header-label {
    font-size: 13px;
    color: var(--text2);
    font-weight: 500;
}

.btn-clear-all {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--danger);
    background: rgba(239,68,68,0.08);
    border: none;
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-clear-all:active { background: rgba(239,68,68,0.18); }

.chips-loading, .chips-empty {
    font-size: 13px;
    color: var(--text3);
    padding: 8px 0;
}

.chips-empty a { color: var(--primary); font-weight: 600; }

.slide-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 12px;
}

/* Make inputs and buttons feel more native on mobile */
@media (hover: none) {
    .btn-login:hover,
    .btn-primary:hover,
    .nav-add-btn:hover { transform: none; }
}

/* Safe area for iPhone notch */
@supports (padding: max(0px)) {
    .top-bar { padding-top: max(var(--safe-top), 12px); height: auto; min-height: var(--top-bar-h); }
    .bottom-nav { padding-bottom: max(var(--safe-bottom), 8px); height: auto; min-height: var(--bottom-nav-h); }
}
