:root {
    /* Rugged Fintech Palette */
    --primary-color: #0F172A;
    /* Deep Navy - Trust & Stability */
    --primary-light: #1E293B;
    /* Slate - Secondary Backgrounds */
    --accent-color: #2563EB;
    /* Electric Blue - Action & Tech */
    --accent-hover: #1D4ED8;
    --success-color: #059669;
    /* Emerald - Financial Positive */
    --warning-color: #D97706;
    /* Amber - Alerts */
    --danger-color: #DC2626;
    /* Red - Errors/Debt */
    --text-color: #0F172A;
    /* Dark Slate - High Contrast Text */
    --text-light: #64748B;
    /* Cool Gray - Secondary Text */
    --bg-color: #F8FAFC;
    /* Light Slate - App Background */
    --card-bg: #FFFFFF;
    /* Pure White - Card Background */
    --border-color: #E2E8F0;
    /* Subtle Border */
    --sidebar-width: 260px;
    --header-height: 60px;
    /* Slightly smaller for mobile */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    /* Base font size for mobile */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout - Mobile First */
.app-container {
    display: flex;
    flex-direction: column;
    /* Stack vertically on mobile */
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: 0;
    /* No margin on mobile */
    padding: 1rem;
    padding-top: calc(var(--header-height) + 1rem);
    transition: margin-left 0.3s ease;
    width: 100%;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.25rem;
}

/* Rugged Cards */
.glass-card,
.fintech-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    /* Smaller padding on mobile */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover,
.fintech-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    /* Prevent zoom on iOS */
    color: var(--text-color);
    background: var(--bg-color);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    width: 100%;
    /* Full width on mobile by default for better touch targets */
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--text-color);
    background: var(--bg-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    width: auto;
    /* Allow small buttons to be auto width */
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    /* Slightly smaller on mobile */
    white-space: nowrap;
    /* Prevent wrapping in cells */
}

.table th {
    text-align: left;
    padding: 0.75rem;
    background: var(--bg-color);
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.table tr:hover td {
    background: rgba(241, 245, 249, 0.5);
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-color);
}

.badge-secondary {
    background: var(--border-color);
    color: var(--text-light);
}

/* Utilities */
.text-light {
    color: var(--text-light) !important;
}

.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

/* Visibility Utilities */
.hide-on-mobile {
    display: none !important;
}

.show-on-mobile {
    display: block !important;
}

/* Responsive Overrides (Tablet and up) */
@media (min-width: 768px) {
    :root {
        --header-height: 70px;
    }

    .app-container {
        flex-direction: row;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding: 2rem;
        padding-top: calc(var(--header-height) + 2rem);
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.875rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .glass-card,
    .fintech-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    /* Prevent zoom on iOS */
    color: var(--text-color);
    background: var(--bg-color);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    width: 100%;
    /* Full width on mobile by default for better touch targets */
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--text-color);
    background: var(--bg-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    width: auto;
    /* Allow small buttons to be auto width */
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    /* Slightly smaller on mobile */
    white-space: nowrap;
    /* Prevent wrapping in cells */
}

.table th {
    text-align: left;
    padding: 0.75rem;
    background: var(--bg-color);
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.table tr:hover td {
    background: rgba(241, 245, 249, 0.5);
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-color);
}

.badge-secondary {
    background: var(--border-color);
    color: var(--text-light);
}

/* Utilities */
.text-light {
    color: var(--text-light) !important;
}

.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

/* Visibility Utilities */
.hide-on-mobile {
    display: none !important;
}

.show-on-mobile {
    display: block !important;
}

/* Responsive Overrides (Tablet and up) */
@media (min-width: 768px) {
    :root {
        --header-height: 70px;
    }

    .app-container {
        flex-direction: row;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding: 2rem;
        padding-top: calc(var(--header-height) + 2rem);
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.875rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .glass-card,
    .fintech-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .btn {
        width: auto;
        /* Reset full width */
    }

    .auth-form-wrapper {
        flex: 1;
        background: white;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 2rem;
        width: 100%;
    }

    .auth-header {
        margin-bottom: 2rem;
    }

    .brand-logo {
        display: inline-flex;
        align-items: center;
        gap: 0.75rem;
        font-weight: 800;
        font-size: 1.5rem;
        color: var(--accent-color);
        margin-bottom: 2rem;
        letter-spacing: -0.02em;
    }

    /* Auth Responsive (Desktop) */
    @media (min-width: 960px) {
        .auth-visual {
            display: flex;
            flex: 1;
            background: var(--primary-color);
            position: relative;
            flex-direction: column;
            justify-content: center;
            padding: 4rem;
            color: white;
            overflow: hidden;
        }

        .auth-visual::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background:
                radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.4) 0%, transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(5, 150, 105, 0.2) 0%, transparent 40%);
            z-index: 1;
        }

        .auth-visual-content {
            position: relative;
            z-index: 2;
            max-width: 600px;
        }

        .auth-visual h1 {
            font-size: 3.5rem;
            line-height: 1.1;
            margin-bottom: 1.5rem;
            color: white;
            letter-spacing: -0.03em;
        }

        .auth-visual p {
            border-bottom: 1px solid var(--border-color);
            color: var(--text-color);
        }

        .table tr:hover td {
            background: rgba(241, 245, 249, 0.5);
        }

        /* Badges */
        .badge {
            padding: 0.25rem 0.6rem;
            border-radius: 9999px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            display: inline-block;
        }

        .badge-success {
            background: rgba(5, 150, 105, 0.1);
            color: var(--success-color);
        }

        .badge-warning {
            background: rgba(217, 119, 6, 0.1);
            color: var(--warning-color);
        }

        .badge-danger {
            background: rgba(220, 38, 38, 0.1);
            color: var(--danger-color);
        }

        .badge-primary {
            background: rgba(37, 99, 235, 0.1);
            color: var(--accent-color);
        }

        .badge-secondary {
            background: var(--border-color);
            color: var(--text-light);
        }

        /* Utilities */
        .text-light {
            color: var(--text-light) !important;
        }

        .text-center {
            text-align: center;
        }

        .mb-1 {
            margin-bottom: 0.5rem;
        }

        .mb-2 {
            margin-bottom: 1rem;
        }

        .mt-1 {
            margin-top: 0.5rem;
        }

        .mt-2 {
            margin-top: 1rem;
        }

        .d-none {
            display: none !important;
        }

        .d-block {
            display: block !important;
        }

        .d-flex {
            display: flex !important;
        }

        /* Visibility Utilities */
        .hide-on-mobile {
            display: none !important;
        }

        .show-on-mobile {
            display: block !important;
        }

        /* Responsive Overrides (Tablet and up) */
        @media (min-width: 768px) {
            :root {
                --header-height: 70px;
            }

            .app-container {
                flex-direction: row;
            }

            .main-content {
                margin-left: var(--sidebar-width);
                padding: 2rem;
                padding-top: calc(var(--header-height) + 2rem);
            }

            h1 {
                font-size: 2.25rem;
            }

            h2 {
                font-size: 1.875rem;
            }

            h3 {
                font-size: 1.5rem;
            }

            .glass-card,
            .fintech-card {
                padding: 1.5rem;
                margin-bottom: 1.5rem;
            }

            .btn {
                width: auto;
                /* Reset full width */
            }

            .auth-form-wrapper {
                flex: 1;
                background: white;
                display: flex;
                flex-direction: column;
                justify-content: center;
                padding: 2rem;
                width: 100%;
            }

            .auth-header {
                margin-bottom: 2rem;
            }

            .brand-logo {
                display: inline-flex;
                align-items: center;
                gap: 0.75rem;
                font-weight: 800;
                font-size: 1.5rem;
                color: var(--accent-color);
                margin-bottom: 2rem;
                letter-spacing: -0.02em;
            }

            /* Auth Responsive (Desktop) */
            @media (min-width: 960px) {
                .auth-visual {
                    display: flex;
                    flex: 1;
                    background: var(--primary-color);
                    position: relative;
                    flex-direction: column;
                    justify-content: center;
                    padding: 4rem;
                    color: white;
                    overflow: hidden;
                }

                .auth-visual::before {
                    content: '';
                    position: absolute;
                    top: 0;
                    left: 0;
                    right: 0;
                    bottom: 0;
                    background:
                        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.4) 0%, transparent 40%),
                        radial-gradient(circle at 80% 80%, rgba(5, 150, 105, 0.2) 0%, transparent 40%);
                    z-index: 1;
                }

                .auth-visual-content {
                    position: relative;
                    z-index: 2;
                    max-width: 600px;
                }

                .auth-visual h1 {
                    font-size: 3.5rem;
                    line-height: 1.1;
                    margin-bottom: 1.5rem;
                    color: white;
                    letter-spacing: -0.03em;
                }

                .auth-visual p {
                    font-size: 1.25rem;
                    color: rgba(255, 255, 255, 0.7);
                    line-height: 1.6;
                }

                .auth-form-wrapper {
                    flex: 0 0 500px;
                    padding: 4rem;
                    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.05);
                    z-index: 10;
                }
            }
        }