/* Minimalist White Design */

:root {
    /* Background colors - pure white, no gray */
    --bg-main: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-surface: #ffffff;
    /* Added missing var */
    /* Changed to Light Slate Gray for contrast */
    --bg-card: #ffffff;

    /* ... */

    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        /* Darker */
        backdrop-filter: blur(5px);
        /* Premium blur effect */
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    --bg-hover: #f0fdfa;

    /* Text colors - warm blacks, no gray tints */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #475569;

    /* Accent colors - teal/emerald instead of blue/purple */
    --accent: #0d9488;
    --accent-light: #14b8a6;
    --accent-dark: #0f766e;
    --accent-bg: #f0fdfa;

    /* Border colors - very light, minimal */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Status colors */
    --success: #059669;
    --success-light: #d1fae5;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;

    /* Shadows - subtle */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.04);

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

/* ... existing code ... */

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    /* Increased from 480px */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.25s ease;
}

/* ... existing code ... */

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: #f8fafc;
    /* Added slight background to inputs */
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

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

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

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

/* Menu Toggle Button */
.menu-toggle {
    display: flex;
    position: fixed;
    top: 1rem;
    left: 24px;
    z-index: 1002;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0;
    cursor: pointer;
    width: 32px;
    height: 32px;
    box-shadow: var(--shadow-sm);
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Move toggle button when sidebar is collapsed */
.menu-toggle.active {
    left: 1rem;
}

/* Toggle icon visibility */
.menu-toggle .icon-open {
    display: block;
}

.menu-toggle .icon-close {
    display: none;
}

.menu-toggle.active .icon-open {
    display: none;
}

.menu-toggle.active .icon-close {
    display: block;
}

.menu-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

/* Hide toggle on mobile - use overlay instead */
@media (max-width: 768px) {
    .menu-toggle {
        left: 1rem;
    }
}

.menu-toggle svg {
    color: var(--text-primary);
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
}

/* Toggle Icons */
/* Toggle Icons */
.menu-toggle .icon-open {
    display: block;
}

/* Default state (closed sidebar) -> Show > (Open) */
.menu-toggle .icon-open {
    display: block;
}

/* Active state (open sidebar) -> Show > (Open) or Hide? Checking user pref. 
   User said "If it is closed use > icon to open menu". 
   If it is open, user said "use < icon to close it inside menu".
   This implies we can just keep > visible or hide it. 
   But simplest is to keep > visible as a toggle. */
.menu-toggle.active {
    display: none;
}

.menu-toggle.active .icon-open {
    display: none;
}

/* Sidebar structure update for bottom link */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Full height */
}

.nav-menu {
    flex: 1;
    /* Pushes content down */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.nav-item-bottom {
    margin-top: auto;
    /* Pushes to bottom */
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
    padding: 10px 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-item-bottom:hover {
    background: var(--bg-hover);
    color: var(--text-primary) !important;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.sidebar-close {
    display: flex;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}

.sidebar-close svg {
    pointer-events: none;
}

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

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, width 0.3s ease;
}

/* Desktop sidebar collapsed state */
@media (min-width: 769px) {
    .sidebar.collapsed {
        transform: translateX(-100%);
        position: absolute;
        z-index: 999;
    }

    .sidebar.collapsed+.sidebar-overlay+.main-content,
    .sidebar.collapsed~.main-content {
        margin-left: 0;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-img {
    width: 32px;
    height: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

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

.nav-item.active {
    background: #f0fdfa;
    color: var(--accent);
    font-weight: 600;
}

.nav-item svg {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.nav-item:hover svg,
.nav-item.active svg {
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg-secondary);
}

/* Custom Scrollbar */
.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

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

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

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

.date-display {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-weight: 500;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: #f0fdfa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.value.highlight {
    color: var(--accent);
}

.stat-info .sub-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.search-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    width: 260px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
}

.data-table td {
    font-size: 0.9rem;
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.text-right {
    text-align: right !important;
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-danger {
    background: #fef2f2;
    color: var(--danger);
}

.badge-warning {
    background: #fffbeb;
    color: #d97706;
}

.badge-success {
    background: #f0fdf4;
    color: var(--success);
}

.badge-neutral {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Checkbox */
.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--success);
    border-radius: 4px;
}

tr.paid {
    opacity: 0.5;
}

tr.paid td {
    color: var(--text-muted);
    text-decoration: line-through;
}

tr.paid:hover {
    opacity: 0.7;
}

/* Button Add */
.btn-add {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

/* Modal container - for standalone modals without overlay */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    animation: modalSlideIn 0.25s ease;
}

.modal.active {
    display: block;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    background: var(--bg-hover);
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #fef2f2;
    color: var(--danger);
}

/* Form Styles */
#paymentForm {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    /* Darker label */
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: #ffffff;
    /* Clean white background */
    border: 1px solid #e2e8f0;
    /* Light subtle border */
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.btn-cancel {
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-submit {
    padding: 12px 28px;
    background: var(--success);
    border: none;
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #16a34a;
}

/* Delete & Edit Buttons */
.btn-delete,
.btn-edit {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-edit:hover {
    background: #f0fdfa;
    color: var(--accent);
}

/* Category Badge */
.category-badge {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.category-badge.expense {
    background: #fef2f2;
    color: var(--danger);
}

.category-badge.income {
    background: #f0fdf4;
    color: var(--success);
}

/* Manual Entry Row */
tr.manual-entry {
    background: #f0fdfa;
}

tr.manual-entry:hover {
    background: #ccfbf1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

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

/* Sub Navigation Tabs */
.sub-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
}

.sub-nav-item {
    padding: 12px 20px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    margin-bottom: -1px;
    white-space: nowrap;
}

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

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        padding: 1.25rem;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-header .brand {
        margin-bottom: 0;
    }

    .main-content {
        padding: 4.5rem 1.25rem 1.25rem;
        width: 100%;
    }

    .header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .header h1 {
        font-size: 1.35rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .table-actions {
        width: 100%;
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .btn-add {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 4rem 1rem 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-info .value {
        font-size: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

/* Deployed Thu Jan  8 15:18:50 +03 2026 */

/* FINAL VERIFICATION Thu Jan  8 15:58:57 +03 2026 */

/* Sidebar Navigation Badge */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    margin-left: auto;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: badgeAppear 0.3s ease;
}

.nav-badge-urgent {
    animation: badgePulse 2s ease-in-out infinite;
}

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

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 2px 12px rgba(239, 68, 68, 0.6);
    }
}