:root {
    --bg-body: #000000;
    --bg-app: #09090b; /* Deep charcoal */
    --bg-card: #18181b; /* Zinc-900 */
    --bg-card-hover: #27272a;
    --bg-overlay: #131315;
    
    --primary: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    --text-main: #ffffff;
    --text-secondary: #a1a1aa; /* Zinc-400 */
    
    --border-subtle: #27272a;
    --border-active: #3f3f46;

    --success: #10b981; /* Emerald */
    --danger: #ef4444; /* Red */
    
    /* Gradients for accent */
    --gradient-1: linear-gradient(to bottom right, #ec4899, #8b5cf6); 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* PERFORMANCE OPTIMIZATIONS */
.transaction-item,
.account-card,
.summary-card,
.more-item,
.nav-item {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.overlay,
.calculator-overlay,
.global-loader {
    will-change: transform, opacity;
    transform: translateZ(0);
}

html {
    height: 100%;
    overflow: hidden;
    /* Prevent zoom on input focus on iOS */
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

.app-container {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: -webkit-fill-available;
    background: var(--bg-app);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    /* Subtle background glow */
    background-image: radial-gradient(circle at 50% 0%, #1e1b4b 0%, transparent 40%);
}

/* Header */
.header {
    padding: calc(30px + env(safe-area-inset-top)) 20px 20px;
    text-align: center;
    flex-shrink: 0;
}

.balance-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.currency {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.edit-icon {
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: 8px;
    opacity: 0.5;
    vertical-align: middle;
    transform: translateY(-4px);
}

.date-navigator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.date-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 200px;
}

.current-date {
    font-size: 0.95rem;
    font-weight: 500;
}

.today-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.today-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.today-btn:active {
    transform: translateY(0);
}

.nav-arrow {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 10px 14px;
    transition: all 0.2s;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
    color: white;
}

.current-date {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Summary Cards */
.summary-section {
    display: flex;
    gap: 16px;
    padding: 0 20px 24px;
    flex-shrink: 0;
}

.summary-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.summary-card.active {
    background: #1e1e24;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.summary-card:active {
    transform: scale(0.98);
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.text-expense { color: var(--danger); }
.text-income { color: var(--success); }

/* Content Area */
.content-area {
    flex: 1;
    padding: 0 20px 120px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    min-height: 0; /* Important for flex scrolling */
    padding-bottom: 140px; /* Increase padding to ensure button is visible */
}

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

.list-header h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.transaction-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    grid-auto-rows: 90px;
}

.transaction-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    min-width: 0;
    max-width: 100%;
    border-radius: 20px;
    padding: 10px; /* Horizontal padding only, vertical handled by flex center */
    height: 100%; /* Fill the grid cell */
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.transaction-item:active {
    background: var(--bg-card-hover);
    transform: scale(0.98);
}

.icon-box {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    /* Colors handled inline */
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    min-width: 0; /* Critical for ellipsis to work in flex container */
    justify-content: center;
    flex: 1;
}

.item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2; /* Enforce consistent line height */
}

.item-amount-preview {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add Button */
.add-btn-card {
    border: 1px dashed var(--border-active);
    justify-content: center;
    color: var(--text-secondary);
    background: transparent;
    flex-direction: column;
    gap: 8px;
}

.add-btn-card:hover {
    border-color: var(--text-secondary);
    color: var(--text-main);
    background: rgba(255,255,255,0.03);
}

/* Fixed Bottom Nav */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    padding: 12px 0 calc(24px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    z-index: 10;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

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

.nav-item.active i {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px var(--primary));
}

/* Calculator Overlay */
.calculator-overlay {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    max-height: -webkit-fill-available;
    background: var(--bg-app);
    z-index: 1000;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calc-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.calc-close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.calc-close-btn:active {
    transform: scale(0.95);
}

.calculator-overlay.active {
    bottom: 0;
}

.calc-split-header {
    display: flex;
    background: #121215;
    padding-top: 40px; /* Status bar safe area */
    border-bottom: 1px solid var(--border-subtle);
}

.split-part {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.split-part.from-account {
    border-right: 1px solid var(--border-subtle);
}

.split-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.selected-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    overflow: hidden; /* Ensure container handles overflow */
}

.selected-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-item i {
    color: var(--primary);
}

.calc-display-area {
    background: #121215;
    padding: 40px 20px;
    text-align: center;
    font-size: 3.5rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    color: var(--text-main);
}

.calc-currency {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.calc-toolbar {
    display: flex;
    justify-content: space-between;
    padding: 10px 24px;
    background: var(--bg-app);
    border-bottom: 1px solid var(--border-subtle);
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 10px;
    cursor: pointer;
}

/* Keypad */
.advanced-keypad {
    flex: 1;
    display: flex;
    background: var(--bg-app);
    padding: 20px 12px 40px;
    gap: 8px;
}

.key-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.key {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.8rem;
    font-weight: 400;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    justify-content: center;
    transition: background 0.1s;
}

.key:active {
    background: rgba(255,255,255,0.05);
}

.key.op {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.key.num {
    font-weight: 500;
}

.text-key {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.action-back {
    height: 60px; 
    color: var(--danger);
}

.action-date {
    height: 60px;
    color: var(--text-secondary);
    font-size: 1.4rem;
}

.action-submit {
    flex: 1; /* Takes remaining space in col */
    background: var(--primary);
    color: white;
    border-radius: 16px;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

/* View Management */
.view-section {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.view-section.active {
    display: flex;
}

/* Accounts List */
.accounts-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.account-card.active-account {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.account-card.active-account::after {
    content: 'Active';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
}

.account-card:active {
    background: var(--bg-card-hover);
    transform: scale(0.98);
}

.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.account-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.account-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-balance {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.add-account-btn {
    width: 100%;
    padding: 18px;
    background: transparent;
    border: 1px dashed var(--border-active);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-account-btn:hover {
    background: rgba(255,255,255,0.03);
    border-color: var(--primary);
    color: var(--primary);
}

/* Add Account Overlay */
.overlay {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    max-height: -webkit-fill-available;
    background: var(--bg-app);
    z-index: 1000;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 24px;
    padding-top: 40px;
    overflow: hidden;
}

.overlay.active {
    bottom: 0;
}

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

.overlay-header .close-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.overlay-header .close-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
}

.overlay-header .close-btn:active {
    transform: scale(0.95);
}

.overlay-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.overlay-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 16px;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Prevent zoom on iOS */
    font-size: max(16px, 1rem);
}

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

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    transition: border-color 0.2s;
}

.password-input-wrapper:focus-within {
    border-color: var(--primary);
}

.password-input-wrapper .form-input {
    padding-right: 50px;
    background: transparent;
    border: none;
    flex: 1;
}

.password-input-wrapper .form-input:focus {
    border: none;
    outline: none;
}

.password-toggle {
    position: absolute;
    right: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
    z-index: 1;
    pointer-events: auto;
}

.password-toggle:hover {
    color: var(--text-main);
}

.password-toggle.active {
    color: var(--primary);
}

.type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.type-selector-grid {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.type-option {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.type-option i {
    font-size: 1.8rem;
}

.type-option span {
    font-size: 0.9rem;
    font-weight: 500;
}

.type-option.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.type-option:active {
    transform: scale(0.95);
}

.overlay-confirm-btn {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s;
    margin-top: auto;
}

.overlay-confirm-btn:active {
    transform: scale(0.98);
}

.overlay-confirm-btn.secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.overlay-confirm-btn.secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    box-shadow: none;
}

.subscription-info {
    margin: 16px 0;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.subscription-terms {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    text-align: center;
    margin: 0;
}

/* Operations / History View */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.history-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 4px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.history-item:active {
    background: var(--bg-card-hover);
    transform: scale(0.98);
}

.history-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.history-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-category {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-account {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-account i {
    font-size: 0.8rem;
}

.history-amount {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

.history-amount.expense {
    color: var(--danger);
}

.history-amount.income {
    color: var(--success);
}

.filter-btn {
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.filter-btn:hover {
    color: var(--text-main);
}

.empty-history {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-history i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    backdrop-filter: blur(12px);
    max-width: calc(100% - 40px);
    pointer-events: none;
}

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

.toast i {
    font-size: 1.2rem;
}

.toast-success {
    border-color: var(--success);
}

.toast-success i {
    color: var(--success);
}

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

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

.toast span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Auth View */
.auth-view {
    width: 100%;
    height: 100vh;
    height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    background-image: radial-gradient(circle at 50% 0%, #1e1b4b 0%, transparent 40%);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: fixed;
    top: 0;
    left: 0;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 40px 24px;
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: 48px;
}

.auth-logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.3s ease;
}

.auth-form.active {
    display: flex;
}

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

.auth-btn {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    margin-top: 12px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.4);
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 8px;
}

.auth-link {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
}

/* Consent Checkbox Styles */
.consent-group {
    margin-top: 8px;
    margin-bottom: 4px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

.consent-checkbox {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.consent-label span {
    flex: 1;
}

.consent-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
}

.consent-link:hover {
    opacity: 0.8;
}
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

/* ========================================
   MORE VIEW (Settings)
======================================== */
.more-section {
    margin-bottom: 32px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    overflow: hidden; /* Important for image clipping */
    flex-shrink: 0;
    flex-shrink: 0; /* Prevent squashing on mobile */
}

.profile-img-circle {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.profile-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.more-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.more-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(4px);
}

.more-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.more-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.more-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
}

.more-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.more-value {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.more-item > i.fa-chevron-right {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 34px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Logout Button Full */
.logout-btn-full {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 16px;
    padding: 18px;
    color: var(--danger);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
}

.logout-btn-full:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    transform: scale(1.02);
}

.logout-btn-full:active {
    transform: scale(0.98);
}

.app-info {
    text-align: center;
    padding: 24px 0 80px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ========================================
   ADD CATEGORY FORM
======================================== */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.icon-option {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

.icon-option.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.color-option {
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 3px solid transparent;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========================================
   ACCOUNT POPUP
======================================== */
.account-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.account-popup.active {
    display: flex;
}

.account-popup-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    animation: slideUp 0.25s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.account-popup-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.account-popup-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.account-popup-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 4px 0;
}

.account-popup-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.account-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-action-btn {
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.popup-action-btn i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.popup-action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    transform: translateY(-2px);
}

.popup-action-btn:active {
    transform: translateY(0);
}

.popup-action-btn.select {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.popup-action-btn.select:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.popup-action-btn.edit {
    color: #3b82f6;
}

.popup-action-btn.edit:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.popup-action-btn.delete {
    color: #ef4444;
}

.popup-action-btn.delete:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.popup-action-btn.cancel {
    color: var(--text-secondary);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   PREMIUM MODAL
======================================== */
.premium-header {
    text-align: center;
    margin-bottom: 30px;
}

.premium-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #000;
    margin: 0 auto 16px;
    box-shadow: 0 0 30px rgba(253, 185, 49, 0.3);
}

.premium-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 8px;
}

.premium-header p {
    color: var(--text-secondary);
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
}

.feature-item i {
    font-size: 1.2rem;
    color: var(--primary);
    width: 24px;
    text-align: center;
}

.feature-item span {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

.subscription-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.plan-card {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 20px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.plan-card:hover {
    transform: translateY(-2px);
}

.plan-card.active {
    border-color: #FDB931;
    background: rgba(253, 185, 49, 0.1);
}

.popular-badge {
    position: absolute;
    top: -12px;
    background: #FDB931;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.plan-duration {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.plan-price {
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 700;
}

.plan-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.feature-locked {
    opacity: 0.5;
    position: relative;
    pointer-events: none;
}

.lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: var(--text-main);
    z-index: 10;
    background: rgba(0,0,0,0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   GLOBAL LOADER
======================================== */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    background: var(--bg-app);
    background-image: radial-gradient(circle at 50% 0%, #1e1b4b 0%, transparent 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.global-loader.hide {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loader-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    opacity: 0.7;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 50px rgba(102, 126, 234, 0.6);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   HEADER BUTTONS
======================================== */
.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

.logout-btn:active {
    transform: scale(0.95);
}

/* ========================================
   SETTINGS SECTION (Accounts View)
======================================== */
.settings-section {
    margin-top: 24px;
    margin-bottom: 24px;
}

.settings-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 4px;
}

.setting-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    transform: translateX(4px);
}

.setting-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.setting-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.setting-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.setting-item i.fa-chevron-right {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.5;
}

/* ========================================
   STATS VIEW
======================================== */
.stats-period-selector {
    display: flex;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border-subtle);
}

.period-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.stats-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-all;
    line-height: 1.2;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-title {
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 20px;
    text-align: left;
}

.top-categories {
    margin-bottom: 24px;
}

#top-categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.top-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.top-category-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top-category-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.top-category-bar {
    height: 6px;
    background: var(--bg-card-hover);
    border-radius: 3px;
    overflow: hidden;
}

.top-category-fill {
    height: 100%;
    border-radius: 3px;
}

.top-category-amount {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.stats-insights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.insight-card i {
    font-size: 1.5rem;
    color: var(--primary);
    opacity: 0.8;
}

.insight-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.insight-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.positive { color: var(--success); }
.negative { color: var(--danger); }

/* ========================================
   CURRENCY SELECTOR
======================================== */
.currency-search {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.currency-search i {
    color: var(--text-secondary);
}

.currency-search input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.currency-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.currency-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.currency-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
}

.currency-item.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.currency-flag {
    font-size: 1.5rem;
}

.currency-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.currency-code {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.currency-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.currency-symbol {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-height: 700px) {
    .header { padding-bottom: 10px; }
    .balance-amount { font-size: 2rem; margin-bottom: 10px; }
    .summary-section { padding-bottom: 16px; }
}

@media (max-width: 374px) {
    .balance-amount { font-size: 1.8rem; }
    .summary-amount { font-size: 1.2rem; }
    .nav-item span { font-size: 0.6rem; }
    .key { font-size: 1.4rem; }
}

/* ==================== VOICE INPUT & SETTINGS ==================== */

/* Header Top Row */
.header-top-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 8px;
    position: relative;
}

.balance-label {
    text-align: center;
    flex: 1;
}

.header-top-row .settings-icon-btn {
    position: absolute;
    right: 0;
}

.settings-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    transform: scale(1.05);
}

.settings-icon-btn:active {
    transform: scale(0.95);
}

/* Microphone Button in Navbar */
.nav-item-microphone {
    position: relative;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -4px;
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.35);
    color: white !important;
    transform: translateY(-2px);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    overflow: visible;
    padding: 6px;
}

/* Slightly larger for mobile devices */
@media (max-width: 768px) {
    .nav-item-microphone {
        width: 52px;
        height: 52px;
        padding: 8px;
    }
    
    .nav-item-microphone::before {
        content: '';
        position: absolute;
        top: -6px;
        left: -6px;
        right: -6px;
        bottom: -6px;
        border-radius: 50%;
        /* Invisible hitbox extension for better touch target */
    }
}

/* Prevent microphone button from being highlighted as active */
.nav-item-microphone.active {
    color: white !important;
}

.nav-item-microphone.active i {
    transform: none;
    filter: none;
}

.nav-item-microphone i {
    font-size: 1.2rem !important;
    margin-bottom: 0 !important;
    position: relative;
    z-index: 2;
}

.nav-item-microphone span {
    display: none;
}

.nav-item-microphone:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.nav-item-microphone:active {
    transform: translateY(-1px) scale(0.95);
}

/* Inline waves for microphone button */
.voice-waves-inline {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.wave-inline {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    opacity: 0;
    width: 48px;
    height: 48px;
}

.nav-item-microphone.recording .wave-inline {
    animation: wave-inline-animation 1.5s ease-out infinite;
}

.nav-item-microphone.recording .wave-inline-1 {
    animation-delay: 0s;
}

.nav-item-microphone.recording .wave-inline-2 {
    animation-delay: 0.5s;
}

.nav-item-microphone.recording .wave-inline-3 {
    animation-delay: 1s;
}

@keyframes wave-inline-animation {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.nav-item-microphone.recording {
    animation: pulse-microphone 1.5s ease-in-out infinite;
    box-shadow: 0 3px 16px rgba(99, 102, 241, 0.7);
}

@keyframes pulse-microphone {
    0%, 100% {
        transform: translateY(-2px) scale(1);
        box-shadow: 0 3px 16px rgba(99, 102, 241, 0.7);
    }
    50% {
        transform: translateY(-2px) scale(1.08);
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.9);
    }
}

/* Voice Input Overlay */
.voice-overlay {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.voice-recording-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-microphone-icon {
    position: absolute;
    z-index: 2;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 30px rgba(99, 102, 241, 0.7);
    }
}

.voice-waves {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wave {
    position: absolute;
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: wave-animation 2s ease-out infinite;
}

.wave-1 {
    width: 120px;
    height: 120px;
    animation-delay: 0s;
}

.wave-2 {
    width: 140px;
    height: 140px;
    animation-delay: 0.4s;
}

.wave-3 {
    width: 160px;
    height: 160px;
    animation-delay: 0.8s;
}

.wave-4 {
    width: 180px;
    height: 180px;
    animation-delay: 1.2s;
}

.wave-5 {
    width: 200px;
    height: 200px;
    animation-delay: 1.6s;
}

@keyframes wave-animation {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.voice-status {
    text-align: center;
    width: 100%;
}

.voice-status-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.voice-transcript {
    font-size: 0.95rem;
    color: var(--text-secondary);
    min-height: 24px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.voice-actions {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

.voice-stop-btn {
    background: var(--danger);
    border: none;
    color: white;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.voice-stop-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.voice-stop-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments for voice overlay */
@media (max-width: 480px) {
    .voice-overlay-content {
        padding: 24px;
    }
    
    .voice-recording-container {
        width: 160px;
        height: 160px;
    }
    
    .voice-microphone-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .wave-1 { width: 100px; height: 100px; }
    .wave-2 { width: 115px; height: 115px; }
    .wave-3 { width: 130px; height: 130px; }
    .wave-4 { width: 145px; height: 145px; }
    .wave-5 { width: 160px; height: 160px; }
}