:root {
    --fresh-primary: #2563eb;
    --fresh-primary-soft: rgba(37, 99, 235, .12);
    --fresh-accent: #14b8a6;
    --fresh-surface: #ffffff;
    --fresh-surface-muted: #f8fafc;
    --fresh-border: #e2e8f0;
    --fresh-text: #0f172a;
    --fresh-muted: #64748b;
    --fresh-radius: 18px;
    --fresh-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

html,
body,
.main-body {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 44%, #f7f4ff 100%) !important;
    color: var(--fresh-text);
}

.content,
.wrapper {
    background: transparent !important;
}

.container-fluid > .card,
.card,
.modal-content,
.dropdown-menu,
.table-responsive,
.livewire-table {
    border: 1px solid rgba(226, 232, 240, .9) !important;
    border-radius: var(--fresh-radius) !important;
    box-shadow: var(--fresh-shadow) !important;
}

.card .card-header,
.modal-header {
    border-bottom: 1px solid rgba(226, 232, 240, .75) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, .96) 0%, rgba(248, 250, 252, .92) 100%) !important;
    border-top-left-radius: var(--fresh-radius) !important;
    border-top-right-radius: var(--fresh-radius) !important;
}

.card .card-body,
.modal-body {
    background: rgba(255, 255, 255, .92);
    border-radius: inherit;
}

h1,
.h1,
h2,
.h2,
h3,
.h3,
.card-title {
    letter-spacing: -.02em;
    color: var(--fresh-text) !important;
}

.form-control,
.form-select,
.select2-container--bootstrap-5 .select2-selection,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 44px;
    border: 1px solid var(--fresh-border) !important;
    border-radius: 14px !important;
    background-color: var(--fresh-surface-muted) !important;
    box-shadow: none !important;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.form-control:focus,
.form-select:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--fresh-primary) !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 .22rem var(--fresh-primary-soft) !important;
}

.form-label {
    color: #334155 !important;
    font-weight: 600 !important;
}

.btn {
    border-radius: 14px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.btn-primary,
.btn-outline-primary:hover,
.btn-active-primary.active,
.btn-active-primary:hover {
    border-color: var(--fresh-primary) !important;
    background: linear-gradient(135deg, var(--fresh-primary) 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
}

.btn-secondary,
.btn-light,
.btn-active-light-primary {
    border-color: var(--fresh-border) !important;
    background: #ffffff !important;
    color: #334155 !important;
}

.aside,
.sidebar,
#kt_aside,
.menu,
.header,
.navbar,
.app-sidebar {
    backdrop-filter: blur(16px);
}

.aside,
#kt_aside,
.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%) !important;
    box-shadow: 12px 0 32px rgba(15, 23, 42, .12) !important;
}

.menu .menu-link,
.aside .nav-link,
.sidebar .nav-link {
    border-radius: 14px !important;
    margin: 2px 10px !important;
}

.menu .menu-link.active,
.menu .menu-link:hover,
.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: rgba(37, 99, 235, .18) !important;
}

.table {
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
}

.table thead th {
    color: var(--fresh-muted) !important;
    font-size: 12px !important;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 0 !important;
}

.table tbody tr {
    background: #ffffff !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.table tbody td {
    border-top: 1px solid rgba(226, 232, 240, .65) !important;
    border-bottom: 1px solid rgba(226, 232, 240, .65) !important;
    vertical-align: middle !important;
}

.badge {
    border-radius: 999px !important;
    padding: .45rem .72rem !important;
}

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

.image-picker .image,
.symbol img,
.avatar img {
    border-radius: 18px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

body.dark-mode,
.dark-mode .main-body,
[data-bs-theme="dark"] body,
[data-theme="dark"] body {
    background: linear-gradient(135deg, #020617 0%, #0f172a 58%, #111827 100%) !important;
    color: #e5e7eb !important;
}

body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode .dropdown-menu,
[data-bs-theme="dark"] .card,
[data-theme="dark"] .card {
    border-color: rgba(51, 65, 85, .9) !important;
    background: rgba(15, 23, 42, .92) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .22) !important;
}

@media (max-width: 991.98px) {
    .card,
    .modal-content,
    .table-responsive {
        border-radius: 16px !important;
    }

    .content {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }
}

/* Invoiceku responsive invoice form revision - 2026-06-20 */
.invoice-form-card {
    overflow: hidden;
    border-radius: 22px !important;
}

.invoice-form-card > .card-body {
    padding: 28px !important;
}

.invoice-responsive-form .form-label {
    font-size: 13px;
    margin-bottom: 8px !important;
}

.invoice-responsive-form .form-control,
.invoice-responsive-form .form-select,
.invoice-responsive-form .select2-container .select2-selection {
    min-height: 48px;
    font-size: 14px;
}

.invoice-responsive-form #addItem {
    min-width: 130px;
    padding: 12px 20px;
}

.invoice-items-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 8px;
    background: rgba(255, 255, 255, .72);
    border-radius: 20px !important;
    -webkit-overflow-scrolling: touch;
}

.invoice-items-table {
    min-width: 1040px;
    margin-bottom: 0 !important;
    table-layout: fixed;
}

.invoice-items-table th,
.invoice-items-table td {
    padding: 12px 10px !important;
}

.invoice-items-table .invoice-col-no,
.invoice-items-table .item-number {
    width: 54px;
}

.invoice-items-table .invoice-col-product,
.invoice-items-table .invoice-product-cell {
    width: 30%;
    min-width: 260px;
}

.invoice-items-table .invoice-col-qty,
.invoice-items-table .invoice-qty-cell {
    width: 150px;
    min-width: 150px;
}

.invoice-items-table .invoice-col-price,
.invoice-items-table .invoice-price-cell {
    width: 170px;
    min-width: 170px;
}

.invoice-items-table .invoice-col-tax,
.invoice-items-table .invoice-tax-cell {
    width: 220px;
    min-width: 220px;
}

.invoice-items-table .invoice-col-amount,
.invoice-items-table .invoice-amount-cell {
    width: 150px;
    min-width: 150px;
}

.invoice-items-table .invoice-col-action,
.invoice-items-table .invoice-action-cell {
    width: 90px;
    min-width: 90px;
}

.invoice-items-table .invoice-qty-input,
.invoice-items-table .invoice-price-input,
.invoice-items-table .qty,
.invoice-items-table .price-input {
    width: 100% !important;
    min-width: 118px;
    height: 48px;
    padding-left: 14px !important;
    padding-right: 14px !important;
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    font-weight: 700;
}

.invoice-items-table .invoice-qty-input,
.invoice-items-table .qty {
    text-align: center;
    font-size: 16px;
    letter-spacing: .02em;
}

.invoice-items-table input[type="number"]::-webkit-outer-spin-button,
.invoice-items-table input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
}

.invoice-items-table .select2-container,
.invoice-responsive-form .select2-container {
    width: 100% !important;
}

.invoice-bottom-panel {
    margin-top: 22px;
}

.invoice-discount-panel .float-right,
.invoice-discount-panel .col-xl-5,
.invoice-discount-panel .col-lg-8 {
    float: none !important;
    width: 100% !important;
    max-width: 520px;
    margin-left: auto;
}

.invoice-summary-panel {
    min-width: 300px;
}

.invoice-summary-box {
    border: 1px solid rgba(226, 232, 240, .9) !important;
    border-radius: 18px;
    padding: 12px 18px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.invoice-summary-box table td {
    font-size: 14px;
}

.invoice-summary-box #finalAmount,
.invoice-summary-box #total,
.invoice-summary-box #discountAmount,
.invoice-summary-box #totalTax {
    font-weight: 700;
}

.invoice-submit-actions {
    width: 100%;
    margin-top: 18px;
}

.invoice-submit-actions .form-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.invoice-submit-actions .btn {
    min-height: 46px;
    margin: 0 !important;
}

@media (max-width: 1199.98px) {
    .invoice-form-card > .card-body {
        padding: 22px !important;
    }

    .invoice-items-table {
        min-width: 980px;
    }
}

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

    .invoice-items-table-wrap {
        padding: 6px;
    }

    .invoice-discount-panel .float-right,
    .invoice-discount-panel .col-xl-5,
    .invoice-discount-panel .col-lg-8 {
        max-width: 100%;
        margin-left: 0;
    }

    .invoice-summary-panel {
        min-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .invoice-form-card > .card-body {
        padding: 16px !important;
    }

    .invoice-responsive-form .row > [class*="col-"] {
        margin-bottom: 14px !important;
    }

    .invoice-responsive-form #addItem {
        width: 100%;
        justify-content: center;
        text-align: center !important;
    }

    .invoice-items-table-wrap {
        overflow: visible;
        padding: 0;
        background: transparent;
        border: 0 !important;
        box-shadow: none !important;
    }

    .invoice-items-table,
    .invoice-items-table thead,
    .invoice-items-table tbody,
    .invoice-items-table th,
    .invoice-items-table td,
    .invoice-items-table tr {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
    }

    .invoice-items-table {
        min-width: 0;
        border-spacing: 0 !important;
    }

    .invoice-items-table thead {
        display: none;
    }

    .invoice-items-table tbody tr.tax-tr {
        margin-bottom: 16px;
        padding: 16px;
        border: 1px solid rgba(226, 232, 240, .95) !important;
        border-radius: 18px;
        background: #ffffff !important;
        box-shadow: 0 14px 34px rgba(15, 23, 42, .08) !important;
    }

    .invoice-items-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 9px 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .invoice-items-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 96px;
        max-width: 96px;
        color: #64748b;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .invoice-items-table tbody td > * {
        flex: 1 1 auto;
        min-width: 0;
    }

    .invoice-items-table .item-number {
        justify-content: flex-start;
        color: #2563eb;
        font-weight: 800;
        font-size: 16px;
    }

    .invoice-items-table .invoice-qty-input,
    .invoice-items-table .qty {
        min-width: 0;
        text-align: left;
        font-size: 16px;
    }

    .invoice-items-table .invoice-amount-cell {
        font-size: 16px;
        font-weight: 800;
        color: #0f172a;
    }

    .invoice-items-table .invoice-action-cell {
        justify-content: flex-end;
        padding-top: 14px !important;
    }

    .invoice-items-table .invoice-action-cell::before {
        display: none;
    }

    .invoice-submit-actions .form-group {
        justify-content: stretch;
    }

    .invoice-submit-actions .btn,
    .invoice-submit-actions a.btn {
        width: 100%;
    }

    .invoice-summary-box {
        padding: 12px 14px;
    }
}

@media (max-width: 575.98px) {
    .content {
        padding-left: .5rem !important;
        padding-right: .5rem !important;
    }

    .invoice-responsive-form .form-control,
    .invoice-responsive-form .form-select,
    .invoice-responsive-form .select2-container .select2-selection {
        min-height: 46px;
        font-size: 13px;
    }

    .invoice-items-table tbody td {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .invoice-items-table tbody td::before {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .invoice-items-table tbody td > * {
        width: 100% !important;
    }

    .invoice-items-table .invoice-action-cell {
        align-items: stretch;
    }
}
