html,
body {
    background: #f3f7fb;
    color: #17233d;
}

.topbar {
    border-bottom: 1px solid #dce7f2;
    box-shadow: 0 1px 0 rgba(20, 63, 143, 0.05);
    height: 72px;
    overflow: hidden;
}

.topbar .mud-toolbar {
    min-height: 72px;
    height: 72px;
    align-items: center;
    overflow: hidden;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 10px;
}

.brand-logo {
    width: 148px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.brand-product {
    display: grid;
    gap: 1px;
    padding-left: 14px;
    border-left: 1px solid #d8e4f2;
}

.brand-product span {
    color: #143f8f;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.brand-product small {
    color: #5a6680;
    font-size: 12px;
    font-weight: 600;
}

.company-switcher {
    width: min(360px, 28vw);
    margin-right: 14px;
}

.user-avatar {
    background: linear-gradient(135deg, #143f8f, #00a37a) !important;
    color: #fff !important;
    font-weight: 700;
}

.side-nav {
    border-right: 1px solid #dce7f2;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.side-nav .mud-nav-link {
    border-radius: 6px;
    margin: 2px 10px;
    color: #35445f;
}

.side-nav .mud-nav-link.active,
.side-nav .mud-nav-link:hover {
    background: #edf6ff;
    color: #143f8f;
}

.side-nav .mud-nav-link.active .mud-icon-root,
.side-nav .mud-nav-link:hover .mud-icon-root {
    color: #00a37a;
}

.drawer-footer {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    color: #60708a;
    display: grid;
    gap: 5px;
}

.drawer-footer img {
    width: 126px;
    height: auto;
    object-fit: contain;
    margin-bottom: 4px;
}

.main-content {
    padding: 88px 28px 28px;
}

.page-heading {
    margin-bottom: 20px;
}

.page-heading .mud-typography-caption {
    color: #00a37a;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.page-heading .mud-typography-h4 {
    color: #143f8f;
    font-weight: 750;
}

.panel {
    border: 1px solid #dce7f2;
    border-radius: 6px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(20, 63, 143, 0.06);
}

.dashboard-metric {
    display: grid;
    gap: 6px;
    min-height: 132px;
    align-content: center;
}

.dashboard-metric span {
    color: #5a6680;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-metric strong {
    color: #143f8f;
    font-size: 32px;
    line-height: 1;
}

.dashboard-metric small {
    color: #60708a;
}

.dashboard-actions {
    display: grid;
    gap: 12px;
    align-content: start;
}

.category-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.category-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dce7f2;
    border-radius: 6px;
    background: #f7fbff;
}

.category-list span {
    color: #5a6680;
}

.category-list strong {
    color: #143f8f;
}

.export-preview textarea {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
}

.mobile-capture-heading .mud-typography-body2 {
    margin-top: 6px;
}

.mobile-capture-shell {
    padding-bottom: 16px;
}

.mobile-capture-panel,
.mobile-mileage-panel {
    display: grid;
    gap: 14px;
}

.capture-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.receipt-scan-button {
    position: relative;
    width: 100%;
    min-height: 148px;
    border: 1px dashed #8cb3d9;
    border-radius: 6px;
    background: #f7fbff;
    color: #143f8f;
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
}

.receipt-scan-button:hover {
    background: #edf6ff;
}

.receipt-scan-icon {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #143f8f;
    color: #fff;
}

.receipt-scan-button strong {
    font-size: 18px;
}

.receipt-scan-button small {
    color: #5a6680;
    font-size: 13px;
}

.receipt-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.receipt-preview-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 42px;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid #dce7f2;
    border-radius: 6px;
    background: #fff;
}

.receipt-preview-card img {
    width: 92px;
    height: 92px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #dce7f2;
    background: #f7fbff;
}

.receipt-preview-card div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.receipt-preview-card span {
    color: #5a6680;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.receipt-preview-card strong {
    color: #143f8f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receipt-preview-card small {
    color: #60708a;
}

.receipt-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.receipt-summary div {
    display: grid;
    gap: 4px;
    min-height: 76px;
    padding: 12px;
    border: 1px solid #dce7f2;
    border-radius: 6px;
    background: #fff;
}

.receipt-summary span {
    color: #5a6680;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.receipt-summary strong {
    color: #143f8f;
    font-size: 18px;
}

.vat-breakdown {
    display: grid;
    gap: 10px;
    margin: 8px 0;
}

.vat-breakdown > div {
    display: grid;
    grid-template-columns: minmax(84px, 0.7fr) minmax(110px, 1fr) minmax(110px, 1fr) 42px;
    gap: 8px;
    align-items: center;
}

.mobile-submit-bar {
    display: none;
}

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

.approval-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.approval-title-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 210px;
}

.approval-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.approval-receipts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.approval-receipt-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #dce7f2;
    border-radius: 6px;
    background: #f7fbff;
}

.approval-receipt-card img {
    width: 78px;
    height: 96px;
    object-fit: cover;
    border: 1px solid #dce7f2;
    border-radius: 6px;
    background: #fff;
}

.approval-receipt-card div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.approval-receipt-card strong,
.approval-receipt-card span,
.approval-receipt-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.approval-receipt-card strong {
    color: #143f8f;
}

.approval-receipt-card span,
.approval-receipt-card small {
    color: #60708a;
}

@media (max-width: 960px) {
    .main-content {
        padding: 84px 18px 92px;
    }

    .company-switcher {
        width: min(260px, 42vw);
        margin-right: 8px;
    }

    .brand-logo {
        width: 118px;
        height: 40px;
    }

    .brand-product {
        display: none;
    }

    .mobile-capture-heading {
        margin-bottom: 14px;
    }

    .mobile-capture-heading .mud-typography-h4 {
        font-size: 24px;
        line-height: 1.15;
    }

    .mobile-capture-panel,
    .mobile-mileage-panel {
        padding: 16px;
    }

    .receipt-scan-button {
        min-height: 132px;
        touch-action: manipulation;
    }

    .mobile-form-grid .mud-input-control {
        margin-top: 0;
    }

    .mobile-submit-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1200;
        display: block;
        padding: 12px 16px 16px;
        border-top: 1px solid #dce7f2;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -10px 28px rgba(20, 63, 143, 0.10);
    }

    .desktop-submit-button {
        display: none;
    }

    .approval-title,
    .approval-title-actions,
    .approval-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .approval-title-actions {
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .topbar {
        height: 64px;
    }

    .topbar .mud-toolbar {
        min-height: 64px;
        height: 64px;
    }

    .main-content {
        padding: 76px 12px 92px;
    }

    .company-switcher {
        display: none;
    }

    .brand-logo {
        width: 104px;
        height: 36px;
    }

    .panel {
        border-radius: 6px;
    }

    .receipt-summary {
        grid-template-columns: 1fr;
    }

    .receipt-preview-card {
        grid-template-columns: 74px minmax(0, 1fr) 38px;
    }

    .receipt-preview-card img {
        width: 74px;
        height: 74px;
    }

    .vat-breakdown > div {
        grid-template-columns: 1fr;
    }

    .dashboard-metric strong {
        font-size: 26px;
    }
}
