:root {
    --ink: #172033;
    --muted: #667085;
    --line: #d6e1ef;
    --brand: #0f9f8f;
    --brand-2: #2f6df6;
    --accent: #f97316;
    --pink: #d946ef;
    --sun: #facc15;
    --violet: #7c3aed;
    --rose: #e11d48;
    --panel: #ffffff;
    --bg: #eef5ff;
}

body {
    background:
        linear-gradient(115deg, rgba(47, 109, 246, .13), transparent 34%),
        linear-gradient(245deg, rgba(249, 115, 22, .13), transparent 35%),
        linear-gradient(180deg, #fbfdff 0%, #eef5ff 50%, #fff6fb 100%);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(47, 109, 246, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 159, 143, .055) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.85), transparent 78%);
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(125deg, rgba(15, 159, 143, .22), transparent 36%),
        linear-gradient(235deg, rgba(217, 70, 239, .18), transparent 32%),
        linear-gradient(135deg, #f8fbff, #ecfeff 45%, #fff7ed);
}

.login-card {
    width: min(100%, 430px);
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, rgba(15, 159, 143, .55), rgba(47, 109, 246, .45), rgba(249, 115, 22, .44)) border-box;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 24px 80px rgba(20, 33, 61, .18);
    backdrop-filter: blur(14px);
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 270px;
    min-height: 100vh;
    background:
        linear-gradient(160deg, rgba(15, 23, 42, .98) 0%, rgba(24, 36, 72, .98) 46%, rgba(11, 30, 46, .98) 100%),
        linear-gradient(135deg, var(--brand), var(--brand-2), var(--accent));
    color: #fff;
    padding: 22px;
    flex-direction: column;
    position: sticky;
    top: 0;
    box-shadow: 18px 0 45px rgba(15, 23, 42, .18);
    overflow: hidden;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(15, 159, 143, .18), transparent 42%),
        linear-gradient(315deg, rgba(249, 115, 22, .16), transparent 38%);
    pointer-events: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.brand span {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2) 48%, var(--pink) 72%, var(--accent));
    font-weight: 800;
    box-shadow: 0 12px 26px rgba(47, 109, 246, .32);
}

.brand strong {
    letter-spacing: .2px;
}

.brand.compact {
    margin-bottom: 0;
    color: var(--ink);
}

.side-nav {
    display: grid;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.side-link {
    color: rgba(255,255,255,.78);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.side-link i {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255,255,255,.10);
}

.offcanvas .side-link {
    color: var(--ink);
}

.side-link:hover,
.side-link.active {
    background: linear-gradient(135deg, rgba(15, 159, 143, .36), rgba(47, 109, 246, .32), rgba(249, 115, 22, .22));
    border-color: rgba(255,255,255,.16);
    color: #fff;
    transform: translateX(3px);
    box-shadow: inset 3px 0 0 var(--sun);
}

.offcanvas .side-link:hover,
.offcanvas .side-link.active {
    background: #eef2ff;
    color: var(--brand-2);
}

.main-panel {
    flex: 1;
    min-width: 0;
}

.topbar {
    min-height: 88px;
    padding: 18px 26px;
    background:
        linear-gradient(90deg, rgba(255,255,255,.90), rgba(255,255,255,.72)),
        linear-gradient(135deg, rgba(15, 159, 143, .08), rgba(217, 70, 239, .07));
    border-bottom: 1px solid rgba(221, 229, 240, .84);
    display: flex;
    gap: 16px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 34px rgba(15, 23, 42, .06);
}

.topbar::after {
    content: "";
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--pink), var(--accent));
    opacity: .72;
}

.page-title {
    margin: 0;
    font-size: clamp(22px, 3vw, 32px);
    letter-spacing: 0;
    font-weight: 800;
    background: linear-gradient(90deg, var(--ink), var(--brand-2), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.content-wrap {
    padding: 26px;
}

.stat-card,
.data-panel {
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, rgba(15, 159, 143, .24), rgba(47, 109, 246, .18), rgba(249, 115, 22, .20)) border-box;
    border: 1px solid transparent;
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(21, 32, 56, .10);
    backdrop-filter: blur(12px);
}

.data-panel {
    position: relative;
}

.data-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--pink), var(--accent));
    opacity: .88;
}

.stat-card {
    padding: 22px;
    overflow: hidden;
    position: relative;
    transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -26px -30px auto;
    width: 96px;
    height: 96px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 159, 143, .18), rgba(217, 70, 239, .14), rgba(249, 115, 22, .16));
    transform: rotate(18deg);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 60px rgba(21, 32, 56, .14);
}

.stat-card i {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2) 52%, var(--pink) 72%, var(--accent));
    box-shadow: 0 14px 28px rgba(47, 109, 246, .25);
}

.data-panel {
    padding: 18px;
}

.data-panel h5 {
    font-weight: 800;
    color: #1f2a44;
}

.table {
    vertical-align: middle;
}

.table-search-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.table-search-box {
    width: min(100%, 360px);
}

.table-search-box .input-group-text {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border: 0;
    color: #fff;
}

.table thead th {
    background: linear-gradient(180deg, #f7faff, #eef5ff);
    color: #344054;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    text-transform: uppercase;
}

.table tbody tr {
    transition: background .18s ease, transform .18s ease;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(15, 159, 143, .06), rgba(47, 109, 246, .05), rgba(249, 115, 22, .04));
}

.badge-soft {
    background: linear-gradient(135deg, #dcfce7, #ccfbf1, #e0f2fe);
    color: #047857;
    border: 1px solid rgba(4, 120, 87, .12);
}

.btn {
    border-radius: 8px;
    font-weight: 700;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2) 55%, var(--violet));
    border: 0;
    box-shadow: 0 12px 24px rgba(47, 109, 246, .20);
}

.btn-primary:hover {
    filter: brightness(.96);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, var(--brand), var(--brand-2));
    border: 0;
    box-shadow: 0 12px 24px rgba(22, 163, 74, .20);
}

.btn-outline-primary {
    border-color: rgba(47, 109, 246, .42);
    color: var(--brand-2);
}

.btn-outline-primary:hover {
    background: var(--brand-2);
    border-color: var(--brand-2);
}

.form-control,
.form-select,
.select2-container--default .select2-selection--single {
    border-color: #d8e2ee;
    border-radius: 8px;
    min-height: 42px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
    background-color: rgba(255, 255, 255, .94);
}

.form-control:focus,
.form-select:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
    border-color: var(--brand-2);
    box-shadow: 0 0 0 .22rem rgba(47, 109, 246, .14);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.select2-dropdown {
    border-color: #d8e2ee;
    border-radius: 8px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .14);
}

.alert {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.ticket-complaint-cell {
    min-width: 220px;
    max-width: 360px;
}

.ticket-status-form {
    display: grid;
    gap: 6px;
    min-width: 170px;
}

@media (max-width: 767px) {
    .content-wrap,
    .topbar {
        padding: 16px;
    }

    .login-card {
        padding: 22px;
    }
}

.document-page {
    max-width: 1128px;
    margin: 0 auto;
}

.document-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.invoice-sheet {
    background: #fff;
    border: 0;
    border-radius: 0;
    padding: 36px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, .10);
    color: #202124;
    font-size: 13px;
    line-height: 1.28;
}

.invoice-head,
.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 285px;
    gap: 24px;
}

.invoice-head {
    border-bottom: 3px solid #e1e5ea;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.invoice-company {
    display: block;
}

.invoice-logo-img {
    width: 255px;
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 6px;
}

.invoice-brand {
    font-size: 17px;
    font-weight: 800;
    color: #24262b;
    line-height: 1.2;
    margin-bottom: 4px;
}

.invoice-head p,
.invoice-parties p,
.invoice-footer p,
.renewal-box p,
.account-box p,
.terms-box p {
    margin: 0 0 3px;
    color: #202124;
}

.invoice-meta {
    text-align: right;
    padding-top: 10px;
}

.invoice-meta h2 {
    letter-spacing: 0;
    font-weight: 800;
    color: #2154d8;
    font-size: 32px;
    line-height: 1;
    margin: 0 0 7px;
    word-break: break-word;
}

.invoice-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 800;
    letter-spacing: .08em;
    font-size: 12px;
}

.invoice-parties {
    margin-bottom: 8px;
    align-items: start;
}

.single-party {
    display: block;
}

.party-box {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    min-height: 0;
}

.party-box h5 {
    margin: 4px 0 3px;
    font-size: 14px;
    font-weight: 800;
}

.invoice-parties span,
.renewal-box h6,
.account-box h6,
.terms-box h6 {
    text-transform: none;
    font-size: 14px;
    color: #202124;
    letter-spacing: 0;
    font-weight: 800;
    margin-bottom: 5px;
}

.invoice-parties span {
    display: block;
    text-transform: none;
}

.invoice-items {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 6px 0 8px;
    border: 1px solid #cbd2dc;
    border-radius: 0;
    overflow: hidden;
}

.invoice-items th {
    background: #f3f4f6;
    color: #202124;
    padding: 7px 8px;
    font-weight: 800;
    border-bottom: 1px solid #cbd2dc;
}

.invoice-items td {
    border-bottom: 1px solid #cbd2dc;
    border-right: 1px solid #cbd2dc;
    padding: 7px 8px;
}

.invoice-items tbody tr:last-child td {
    border-bottom: 0;
}

.invoice-items th:not(:last-child) {
    border-right: 1px solid #cbd2dc;
}

.invoice-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 10px;
    align-items: start;
}

.invoice-detail-left,
.invoice-detail-right {
    display: grid;
    gap: 12px;
}

.invoice-total {
    width: 100%;
    border: 1px solid #cbd2dc;
    border-radius: 0;
    overflow: hidden;
}

.invoice-total div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 7px 8px;
    border-bottom: 1px solid #cbd2dc;
    background: #fff;
}

.invoice-total div:last-child {
    border-bottom: 0;
}

.invoice-total .accent-row {
    color: #1d4ed8;
    font-weight: 800;
    font-size: 14px;
}

.renewal-box,
.account-box,
.payment-breakup-box,
.support-policy-box,
.terms-box {
    border: 0;
    padding: 0;
    margin-top: 0;
}

.account-box {
    display: grid;
    grid-template-columns: 1fr 96px;
    align-items: center;
    gap: 12px;
}

.account-box img {
    width: 92px;
    height: auto;
    justify-self: end;
    border: 0;
    background: #fff;
    display: block;
}

.terms-box p {
    white-space: normal;
}

.renewal-box,
.payment-breakup-box,
.account-box,
.terms-box {
    border-top: 1px solid #e1e5ea;
    padding-top: 9px;
}

.invoice-detail-left .renewal-box,
.invoice-detail-right .invoice-total + .account-box {
    border-top: 0;
    padding-top: 0;
}

.renewal-box h6,
.payment-breakup-box h6,
.account-box h6,
.terms-box h6 {
    color: #111827;
}

.payment-breakup-box h6 {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 5px;
}

.payment-breakup-table {
    width: 100%;
    border-collapse: collapse;
}

.payment-breakup-table th,
.payment-breakup-table td {
    border: 1px solid #cbd2dc;
    padding: 6px 7px;
}

.payment-breakup-table th {
    background: #f3f4f6;
}

.payment-breakup-table tfoot th {
    color: #198754;
}

.receipt-action-col {
    width: 130px;
    text-align: center;
}

.support-policy-box {
    padding: 0;
}

.support-policy-box img {
    display: block;
    width: 100%;
    height: 235px;
    object-fit: contain;
}

.support-instruction-box img {
    display: block;
    width: 100%;
    height: 390px;
    object-fit: contain;
    object-position: left top;
}

.support-policy-top {
    align-self: start;
}

.support-policy-top img {
    height: 178px;
    object-fit: contain;
    object-position: right top;
}

.invoice-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 54px;
}

.invoice-signatures div {
    border-top: 1px solid #101828;
    padding-top: 10px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.invoice-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e1e5ea;
    text-align: center;
}

.tech-closed-notice {
    margin: 8px 0 0;
    color: #dc2626;
    font-weight: 800;
    text-align: center;
}

.invoice-footer p {
    font-size: 13px;
    margin-bottom: 3px;
}

.invoice-footer span {
    color: #667085;
}

.receipt-sheet {
    background: #fff;
    border: 0;
    border-radius: 0;
    padding: 56px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, .10);
    color: #202124;
    font-size: 15px;
    line-height: 1.35;
}

.receipt-head {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 36px;
    border-bottom: 3px solid #e1e5ea;
    padding-bottom: 18px;
    margin-bottom: 26px;
}

.receipt-logo-img {
    width: 220px;
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 14px;
}

.receipt-brand {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
}

.receipt-head p,
.receipt-box p,
.receipt-footer p {
    margin: 0 0 7px;
}

.receipt-meta {
    text-align: right;
    padding-top: 24px;
}

.receipt-meta h2 {
    color: #1f6ff2;
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    margin: 0 0 16px;
}

.receipt-box {
    border: 1px solid #cbd2dc;
    padding: 20px;
    margin-bottom: 20px;
}

.receipt-box h6 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 16px;
}

.receipt-box h5 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
}

.receipt-items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.receipt-items th,
.receipt-items td {
    border: 1px solid #cbd2dc;
    padding: 14px;
}

.receipt-items th {
    background: #f3f4f6;
    font-size: 16px;
}

.amount-box span {
    color: #198754;
    font-size: 28px;
    font-weight: 800;
}

.receipt-footer {
    border-top: 1px solid #e1e5ea;
    margin-top: 32px;
    padding-top: 22px;
    text-align: center;
    font-size: 16px;
}

.receipt-footer span {
    color: #667085;
}

@media (max-width: 767px) {
    .invoice-sheet {
        padding: 18px;
        font-size: 12px;
    }

    .invoice-head,
    .invoice-parties,
    .invoice-detail-grid,
    .account-box {
        grid-template-columns: 1fr;
    }

    .invoice-meta {
        text-align: left;
        padding-top: 0;
    }

    .invoice-meta h2 {
        font-size: 26px;
    }

    .invoice-signatures {
        grid-template-columns: 1fr;
    }

    .account-box img {
        justify-self: start;
    }

    .receipt-sheet {
        padding: 22px;
        font-size: 13px;
    }

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

    .receipt-meta {
        text-align: left;
        padding-top: 0;
    }

    .receipt-meta h2 {
        font-size: 30px;
    }

    .support-policy-box img {
        max-height: none;
    }

    .support-instruction-box img {
        height: auto;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .document-toolbar,
    .alert {
        display: none !important;
    }

    .app-shell,
    .main-panel,
    .content-wrap {
        display: block;
        padding: 0;
        margin: 0;
    }

    .invoice-sheet,
    .receipt-sheet {
        border: 0;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        width: 100%;
        font-size: 12px;
    }

    .invoice-status,
    .party-box,
    .invoice-items th,
    .payment-breakup-table th,
    .invoice-total .accent-row,
    .receipt-items th {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .receipt-action-col {
        display: none;
    }
}

.pdf-exporting .receipt-action-col {
    display: none;
}
