/* ==========================================================================
   EXDUIT - Design System & Stylesheet
   Color Palette: Dark Navy (#08131C), Card (#12212C), Primary Turquoise (#18D4C4)
   ========================================================================== */

:root {
    --bg-main: #08131C;
    --bg-card: #12212C;
    --bg-card-hover: #182B38;
    --bg-input: #0B1924;
    --border-color: #1A2F3F;
    --border-focus: #18D4C4;
    --primary: #18D4C4;
    --primary-hover: #14B8AA;
    --primary-glow: rgba(24, 212, 196, 0.18);
    --income: #10B981;
    --income-glow: rgba(16, 185, 129, 0.15);
    --expense: #F43F5E;
    --expense-glow: rgba(244, 63, 94, 0.15);
    --text-white: #FFFFFF;
    --text-muted: #94A3B8;
    --text-dark: #08131C;
    --sidebar-width: 250px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    --transition: all 0.2s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: var(--font-family);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--primary-hover);
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.25;
}

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

.text-primary {
    color: var(--primary);
}

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

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

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-income {
    background: rgba(16, 185, 129, 0.15);
    color: var(--income);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-expense {
    background: rgba(244, 63, 94, 0.15);
    color: var(--expense);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-primary {
    background: rgba(24, 212, 196, 0.15);
    color: var(--primary);
    border: 1px solid rgba(24, 212, 196, 0.3);
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    box-sizing: border-box;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-dark);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 15px var(--primary-glow);
    color: var(--text-dark);
}

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

.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.btn-danger {
    background-color: rgba(244, 63, 94, 0.15);
    color: var(--expense);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

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

.btn-block {
    width: 100%;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: 0.9375rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--income);
}

.alert-error {
    background-color: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--expense);
}

/* ==========================================================================
   Layout: Desktop Sidebar & Main Content
   ========================================================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(24, 212, 196, 0.35));
    flex-shrink: 0;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.brand-logo:hover .brand-logo-img {
    transform: scale(1.06);
    filter: drop-shadow(0 3px 12px rgba(24, 212, 196, 0.55));
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #06B6D4 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-weight: 900;
    font-size: 1.1rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-white);
    line-height: 1.15;
}

.brand-highlight,
.brand-name .brand-highlight {
    color: var(--primary) !important;
}

.brand-name span:not(.brand-highlight) {
    color: var(--text-white);
}

.brand-tagline {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    font-weight: 600;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 12px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 10px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
}

.nav-link:hover {
    color: var(--text-white);
    background-color: var(--bg-card-hover);
}

.nav-link.active {
    color: var(--text-dark);
    background-color: var(--primary);
    font-weight: 600;
}

.nav-link.active .nav-icon {
    color: var(--text-dark);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #1A2F3F;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    border: 1px solid var(--border-color);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-white);
}

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 28px 36px 60px;
    max-width: 1300px;
    box-sizing: border-box;
}

/* ==========================================================================
   Header & Greeting Section
   ========================================================================== */

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

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.greeting-title {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.greeting-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
}

.filter-pill-select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
}

.budget-cards-grid,
.goal-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.modal-backdrop.show {
    display: flex !important;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    animation: modalPop 0.2s ease-out;
    box-sizing: border-box;
}

@keyframes modalPop {
    from {
        transform: scale(0.96);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Dashboard KPI Grid
   ========================================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.kpi-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.kpi-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.kpi-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.kpi-bottom {
    display: flex;
    align-items: center;
}

/* ==========================================================================
   Charts & Category Breakdown
   ========================================================================== */

.dashboard-middle-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

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

.chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.category-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

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

.category-icon-box {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 0.4s ease;
}

/* ==========================================================================
   Recent Transactions & Telegram Promo Banner
   ========================================================================== */

.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
}

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tx-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.tx-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

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

.tx-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.tx-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

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

.tx-amount {
    font-size: 0.9375rem;
    font-weight: 700;
}

/* Telegram Promo Card */
.telegram-banner-card {
    background: linear-gradient(145deg, #102534 0%, #0F3245 100%);
    border: 1px solid rgba(24, 212, 196, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.telegram-bubble-preview {
    background: rgba(8, 19, 28, 0.7);
    border-radius: 12px;
    padding: 12px;
    margin-top: 14px;
    border: 1px solid var(--border-color);
    font-size: 0.8125rem;
}

/* ==========================================================================
   Add Transaction Page (2-Column Form & AI Receipt Upload)
   ========================================================================== */

.add-tx-layout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
}

.tx-type-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.toggle-btn.active-expense {
    background: rgba(244, 63, 94, 0.15);
    border-color: var(--expense);
    color: var(--expense);
}

.toggle-btn.active-income {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--income);
    color: var(--income);
}

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

/* Drag & Drop Receipt Zone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: rgba(8, 19, 28, 0.4);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background-color: var(--bg-card-hover);
}

.receipt-preview-container {
    margin-top: 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: #08131C;
    display: none;
    position: relative;
}

.receipt-preview-img {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    background: #000;
}

.receipt-loading {
    display: none;
    text-align: center;
    padding: 16px;
    color: var(--primary);
}

/* ==========================================================================
   Telegram Bot Setup & Simulator
   ========================================================================== */

.telegram-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.status-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 600;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

.step-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.table-responsive {
    overflow-x: auto;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-custom th {
    text-align: left;
    padding: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.table-custom td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
}

/* ==========================================================================
   Auth Pages (Login / Register Split View)
   ========================================================================== */

.auth-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    background-color: #060F16;
}

.auth-branding-panel {
    background: #07131D;
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    border-right: 1px solid rgba(24, 212, 196, 0.2);
    overflow: hidden;
}

.auth-ambient-backdrop {
    position: absolute;
    inset: -30px;
    inset: -12px;
    background-size: cover;
    background-position: center;
    filter: blur(45px) brightness(0.22);
    opacity: 0.85;
    filter: blur(6px) brightness(0.62) saturate(1.08);
    opacity: 0.92;
    pointer-events: none;
    z-index: 1;
}

.auth-banner-frame {
    width: 100%;
    max-width: 620px;
    max-width: 640px;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 55px -10px rgba(0, 0, 0, 0.75), 0 0 30px rgba(24, 212, 196, 0.2);
    border: 1px solid rgba(24, 212, 196, 0.35);
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85), 0 0 35px rgba(24, 212, 196, 0.25);
    border: 1px solid rgba(24, 212, 196, 0.4);
    background: #08131C;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-banner-frame:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 30px 65px -10px rgba(0, 0, 0, 0.85), 0 0 40px rgba(24, 212, 196, 0.3);
}

.auth-branding-panel::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--primary), transparent);
    box-shadow: 0 0 15px var(--primary);
    pointer-events: none;
    z-index: 3;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    background: radial-gradient(circle at 50% 30%, rgba(24, 212, 196, 0.04) 0%, transparent 65%), #08131C;
}

.auth-form-box {
    width: 100%;
    max-width: 420px;
}

.google-btn {
    width: 100%;
    background: #FFFFFF;
    color: #1F2937;
    border-radius: var(--radius-pill);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    margin-bottom: 20px;
}

.google-btn:hover {
    background: #F3F4F6;
    color: #111827;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: 20px;
}

.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

/* ==========================================================================
   Mobile Bottom Navigation & Topbar
   ========================================================================== */

.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-menu-btn, .mobile-topbar-icon {
    background: transparent;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--primary);
}

/* Mobile Drawer Overlay */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    bottom: 0;
    width: 270px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}

.mobile-drawer.open {
    transform: translateX(280px);
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(18, 33, 44, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    align-items: center;
    justify-content: space-around;
    padding-left: 8px;
    padding-right: 8px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    gap: 3px;
    text-decoration: none;
    flex: 1;
    transition: var(--transition);
}

.bottom-nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

.bottom-nav-add-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -22px;
    box-shadow: 0 4px 14px var(--primary-glow);
    font-size: 1.4rem;
    border: 3px solid var(--bg-main);
    text-decoration: none;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.bottom-nav-add-btn:active {
    transform: scale(0.92);
}

/* ==========================================================================
   Transaction List Styles (Desktop Table vs Mobile Cards)
   ========================================================================== */

.filter-form-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: flex-end;
}

.mobile-transaction-list {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.mobile-tx-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.mobile-tx-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.mobile-tx-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

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

.mobile-tx-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-tx-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-tx-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}

.mobile-tx-amount {
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
}

.mobile-tx-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mobile-tx-delete-btn:hover {
    color: var(--expense);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 900px) {
    .dashboard-middle-grid,
    .dashboard-bottom-grid,
    .add-tx-layout,
    .telegram-layout {
        grid-template-columns: 1fr;
    }
    .auth-container {
        grid-template-columns: 1fr;
    }
    .auth-branding-panel {
        display: none;
    }
    .auth-mobile-brand {
        display: block !important;
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .app-container {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 12px 14px 84px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .mobile-topbar {
        display: flex;
    }

    .bottom-nav {
        display: flex;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
    }

    .greeting-title {
        font-size: 1.35rem;
    }

    .greeting-subtitle {
        font-size: 0.8125rem;
    }

    .filter-pill-select {
        padding: 6px 14px;
        font-size: 0.8125rem;
        width: 100%;
    }

    .kpi-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
    }

    .kpi-card {
        padding: 12px 12px !important;
        border-radius: 14px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .kpi-top {
        margin-bottom: 6px !important;
        gap: 6px !important;
    }

    .kpi-icon {
        width: 24px !important;
        height: 24px !important;
        border-radius: 6px !important;
    }

    .kpi-label {
        font-size: 0.72rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .kpi-value {
        font-size: 1.15rem !important;
        letter-spacing: -0.4px !important;
        margin-bottom: 6px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .badge {
        padding: 2px 7px !important;
        font-size: 0.68rem !important;
    }

    .card {
        padding: 16px 14px !important;
        border-radius: 14px !important;
    }

    .dashboard-middle-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
    }

    .chart-container-box {
        height: 190px !important;
        position: relative;
        width: 100% !important;
        overflow: hidden;
    }

    /* Transactions Page Mobile Rules */
    .desktop-table-container {
        display: none !important;
    }

    .mobile-transaction-list {
        display: flex !important;
    }

    .filter-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .filter-form-grid .form-group-full {
        grid-column: span 2 !important;
    }

    .filter-form-grid select.form-control,
    .filter-form-grid input.form-control {
        font-size: 0.8125rem !important;
        padding: 9px 10px !important;
        min-width: 0 !important;
    }

    .filter-form-grid select.form-control {
        padding-right: 28px !important;
        background-position: right 8px center !important;
        background-size: 14px !important;
        text-overflow: ellipsis;
    }

    .page-header-actions {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        gap: 8px !important;
        margin-top: 6px !important;
        box-sizing: border-box !important;
    }

    .page-header-actions .btn {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: nowrap !important;
        padding: 9px 10px !important;
        font-size: 0.8125rem !important;
        gap: 6px !important;
        box-sizing: border-box !important;
    }

    .budget-cards-grid,
    .goal-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
    }
}

/* Admin Quick Action Dropdown */
.dropdown-menu-card {
    background-color: #12212C !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.drop-item {
    transition: background-color 0.15s ease;
}

.drop-item:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   Premium Modal & Universal Toast Notification System
   ========================================================================== */
.premium-modal {
    position: relative;
    border-radius: 22px !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 35px rgba(24, 212, 196, 0.15) !important;
    border: 1px solid rgba(24, 212, 196, 0.35) !important;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.modal-backdrop {
    animation: fadeInBackdrop 0.2s ease-out;
}

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

/* Universal Premium Toast Container */
#toastContainer {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-notification {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    min-width: 280px;
    max-width: 400px;
    background: linear-gradient(150deg, rgba(18, 33, 44, 0.96) 0%, rgba(8, 19, 28, 0.98) 100%);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 20px rgba(24, 212, 196, 0.1);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.25s ease;
}

.toast-notification.toast-hide {
    animation: toastSlideOut 0.25s ease forwards;
}

.toast-notification.toast-success {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.18);
}

.toast-notification.toast-error {
    border-color: rgba(244, 63, 94, 0.45);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(244, 63, 94, 0.18);
}

.toast-notification.toast-warning {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.18);
}

.toast-notification.toast-info {
    border-color: rgba(24, 212, 196, 0.45);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(24, 212, 196, 0.18);
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--income);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.toast-error .toast-icon {
    background: rgba(244, 63, 94, 0.2);
    color: var(--expense);
    border: 1px solid rgba(244, 63, 94, 0.4);
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #FCD34D;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.toast-info .toast-icon {
    background: rgba(24, 212, 196, 0.2);
    color: var(--primary);
    border: 1px solid rgba(24, 212, 196, 0.4);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(50px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(50px) scale(0.9);
    }
}

@media (max-width: 640px) {
    #toastContainer {
        top: 14px;
        left: 14px;
        right: 14px;
        align-items: center;
    }
    .toast-notification {
        width: 100%;
        max-width: 100%;
    }
}

/* ==========================================================================
   Telegram Chat Simulator & Inline Utilities
   ========================================================================== */
.spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spinInline 0.7s linear infinite;
    vertical-align: middle;
}

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

.quick-sample-msg {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.quick-sample-msg:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 212, 196, 0.25);
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

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

.sim-msg {
    animation: simBubbleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes simBubbleIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


