body {
    background: #f4f7fb;
    font-family: Arial, sans-serif;
    color: #1f2937;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0d1f3b 0%, #122d52 100%);
    color: #fff;
    padding: 24px 18px;
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 20px;
}

.sidebar-logo {
    width: 68px;
    height: 68px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
}

.mobile-sidebar-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
}

.brand-name {
    font-size: 1rem;
    font-weight: 700;
}

.login-logo {
    display: block;
    width: 160px;
    height: 160px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 50%;
    margin-right: auto;
    margin-left: auto;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.82);
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-weight: 600;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.mobile-link {
    color: #1f2937 !important;
    padding: 12px 16px;
    border-bottom: 1px solid #edf2f7;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-content {
    padding: 24px 28px 48px;
}

.card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.metric-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-left: 4px solid #0d6efd;
}

.metric-card:nth-child(2n) {
    border-left-color: #dc3545;
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(13,110,253,0.12);
    color: #0d6efd;
}

.metric-card:nth-child(2n) .metric-icon {
    background: rgba(220,53,69,0.12);
    color: #dc3545;
}

.metric-label {
    color: #6b7280;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-value {
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 700;
    margin-top: 10px;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid #edf2f7;
}

.table td, .table th {
    vertical-align: middle;
}

.record-table-wrap {
    overflow-x: visible;
}

.record-table {
    width: 100%;
    table-layout: fixed;
    font-size: 0.84rem;
}

.partner-accounts-table {
    min-width: 1500px;
}

.booking-list-table {
    width: 100%;
    min-width: 0;
}

.record-table th,
.record-table td {
    overflow-wrap: anywhere;
}

.record-table .record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.record-table .record-actions form {
    margin: 0;
}

.record-table .record-actions .btn {
    white-space: normal;
}

.invoice-pdf-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
}

.invoice-pdf-form .form-check-label {
    white-space: normal !important;
    text-align: left;
}

.invoice-pdf-form .btn {
    align-self: flex-start;
}

.record-table-cards {
    display: block;
}

.record-table-cards thead {
    display: none;
}

.record-table-cards tbody {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 0.85rem;
}

.record-table-cards tbody tr {
    display: block;
    min-width: 0;
    padding: 0.4rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
}

.record-table-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.55rem 0.2rem;
    border: 0;
    border-bottom: 1px solid #edf2f7;
    text-align: right;
}

.record-table-cards tbody td:last-child {
    border-bottom: 0;
}

.record-table-cards tbody td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
}

.record-table-cards tbody td[colspan] {
    display: block;
    text-align: center;
}

.record-table-cards tbody td[colspan]::before {
    content: none;
}

.record-table-cards .record-actions {
    justify-content: flex-end;
}

@media (max-width: 1399.98px) {
    .record-table-responsive thead {
        display: none;
    }

    .record-table-responsive,
    .record-table-responsive tbody {
        display: block;
        width: 100%;
    }

    .record-table-responsive tbody {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
        gap: 0.85rem;
    }

    .record-table-responsive tbody tr {
        display: block;
        min-width: 0;
        padding: 0.4rem 0.75rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        background: #fff;
    }

    .record-table-responsive tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.55rem 0.2rem;
        border: 0;
        border-bottom: 1px solid #edf2f7;
        text-align: right;
    }

    .record-table-responsive tbody td:last-child {
        border-bottom: 0;
    }

    .record-table-responsive tbody td::before {
        content: attr(data-label);
        flex: 0 0 38%;
        color: #64748b;
        font-size: 0.74rem;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
    }

    .record-table-responsive tbody td[colspan] {
        display: block;
        text-align: center;
    }

    .record-table-responsive tbody td[colspan]::before {
        content: none;
    }

    .record-table-responsive .record-actions {
        justify-content: flex-end;
    }
}

.form-card {
    padding: 24px;
}

.booking-layout {
    align-items: flex-start;
}

.booking-form-card {
    position: sticky;
    top: 24px;
}

.booking-form-shell {
    max-width: 100%;
    margin: 0;
}

.booking-form-scroll {
    max-height: 76vh;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.booking-form-scroll::-webkit-scrollbar {
    width: 7px;
}

.booking-form-scroll::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 999px;
}

.section-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 18px;
}

.summary-box {
    border-radius: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #eef5ff, #f5f7ff);
    border: 1px solid #dfe8ff;
}

.account-earnings-box {
    min-height: 148px;
}

.account-metric-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    color: #1b2d43;
}

.account-metric-title::before {
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: #4f80e2;
    content: "";
}

.account-metric-row .summary-box {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    border: 1px solid #e6edf5;
    border-left: 4px solid var(--account-card-accent, #4f80e2);
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 0 6px 18px rgba(24, 49, 79, 0.055);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.account-metric-row .summary-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(24, 49, 79, 0.1);
}

.account-metric-row .summary-box > .text-muted.small:first-child {
    color: #66778c !important;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1.4;
    text-transform: uppercase;
}

.account-metric-row .summary-box > .fw-bold {
    margin-top: 10px !important;
    color: #172b45;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.account-metric-row .summary-box > .small.text-muted {
    margin-top: 7px !important;
    color: #8794a5 !important;
    font-size: 0.78rem;
    line-height: 1.4;
}

.account-metric-row .summary-box.company-income-box {
    --account-card-accent: #3385dc;
    background: linear-gradient(145deg, #f1f8ff, #ffffff);
}

.account-metric-row .summary-box.partner-income-box {
    --account-card-accent: #2da47b;
    background: linear-gradient(145deg, #effaf5, #ffffff);
}

.account-metric-row .summary-box.company-owned-income-box {
    --account-card-accent: #e6a23c;
    background: linear-gradient(145deg, #fff8ec, #ffffff);
}

.account-expense-box {
    --account-card-accent: #e58b48;
    background: linear-gradient(145deg, #fff7f0, #ffffff) !important;
}

.account-summary-card {
    border: 1px solid #e8edf4;
    box-shadow: 0 12px 30px rgba(24, 49, 79, 0.07);
}

.account-summary-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #1b2d43;
}

.account-summary-title small {
    font-size: 0.78rem;
}

.account-panel {
    border-radius: 18px;
    padding: 22px;
    border: 1px solid #e1e9f2;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 8px 20px rgba(24, 49, 79, 0.055);
}

.company-account-panel {
    background: linear-gradient(145deg, #f2f8ff, #ffffff);
}

.partner-account-panel {
    background: linear-gradient(145deg, #f7f4ff, #ffffff);
}

.account-panel-header {
    font-size: 1rem;
    font-weight: 700;
    color: #14213d;
}

.account-panel-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    flex: 1;
}

.account-mini-box {
    --account-mini-accent: #4f80e2;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    min-width: 0;
    min-height: 108px;
    padding: 16px 12px;
    border-radius: 15px;
    border: 1px solid #e6edf5;
    border-left: 3px solid var(--account-mini-accent);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(24, 49, 79, 0.04);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.account-mini-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(24, 49, 79, 0.09);
}

.account-mini-box span {
    display: block;
    color: #68798e;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.account-mini-box strong {
    display: block;
    margin-top: 8px;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    color: #172b45;
    overflow-wrap: anywhere;
}

.income-box {
    --account-mini-accent: #2da47b;
    background: linear-gradient(145deg, #effaf5, #ffffff);
}

.expense-box {
    --account-mini-accent: #e58b48;
    background: linear-gradient(145deg, #fff7f0, #ffffff);
}

.net-box {
    --account-mini-accent: #4f80e2;
}

.net-box.positive {
    --account-mini-accent: #2da47b;
    background: linear-gradient(145deg, #effaf5, #ffffff);
}

.net-box.negative {
    --account-mini-accent: #dd5e68;
    background: linear-gradient(145deg, #fff1f2, #ffffff);
}

.net-box.positive strong {
    color: #166534;
}

.net-box.negative strong {
    color: #b91c1c;
}

.account-summary-panel {
    background: #ffffff;
    border: 1px solid #e5edf7;
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
    padding: 20px;
    margin-bottom: 1.5rem;
}

.account-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.account-section-header h5 {
    margin: 0;
    font-weight: 700;
}

.account-box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
}

.account-stat-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 155px;
    padding: 18px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.account-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.account-stat-box .label {
    color: #64748b;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
}

.account-stat-box .value {
    font-size: clamp(1.3rem, 2vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    word-break: break-word;
}

.account-stat-box .subtext {
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.5;
}

.account-stat-box.company {
    background: linear-gradient(135deg, #eef7ff, #f8fbff);
    border-color: #cfe5ff;
}

.account-stat-box.partner {
    background: linear-gradient(135deg, #f3f0ff, #fafaff);
    border-color: #ddd3ff;
}

.account-stat-box.expense {
    background: linear-gradient(135deg, #fff8ed, #fffdf9);
    border-color: #f6d4a8;
}

.account-stat-box.net {
    background: linear-gradient(135deg, #f0fdf4, #f9fffb);
    border-color: #c8f0d5;
}

.account-stat-box.warning {
    background: linear-gradient(135deg, #fff1f2, #fffaf8);
    border-color: #ffd1d7;
}

.account-stat-box.company .value {
    color: #0b5ed7;
}

.account-stat-box.partner .value {
    color: #5b3ecf;
}

.account-stat-box.expense .value {
    color: #b76a00;
}

.account-stat-box.net .value {
    color: #166534;
}

.account-stat-box.warning .value {
    color: #b91c1c;
}

.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.7em;
}

@media (max-width: 991.98px) {
    .sidebar {
        display: none !important;
    }

    .page-content {
        padding: 20px 18px 40px;
    }
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    min-height: 190px;
    padding: 30px 34px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(115deg, #10284a 0%, #174b78 58%, #1b8190 100%);
    box-shadow: 0 16px 34px rgba(16, 40, 74, 0.18);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 290px;
    height: 290px;
    right: 15%;
    top: -180px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.035), 0 0 0 70px rgba(255, 255, 255, 0.025);
    pointer-events: none;
}

.dashboard-hero > * {
    position: relative;
    z-index: 1;
}

.dashboard-eyebrow {
    margin-bottom: 8px;
    color: #b9e7eb;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.dashboard-hero h2 {
    font-weight: 750;
    letter-spacing: -0.035em;
}

.dashboard-subtitle,
.dashboard-date {
    color: rgba(255, 255, 255, 0.78);
}

.dashboard-date {
    font-size: 0.9rem;
}

.dashboard-booking-btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    color: #153c62;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.dashboard-booking-btn:hover {
    color: #10284a;
    background: #eaf8fa;
    transform: translateY(-1px);
}

.dashboard-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 17px;
    border: 1px solid #d8e9f5;
    border-radius: 14px;
    color: #476078;
    background: linear-gradient(100deg, #f1f8ff, #f4fbfc);
    font-size: 0.88rem;
    line-height: 1.6;
}

.dashboard-note strong {
    color: #183d60;
}

.dashboard-note-icon {
    color: #2473ad;
    font-size: 1.1rem;
}

.dashboard-metrics {
    --dashboard-blue: #3d73db;
    --dashboard-green: #25a477;
    --dashboard-orange: #e99537;
    --dashboard-red: #dd5e68;
    --dashboard-purple: #8863ca;
    --dashboard-teal: #219da2;
}

.dashboard-metric-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #edf1f6;
    border-left: 0;
    border-top: 3px solid var(--metric-tone, var(--dashboard-blue));
    border-radius: 16px;
    background: linear-gradient(145deg, #fff 0%, var(--metric-wash, #f8fafc) 100%);
    box-shadow: 0 5px 18px rgba(24, 49, 79, 0.055);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.dashboard-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(24, 49, 79, 0.11);
}

.dashboard-metric-card .card-body {
    min-height: 116px;
    padding: 19px 18px;
}

.dashboard-metric-card .metric-label {
    max-width: 175px;
    color: #64748b;
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.4;
}

.dashboard-metric-card .metric-value {
    margin-top: 8px;
    color: #172b43;
    font-size: clamp(1.25rem, 1.65vw, 1.75rem);
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.dashboard-metric-card .metric-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: var(--metric-tone, var(--dashboard-blue));
    background: var(--metric-wash, #eef4ff);
    font-size: 1.25rem;
}

.dashboard-metric-card.tone-blue { --metric-tone: #3d73db; --metric-wash: #eef4ff; }
.dashboard-metric-card.tone-green { --metric-tone: #25a477; --metric-wash: #eaf8f2; }
.dashboard-metric-card.tone-orange { --metric-tone: #e99537; --metric-wash: #fff5e8; }
.dashboard-metric-card.tone-red { --metric-tone: #dd5e68; --metric-wash: #fff0f1; }
.dashboard-metric-card.tone-purple { --metric-tone: #8863ca; --metric-wash: #f4efff; }
.dashboard-metric-card.tone-teal { --metric-tone: #219da2; --metric-wash: #e9f8f8; }

.dashboard-panel {
    border: 1px solid #edf1f6;
    border-radius: 18px;
    box-shadow: 0 7px 24px rgba(24, 49, 79, 0.06);
}

.dashboard-panel > .card-body {
    padding: 22px;
}

.dashboard-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: #1b2d43;
}

.dashboard-section-title > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-section-title small {
    color: #8794a5;
    font-size: 0.76rem;
    font-weight: 400;
}

.section-title-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

.section-title-icon.tone-blue { color: #3d73db; background: #eef4ff; }
.section-title-icon.tone-purple { color: #8863ca; background: #f4efff; }
.section-title-icon.tone-teal { color: #219da2; background: #e9f8f8; }

.dashboard-summary-box {
    position: relative;
    min-height: 118px;
    overflow: hidden;
    padding: 17px 16px;
    border: 1px solid #eaf0f5;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff, #f8fafc);
    transition: border-color 160ms ease, transform 160ms ease;
}

.dashboard-summary-box:hover {
    transform: translateY(-2px);
    border-color: #d4e2ef;
}

.dashboard-summary-box .text-muted {
    max-width: calc(100% - 38px);
    font-weight: 600;
    line-height: 1.4;
}

.dashboard-summary-box .fw-bold {
    color: #1b2d43;
    font-size: 1.12rem;
}

.summary-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: #3d73db;
    background: #eef4ff;
}

.dashboard-summaries .col-md-6:nth-child(4n + 2) .summary-icon { color: #25a477; background: #eaf8f2; }
.dashboard-summaries .col-md-6:nth-child(4n + 3) .summary-icon { color: #e99537; background: #fff5e8; }
.dashboard-summaries .col-md-6:nth-child(4n) .summary-icon { color: #8863ca; background: #f4efff; }

.dashboard-table {
    margin-bottom: 0;
}

.dashboard-table thead th {
    padding: 13px 12px;
    border: 0;
    color: #62748a;
    background: #f3f7fb;
}

.dashboard-table thead th:first-child { border-radius: 10px 0 0 10px; }
.dashboard-table thead th:last-child { border-radius: 0 10px 10px 0; }
.dashboard-table tbody td { padding: 14px 12px; }
.dashboard-table tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 575.98px) {
    .dashboard-hero {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 20px;
        padding: 24px 22px;
    }

    .dashboard-hero h2 {
        font-size: 1.55rem;
    }

    .dashboard-panel > .card-body {
        padding: 17px;
    }

    .account-panel {
        padding: 16px;
    }

    .account-panel-metrics {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .account-mini-box {
        min-height: 72px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px;
    }

    .account-mini-box strong {
        margin-top: 0;
        text-align: right;
    }
}
