/* Base Styles */
body {
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-default);
    color: var(--text-primary);
}

/* Auth Layout */
body.auth-layout {
    background: linear-gradient(165deg, #eef2f6 0%, #e4eaf0 40%, #f2f5f8 100%);
}

.auth-container--public {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 100% 70% at 50% -15%, color-mix(in srgb, var(--primary-color) 28%, transparent) 0%, transparent 58%),
        radial-gradient(ellipse 55% 45% at 105% 8%, color-mix(in srgb, var(--primary-color) 14%, transparent) 0%, transparent 52%),
        radial-gradient(ellipse 50% 42% at -5% 92%, color-mix(in srgb, var(--primary-color) 11%, transparent) 0%, transparent 48%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 42%);
}

.auth-container--public .auth-main {
    position: relative;
    z-index: 1;
}

.auth-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.auth-brand .logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 20px 50px rgba(0, 0, 0, 0.1),
        0 0 0 1px color-mix(in srgb, var(--primary-color) 12%, transparent);
    margin-bottom: 1.1rem;
    padding: 16px;
    box-sizing: border-box;
}

.auth-brand .logo-img {
    width: 100%;
    height: auto;
    max-height: 84px;
    object-fit: contain;
    display: block;
}

.auth-brand h1 {
    font-size: 1.45rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.auth-brand .auth-tagline {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.auth-form-container {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 2rem 1.75rem;
    border-radius: 1.15rem;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.03),
        0 24px 48px rgba(15, 23, 42, 0.1);
    width: min(92vw, 400px);
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.85);
}

.sign-in-text {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.75rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.auth-form-container .form-control {
    border-radius: 10px;
    padding: 0.82rem 1rem;
    border-color: color-mix(in srgb, var(--text-primary) 10%, #e5e8eb);
}

.auth-form-container .btn-primary.btn-block {
    margin-top: 0.6rem;
    padding: 0.88rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--primary-color) 32%, transparent);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s;
}

.auth-form-container .btn-primary.btn-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 26px color-mix(in srgb, var(--primary-color) 38%, transparent);
}

/* Form Styles */
.auth-form {
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    background-color: var(--input-background);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    box-sizing: border-box;
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.password-input {
    position: relative;
}

.password-input .toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
}

.btn {
    padding: 0.6rem 0.8rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 0.1rem 0;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary, .bg-primary, .progress-bar {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    background-color: #ffffff;
    color: var(--primary-color-darker);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color-darker);
    color: white;
    border-color: var(--primary-color);
}

.btn-action {
    gap: 0.5rem;
    display: flex;
    align-items: center;
}

.btn-primary:hover {
    background-color: var(--primary-color-darker) !important;
    color: white;
}

.auth-footer {
    text-align: center;
}

.forgot-password {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 1rem;
}

.forgot-password:hover {
    text-decoration: underline;
}

.signup-section {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.signup-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

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

/* Alert Styles */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: #fdecea;
    color: #d32f2f;
}

/* Authenticated Layout */
.authenticated-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    min-height: 64px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    align-items: center;
    max-width: 99vw;
    margin: 0 auto;
    width: 100%;
    padding: 0 0.5rem;
}

.header-content .brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.header-content .brand:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-content .brand i {
    font-size: 1.8rem !important;
    transition: transform 0.3s ease;
}

.header-content .brand:hover i {
    transform: scale(1.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions .icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible;
}

.header-actions .icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header-actions .icon-btn:hover::before {
    opacity: 1;
}

.header-actions .icon-btn:active::before {
    opacity: 0.2;
    animation: ripple 0.6s ease-out;
}

.header-actions .badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--warning-color, #ffc107);
    color: var(--warning-text-color, #000);
    border-radius: 50%;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(25%, -25%);
}

.dropdown-menu {
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    background: white;
}

.dropdown-menu .dropdown-item {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
}

.dropdown-menu .dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.dropdown-menu .dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.notifications-menu {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.notification-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-color);
}

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

.view-all-notifications {
    text-align: center;
    padding: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.view-all-notifications:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.app-main {
    flex: 1;
    padding: 5rem 1rem 5rem;
    max-width: 99vw;
    margin: 0 auto;
    width: 100%;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-paper);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 0.25rem;
}

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

/* Bottom Navigation Styles */
.mobile-nav .nav-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-nav .nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color, #007bff);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 8px;
}

.mobile-nav .nav-item:active::before {
    opacity: 0.15;
    animation: ripple 0.6s ease-out;
}

.mobile-nav .nav-item.active {
    color: var(--primary-color);
    transform: translateY(-2px);
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 0.15;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

#main-content {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .app-main {
        padding: 5.75rem 1rem 5.75rem;
    }
}

/* Dashboard Styles */
.welcome-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card {
    border-radius: 16px;
    border: none;
}

.dashboard-card {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 1rem;
    transition: transform 0.2s;
}

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

.card-icon {
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.card-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.card-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.quick-actions h5,
.recent-activity h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mobile Navigation */
.mobile-nav {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.55rem 0 calc(0.55rem + env(safe-area-inset-bottom, 0px));
    box-shadow:
        0 -1px 0 rgba(0, 0, 0, 0.06),
        0 -8px 32px rgba(15, 23, 42, 0.08);
    z-index: 1030;
    border-top: 1px solid color-mix(in srgb, var(--primary-color) 12%, transparent);
}

.nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.72rem;
    flex: 1 1 0%;
    min-width: 0;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nav-item span:not(.nav-item-icon) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item .nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.35rem;
    margin-bottom: 0.2rem;
}

.nav-item .nav-item-icon i {
    font-size: 1.25rem;
    line-height: 1;
}

.nav-item .nav-item-icon--accent i {
    color: color-mix(in srgb, var(--primary-color) 92%, #1a1a1a);
}

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

.nav-item.active .nav-item-icon i {
    transform: translateY(-1px);
}

.nav-items-with-fab {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: flex-end;
    gap: 0.35rem;
    padding: 0 0.1rem 0.1rem;
}

.nav-cluster {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    gap: 0.15rem;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.1rem;
}

.nav-cluster::-webkit-scrollbar {
    display: none;
}

.nav-cluster .nav-item {
    flex: 0 1 auto;
    padding: 0.2rem 0.15rem;
}

.nav-fab-slot {
    flex: 0 0 auto;
    width: 3.5rem;
    display: flex;
    justify-content: center;
    margin-top: -1.35rem;
    position: relative;
    z-index: 2;
}

.nav-fab-btn {
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.95);
    background: linear-gradient(145deg, var(--primary-color), var(--primary-color-darker));
    color: #fff;
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.08),
        0 10px 28px color-mix(in srgb, var(--primary-color) 42%, transparent);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-fab-btn:active {
    transform: scale(0.96);
}

/* Responsive Padding for Mobile Nav */
@media (max-width: 768px) {
    body {
        padding-bottom: 4rem;
    }
}

/* Transaction Filters */
.transaction-filters {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    background: white;
    color: var(--text-primary);
}

.filter-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-color), 0.1);
}

/* Material Select Dropdown */
select.filter-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23495057' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
    cursor: pointer;
}

select.filter-input option {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

select.filter-input option:checked {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

select.filter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

/* Select Dropdown Menu */
select.filter-input::-ms-expand {
    display: none;
}

select.filter-input option:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

/* Custom Select Wrapper */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::before {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.select-wrapper select:focus + .select-icon {
    color: var(--primary-color);
}

/* Filter Input Improvements */
.filter-input {
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.filter-input:hover {
    background-color: #f0f1f2;
}

.filter-input:focus {
    background-color: white;
}

/* Filter Group Improvements */
.filter-group {
    position: relative;
}

.filter-group .filter-label {
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.filter-group:focus-within .filter-label {
    color: var(--primary-color);
}

/* Transaction Table */
table {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
}

table {
    margin-bottom: 0;
}

table th {
    background: #f8f9fa;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: none;
    padding: 1rem;
    border-bottom: none;
}

table td {
    padding: 1rem;
    color: var(--text-primary);
    border-bottom: none;
    vertical-align: middle;
}

table tbody {
    border-top: none !important;
}

table tr td {
    padding: 1rem !important;
}

table tbody tr:last-child td {
    border-bottom: none;
}

table .badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 1rem;
}

.avatar-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    padding: 1rem 1.5rem;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.list-group-item {
    border-left: none;
    border-right: none;
    padding: 1rem;
}

.list-group-item:first-child {
    border-top: none;
}

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

@media (min-width: 992px) {
    .authenticated-layout {
        background-color: var(--background-default);
        background-image:
            radial-gradient(ellipse 90% 55% at 100% 0%, color-mix(in srgb, var(--primary-color) 9%, transparent) 0%, transparent 52%),
            radial-gradient(ellipse 70% 45% at 0% 100%, color-mix(in srgb, var(--primary-color) 6%, transparent) 0%, transparent 50%);
    }

    .app-container {
        flex-direction: row;
    }

    .app-header {
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 4px 24px rgba(0, 0, 0, 0.12);
    }

    .header-content {
        max-width: min(1600px, 100%);
        padding: 0 1.25rem;
    }

    .left-nav-kicker {
        margin: 0;
        padding: 0 1rem 0.85rem;
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: var(--text-secondary);
        opacity: 0.85;
    }

    .left-nav {
        width: 268px;
        background: linear-gradient(180deg, #ffffff 0%, var(--surface-muted) 100%);
        border-right: 1px solid var(--surface-border);
        padding: 1.15rem 0 1rem;
        position: fixed;
        top: 64px;
        bottom: 0;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        scrollbar-width: thin;
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.04);
    }

    .left-nav .nav-item {
        display: flex;
        align-items: center;
        padding: 0.7rem 1rem;
        color: var(--text-secondary);
        text-decoration: none;
        transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
        margin: 0.12rem 0.65rem;
        border-radius: 12px;
    }

    .left-nav .nav-item i {
        margin-right: 0.85rem;
        width: 24px;
        text-align: center;
    }

    .left-nav .nav-item:hover {
        background: color-mix(in srgb, var(--primary-color) 8%, var(--background-paper));
        color: var(--text-primary);
    }

    .left-nav .nav-item:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    .left-nav .nav-item.active {
        background: var(--primary-color);
        color: white;
        border-radius: 12px;
        margin-left: 0.65rem;
        margin-right: 0.65rem;
        box-shadow: 0 6px 20px color-mix(in srgb, var(--primary-color) 38%, transparent);
        font-weight: 600;
    }

    .left-nav .nav-item.active:hover {
        color: white;
        background: var(--primary-color-darker);
    }

    .app-main {
        margin-left: 268px;
        width: calc(100% - 268px);
        padding: 5.5rem 1.5rem 2.25rem;
        min-height: calc(100vh - 64px);
    }

    .app-main-shell {
        width: 100%;
        max-width: min(1360px, 100%);
        margin-left: auto;
        margin-right: auto;
    }

    .mobile-nav {
        display: none;
    }
}

@media (max-width: 991px) {
    .left-nav {
        display: none;
    }

    .app-main {
        margin-left: 0;
        width: 100%;
    }
}

/* -------------------------------------------------------------------------- */
/* Client portal UI kit — shared layout for templates (simple, cohesive)     */
/* -------------------------------------------------------------------------- */

.client-page {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 0.5rem;
    min-width: 0; /* allow horizontal scroll inside nested tables in flex layouts */
}

.page-head {
    margin-bottom: 1.5rem;
}

.page-head--gradient {
    background: linear-gradient(125deg, var(--primary-color) 0%, var(--primary-color-darker) 52%, #1a3028 100%);
    color: #fff;
    border-radius: var(--radius-page, 1.25rem);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow-lift);
    position: relative;
    overflow: hidden;
}

.page-head--gradient::after {
    content: '';
    position: absolute;
    right: -15%;
    top: -50%;
    width: 50%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.page-head--gradient .page-title,
.page-head--gradient .page-kicker,
.page-head--gradient .page-sub {
    color: #fff;
    position: relative;
    z-index: 1;
}

.page-head--gradient .page-sub {
    opacity: 0.92;
    font-size: 0.95rem;
}

.page-kicker {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-primary);
}

.page-sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.35rem 0 0;
    line-height: 1.45;
}

.surface-card {
    background: var(--background-paper);
    border-radius: var(--radius-page);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-soft);
}

.loan-sheet {
    padding: 0;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.loan-sheet__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border-bottom: 1px solid var(--surface-border);
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--background-paper) 100%);
}

.loan-sheet__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

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

.loan-sheet__stats {
    padding: 1.25rem 1.35rem 0.5rem;
}

.loan-sheet__table {
    padding: 0 1.35rem 1.35rem;
}

.stat-pill {
    display: flex;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid var(--surface-border);
    background: var(--background-paper);
    height: 100%;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-pill:hover {
    box-shadow: var(--shadow-soft);
    border-color: rgba(0, 0, 0, 0.08);
}

.stat-pill--plain {
    flex-direction: column;
    gap: 0.5rem;
}

.stat-pill__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
    font-size: 1.1rem;
}

.stat-pill__icon--accent {
    background: rgba(0, 0, 0, 0.06);
}

.stat-pill__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-pill__value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.loan-detail-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--surface-border);
}

.loan-detail-list li:last-child {
    border-bottom: none;
}

.loan-detail-list span {
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-page);
    border: 1px dashed var(--surface-border);
    background: var(--surface-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-paper);
    color: var(--primary-color);
    font-size: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.badge-soft-success {
    background: rgba(25, 135, 84, 0.12) !important;
    color: #146c43 !important;
    font-weight: 600;
    padding: 0.45em 0.85em;
}

.badge-soft-danger {
    background: rgba(220, 53, 69, 0.12) !important;
    color: #b02a37 !important;
    font-weight: 600;
    padding: 0.45em 0.85em;
}

.badge-soft-secondary {
    background: rgba(108, 117, 125, 0.15) !important;
    color: #495057 !important;
    font-weight: 600;
}

.badge-soft-warning {
    background: rgba(255, 193, 7, 0.2) !important;
    color: #856404 !important;
    font-weight: 600;
    padding: 0.45em 0.85em;
}

.badge-soft-dark {
    background: rgba(33, 37, 41, 0.12) !important;
    color: #212529 !important;
    font-weight: 600;
    padding: 0.45em 0.85em;
}

/* Loan history — compact stat row */
.stat-pill--compact {
    padding: 0.85rem 1rem;
}

.stat-pill--compact .stat-pill__value {
    font-size: 1.15rem;
}

.loan-history-filters {
    background: var(--background-paper);
}

.loan-history-table-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--background-paper) 100%);
    border-bottom: 1px solid var(--surface-border);
}

.client-table-wrap {
    border-radius: 0.85rem;
    border: 1px solid var(--surface-border);
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.table-client thead th {
    background: var(--surface-muted) !important;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary) !important;
    font-weight: 600;
    border-bottom: 1px solid var(--surface-border) !important;
}

.table-client tbody td {
    border-bottom: 1px solid var(--surface-border);
    vertical-align: middle;
}

.table-client tbody tr:last-child td {
    border-bottom: none;
}

/* Wide tables: keep columns readable; swipe/drag horizontally on phones */
.table-client {
    width: 100%;
    min-width: 36rem;
    margin-bottom: 0;
}

/* All data tables in the client app — Bootstrap .table-responsive + touch scroll */
.client-page .table-responsive,
.app-main .table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.table-responsive table {
    overflow: visible;
}

.client-page .table-responsive:not(.client-table-wrap) table.table,
.app-main .table-responsive:not(.client-table-wrap) table.table {
    min-width: 32rem;
    margin-bottom: 0;
}

.client-page .table-responsive::-webkit-scrollbar,
.client-table-wrap::-webkit-scrollbar {
    height: 7px;
}

.client-page .table-responsive::-webkit-scrollbar-thumb,
.client-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
}

@media (max-width: 576px) {
    .table-client {
        min-width: 34rem;
        font-size: 0.8125rem;
    }

    .table-client thead th,
    .table-client tbody td {
        padding: 0.5rem 0.45rem !important;
    }

    .client-page .table-responsive:not(.client-table-wrap) table.table {
        min-width: 30rem;
    }
}

/* Quick actions — shared (replaces inline blocks in many templates) */
.quick-action-btn {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--surface-border);
}

.quick-action-btn:hover {
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: inherit;
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.08);
}

.icon-wrapper {
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-wrapper i {
    font-size: 1.25rem;
}

.action-text {
    flex: 1;
}

.action-text > h6 {
    font-size: 0.8rem;
}

.quick-actions h5 {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

/* Notifications feed (was inline in notifications_content) */
.notif-loan-feed .dash-feed-card {
    border-radius: 1.15rem;
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.notif-loan-feed .dash-feed-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%, transparent 100%);
    border-bottom: 1px solid var(--surface-border);
}

.notif-loan-feed .dash-feed-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--surface-border);
    align-items: flex-start;
}

.notif-loan-feed .dash-feed-item:last-child {
    border-bottom: none;
}

.notif-loan-feed .dash-feed-dot {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.notif-loan-feed .dash-feed-meta {
    font-size: 0.75rem;
    opacity: 0.75;
}

/* Auth & marketing */
.auth-form-container.auth-panel {
    border-radius: 1.15rem;
    box-shadow: var(--shadow-lift);
    border: 1px solid var(--surface-border);
}

.marketing-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-darker) 100%);
    color: #fff;
    border-radius: var(--radius-page);
    padding: 2rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lift);
}

.marketing-hero .display-4 {
    font-size: 1.85rem;
    font-weight: 800;
}

.error-page {
    padding: 2rem 1rem;
}

.error-page .display-1 {
    font-weight: 800;
    color: var(--primary-color);
    opacity: 0.35;
}

/* Repayment “make payment” page */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payment-info-alert {
    background-color: #e8f4fc;
    border: 1px solid #90caf9;
    color: #0d47a1;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.65rem;
}

.next-payment-alert {
    background-color: #f3e5f5;
    border: 1px solid #ce93d8;
    color: #4a148c;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.65rem;
}

.error-alert {
    background-color: #ffebee;
    border: 1px solid #ef9a9a;
    color: #b71c1c;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.65rem;
}

.balance-alert {
    background-color: #f3e5f5;
    border: 1px solid #ce93d8;
    color: #4a148c;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.65rem;
}

.info-alert {
    background-color: #e8f4fc;
    border: 1px solid #90caf9;
    color: #0d47a1;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.65rem;
}

@media (max-width: 576px) {
    .page-title {
        font-size: 1.35rem;
    }

    .loan-sheet__header {
        flex-direction: column;
    }
}

/* -------------------------------------------------------------------------- */
/* Large desktop — breathing room & readable line length                       */
/* -------------------------------------------------------------------------- */

@media (min-width: 1200px) {
    .client-page {
        max-width: 1240px;
    }

    .header-content {
        padding: 0 1.75rem;
    }

    .left-nav {
        width: 280px;
    }

    .app-main {
        margin-left: 280px;
        width: calc(100% - 280px);
        padding-left: 2.25rem;
        padding-right: 2.25rem;
    }
}

@media (min-width: 1400px) {
    .app-main-shell {
        max-width: 1420px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .left-nav .nav-item,
    .dashboard-card,
    .quick-action-btn {
        transition: none;
    }

    .left-nav .nav-item.active {
        box-shadow: none;
    }
}