:root {
    --bg: #0b0d17;
    --bg-soft: #11152a;
    --panel: rgba(18, 22, 39, 0.9);
    --panel-alt: #171d38;
    --panel-alt-2: #121731;
    --text: #eef1f6;
    --muted: #9db0cc;
    --line: #26315f;
    --primary: #8eb7d2;
    --primary-soft: rgba(94, 158, 193, 0.12);
    --success-soft: rgba(94, 158, 193, 0.12);
    --danger-soft: rgba(240, 61, 163, 0.14);
    --warning-soft: rgba(42, 27, 154, 0.22);
    --shadow: 0 18px 44px rgba(4, 7, 18, 0.42);
    --radius: 22px;
}

body {
    background:
        radial-gradient(circle at top left, rgba(94, 158, 193, 0.12), transparent 26%),
        radial-gradient(circle at top right, rgba(240, 61, 163, 0.08), transparent 16%),
        linear-gradient(180deg, #090b14 0%, #0f1430 54%, #111531 100%);
    color: var(--text);
    font-family: "Segoe UI", "Inter", sans-serif;
    min-height: 100vh;
}

.shell {
    padding: 2rem 0 3rem;
}

.hero {
    background:
        radial-gradient(circle at top right, rgba(240, 61, 163, 0.14), transparent 26%),
        linear-gradient(135deg, rgba(21, 33, 109, 0.98) 0%, rgba(42, 27, 154, 0.82) 52%, rgba(18, 27, 70, 0.98) 100%);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.hero::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12));
    content: "";
    inset: 0;
    position: absolute;
    transform: none;
    opacity: 0.28;
}

.hero-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero-meta-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 190px;
    padding: 0.7rem 0.9rem;
    background: rgba(7, 12, 30, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    text-align: left;
}

.hero-meta-label {
    color: rgba(222, 229, 240, 0.62);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-meta-value {
    color: #f4f7fb;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.panel,
.summary-card,
.table-wrap,
.auth-card {
    background: var(--panel);
    border: 1px solid rgba(52, 67, 126, 0.62);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.panel-soft {
    background: linear-gradient(180deg, rgba(20, 26, 50, 0.98) 0%, rgba(15, 21, 42, 0.98) 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.summary-card {
    height: 100%;
    padding: 1.25rem;
}

.summary-card .eyebrow {
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.summary-card .value {
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 700;
}

.summary-card.balance {
    background: linear-gradient(180deg, rgba(17, 33, 67, 0.96) 0%, rgba(18, 42, 78, 0.96) 100%);
}

.summary-card.split {
    background: linear-gradient(180deg, rgba(33, 25, 88, 0.96) 0%, rgba(21, 33, 109, 0.96) 100%);
}

.section-title {
    align-items: center;
    display: flex;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.section-title span {
    background: var(--primary-soft);
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    text-transform: uppercase;
}

.table-wrap {
    overflow: hidden;
}

.import-table .table td:first-child {
    min-width: 260px;
}

.imports-page .table thead th {
    background: rgba(28, 31, 39, 0.98);
    color: #a6afbd;
}

.imports-page .table td {
    background: transparent;
    color: var(--text);
}

.imports-page .table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.imports-page .fw-semibold,
.imports-page .text-end,
.imports-page .muted,
.imports-page .small {
    color: inherit;
}

.imports-page .muted,
.imports-page .small.muted,
.imports-page .table .muted {
    color: var(--muted) !important;
}

.imports-page .progress {
    background-color: #121a35;
    border: 1px solid rgba(38, 49, 95, 0.95);
    height: 1rem;
}

.imports-page .progress-bar {
    background: linear-gradient(90deg, #5e9ec1 0%, #f03da3 100%);
}

.imports-page .text-danger,
#refresh-progress-errors {
    color: #f0b2bc !important;
}

.imports-page .btn-primary,
.imports-page #refresh-all-button {
    background: linear-gradient(180deg, #3e56a8 0%, #2a1b9a 100%);
    border-color: #5b73bc;
}

.imports-page .btn-primary:hover,
.imports-page .btn-primary:focus,
.imports-page #refresh-all-button:hover,
.imports-page #refresh-all-button:focus {
    background: linear-gradient(180deg, #5270c0 0%, #3f2ab3 100%);
    border-color: #7c94d4;
}

.imports-page .btn-outline-primary {
    border-color: #5e9ec1;
    color: #c3deef;
}

.imports-page .btn-outline-primary:hover,
.imports-page .btn-outline-primary:focus {
    background: rgba(94, 158, 193, 0.14);
    border-color: #8ab8d1;
    color: #f4f7fb;
}

.imports-page .btn-outline-danger {
    border-color: #b96f7d;
    color: #f0bcc5;
}

.imports-page .btn-outline-danger:hover,
.imports-page .btn-outline-danger:focus {
    background: rgba(185, 111, 125, 0.14);
    border-color: #d78a98;
    color: #ffe0e6;
}

.imports-page .panel-soft .fw-semibold,
.imports-page .panel-soft .small,
.imports-page .panel-soft .muted {
    color: var(--text);
}

.monthly-breakdown-table {
    background: linear-gradient(180deg, rgba(17, 22, 42, 0.98) 0%, rgba(13, 17, 33, 0.98) 100%);
    border: 1px solid rgba(38, 49, 95, 0.95);
    border-radius: 18px;
    overflow: hidden;
}

.monthly-breakdown-table .table thead th {
    background: rgba(20, 28, 57, 0.98);
    color: #a8c0d4;
    font-size: 0.74rem;
    padding: 0.65rem 0.85rem;
}

.monthly-breakdown-table .table td {
    background: transparent;
    border-color: rgba(38, 49, 95, 0.9);
    color: var(--text);
    padding: 0.7rem 0.85rem;
}

.monthly-breakdown-table .table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.year-divider-row td {
    background: rgba(24, 32, 68, 0.98) !important;
    color: #dbe8f4 !important;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.55rem 0.85rem !important;
}

.monthly-subamount {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.15;
    margin-top: 0.12rem;
}

.monthly-breakdown-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.12rem;
    margin-top: 0.22rem;
}

.monthly-breakdown-meta div {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
}

.monthly-breakdown-meta span {
    color: var(--muted);
    font-size: 0.68rem;
}

.monthly-breakdown-meta strong {
    color: #dfeaf5;
    font-size: 0.72rem;
    font-weight: 600;
}

.latest-import-month {
    display: inline-block;
    border-bottom: 1px dashed rgba(94, 158, 193, 0.75);
    color: #eef6ff;
    font-weight: 600;
    padding-bottom: 0.05rem;
}

.latest-import-marker {
    display: inline-block;
    margin-left: 0.45rem;
    color: #9cc7de;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}

.videos-table td:nth-child(1) {
    min-width: 250px;
}

.videos-table td:nth-child(2) {
    min-width: 150px;
}

.videos-table td:nth-child(3) {
    min-width: 120px;
}

.video-form-row td {
    background: rgba(28, 31, 39, 0.94);
    font-size: 0.78rem;
    padding: 0.28rem 0.38rem;
}

.video-form-row .form-control-sm {
    font-size: 0.74rem;
    min-height: 1.62rem;
    padding: 0.1rem 0.34rem;
}

.video-form-row .form-select-sm {
    font-size: 0.73rem;
    min-height: 1.62rem;
    padding: 0.1rem 1.75rem 0.1rem 0.34rem;
}

.videos-table thead th {
    font-size: 0.68rem;
    padding: 0.34rem 0.38rem;
}

.videos-table td {
    padding: 0.28rem 0.38rem;
}

.video-title-text {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.1;
}

.video-title-link {
    color: var(--text);
    display: inline-block;
    text-decoration: none;
}

.compact-number-input {
    max-width: 84px;
    margin-left: auto;
}

.compact-id-input {
    max-width: 104px;
}

.compact-money {
    font-size: 0.75rem;
    white-space: nowrap;
}

.compact-actions .btn {
    white-space: nowrap;
}

.compact-btn {
    font-size: 0.72rem;
    padding: 0.12rem 0.34rem;
}

.compact-switch .form-check-label {
    font-size: 0.68rem;
}

.compact-switch-label {
    display: none;
}

.finance-table td {
    font-size: 0.79rem;
    padding: 0.35rem 0.42rem;
}

.finance-table thead th {
    font-size: 0.7rem;
    padding: 0.4rem 0.42rem;
}

.finance-table .form-control-sm {
    font-size: 0.75rem;
    min-height: 1.8rem;
    padding: 0.14rem 0.4rem;
}

.finance-number-input {
    margin-left: auto;
    max-width: 110px;
}

.finance-cut-input {
    margin-left: auto;
    max-width: 76px;
}

@media (max-width: 991.98px) {
    .videos-table td:nth-child(2),
    .videos-table td:nth-child(3) {
        min-width: 220px;
    }
}

.table thead th {
    background: rgba(19, 26, 52, 0.98);
    border-bottom-width: 1px;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.panel .table,
.table-wrap .table,
.panel-soft .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: rgba(39, 53, 82, 0.95);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.015);
    --bs-table-striped-color: var(--text);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.028);
    --bs-table-hover-color: var(--text);
    color: var(--text);
    margin-bottom: 0;
}

.panel .table thead th,
.table-wrap .table thead th,
.panel-soft .table thead th {
    background: rgba(32, 36, 45, 0.98);
    color: var(--muted);
}

.panel .table td,
.panel .table th,
.table-wrap .table td,
.table-wrap .table th,
.panel-soft .table td,
.panel-soft .table th {
    background: transparent;
    color: inherit;
}

.panel .table tbody tr:hover td,
.table-wrap .table tbody tr:hover td,
.panel-soft .table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.028);
}

.panel .table .fw-semibold,
.panel .table .text-end,
.table-wrap .table .fw-semibold,
.table-wrap .table .text-end,
.panel-soft .table .fw-semibold,
.panel-soft .table .text-end {
    color: inherit;
}

.panel .table .small,
.panel .table .small.muted,
.panel .table .muted,
.table-wrap .table .small,
.table-wrap .table .small.muted,
.table-wrap .table .muted,
.panel-soft .table .small,
.panel-soft .table .small.muted,
.panel-soft .table .muted {
    color: var(--muted) !important;
}

.panel .table a:not(.btn),
.table-wrap .table a:not(.btn),
.panel-soft .table a:not(.btn) {
    color: #dde3ec;
}

.panel .table .btn-outline-secondary,
.table-wrap .table .btn-outline-secondary,
.panel-soft .table .btn-outline-secondary {
    border-color: #5c6472;
    color: #d9dfe8;
}

.table td,
.table th {
    border-color: rgba(39, 53, 82, 0.95);
    vertical-align: middle;
}

.pill {
    background: rgba(42, 27, 154, 0.18);
    border-radius: 999px;
    color: var(--muted);
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
}

.pill.success {
    background: rgba(94, 158, 193, 0.16);
    color: #b7d9ea;
}

.pill.warning {
    background: rgba(42, 27, 154, 0.24);
    color: #c8c0ff;
}

.pill.danger {
    background: rgba(240, 61, 163, 0.16);
    color: #ffbde0;
}

.mini-form {
    background: linear-gradient(180deg, rgba(29, 33, 42, 0.98) 0%, rgba(22, 25, 33, 0.98) 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1rem;
}

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

.auth-card {
    max-width: 480px;
    padding: 2rem;
    width: 100%;
}

.auth-brand {
    align-items: center;
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-brand-logo {
    display: block;
    height: 72px;
    max-width: min(100%, 280px);
    width: auto;
}

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

.sticky-tools {
    position: sticky;
    top: 1.5rem;
}

.navbar .nav-link.active {
    color: var(--primary);
    font-weight: 700;
}

.navbar {
    background: rgba(12, 16, 31, 0.94) !important;
}

.navbar .container-fluid {
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand,
.nav-link,
.navbar .btn {
    color: var(--text) !important;
}

.nav-brand-lockup {
    align-items: center;
    display: inline-flex;
    margin-right: 0.75rem;
    max-width: min(100%, 230px);
    text-decoration: none;
}

.nav-brand-logo {
    display: block;
    flex: 0 0 auto;
    height: 34px;
    max-width: 100%;
    width: auto;
}

.navbar-toggler {
    border-color: rgba(122, 131, 146, 0.55);
    box-shadow: none !important;
    padding: 0.3rem 0.45rem;
}

.navbar-toggler:focus {
    border-color: rgba(154, 163, 177, 0.78);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28238, 241, 246, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-collapse {
    min-width: 0;
}

.navbar-nav {
    gap: 0.15rem;
}

.navbar .nav-link {
    border-radius: 10px;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
}

.nav-load{
    padding-left: 0.7rem;
    padding-right: 0.7rem; 
    padding-top: 0.50rem;
    font-weight: 800;
    color: gray;
}

.navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
}

.nav-link:hover,
.navbar-brand:hover,
a:hover {
    color: #d2d8e3 !important;
}

@media (max-width: 991.98px) {
    .navbar .container-fluid {
        gap: 0.5rem;
    }

    .navbar-collapse {
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        width: 100%;
    }

    .navbar-collapse .d-flex {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 0.75rem !important;
        margin-top: 0.5rem;
    }

    .nav-brand-logo {
        height: 28px;
    }
}

.btn {
    border-radius: 12px;
}

.btn-primary {
    background: linear-gradient(180deg, #3e56a8 0%, #2a1b9a 100%);
    border-color: #5b73bc;
    color: #f7fbff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(180deg, #5270c0 0%, #3f2ab3 100%);
    border-color: #7c94d4;
    color: #fff;
}

.btn-outline-primary {
    border-color: #5e9ec1;
    color: #c3deef;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(94, 158, 193, 0.14);
    border-color: #8ab8d1;
    color: #f2f5fb;
}

.btn-outline-danger {
    border-color: #d06779;
    color: #ffb6c1;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: rgba(208, 103, 121, 0.14);
    border-color: #ef8798;
    color: #ffdce2;
}

.btn-outline-secondary {
    border-color: #5c6472;
    color: #cdd3dd;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: rgba(84, 98, 125, 0.16);
    color: #eef3ff;
}

.form-control,
.form-select {
    background-color: var(--panel-alt-2);
    border-color: var(--line);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    background-color: #171d38;
    border-color: #5e9ec1;
    box-shadow: 0 0 0 0.2rem rgba(94, 158, 193, 0.16);
    color: var(--text);
}

.form-control::placeholder {
    color: #72819b;
}

.form-check-input {
    background-color: #10172f;
    border-color: #476394;
}

.form-check-input:checked {
    background-color: #5e9ec1;
    border-color: #5e9ec1;
}

.form-check-label,
.form-label,
label {
    color: var(--text);
}

code {
    color: #f3a1c4;
}

a {
    color: #d4dae5;
}

.progress {
    background-color: #121a35;
}

.progress-bar {
    background: linear-gradient(90deg, #5e9ec1 0%, #f03da3 100%);
    color: #fff;
}

.alert {
    border-width: 1px;
}

.alert-success {
    background: rgba(24, 63, 46, 0.9);
    border-color: rgba(55, 124, 92, 0.9);
    color: #c8f5df;
}

.alert-danger {
    background: rgba(72, 28, 39, 0.92);
    border-color: rgba(155, 76, 92, 0.92);
    color: #ffd5dd;
}

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

.compact-money,
.videos-table td.text-end,
.table td .fw-semibold,
.summary-card .value {
    color: var(--text) !important;
}

.text-white-50 {
    color: rgba(233, 241, 255, 0.72) !important;
}

.app-footer {
    border-top: 1px solid rgba(94, 158, 193, 0.14);
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 2.5rem;
    padding: 1.1rem 0 0.25rem;
    text-align: center;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    25%, 100% { transform: translateX(100%); }
}

@media (max-width: 991.98px) {
    .sticky-tools {
        position: static;
    }
}
