.invoice-form-page {
    --invoice-card: #ffffff;
    --invoice-soft: #f7f9fc;
    --invoice-border: #e6ebf2;
    --invoice-heading: #26334a;
    --invoice-text: #475569;
    --invoice-muted: #8b98aa;
    --invoice-input: #ffffff;
    --invoice-table-head: #f8fafc;
}

body.dark .invoice-form-page,
body.dark-theme .invoice-form-page,
body[data-theme="dark"] .invoice-form-page,
body[data-bs-theme="dark"] .invoice-form-page,
html.dark .invoice-form-page,
html.dark-theme .invoice-form-page,
html[data-theme="dark"] .invoice-form-page,
html[data-bs-theme="dark"] .invoice-form-page {
    --invoice-card: #1b2735;
    --invoice-soft: #121c27;
    --invoice-border: #304052;
    --invoice-heading: #ffffff;
    --invoice-text: #d9e3ee;
    --invoice-muted: #9aacbf;
    --invoice-input: #121c27;
    --invoice-table-head: #121c27;
}

.invoice-form-page {
    min-height: 100vh;
    color: var(--invoice-text);
    background:
        radial-gradient(circle at 95% 2%, rgba(79, 70, 229, .12), transparent 28%),
        radial-gradient(circle at 5% 18%, rgba(14, 165, 233, .10), transparent 24%);
}

/* Dropdown ko parent se clip hone se rokta hai */
.invoice-form-page .main-content-container {
    overflow: visible !important;
}

.invoice-hero {
    padding: 24px 26px;
    border: 1px solid rgba(79, 70, 229, .15);
    border-radius: 18px;
    background: linear-gradient(135deg, #111827 0%, #253b80 56%, #2563eb 100%);
    box-shadow: 0 18px 45px rgba(30, 64, 175, .18);
}

.invoice-hero h3,
.invoice-hero a,
.invoice-hero span {
    color: #ffffff !important;
}

.invoice-hero p {
    color: rgba(255, 255, 255, .72) !important;
}

.wizard-card {
    position: relative;
    overflow: visible !important;
    color: var(--invoice-text);
    border: 0 !important;
    border-radius: 18px !important;
    background: var(--invoice-card) !important;
    box-shadow: 0 14px 38px rgba(15, 23, 42, .08);
}

.wizard-tabs {
    position: relative;
    padding: 8px 4px 26px;
}

.wizard-tabs::before {
    content: '';
    position: absolute;
    top: 31px;
    right: 7%;
    left: 7%;
    height: 2px;
    background: var(--invoice-border);
}

.wizard-tabs .nav-item {
    position: relative;
    z-index: 2;
}

.wizard-tabs .nav-link {
    color: var(--invoice-muted);
    border: 0 !important;
    background: transparent !important;
}

.wizard-number {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    color: #64748b;
    border: 2px solid var(--invoice-border);
    border-radius: 50%;
    background: var(--invoice-soft);
    font-size: 18px;
    font-weight: 800;
    transition: .2s ease;
}

.wizard-label {
    display: flex;
    flex-direction: column;
    margin-left: 12px;
    text-align: left;
}

.wizard-label strong {
    color: var(--invoice-heading);
    font-size: 14px;
}

.wizard-label small {
    color: var(--invoice-muted);
    font-size: 11px;
}

.wizard-tabs .nav-link.active .wizard-number,
.wizard-tabs .nav-link.completed .wizard-number {
    color: #ffffff;
    border-color: #2563eb;
    border-radius: 25px!important;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    box-shadow: 0 7px 18px rgba(37, 99, 235, .25);
}

.wizard-tabs .nav-link.completed .wizard-number {
    font-size: 0;
}

.wizard-tabs .nav-link.completed .wizard-number::after {
    content: '✓';
    font-size: 18px;
}

.wizard-pane {
    position: relative;
    display: none;
    min-height: 410px;
    padding: 26px;
    overflow: visible !important;
    border: 1px solid var(--invoice-border);
    border-radius: 16px;
    background: var(--invoice-card);
}

.wizard-pane.active {
    display: block;
    border-radius: 25px!important;
    animation: invoiceStepIn .25s ease;
}

@keyframes invoiceStepIn {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.pane-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.pane-head h4 {
    margin: 0 0 4px;
    color: var(--invoice-heading);
    font-size: 19px;
    font-weight: 750;
}

.pane-head p {
    margin: 0;
    color: var(--invoice-muted);
    font-size: 12px;
}

.pane-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    color: #2563eb;
    border-radius: 12px;
    background: rgba(37, 99, 235, .10);
    font-size: 23px;
}

.invoice-form-page .form-control {
    min-height: 48px;
    color: var(--invoice-text);
    border-color: var(--invoice-border);
    border-radius: 12px;
    background: var(--invoice-input);
}

.invoice-form-page .form-control::placeholder {
    color: var(--invoice-muted);
}

.invoice-form-page .form-control:focus {
    color: var(--invoice-text);
    border-color: #6366f1;
    background: var(--invoice-input);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .11);
}

.search-wrap {
    position: relative;
    z-index: 50;
}

/* Dropdown overlay hoga, content ko neeche push nahi karega */
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 9999;
    max-height: 230px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    border: 1px solid var(--invoice-border);
    border-radius: 10px;
    background: var(--invoice-card);
    box-shadow: 0 12px 30px rgba(28, 39, 60, .18);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.search-results::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.search-item {
    display: block;
    width: 100%;
    padding: 11px 13px;
    color: var(--invoice-text);
    border: 0;
    border-bottom: 1px solid var(--invoice-border);
    background: transparent;
    text-align: left;
}

.search-item:last-child {
    border-bottom: 0;
}

.search-item strong {
    color: var(--invoice-heading);
}

.search-item:hover {
    color: #0d6efd;
    background: rgba(13, 110, 253, .08);
}

.selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    padding: 7px 10px;
    color: #0d6efd;
    border-radius: 8px;
    background: rgba(13, 110, 253, .10);
    font-size: 12px;
    font-weight: 700;
}

.check-list {
    max-height: 355px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    border: 0;
    border-radius: 14px;
    background: var(--invoice-soft);
    scrollbar-width: thin;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 9px;
    padding: 14px;
    border: 1px solid var(--invoice-border);
    border-radius: 12px;
    background: var(--invoice-card);
    cursor: pointer;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.check-item:last-child {
    margin-bottom: 0;
}

.check-item:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 70, 229, .40);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
}

.check-item strong {
    display: block;
    color: var(--invoice-heading);
    font-size: 13px;
}

.check-item small {
    color: var(--invoice-muted);
    font-size: 11px;
}

.table-wrap,
.review-panel {
    overflow: hidden;
    border: 1px solid var(--invoice-border);
    border-radius: 14px;
}

.ticket-table {
    color: var(--invoice-text) !important;
}

.ticket-table thead th {
    padding: 14px 12px;
    color: var(--invoice-muted) !important;
    border-color: var(--invoice-border) !important;
    background: var(--invoice-table-head) !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    white-space: nowrap;
    text-transform: uppercase;
}

.ticket-table tbody td {
    padding: 15px 12px;
    color: var(--invoice-text) !important;
    border-color: var(--invoice-border) !important;
    background: var(--invoice-card) !important;
    vertical-align: middle;
}

.ticket-table strong {
    color: var(--invoice-heading) !important;
}

.empty {
    padding: 30px 15px;
    color: var(--invoice-muted);
    text-align: center;
}

.summary {
    padding: 18px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(79, 70, 229, .11), rgba(14, 165, 233, .09));
}

.summary span,
.summary strong {
    display: block;
}

.summary span {
    color: var(--invoice-muted);
    font-size: 12px;
}

.summary strong {
    margin-top: 3px;
    color: var(--invoice-heading);
    font-size: 25px;
}

.review-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 18px;
    border-bottom: 1px solid var(--invoice-border);
}

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

.review-row span {
    color: var(--invoice-muted);
    font-size: 13px;
}

.review-row strong {
    color: var(--invoice-heading);
    text-align: right;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--invoice-border);
}

.actions .btn {
    min-height: 48px;
    border-radius: 11px;
}

.actions .btn-light {
    color: #2563eb !important;
    border: 0 !important;
    background: rgba(37, 99, 235, .10) !important;
}

#submitButton {
    border: 0;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
}

@media (max-width: 767px) {
    .invoice-hero {
        padding: 20px;
    }

    .invoice-hero nav {
        display: none;
    }

    .wizard-tabs::before {
        right: 12%;
        left: 12%;
    }

    .wizard-label {
        display: none;
    }

    .wizard-pane {
        min-height: auto;
        padding: 18px;
    }

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

    .actions > *,
    .actions .d-flex {
        width: 100%;
    }

    .actions .btn {
        flex: 1;
    }

    .search-results {
        max-height: 200px;
    }
}


/* ===== FINAL POLISHED LIGHT/DARK WIZARD ===== */
.invoice-form-page {
    --wizard-shell: #ffffff;
    --wizard-panel: #ffffff;
    --wizard-soft: #f8fafc;
    --wizard-border: #e2e8f0;
    --wizard-line: #dbe3ee;
    --wizard-title: #172033;
    --wizard-text: #475569;
    --wizard-muted: #8da0b8;
    --wizard-input: #ffffff;
    --wizard-head: #f8fafc;
    --wizard-shadow: 0 14px 38px rgba(15, 23, 42, .08);
}

body.dark .invoice-form-page,
body.dark-theme .invoice-form-page,
body[data-theme="dark"] .invoice-form-page,
body[data-bs-theme="dark"] .invoice-form-page,
html.dark .invoice-form-page,
html.dark-theme .invoice-form-page,
html[data-theme="dark"] .invoice-form-page,
html[data-bs-theme="dark"] .invoice-form-page {
    --wizard-shell: #172231;
    --wizard-panel: #111b28;
    --wizard-soft: #0f1925;
    --wizard-border: #2b3a4c;
    --wizard-line: #334155;
    --wizard-title: #f8fafc;
    --wizard-text: #d5dfeb;
    --wizard-muted: #8fa2b8;
    --wizard-input: #111b28;
    --wizard-head: #101a27;
    --wizard-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}

.wizard-card {
    overflow: hidden !important;
    border: 1px solid var(--wizard-border) !important;
    border-radius: 18px !important;
    background: var(--wizard-shell) !important;
    box-shadow: var(--wizard-shadow) !important;
}

.wizard-card > .card-body {
    padding: 28px !important;
    background: var(--wizard-shell) !important;
}

.wizard-tabs {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 34px !important;
    padding: 8px 12px 4px !important;
    border: 0 !important;
    background: transparent !important;
}

.wizard-tabs::before {
    top: 32px !important;
    right: 9% !important;
    left: 9% !important;
    height: 2px !important;
    background: var(--wizard-line) !important;
}

.wizard-tabs .nav-item {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.wizard-tabs .nav-link,
.wizard-tabs .nav-link:hover,
.wizard-tabs .nav-link:focus,
.wizard-tabs .nav-link.active,
.wizard-tabs .nav-link.completed {
    position: relative;
    width: auto !important;
    border-radius: 25px!important;
    min-width: 150px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    color: var(--wizard-text) !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-border-radius: 25px!important;
    -moz-border-radius: 25px!important;
    -ms-border-radius: 25px!important;
    -o-border-radius: 25px!important;
}

.wizard-number {
    position: relative;
    z-index: 2;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    color: var(--wizard-muted) !important;
    border: 2px solid var(--wizard-border) !important;
    border-radius: 50% !important;
    background: var(--wizard-panel) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}

.wizard-label {
    position: relative;
    z-index: 2;
    margin-left: 12px;
    padding: 4px 0;
    background: transparent !important;
}

.wizard-label strong {
    color: var(--wizard-title) !important;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
}

.wizard-label small {
    margin-top: 4px;
    color: var(--wizard-muted) !important;
    font-size: 11px;
    line-height: 1.15;
}

.wizard-tabs .nav-link.active .wizard-number {
    color: #ffffff !important;
    border-color: #2563eb !important;
    border-radius: 25px!important;
    background: linear-gradient(135deg, #4f46e5, #2563eb) !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .30) !important;
}

.wizard-tabs .nav-link.completed .wizard-number {
    color: #ffffff !important;
    border-color: #2563eb !important;
    background: linear-gradient(135deg, #4f46e5, #2563eb) !important;
}

.wizard-tabs .nav-link.completed .wizard-number::after {
    content: '✓';
    position: static !important;
    font-size: 18px;
    font-weight: 900;
}

.wizard-tabs .nav-link.completed .wizard-number {
    font-size: 0;
}

.wizard-pane {
    min-height: 450px !important;
    padding: 28px !important;
    overflow: visible !important;
    border: 1px solid var(--wizard-border) !important;
    border-radius: 16px !important;
    background:
        radial-gradient(circle at 100% 0, rgba(37, 99, 235, .06), transparent 28%),
        var(--wizard-panel) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}

.pane-head {
    margin-bottom: 24px !important;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--wizard-border);
}

.pane-head h4 {
    color: var(--wizard-title) !important;
    font-size: 20px !important;
    font-weight: 800 !important;
}

.pane-head p {
    color: var(--wizard-muted) !important;
    font-size: 13px !important;
}

.pane-icon {
    color: #60a5fa !important;
    border: 1px solid rgba(96, 165, 250, .18);
    background: rgba(37, 99, 235, .10) !important;
}

.invoice-form-page .form-control {
    min-height: 54px !important;
    color: var(--wizard-text) !important;
    border-color: var(--wizard-border) !important;
    background: var(--wizard-input) !important;
}

.invoice-form-page .form-control::placeholder {
    color: var(--wizard-muted) !important;
}

.invoice-form-page .form-control:focus {
    border-color: #3b82f6 !important;
    background: var(--wizard-input) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .12) !important;
}

.search-results {
    max-height: 240px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-color: var(--wizard-border) !important;
    background: var(--wizard-panel) !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(148, 163, 184, .55) transparent !important;
}

.search-results::-webkit-scrollbar {
    width: 6px !important;
}

.search-results::-webkit-scrollbar-track {
    background: transparent !important;
}

.search-results::-webkit-scrollbar-thumb {
    border-radius: 20px !important;
    background: rgba(148, 163, 184, .55) !important;
}

.search-item {
    color: var(--wizard-text) !important;
    border-bottom-color: var(--wizard-border) !important;
    background: transparent !important;
}

.search-item strong {
    color: var(--wizard-title) !important;
}

.search-item:hover {
    background: rgba(37, 99, 235, .10) !important;
}

.check-list {
    border: 1px solid var(--wizard-border) !important;
    background: var(--wizard-soft) !important;
}

.check-item {
    border-color: var(--wizard-border) !important;
    background: var(--wizard-panel) !important;
}

.check-item strong {
    color: var(--wizard-title) !important;
}

.check-item small,
.empty,
.review-row span,
.summary span {
    color: var(--wizard-muted) !important;
}

.table-wrap,
.review-panel {
    border-color: var(--wizard-border) !important;
    background: var(--wizard-panel) !important;
}

.ticket-table,
.ticket-table thead,
.ticket-table tbody,
.ticket-table tr,
.ticket-table th,
.ticket-table td {
    background: transparent !important;
}

.ticket-table thead th {
    color: var(--wizard-muted) !important;
    border-color: var(--wizard-border) !important;
    background: var(--wizard-head) !important;
}

.ticket-table tbody td {
    color: var(--wizard-text) !important;
    border-color: var(--wizard-border) !important;
    background: var(--wizard-panel) !important;
}

.ticket-table strong,
.review-row strong,
.summary strong {
    color: var(--wizard-title) !important;
}

.summary {
    border: 1px solid rgba(59, 130, 246, .18) !important;
    background: linear-gradient(135deg, rgba(79, 70, 229, .12), rgba(14, 165, 233, .08)) !important;
}

.actions {
    padding: 20px !important;
    border: 1px solid var(--wizard-border) !important;
    border-radius: 12px;
    background: var(--wizard-soft) !important;
}

.actions .btn-light {
    color: #60a5fa !important;
    border: 1px solid #2563eb !important;
    background: transparent !important;
}

.actions .btn-light:hover {
    color: #ffffff !important;
    background: #2563eb !important;
}

body.dark .wizard-tabs .nav-link,
body.dark-theme .wizard-tabs .nav-link,
body[data-theme="dark"] .wizard-tabs .nav-link,
body[data-bs-theme="dark"] .wizard-tabs .nav-link,
html.dark .wizard-tabs .nav-link,
html.dark-theme .wizard-tabs .nav-link,
html[data-theme="dark"] .wizard-tabs .nav-link,
html[data-bs-theme="dark"] .wizard-tabs .nav-link {
    background: transparent !important;
}

@media (max-width: 1100px) {
    .wizard-tabs .nav-link {
        min-width: 118px;
    }

    .wizard-label {
        margin-left: 8px;
    }
}

@media (max-width: 767px) {
    .wizard-card > .card-body {
        padding: 18px !important;
    }

    .wizard-tabs {
        grid-template-columns: repeat(4, 1fr);
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .wizard-tabs::before {
        right: 8% !important;
        left: 8% !important;
    }

    .wizard-tabs .nav-link {
        min-width: auto !important;
        justify-content: center !important;
    }

    .wizard-label {
        display: none !important;
    }

    .wizard-pane {
        min-height: auto !important;
        padding: 18px !important;
    }

    .pane-head {
        align-items: flex-start !important;
    }

    .actions {
        padding: 14px !important;
    }
}