/* =============================================
   FAMILY EXPENSE TRACKER - COMPLETE STYLES
   ============================================= */

/* ===== CSS Variables ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --bg-hover: #475569;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border: #334155;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

input, button, select, textarea {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
    color:#fff;
}

button {
    cursor: pointer;
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

.empty-text {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
    font-size: 14px;
}

/* ===== Splash Screen ===== */
.splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-card));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
}

.splash-icon {
    font-size: 72px;
    margin-bottom: 16px;
    animation: bounce 1s infinite;
}

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

.splash-content h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.splash-content p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-input);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Screens ===== */
.screen {
    min-height: 100vh;
    min-height: 100dvh;
}

/* ===== Login Screen ===== */
.login-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    padding-top: calc(24px + var(--safe-top));
}

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

.login-icon {
    font-size: 72px;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

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

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.2s;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: var(--primary);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.toggle-password {
    position: absolute;
    right: 16px;
    font-size: 18px;
    opacity: 0.6;
    cursor: pointer;
}

.btn-primary {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, opacity 0.2s;
}

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

.btn-primary:disabled {
    opacity: 0.7;
}

.btn-block {
    width: 100%;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 14px;
}

.login-footer strong {
    color: var(--primary-light);
}

/* ===== App Header ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    padding-top: calc(16px + var(--safe-top));
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left .greeting {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-left h1 {
    font-size: 22px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4c90ff;
    border-radius: var(--radius-md);
    font-size: 20px;
    color: transparent;
    text-shadow: 0 0 0 #ffffff;
    margin-top: 10px;
}

.avatar {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

/* ===== Main Content ===== */
.app-content {
    padding: 0 20px 100px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* ===== Balance Card ===== */
.balance-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
    opacity: 0.9;
}

.month-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.balance-amount {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.balance-amount .currency {
    font-size: 28px;
    font-weight: 600;
    margin-right: 4px;
    margin-top: 8px;
}

.balance-amount .amount {
    font-size: 52px;
    font-weight: 800;
    line-height: 1;
}

.balance-status {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.balance-details {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 16px;
}

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

.balance-item .label {
    font-size: 12px;
   /* opacity: 0.8;*/
    display: block;
    margin-bottom: 4px;
}

.balance-item .value {
    font-size: 18px;
    font-weight: 700;
}

.balance-details .divider {
    width: 1px;
    background: rgba(255,255,255,0.2);
    margin: 0 16px;
}

/* ===== Quick Actions ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    transition: transform 0.2s;
}

.quick-action:active {
    transform: scale(0.95);
}

.action-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 24px;
}

.action-icon.green { background: rgb(67 130 255);color: transparent;
    text-shadow: 0 0 0 #ffffff; }
.action-icon.yellow { background: rgba(245, 158, 11, 0.2); }
.action-icon.blue { background: rgba(6, 182, 212, 0.2); }
.action-icon.purple { background: rgba(139, 92, 246, 0.2); }

.quick-action span:last-child {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* ===== Widgets ===== */
.widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

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

.widget-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.btn-link {
    font-size: 13px;
    color: var(--primary-light);
    font-weight: 500;
}

/* ===== Cash Pool Item ===== */
.pool-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.pool-item:last-child {
    margin-bottom: 0;
}

.pool-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pool-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.pool-details h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.pool-details span {
    font-size: 12px;
    color: var(--text-muted);
}

.pool-amount {
    text-align: right;
}

.pool-amount .remaining {
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
}

.pool-amount .total {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Upcoming Bill Item ===== */
.bill-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
}

.bill-item.overdue {
    border-left: 3px solid var(--danger);
}

.bill-item.soon {
    border-left: 3px solid var(--warning);
}

.bill-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bill-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.bill-details h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.bill-details span {
    font-size: 12px;
    color: var(--text-muted);
}

.bill-amount {
    text-align: right;
}

.bill-amount .amount {
    font-size: 16px;
    font-weight: 700;
}

.bill-amount .due {
    font-size: 12px;
}

.bill-amount .due.overdue { color: var(--danger); }
.bill-amount .due.soon { color: var(--warning); }

/* ===== Transaction Item ===== */
.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:active {
    opacity: 0.7;
}

.trans-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trans-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.trans-details h4 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.trans-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.trans-tag {
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
}

.trans-amount {
    text-align: right;
}

.trans-amount .amount {
    font-size: 16px;
    font-weight: 600;
}

.trans-amount .method {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== View Header ===== */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-primary);
}

.view-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* ===== Add Expense Form ===== */
.expense-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.amount-input-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
}

.amount-input-box .currency {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-right: 8px;
}

.amount-input-box input {
    font-size: 48px;
    font-weight: 700;
    width: 180px;
    text-align: center;
    color: var(--text-primary);
}

.amount-input-box input::placeholder {
    color: var(--text-muted);
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

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

.form-section label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ===== Category Grid ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

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

.category-item .icon {
    font-size: 24px;
}

.category-item .name {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
}

/* ===== Payment Methods ===== */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.payment-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.payment-option span:first-child {
    font-size: 24px;
}

.payment-option span:last-child {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ===== Toggle ===== */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

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

.toggle-label {
    font-size: 15px;
    font-weight: 500;
}

.toggle-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.toggle {
    position: relative;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    transition: background 0.3s;
}

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

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

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

/* ===== Filter Chips ===== */
.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.chip {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s;
}

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

/* ===== Pool Summary ===== */
.pool-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.pool-stat {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

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

/* ===== Date Group ===== */
.date-group {
    margin-bottom: 24px;
}

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

.date-group-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.date-group-header span {
    font-size: 14px;
    font-weight: 600;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    padding-bottom: calc(8px + var(--safe-bottom));
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.nav-icon {
    font-size: 24px;
}

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

.nav-add {
    position: relative;
    top: -20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    color: white;
}

.nav-add .nav-icon {
    font-size: 28px;
        font-size: 28px;
    color: transparent;
    text-shadow: 0 0 0 #ffffff;
    margin-top: 10px;
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    backdrop-filter: blur(4px);
}

.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    padding-bottom: calc(24px + var(--safe-bottom));
    z-index: 201;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.modal:not(.hidden) {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: 50%;
    font-size: 16px;
    color: var(--text-secondary);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-body.centered {
    text-align: center;
    padding: 24px 0;
}

.modal-footer {
    display: flex;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-outline {
    flex: 1;
    padding: 14px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 500;
}
.aiir-success{
     background: #28a745 !important;
}
.aiir-edit{
     background:#ffc107 !important;
     color:black;
}
.btn-danger {
    flex: 1;
    padding: 14px;
    background: var(--danger);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
}

/* ===== Delete Modal ===== */
.delete-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.delete-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--danger);
    margin: 16px 0 24px;
}

/* ===== Transaction Detail ===== */
.detail-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.detail-amount {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
}

.detail-badge.common {
    background: var(--primary);
    color: white;
}

.detail-badge.personal {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-value {
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.family-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.family-badge.hitesh {
    background: #3b82f620;
    color: #3b82f6;
}

.family-badge.rahul {
    background: #f59e0b20;
    color: #f59e0b;
}

/* ===== Reports ===== */
.report-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.report-card h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.report-stat {
    text-align: center;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.report-stat .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.report-stat .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.report-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.report-row:last-child {
    border-bottom: none;
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar .fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-input);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 300;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: all 0.3s ease;
}

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

.toast-icon {
    font-size: 18px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--info); }

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

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

.modal .form-group input,
.modal .form-group select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
}

.modal .form-group input:focus,
.modal .form-group select:focus {
    border-color: var(--primary);
}

.modal .input-wrapper input {
    padding-left: 48px;
}

.help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Pool Card ===== */
.pool-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

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

.pool-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pool-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pool-card-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.pool-card-date {
    font-size: 12px;
    color: var(--text-muted);
}

.pool-progress {
    margin-bottom: 16px;
}

.pool-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.pool-progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.pool-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.3s;
}

.pool-usage-list {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.pool-usage-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.pool-usage-item:last-child {
    border-bottom: none;
}

.pool-usage-info span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.btn-use-cash {
    padding: 10px 20px;
    background: var(--primary);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* ===== Bills Section ===== */
.bills-section {
    margin-bottom: 24px;
}

.bills-section h3 {
    font-size: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
    .app-content {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .modal {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        border-radius: var(--radius-xl);
        margin-bottom: 20px;
    }
    
    .modal:not(.hidden) {
        transform: translateX(-50%) translateY(0);
    }
}


/* ===== Pool Detail View ===== */
.pool-detail-card {
    background: linear-gradient(135deg, var(--success), #059669);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 20px;
    color: white;
}

.pool-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.pool-detail-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.pool-detail-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.pool-detail-info p {
    font-size: 13px;
    opacity: 0.9;
}

.pool-detail-amounts {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pool-detail-amount {
    text-align: center;
}

.pool-detail-amount .value {
    font-size: 24px;
    font-weight: 700;
}

.pool-detail-amount .label {
    font-size: 12px;
    opacity: 0.8;
}

.pool-detail-progress {
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
}

.pool-detail-progress-fill {
    height: 100%;
    background: white;
    border-radius: 8px;
    transition: width 0.5s ease;
}

.pool-detail-progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.9;
}

/* Pool Stats Grid */
.pool-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pool-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.pool-stat-card .stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.pool-stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.pool-stat-card .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Pool Tabs */
.pool-tabs {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 20px;
}

.pool-tab {
    flex: 1;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-align: center;
}

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

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Pool Transaction Group */
.pool-trans-group {
    margin-bottom: 24px;
}

.pool-trans-date {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.pool-trans-date h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pool-trans-date span {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* Pool Transaction Item */
.pool-trans-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.pool-trans-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pool-trans-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pool-trans-details {
    flex: 1;
}

.pool-trans-details h5 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.pool-trans-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.pool-trans-user {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
}

.pool-trans-user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pool-trans-right {
    text-align: right;
}

.pool-trans-amount {
    font-size: 16px;
    font-weight: 600;
}

.pool-trans-type {
    font-size: 11px;
    color: var(--text-muted);
}

/* Member Summary Card */
.member-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.member-summary-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-summary-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.member-summary-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.member-summary-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.member-summary-right {
    text-align: right;
}

.member-summary-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.member-summary-percent {
    font-size: 12px;
    color: var(--text-muted);
}

/* Category Summary Card */
.category-summary-card {
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.category-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.category-summary-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-summary-icon {
    font-size: 24px;
}

.category-summary-name {
    font-size: 15px;
    font-weight: 500;
}

.category-summary-right {
    text-align: right;
}

.category-summary-amount {
    font-size: 16px;
    font-weight: 600;
}

.category-summary-count {
    font-size: 12px;
    color: var(--text-muted);
}

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

.category-summary-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
}

/* Empty Pool State */
.pool-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.pool-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.pool-empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.pool-empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Pool Exhausted Badge */
.pool-exhausted-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.pool-active-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--success);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: white;
    margin-top: 8px;
}

/* ===== Install Banner ===== */
.install-banner {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 250;
}

.install-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.install-text strong {
    font-size: 14px;
}

.install-text span {
    font-size: 12px;
    color: var(--text-secondary);
}

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

.btn-link {
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
}

.hidden {
    display: none !important;
}

/* ===== Month Dropdown ===== */
.month-selector {
    position: relative;
}

.month-dropdown {
    position: absolute;
    right: 0;
    top: 125%;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 4px 0;
    min-width: 170px;
    z-index: 150;
}

.month-dropdown-item {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
}

.month-dropdown-item:hover {
    background: var(--bg-input);
}

.month-dropdown-item.current {
    font-weight: 600;
    color: var(--primary);
}

.month-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}