/* Global Styles */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #0d6efd;
    --dark-color: #2d3748;
    --light-color: #f7fafc;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-color);
    color: #333;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    display: grid;
    gap: 12px;
    justify-items: center;
    margin-bottom: 24px;
    text-align: center;
}

.sidebar-brand-logo {
    width: 128px;
    max-width: 100%;
    height: 74px;
    object-fit: contain;
    padding: 10px;
    border-radius: 8px;
    background: #ffffff;
}

.sidebar-brand-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead {
    background-color: var(--light-color);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 6px;
}

.alert-danger {
    background-color: rgba(245, 101, 101, 0.1);
    color: var(--danger-color);
}

.alert-success {
    background-color: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.billing-notification {
    position: fixed;
    top: calc(24px + var(--billing-notification-index, 0) * 92px);
    right: 24px;
    z-index: 2600;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 32px;
    gap: 12px;
    align-items: start;
    width: min(440px, calc(100vw - 32px));
    min-height: 76px;
    padding: 14px 14px 18px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 5px solid #2563eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
    animation: billingNotificationIn 0.24s ease-out both;
}

.billing-notification-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: #2563eb;
    font-size: 20px;
}

.billing-notification-content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.billing-notification-content strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.billing-notification-content span {
    color: #334155;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.billing-notification-close {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #64748b;
    background: transparent;
}

.billing-notification-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.billing-notification-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: currentColor;
    opacity: 0.55;
    transform-origin: left;
    animation: billingNotificationProgress 6s linear forwards;
}

.billing-notification-success {
    border-left-color: #16a34a;
    color: #16a34a;
    background: linear-gradient(90deg, #f0fdf4 0, #ffffff 42%);
}

.billing-notification-success .billing-notification-icon {
    background: #16a34a;
}

.billing-notification-danger {
    border-left-color: #dc2626;
    color: #dc2626;
    background: linear-gradient(90deg, #fef2f2 0, #ffffff 42%);
}

.billing-notification-danger .billing-notification-icon {
    background: #dc2626;
}

.billing-notification-danger .billing-notification-progress {
    animation-duration: 8s;
}

.billing-notification-warning {
    border-left-color: #d97706;
    color: #d97706;
    background: linear-gradient(90deg, #fffbeb 0, #ffffff 42%);
}

.billing-notification-warning .billing-notification-icon {
    background: #d97706;
}

.billing-notification-info,
.billing-notification-secondary {
    border-left-color: #2563eb;
    color: #2563eb;
    background: linear-gradient(90deg, #eff6ff 0, #ffffff 42%);
}

.billing-notification-info .billing-notification-icon,
.billing-notification-secondary .billing-notification-icon {
    background: #2563eb;
}

@keyframes billingNotificationIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes billingNotificationProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.admin-notification {
    position: fixed;
    right: 24px;
    bottom: calc(24px + var(--admin-notification-index, 0) * 88px);
    z-index: 2600;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 30px;
    gap: 12px;
    align-items: start;
    width: min(420px, calc(100vw - 32px));
    min-height: 72px;
    padding: 14px 14px 18px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-left: 5px solid #2563eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
    animation: adminNotificationIn 0.22s ease-out both;
}

.admin-notification-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: #2563eb;
    font-size: 18px;
}

.admin-notification-content {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.admin-notification-content strong {
    color: #111827;
    font-size: 14px;
    font-weight: 800;
}

.admin-notification-content span {
    color: #334155;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.admin-notification-close {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #64748b;
    background: transparent;
}

.admin-notification-close:hover {
    color: #111827;
    background: #f1f5f9;
}

.admin-notification-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: currentColor;
    opacity: 0.55;
    transform-origin: left;
    animation: adminNotificationProgress 5s linear forwards;
}

.admin-notification-success {
    border-left-color: #168751;
    color: #168751;
    background: linear-gradient(90deg, #ecfdf5 0, #ffffff 46%);
}

.admin-notification-success .admin-notification-icon {
    background: #168751;
}

.admin-notification-danger {
    border-left-color: #dc2626;
    color: #dc2626;
    background: linear-gradient(90deg, #fef2f2 0, #ffffff 46%);
}

.admin-notification-danger .admin-notification-icon {
    background: #dc2626;
}

.admin-notification-danger .admin-notification-progress {
    animation-duration: 8s;
}

.admin-notification-warning {
    border-left-color: #d97706;
    color: #d97706;
    background: linear-gradient(90deg, #fffbeb 0, #ffffff 46%);
}

.admin-notification-warning .admin-notification-icon {
    background: #d97706;
}

.admin-notification-info,
.admin-notification-secondary {
    border-left-color: #2563eb;
    color: #2563eb;
    background: linear-gradient(90deg, #eff6ff 0, #ffffff 46%);
}

.admin-notification-info .admin-notification-icon,
.admin-notification-secondary .admin-notification-icon {
    background: #2563eb;
}

.admin-backup-panel {
    height: 100%;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.admin-backup-panel h6 {
    margin: 0 0 6px;
    color: #0f172a;
    font-weight: 800;
}

@keyframes adminNotificationIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes adminNotificationProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Status Badges */
.status-open {
    background-color: var(--info-color);
    color: white;
}

.status-closed {
    background-color: #cbd5e0;
    color: #333;
}

.status-awarded {
    background-color: var(--success-color);
    color: white;
}

.status-archived {
    background-color: #4a5568;
    color: white;
}

.status-draft {
    background-color: var(--warning-color);
    color: white;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Charts */
canvas {
    max-height: 300px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100% !important;
        min-height: auto;
    }

    .d-flex {
        flex-direction: column;
    }

    .flex-grow-1 {
        margin-top: 10px;
    }
}

/* Utility Classes */
.text-muted {
    color: #718096;
}

.border-top {
    border-top: 1px solid var(--border-color);
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rounded-lg {
    border-radius: 8px;
}

.notification-menu {
    width: 360px;
    max-width: calc(100vw - 2rem);
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    white-space: normal;
    border-bottom: 1px solid var(--border-color);
}

.notification-item.unread {
    background-color: rgba(13, 110, 253, 0.08);
}

.response-review-toolbar .form-select,
.response-review-toolbar .form-control {
    min-width: 160px;
}

.bid-chat__messages {
    max-height: 280px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafc;
}

.bid-chat__message {
    display: flex;
    margin-bottom: 10px;
}

.bid-chat__message.mine {
    justify-content: flex-end;
}

.bid-chat__bubble {
    max-width: min(76%, 540px);
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.bid-chat__message.mine .bid-chat__bubble {
    color: #ffffff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.bid-chat__message.mine .text-muted {
    color: rgba(255, 255, 255, 0.78) !important;
}

.bid-chat__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.bid-chat__form .btn {
    min-width: 96px;
}

.brand-preview-logo,
.brand-preview-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 8px;
}

.brand-preview-logo {
    display: none;
    object-fit: contain;
    border: 1px solid var(--border-color);
    padding: 8px;
    background: #fff;
}

.brand-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #a0aec0;
    color: #4a5568;
    background: #f7fafc;
    font-weight: 700;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border {
    color: var(--primary-color);
}

/* Bid Card */
.bid-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bid-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.bid-card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
}

.bid-card-body {
    padding: 1.5rem;
}

.bid-card-footer {
    background-color: var(--light-color);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

/* Splash Screen */
body.splash-active {
    overflow: hidden;
}

.app-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #ffffff;
    background:
        linear-gradient(rgba(19, 28, 43, 0.82), rgba(19, 28, 43, 0.9)),
        url("../assets/login-logistics-bg-ofii.png") center / cover no-repeat,
        #1f2937;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.app-splash.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-splash__card {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
    animation: splashEnter 0.65s ease both;
}

.app-splash__logo {
    width: 116px;
    height: 116px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.app-splash__logo img {
    width: 92px;
    height: 92px;
    object-fit: contain;
}

.app-splash__title {
    margin: 0;
    font-size: clamp(1.45rem, 4vw, 2.2rem);
    line-height: 1.1;
    font-weight: 800;
}

.app-splash__subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1rem;
}

.app-splash__loader {
    width: min(230px, 64vw);
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
}

.app-splash__loader::after {
    content: "";
    display: block;
    width: 45%;
    height: 100%;
    border-radius: inherit;
    background: var(--primary-color);
    animation: splashLoad 1.05s ease-in-out infinite;
}

@keyframes splashEnter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes splashLoad {
    0% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(245%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-splash,
    .app-splash *,
    .app-splash *::before,
    .app-splash *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* OFII Supplier Invoice Payment Request */
.billing-page {
    padding: 24px;
}

.billing-toolbar {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.billing-tabs,
.billing-subtabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.billing-tab,
.billing-subtab {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #4a5568;
    background: transparent;
    font-weight: 600;
    white-space: nowrap;
}

.billing-tab.active,
.billing-subtab.active {
    border-bottom-color: #ffc107;
    color: #202938;
}

#newTab {
    min-height: 42px;
    margin: 0 6px 6px 0;
    padding: 0 18px;
    border: 1px solid #0d6efd;
    border-radius: 8px;
    color: #0b5ed7;
    background: #eef5ff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.14);
}

#newTab i {
    color: #0d6efd;
    font-size: 15px;
}

#newTab:hover,
#newTab:focus-visible {
    color: #ffffff;
    border-color: #0b5ed7;
    background: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.24);
}

#newTab:hover i,
#newTab:focus-visible i {
    color: #ffffff;
}

#newTab.active {
    color: #ffffff;
    border-color: #0b5ed7;
    border-bottom-color: #0b5ed7;
    background: #0d6efd;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.28);
}

#newTab.active i {
    color: #ffffff;
}

.billing-section {
    display: grid;
    gap: 20px;
}

.billing-section-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.billing-section-header h1 {
    margin: 0 0 4px;
    font-size: 28px;
    font-weight: 700;
}

.billing-section-header p {
    margin: 0;
    color: #667085;
}

.billing-form,
.billing-report-form,
.billing-filters,
.billing-rates-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 22px 42px;
    align-items: end;
}

.billing-view-filters {
    grid-template-columns: minmax(160px, 0.75fr) minmax(160px, 0.75fr) minmax(260px, 1.4fr) auto;
    gap: 12px 16px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.billing-rates-form {
    grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr) auto;
    gap: 12px 16px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.billing-request-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    gap: 16px;
    align-items: start;
}

.billing-request-main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.billing-request-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.billing-request-card h2 {
    margin: 0;
    color: #1d4ed8;
    font-size: 16px;
    font-weight: 700;
}

.billing-request-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px 28px;
    align-items: end;
}

.billing-notes-field {
    grid-column: 1 / -1;
}

.billing-line-items {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.billing-line-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.billing-line-toolbar span {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.billing-line-table {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.billing-line-header,
.billing-line-row {
    display: grid;
    grid-template-columns:
        minmax(86px, 0.8fr)
        minmax(96px, 0.9fr)
        minmax(104px, 0.95fr)
        minmax(102px, 0.95fr)
        minmax(136px, 1.2fr)
        minmax(76px, 0.68fr)
        minmax(90px, 0.8fr)
        minmax(96px, 0.82fr)
        38px;
    min-width: 862px;
}

.billing-line-header {
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.billing-line-header span {
    padding: 8px;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
    border-right: 1px solid var(--border-color);
}

.billing-line-header span:last-child {
    border-right: 0;
    text-align: center;
}

.billing-line-body {
    display: grid;
}

.billing-line-row {
    align-items: end;
    border-bottom: 1px solid var(--border-color);
}

.billing-line-row:last-child {
    border-bottom: 0;
}

.billing-line-total-row {
    display: grid;
    grid-template-columns:
        minmax(86px, 0.8fr)
        minmax(96px, 0.9fr)
        minmax(104px, 0.95fr)
        minmax(102px, 0.95fr)
        minmax(136px, 1.2fr)
        minmax(76px, 0.68fr)
        minmax(90px, 0.8fr)
        minmax(96px, 0.82fr)
        38px;
    min-width: 862px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
}

.billing-line-total-row span,
.billing-line-total-row strong {
    padding: 10px;
    border-right: 1px solid var(--border-color);
    color: #1f2937;
    font-size: 13px;
}

.billing-line-total-row span:first-child {
    grid-column: 7 / 8;
    font-weight: 700;
    text-align: right;
}

.billing-line-total-row strong {
    grid-column: 8 / 9;
    font-weight: 800;
}

.billing-line-total-row span:last-child {
    grid-column: 9 / 10;
    border-right: 0;
}

.billing-line-row .billing-field,
.billing-line-action {
    min-width: 0;
    padding: 8px;
    border-right: 1px solid var(--border-color);
}

.billing-line-row .billing-field .form-control,
.billing-line-row .billing-field .form-select {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 12px;
}

.billing-line-row .billing-field label {
    display: none;
}

.billing-line-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    border-right: 0;
}

.billing-line-action .btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.billing-line-review-table {
    display: grid;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.billing-line-review-header,
.billing-line-review-row {
    display: grid;
    grid-template-columns: minmax(130px, 0.9fr) minmax(130px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr) minmax(180px, 1.35fr) minmax(90px, 0.65fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr);
    min-width: 1120px;
}

.billing-line-review-table-dimensions .billing-line-review-header,
.billing-line-review-table-dimensions .billing-line-review-row {
    grid-template-columns: minmax(130px, 0.9fr) minmax(130px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr) minmax(170px, 1.1fr) repeat(8, minmax(115px, 0.75fr)) minmax(90px, 0.6fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr);
    min-width: 2130px;
}

.billing-line-review-header {
    background: #f8fafc;
}

.billing-line-review-header span,
.billing-line-review-row span {
    padding: 9px 10px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.billing-line-review-header span {
    color: #475467;
    font-weight: 700;
}

.billing-line-review-header span:last-child,
.billing-line-review-row span:last-child {
    border-right: 0;
}

.billing-line-review-row:last-child span {
    border-bottom: 0;
}

.billing-line-review-total {
    display: grid;
    grid-template-columns: minmax(130px, 0.9fr) minmax(130px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr) minmax(180px, 1.35fr) minmax(90px, 0.65fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr);
    min-width: 1120px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
}

.billing-line-review-table-dimensions .billing-line-review-total {
    grid-template-columns: minmax(130px, 0.9fr) minmax(130px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr) minmax(170px, 1.1fr) repeat(8, minmax(115px, 0.75fr)) minmax(90px, 0.6fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr);
    min-width: 2130px;
}

.billing-line-review-total span,
.billing-line-review-total strong {
    padding: 10px;
    color: #1f2937;
    font-size: 13px;
}

.billing-line-review-total span {
    grid-column: 7;
    text-align: right;
    font-weight: 700;
    border-right: 1px solid var(--border-color);
}

.billing-line-review-table-dimensions .billing-line-review-total span {
    grid-column: 15;
}

.billing-line-review-total strong {
    grid-column: 8;
    font-weight: 800;
}

.billing-line-review-table-dimensions .billing-line-review-total strong {
    grid-column: 16;
}

.billing-bc-line-dimension-cell {
    display: flex;
    align-items: center;
}

.billing-bc-line-dimension-input {
    min-width: 0;
    font-size: 12px;
}

.billing-line-sis-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.billing-line-sis-toolbar small {
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

.billing-line-sis-toolbar small.is-error {
    color: #b42318;
}

.billing-line-sis-review-input {
    width: 100%;
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #202938;
    font-size: 12px;
    font-weight: 700;
    background: #ffffff;
}

.billing-notes-field textarea {
    resize: vertical;
}

.billing-attachments-panel {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.billing-attachments-panel .billing-request-card {
    gap: 10px;
    padding: 12px;
}

.billing-upload-note {
    margin: 0;
    color: #667085;
    font-size: 11px;
    line-height: 1.3;
}

.billing-document-stack {
    display: grid;
    gap: 9px;
}

.billing-dropzone {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 58px;
    margin: 0;
    padding: 9px 12px;
    border: 2px dashed #8ab4f8;
    border-radius: 8px;
    color: #4a5568;
    background: #ffffff;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.billing-dropzone:hover,
.billing-dropzone:focus-within,
.billing-dropzone.is-dragover {
    border-color: #1d4ed8;
    background: #f8fbff;
}

.billing-dropzone.is-attached {
    border-color: #22c55e;
    color: #14532d;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.billing-dropzone.is-attachment-pulse {
    animation: billingAttachmentPulse 620ms ease-out;
}

.billing-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.billing-dropzone i {
    color: #1d4ed8;
    font-size: 20px;
    transition: color 160ms ease, transform 160ms ease;
}

.billing-dropzone.is-attached i {
    color: #16a34a;
    transform: scale(1.04);
}

.billing-dropzone span {
    font-size: 11px;
    line-height: 1.25;
}

.billing-dropzone strong {
    color: #0d6efd;
}

.billing-attachment-status {
    grid-column: 1 / -1;
    min-height: 18px;
    margin-top: -4px;
    padding-left: 28px;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes billingAttachmentPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.32);
    }

    42% {
        transform: scale(1.012);
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.16);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
    }
}

.billing-reminder {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 14px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1e3a8a;
    background: #eff6ff;
}

.billing-reminder p {
    margin: 4px 0 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.4;
}

.billing-submit-actions {
    grid-column: 1 / -1;
}

.billing-field label {
    display: block;
    margin-bottom: 6px;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
}

.billing-check {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 38px;
}

.billing-upload {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    gap: 12px;
    min-height: 112px;
    padding: 18px;
    border: 1px dashed #a0aec0;
    border-radius: 8px;
    background: #fff;
    text-align: center;
}

.billing-upload-title {
    display: grid;
    gap: 2px;
}

.billing-upload-title span {
    font-size: 20px;
    font-weight: 600;
}

.billing-upload-title small {
    color: #202938;
    font-weight: 700;
}

.billing-document-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 28px;
    align-items: start;
    text-align: left;
}

.billing-document-field {
    display: grid;
    gap: 6px;
}

.billing-document-field label {
    color: #202938;
    font-size: 14px;
    font-weight: 700;
}

.billing-document-field .form-control {
    min-height: 38px;
}

.billing-upload-icon {
    color: #202938;
    font-size: 28px;
}

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

.billing-report-filter-card {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.billing-report-type-field {
    grid-column: 1 / -1;
    max-width: 420px;
}

.billing-field-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 6px;
}

.billing-field-heading label {
    margin-bottom: 0;
}

.billing-inline-check {
    display: inline-flex !important;
    gap: 6px;
    align-items: center;
    margin: 0 !important;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap;
}

.billing-inline-check input {
    margin: 0;
}

.billing-field-help {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.3;
}

.billing-list-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.billing-summary-tile {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-left: 4px solid #94a3b8;
    border-radius: 8px;
    background: #ffffff;
}

.billing-summary-tile span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.billing-summary-tile strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-size: 18px;
    line-height: 1.15;
}

.billing-summary-tile.is-total { border-left-color: #2563eb; }
.billing-summary-tile.is-pending { border-left-color: #0891b2; }
.billing-summary-tile.is-approved { border-left-color: #16a34a; }
.billing-summary-tile.is-paid { border-left-color: #2563eb; }
.billing-summary-tile.is-declined { border-left-color: #dc2626; }
.billing-summary-tile.is-submitted { border-left-color: #7c3aed; }
.billing-summary-tile.is-amount { border-left-color: #ca8a04; }

.billing-report-action {
    grid-column: 1 / -1;
}

.billing-report-results {
    display: grid;
    gap: 14px;
}

.billing-report-summary {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) repeat(3, minmax(160px, 1fr));
    gap: 12px;
}

.billing-report-metric,
.billing-report-copy {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.billing-report-metric {
    display: grid;
    gap: 4px;
    align-content: start;
}

.billing-report-metric span {
    color: #667085;
    font-size: 12px;
    font-weight: 600;
}

.billing-report-metric strong {
    color: #202938;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.billing-report-metric small {
    color: #64748b;
    font-size: 12px;
}

.billing-report-metric-primary {
    border-left: 4px solid #2563eb;
}

.billing-report-copy {
    display: grid;
    gap: 14px;
    margin: 12px;
}

.billing-report-copy-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.billing-report-copy-header div {
    display: grid;
    gap: 2px;
}

.billing-report-copy-header strong {
    font-size: 18px;
}

.billing-report-copy-header span:not(.badge) {
    color: #667085;
}

.billing-table-card {
    overflow: hidden;
}

.billing-view-panel {
    display: grid;
    gap: 18px;
}

.billing-request-details,
.billing-request-details-empty {
    display: grid;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.billing-request-details-empty {
    color: #667085;
}

.billing-details-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.billing-details-toolbar h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
}

.billing-details-status {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.billing-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
}

.billing-detail-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafc;
}

.billing-detail-item span {
    color: #667085;
    font-size: 12px;
    font-weight: 600;
}

.billing-detail-item strong {
    color: #202938;
    font-size: 14px;
    word-break: break-word;
}

.billing-detail-input-item input {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #202938;
    font-size: 14px;
    font-weight: 700;
    background: #ffffff;
}

.billing-sis-highlight {
    border: 2px solid #f59e0b;
    background: #fff7d6;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.billing-sis-highlight label {
    color: #92400e;
    font-size: 13px;
    font-weight: 800;
}

.billing-sis-save-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.billing-sis-save-btn {
    min-height: 34px;
    font-weight: 800;
    white-space: nowrap;
}

#billingSisNoSaveStatus,
#billingOriginalDocumentTransmittalDateSaveStatus {
    min-height: 16px;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

#billingSisNoSaveStatus.is-error,
#billingOriginalDocumentTransmittalDateSaveStatus.is-error {
    color: #b42318;
}

.billing-details-section {
    display: grid;
    gap: 10px;
}

.billing-details-section h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.billing-documents-list,
.billing-history-list {
    display: grid;
    gap: 8px;
}

.billing-charge-document-upload-list {
    display: grid;
    gap: 8px;
}

.billing-charge-document-upload-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff7d6;
}

.billing-charge-document-upload-row strong,
.billing-charge-document-upload-row small {
    display: block;
}

.billing-charge-document-upload-row small,
#billingChargeDocumentUploadStatus {
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

#billingChargeDocumentUploadStatus.is-error {
    color: #b42318;
}

.billing-charge-document-input {
    width: 100%;
    font-size: 12px;
}

.billing-document-row,
.billing-history-row {
    display: grid;
    grid-template-columns: minmax(140px, 0.8fr) minmax(220px, 1.4fr) minmax(90px, 0.5fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.billing-history-row {
    grid-template-columns: minmax(90px, 0.4fr) minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(220px, 1.2fr);
}

.billing-document-row span,
.billing-document-row small,
.billing-history-row small {
    color: #667085;
}

.billing-document-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.billing-details-actions {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.billing-document-modal-open {
    overflow: hidden;
}

.billing-document-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    place-items: center;
    padding: 22px;
}

.billing-document-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
}

.billing-document-modal-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(980px, 96vw);
    height: min(760px, 92vh);
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

.billing-document-modal-header,
.billing-document-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.billing-document-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    border-bottom: 0;
}

.billing-document-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.billing-document-modal-body {
    min-height: 0;
    overflow: auto;
    background: #f8fafc;
}

.billing-document-preview-frame {
    width: 100%;
    height: 100%;
    min-height: 620px;
    border: 0;
    background: #ffffff;
}

.billing-document-preview-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.billing-document-preview-fallback {
    display: grid;
    min-height: 240px;
    place-items: center;
    padding: 24px;
    color: #667085;
    text-align: center;
}

.billing-check-preparation-dialog {
    width: min(1120px, 96vw);
    height: auto;
    max-height: 92vh;
}

.billing-check-preparation-body {
    padding: 18px;
    background: #eef2f7;
}

.billing-push-bc-dialog {
    width: min(1040px, 96vw);
    height: auto;
    max-height: 88vh;
}

.billing-push-bc-body {
    padding: 18px;
    background: #eef2f7;
}

.billing-push-bc-sheet {
    display: grid;
    gap: 16px;
}

.billing-push-bc-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.billing-push-bc-field,
.billing-push-bc-lines {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
}

.billing-push-bc-field {
    min-width: 0;
    padding: 12px;
}

.billing-push-bc-field span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.billing-push-bc-field strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-size: 14px;
}

.billing-push-bc-lines {
    padding: 14px;
    overflow: hidden;
}

.billing-push-bc-lines h3 {
    margin: 0;
    padding: 0 0 10px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
}

.billing-bc-line-dimension-status {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
}

.billing-check-sheet {
    display: grid;
    gap: 14px;
    color: #111827;
    font-family: Inter, Arial, sans-serif;
}

.billing-check-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
}

.billing-check-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
}

.billing-check-subtitle {
    margin-top: 2px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.billing-check-status {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
}

.billing-check-status.is-ready {
    color: #075985;
    background: #e0f2fe;
}

.billing-check-status.is-submitted {
    color: #166534;
    background: #dcfce7;
}

.billing-check-status.is-failed {
    color: #991b1b;
    background: #fee2e2;
}

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

.billing-check-summary div,
.billing-check-card {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
}

.billing-check-summary div {
    min-width: 0;
    padding: 12px;
}

.billing-check-summary span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.billing-check-summary strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-size: 14px;
}

.billing-check-card {
    overflow: hidden;
}

.billing-check-lines-card {
    padding: 14px;
}

.billing-check-lines-card h3 {
    margin: 0;
    padding: 0 0 10px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
}

.billing-check-lines-card .billing-line-review-table {
    border-radius: 6px;
}

.billing-check-section-title {
    padding: 11px 14px;
    border-bottom: 1px solid #cbd5e1;
    color: #334155;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.billing-check-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.billing-check-field {
    display: grid;
    grid-template-columns: minmax(170px, 0.75fr) minmax(180px, 1.25fr);
    align-items: stretch;
    min-height: 40px;
    margin: 0;
    border-right: 1px solid #dbe3ef;
    border-bottom: 1px solid #dbe3ef;
}

.billing-check-field:nth-child(2n),
.billing-check-field-wide {
    border-right: 0;
}

.billing-check-field-wide {
    grid-column: 1 / -1;
    grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1.65fr);
}

.billing-check-field span {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 10px;
    border-right: 1px solid #dbe3ef;
    color: #334155;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: right;
}

.billing-check-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 8px 10px;
    color: #1f4e79;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.billing-check-field input:focus,
.billing-check-bc-field input:focus,
.billing-check-signature textarea:focus {
    outline: 2px solid rgba(13, 110, 253, 0.35);
    outline-offset: -2px;
}

.billing-check-bc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}

.billing-check-bc-field {
    display: grid;
    gap: 6px;
    margin: 0;
}

.billing-check-bc-field span {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.billing-check-bc-field input {
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 9px 10px;
    color: #0f172a;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.billing-check-signatures {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.billing-check-signature {
    display: grid;
    grid-template-rows: auto minmax(86px, auto);
    margin: 0;
    border-right: 1px solid #d0d7de;
}

.billing-check-signature:last-child {
    border-right: 0;
}

.billing-check-signature span {
    padding: 8px;
    border-bottom: 1px solid #d0d7de;
    color: #334155;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 700;
}

.billing-check-signature textarea {
    width: 100%;
    min-height: 86px;
    border: 0;
    padding: 8px;
    resize: vertical;
    color: #1f4e79;
    font-weight: 600;
}

.billing-check-approval-card {
    break-inside: avoid;
}

.billing-check-approval-list {
    display: grid;
    gap: 0;
}

.billing-check-approval-item {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.billing-check-approval-item:last-child {
    border-bottom: 0;
}

.billing-check-approval-main {
    display: flex;
    min-width: 0;
    gap: 10px;
    align-items: flex-start;
}

.billing-check-approval-main strong,
.billing-check-approval-main span,
.billing-check-approval-note {
    overflow-wrap: anywhere;
}

.billing-check-approval-main strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
}

.billing-check-approval-main span {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.billing-check-approval-badge {
    flex: 0 0 auto;
    min-width: 86px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.billing-check-approval-badge.is-approved {
    color: #166534;
    background: #dcfce7;
}

.billing-check-approval-badge.is-declined,
.billing-check-approval-badge.is-closed {
    color: #991b1b;
    background: #fee2e2;
}

.billing-check-approval-badge.is-neutral {
    color: #334155;
    background: #e2e8f0;
}

.billing-check-approval-note {
    min-width: 0;
    color: #1f4e79;
    font-size: 13px;
    font-weight: 600;
}

.billing-check-empty-note {
    padding: 14px;
    color: #64748b;
    font-size: 13px;
}

.billing-check-submit-status {
    flex: 1 1 auto;
    color: #64748b;
    font-size: 13px;
    text-align: left;
}

@media (max-width: 900px) {
    .billing-check-hero,
    .billing-document-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .billing-check-summary,
    .billing-check-grid,
    .billing-check-bc-grid,
    .billing-check-signatures,
    .billing-check-approval-item {
        grid-template-columns: 1fr;
    }

    .billing-check-field,
    .billing-check-field-wide {
        grid-template-columns: 1fr;
    }

    .billing-check-field span {
        justify-content: flex-start;
        border-right: 0;
        border-bottom: 1px solid #dbe3ef;
        text-align: left;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 7mm;
    }

    body.billing-check-printing {
        margin: 0;
        background: #ffffff !important;
        overflow: visible !important;
    }

    body.billing-check-printing > :not(#billingCheckPreparationModal) {
        display: none !important;
    }

    body.billing-check-printing #billingCheckPreparationModal,
    body.billing-check-printing .billing-document-modal-dialog,
    body.billing-check-printing .billing-document-modal-body {
        position: static !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
        background: #ffffff !important;
        box-shadow: none !important;
    }

    body.billing-check-printing .billing-document-modal-backdrop,
    body.billing-check-printing .billing-document-modal-header,
    body.billing-check-printing .billing-document-modal-footer,
    body.billing-check-printing .billing-check-bc-card {
        display: none !important;
    }

    body.billing-check-printing .billing-check-preparation-body {
        padding: 0 !important;
        background: #ffffff !important;
    }

    body.billing-check-printing .billing-check-sheet {
        gap: 5px;
        color: #111827 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body.billing-check-printing .billing-check-hero,
    body.billing-check-printing .billing-check-summary div,
    body.billing-check-printing .billing-check-signatures {
        break-inside: avoid;
        box-shadow: none !important;
    }

    body.billing-check-printing .billing-check-hero {
        padding: 7px 9px;
        border-radius: 5px;
    }

    body.billing-check-printing .billing-check-title {
        font-size: 15px;
    }

    body.billing-check-printing .billing-check-subtitle,
    body.billing-check-printing .billing-check-status,
    body.billing-check-printing .billing-check-summary span {
        font-size: 8.5px;
    }

    body.billing-check-printing .billing-check-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
    }

    body.billing-check-printing .billing-check-summary div {
        padding: 5px 6px;
        border-radius: 5px;
    }

    body.billing-check-printing .billing-check-summary span {
        margin-bottom: 2px;
    }

    body.billing-check-printing .billing-check-summary strong {
        font-size: 9.5px;
    }

    body.billing-check-printing .billing-check-card,
    body.billing-check-printing .billing-check-signatures {
        border-radius: 5px;
    }

    body.billing-check-printing .billing-check-section-title {
        padding: 5px 7px;
        font-size: 9.5px;
    }

    body.billing-check-printing .billing-check-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    body.billing-check-printing .billing-check-field,
    body.billing-check-printing .billing-check-field-wide {
        grid-template-columns: minmax(118px, 0.62fr) minmax(150px, 1.38fr);
        min-height: 22px;
    }

    body.billing-check-printing .billing-check-field span,
    body.billing-check-printing .billing-check-field input {
        padding: 4px 6px;
        line-height: 1.15;
    }

    body.billing-check-printing .billing-check-field span,
    body.billing-check-printing .billing-check-field input,
    body.billing-check-printing .billing-check-signature span,
    body.billing-check-printing .billing-check-signature textarea,
    body.billing-check-printing .billing-check-approval-main strong,
    body.billing-check-printing .billing-check-approval-main span,
    body.billing-check-printing .billing-check-approval-note {
        font-size: 9.5px;
    }

    body.billing-check-printing .billing-check-field input,
    body.billing-check-printing .billing-check-signature textarea {
        color: #1f4e79 !important;
    }

    body.billing-check-printing .billing-check-signature textarea {
        min-height: 34px;
        padding: 5px 7px;
        resize: none;
    }

    body.billing-check-printing .billing-check-signature {
        grid-template-rows: auto minmax(34px, auto);
    }

    body.billing-check-printing .billing-check-signature span {
        padding: 5px 7px;
    }

    body.billing-check-printing .billing-check-approval-card {
        break-before: auto;
        break-inside: auto;
        page-break-before: auto;
        page-break-inside: auto;
    }

    body.billing-check-printing .billing-check-approval-item {
        grid-template-columns: minmax(190px, 0.78fr) minmax(0, 1.22fr);
        gap: 7px;
        padding: 5px 7px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.billing-check-printing .billing-check-approval-badge {
        min-width: 62px;
        padding: 3px 6px;
        font-size: 8.5px;
    }
}

#billingRequestsTable {
    min-width: 2555px;
    table-layout: fixed;
}

#billingRequestsTable.billing-hide-bc-private-columns {
    min-width: 2000px;
}

#billingRequestsTable.billing-hide-bc-private-columns .billing-bc-private-column {
    display: none;
}

#billingRequestsTable th:nth-child(1) { width: 112px; }
#billingRequestsTable th:nth-child(2) { width: 150px; }
#billingRequestsTable th:nth-child(3) { width: 150px; }
#billingRequestsTable th:nth-child(4) { width: 150px; }
#billingRequestsTable th:nth-child(5) { width: 190px; }
#billingRequestsTable th:nth-child(6) { width: 190px; }
#billingRequestsTable th:nth-child(7) { width: 130px; }
#billingRequestsTable th:nth-child(8) { width: 110px; }
#billingRequestsTable th:nth-child(9) { width: 120px; }
#billingRequestsTable th:nth-child(10) { width: 105px; }
#billingRequestsTable th:nth-child(11) { width: 105px; }
#billingRequestsTable th:nth-child(12) { width: 130px; }
#billingRequestsTable th:nth-child(13) { width: 170px; }
#billingRequestsTable th:nth-child(14) { width: 190px; }
#billingRequestsTable th:nth-child(15) { width: 150px; }
#billingRequestsTable th:nth-child(16) { width: 130px; }
#billingRequestsTable th:nth-child(17) { width: 155px; }
#billingRequestsTable th:nth-child(18) { width: 130px; }
#billingRequestsTable th:nth-child(19) { width: 80px; }
#billingRequestsTable th:nth-child(20) { width: 130px; }
#billingRequestsTable th:nth-child(21) { width: 150px; }

#billingRequestsTable th,
#billingRequestsTable td {
    vertical-align: middle;
}

#billingRequestsTable th {
    white-space: normal;
    overflow-wrap: break-word;
    padding: 8px 10px;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: uppercase;
}

#billingRequestsTable td {
    padding: 10px;
    color: #334155;
    font-size: 13px;
}

#billingRequestsTable th:nth-child(15),
#billingRequestsTable td:nth-child(15),
#billingRequestsTable th:nth-child(16),
#billingRequestsTable td:nth-child(16),
#billingRequestsTable th:nth-child(17),
#billingRequestsTable td:nth-child(17),
#billingRequestsTable th:nth-child(18),
#billingRequestsTable td:nth-child(18) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}

#billingRequestsTable th:first-child,
#billingRequestsTable td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 104px;
    background: #ffffff;
    box-shadow: 1px 0 0 var(--border-color);
}

#billingRequestsTable thead th:first-child {
    z-index: 3;
    background: #f8fafc;
}

#billingRequestsTable th:last-child,
#billingRequestsTable td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 150px;
    background: #ffffff;
    box-shadow: -1px 0 0 var(--border-color);
}

#billingRequestsTable thead th:last-child {
    z-index: 3;
    background: #f8fafc;
}

#billingRequestsTable tbody tr:hover td {
    background: #f8fbff;
}

.billing-actions-cell {
    min-width: 124px;
    width: 124px;
    max-width: 124px;
}

.billing-action-tooltip {
    display: inline-flex;
}

.billing-action-tooltip .billing-disabled-action {
    pointer-events: none;
}

.billing-disabled-action,
.billing-disabled-action:disabled {
    opacity: 0.55;
    filter: grayscale(0.35);
    cursor: not-allowed;
}

.billing-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.billing-icon-action {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    white-space: nowrap;
}

.billing-icon-action span {
    font-size: 12px;
    font-weight: 700;
}

.billing-bc-fetch-status {
    width: 106px;
    max-width: 106px;
    overflow: hidden;
    pointer-events: none;
}

.billing-bc-fetch-status span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.billing-bc-fetch-status.is-waiting i {
    animation: billingBcWaitingSpin 1.8s linear infinite;
}

.billing-bc-fetch-status.is-fetching {
    color: #0f5132;
    background: #ecfdf3;
    border-color: #86efac;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.28);
    animation: billingBcFetchPulse 1.35s ease-in-out infinite;
}

.billing-bc-fetch-status.is-fetching .spinner-border {
    width: 0.8rem;
    height: 0.8rem;
    border-width: 0.12em;
}

@keyframes billingBcWaitingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes billingBcFetchPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.2);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(22, 163, 74, 0);
    }
}

.billing-request-no {
    color: #0f172a;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.billing-text-cell {
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.billing-nowrap,
.billing-date-cell,
.billing-amount-cell {
    white-space: nowrap;
}

.billing-date-cell {
    line-height: 1.3;
}

.billing-amount-cell {
    color: #0f172a;
    font-weight: 700;
    text-align: right;
}

.billing-status-cell {
    min-width: 140px;
}

.billing-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    max-width: 100%;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}

.billing-status-pill.is-open,
.billing-status-pill.is-pending {
    color: #155e75;
    background: #cffafe;
}

.billing-status-pill.is-approved {
    color: #166534;
    background: #dcfce7;
}

.billing-status-pill.is-available {
    color: #065f46;
    background: #a7f3d0;
}

.billing-status-pill.is-paid {
    color: #1e3a8a;
    background: #dbeafe;
}

.billing-status-pill.is-declined {
    color: #991b1b;
    background: #fee2e2;
}

.billing-status-pill.is-closed {
    color: #334155;
    background: #e2e8f0;
}

.billing-status-pill.is-submitted {
    color: #5b21b6;
    background: #ede9fe;
}

.billing-status-subtext {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.billing-empty-state {
    display: grid;
    min-height: 96px;
    place-items: center;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

/* Booking Requests */
.booking-page {
    padding: 24px;
}

.booking-toolbar {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.booking-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.booking-tab {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #4a5568;
    background: transparent;
    font-weight: 600;
    white-space: nowrap;
}

.booking-tab.active {
    border-bottom-color: #0d6efd;
    color: #202938;
}

.booking-section {
    display: grid;
    gap: 20px;
}

.booking-section-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.booking-section-header h1 {
    margin: 0 0 4px;
    font-size: 28px;
    font-weight: 700;
}

.booking-section-header p {
    margin: 0;
    color: #667085;
}

.booking-form,
.booking-report-form,
.booking-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 22px 42px;
    align-items: end;
}

.booking-field label {
    display: block;
    margin-bottom: 6px;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
}

.booking-span,
.booking-upload,
.booking-report-action {
    grid-column: 1 / -1;
}

.booking-check {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 38px;
}

.booking-upload {
    display: grid;
    place-items: center;
    min-height: 112px;
    padding: 18px;
    border: 1px dashed #a0aec0;
    border-radius: 8px;
    background: #fff;
    text-align: center;
}

.booking-upload label {
    font-size: 20px;
    font-weight: 600;
}

.booking-upload .form-control {
    max-width: 420px;
    margin: 10px auto;
}

.booking-upload-icon {
    color: #202938;
    font-size: 28px;
}

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

.booking-table-card {
    overflow: hidden;
}

#bookingsTable {
    min-width: 1320px;
}

#bookingsTable th {
    white-space: nowrap;
    font-size: 12px;
}

@media (max-width: 900px) {
    .billing-form,
    .billing-report-form,
    .billing-filters,
    .billing-rates-form,
    .booking-form,
    .booking-report-form,
    .booking-filters {
        grid-template-columns: 1fr;
    }

    .billing-request-workspace,
    .billing-request-grid {
        grid-template-columns: 1fr;
    }

    .billing-line-table {
        overflow-x: visible;
    }

    .billing-line-header {
        display: none;
    }

    .billing-line-row {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .billing-line-total-row {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .billing-line-total-row span:first-child,
    .billing-line-total-row strong,
    .billing-line-total-row span:last-child {
        grid-column: auto;
        border-right: 0;
    }

    .billing-line-total-row span:first-child {
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }

    .billing-line-total-row span:last-child {
        display: none;
    }

    .billing-line-review-total {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .billing-line-review-total span,
    .billing-line-review-total strong {
        grid-column: auto;
    }

    .billing-line-review-total span {
        text-align: left;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .billing-line-row .billing-field,
    .billing-line-action {
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .billing-line-row .billing-field label {
        display: block;
    }

    .billing-line-action {
        justify-content: flex-end;
        border-bottom: 0;
    }

    .billing-list-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .billing-submit-actions {
        grid-column: auto;
    }

    .billing-section-header,
    .booking-section-header {
        flex-direction: column;
    }

    .billing-actions,
    .booking-actions {
        justify-content: stretch;
    }

    .billing-actions .btn,
    .booking-actions .btn {
        width: 100%;
    }

    .billing-view-filters .billing-actions,
    .billing-rates-form .billing-actions {
        justify-content: stretch;
    }

    .billing-view-filters .billing-actions .btn,
    .billing-rates-form .billing-actions .btn {
        width: 100%;
    }

    .billing-document-grid {
        grid-template-columns: 1fr;
    }

    .billing-details-toolbar {
        flex-direction: column;
    }

    .billing-details-status {
        justify-items: start;
    }

    .billing-report-summary,
    .billing-details-grid,
    .billing-document-row,
    .billing-history-row {
        grid-template-columns: 1fr;
    }

    .billing-field-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .billing-document-actions,
    .billing-document-modal-footer {
        justify-content: stretch;
    }

    .billing-document-actions .btn,
    .billing-document-modal-footer .btn {
        flex: 1;
    }

    .billing-document-modal {
        padding: 10px;
    }

    .billing-document-modal-dialog {
        height: 94vh;
    }

    .billing-check-grid,
    .billing-check-signatures,
    .billing-push-bc-summary {
        grid-template-columns: 1fr;
    }

    .billing-check-field,
    .billing-check-field-wide {
        grid-template-columns: 1fr;
        border-right: 0;
    }

    .billing-check-field span {
        justify-content: flex-start;
        border-right: 0;
        border-bottom: 1px solid #202020;
        text-align: left;
    }

    .billing-check-signature {
        border-right: 0;
        border-bottom: 1px solid #d0d7de;
    }
}
