/* @fontsource */
@import url(../fonts/sora/fonts.css);
@import url(../fonts/inter/index.css);
@import url(../fonts/poppins/fonts.css);

@import url(../libs/wizard/steps.css);
@import url(../libs/flatpickr/dist/flatpickr.min.css);
@import url(../libs/toast-master/css/jquery.toast.css);
@import url(../libs/sweetalert2/dist/sweetalert2.min.css);
@import url(../libs/datatables.net-bs5/datatables.min.css);
@import url(../libs/bootstrap-icons/bootstrap-icons.min.css);
@import url(../libs/flatpickr/dist/plugins/monthSelect/style.css);
@import url(../libs/fontawesome/fontawesome-free/css/all.min.css);

:root {
    --muted: #64748b;
    --brand: #0f172a;
    --accent: #1d4ed8;
    --acc-lt: #eff6ff;
    --border: #e2e8f0;
    --surface: #f8fafc;
    --danger-lt: #fef2f2;
}

/* html {
    font-size: var(--bs-body-font-size);
    font-family: var(--bs-body-font-family);
    font-weight: var(--bs-body-font-weight);
    line-height: var(--bs-body-line-height);
} */

body {
    padding-right: 0;
    font-size: var(--bs-body-font-size) !important;
    font-family: var(--bs-body-font-family) !important;
    font-weight: var(--bs-body-font-weight) !important;
    line-height: var(--bs-body-line-height) !important;
}

body.modal-open {
    padding-right: 0 !important;
    /* Remove padding à direita */
}

/* Start Custom Layout */

div#layout-wrapper * {
    font-size: var(--bs-body-font-size) !important;
}

/*  Ícones de notificação */
.noti-icon i {
    font-size: var(--bs-body-font-size) !important;
}

/* Ícones do topnav */
.topnav .navbar-nav .nav-link i {
    font-size: var(--bs-body-font-size) !important;
}

/* Ícones do menu lateral */
#sidebar-menu ul li a i {
    font-size: var(--bs-body-font-size) !important;
}

/* End Custom Layout */

.readonly-select {
    pointer-events: none;
    touch-action: none;
}

.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    text-decoration: none;
}

/* ===== FORM CONTROL CUSTOMIZAÇÃO ===== */

.form-label {
    color: var(--brand);
    margin-bottom: 0.5rem;
    font-weight: var(--bs-body-font-weight) !important;
}

.form-control,
.form-select {
    border-radius: 8px;
    padding: .375rem .75rem;
    border: 1px solid var(--border);
    font-weight: var(--bs-body-font-weight) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .1);
}

.form-control[readonly],
.form-control:disabled {
    background: #f8fafc;
    color: var(--muted);
    cursor: not-allowed;
}

/* Placeholders customizados */
.form-control::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

button.btn {
    border-radius: 8px;
    padding: .375rem .75rem;
}

button.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

a.btn {
    border-radius: 8px;
    padding: .375rem .75rem;
}

a.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== SELECT2 CUSTOMIZAÇÃO ===== */

.select2 {
    width: 100% !important;
}

/* Select2 no modal - CORREÇÃO DEFINITIVA */
.select2-container {
    z-index: 9999 !important;
}

.select2-dropdown {
    z-index: 9999 !important;
}

.modal-body {
    overflow: visible !important;
}

/* Mantém a customização que você já tinha */
.select2-container .select2-selection {
    border-radius: 8px;
    padding: .375rem .75rem;
    border: 1px solid var(--border);
    min-height: 38px;
    height: auto;
}

.select2-container--open .select2-selection {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .1);
}

/* Container principal */
.select2-container .select2-selection {
    border-radius: 8px;
    padding: .375rem .75rem;
    border: 1px solid var(--border);
    min-height: 38px;
    height: auto;
    background: white;
}

/* Texto selecionado */
.select2-container .select2-selection .select2-selection__rendered {
    padding: 0;
    color: inherit;
    line-height: 1.5;
}

/* Placeholder */
.select2-container .select2-selection .select2-selection__placeholder {
    color: var(--muted);
}

/* Seta */
.select2-container .select2-selection .select2-selection__arrow {
    height: 100%;
    right: 10px;
}

/* Focus */
.select2-container--open .select2-selection {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .1);
}

/* Disabled */
.select2-container--disabled .select2-selection {
    background: #f8fafc;
    color: var(--muted);
    cursor: not-allowed;
}

/* Dropdown */
.select2-dropdown {
    border-radius: 8px;
    border-color: var(--border);
    margin-top: 4px;
}

/* Campo de busca no dropdown */
.select2-dropdown .select2-search__field {
    border-radius: 6px;
    border: 1px solid var(--border);
    padding: .375rem .75rem;
}

.select2-dropdown .select2-search__field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .1);
    outline: none;
}

/* Opções */
.select2-results .select2-results__option {
    padding: 8px 12px;
}

.select2-results .select2-results__option--highlighted {
    background-color: var(--accent);
    color: white;
}

.select2-results .select2-results__option[aria-selected="true"] {
    background-color: rgba(29, 78, 216, .1);
    color: var(--brand);
}

/* Ajuste para selects múltiplos */
.select2-container--multi .select2-selection {
    padding: .3rem .75rem;
}

.select2-container--multi .select2-selection .select2-selection__choice {
    border-radius: 4px;
    background: rgba(29, 78, 216, .1);
    border-color: var(--border);
    padding: 2px 8px;
}

.select2-container--multi .select2-selection .select2-selection__choice__remove {
    color: var(--muted);
    margin-right: 4px;
}

.select2-container--multi .select2-selection .select2-selection__choice__remove:hover {
    color: var(--brand);
    background: none;
}

/* Dashboard Card */
.card-dash-left {
    margin-bottom: 25px;
    border-top-right-radius: 0px !important;
    border-top-left-radius: 35px !important;
    border-bottom-left-radius: 0px !important;
    border-bottom-right-radius: 35px !important;
}

.card-dash-right {
    margin-bottom: 25px;
    border-top-right-radius: 35px !important;
    border-top-left-radius: 0px !important;
    border-bottom-left-radius: 35px !important;
    border-bottom-right-radius: 0px !important;
}

.card-dash-rounded {
    margin-bottom: 25px;
    border-top-right-radius: 50px !important;
    border-top-left-radius: 50px !important;
    border-bottom-left-radius: 50px !important;
    border-bottom-right-radius: 50px !important;
}

.card-dash-user {
    margin-bottom: 25px;
    border-top-right-radius: 20px !important;
    border-top-left-radius: 20px !important;
    border-bottom-left-radius: 20px !important;
    border-bottom-right-radius: 20px !important;
}

.border-top-primary {
    border-top: 0.35rem solid #4e73df !important;
}

.border-left-primary {
    border-left: 0.35rem solid #4e73df !important;
}

.border-right-primary {
    border-right: 0.35rem solid #4e73df !important;
}

.border-bottom-primary {
    border-bottom: 0.35rem solid #4e73df !important;
}

.border-top-secondary {
    border-top: 0.35rem solid #858796 !important;
}

.border-left-secondary {
    border-left: 0.35rem solid #858796 !important;
}

.border-right-secondary {
    border-right: 0.35rem solid #858796 !important;
}

.border-bottom-secondary {
    border-bottom: 0.35rem solid #858796 !important;
}

.border-top-success {
    border-top: 0.35rem solid #1cc88a !important;
}

.border-left-success {
    border-left: 0.35rem solid #1cc88a !important;
}

.border-right-success {
    border-right: 0.35rem solid #1cc88a !important;
}

.border-bottom-success {
    border-bottom: 0.35rem solid #1cc88a !important;
}

.border-top-info {
    border-top: 0.35rem solid #36b9cc !important;
}

.border-left-info {
    border-left: 0.35rem solid #36b9cc !important;
}

.border-right-info {
    border-right: 0.35rem solid #36b9cc !important;
}

.border-bottom-info {
    border-bottom: 0.35rem solid #36b9cc !important;
}

.border-top-warning {
    border-top: 0.35rem solid #f6c23e !important;
}

.border-left-warning {
    border-left: 0.35rem solid #f6c23e !important;
}

.border-right-warning {
    border-right: 0.35rem solid #f6c23e !important;
}

.border-bottom-warning {
    border-bottom: 0.35rem solid #f6c23e !important;
}

.border-top-danger {
    border-top: 0.35rem solid #e74a3b !important;
}

.border-left-danger {
    border-left: 0.35rem solid #e74a3b !important;
}

.border-right-danger {
    border-right: 0.35rem solid #e74a3b !important;
}

.border-bottom-danger {
    border-bottom: 0.35rem solid #e74a3b !important;
}

.border-top-light {
    border-top: 0.35rem solid #f8f9fc !important;
}

.border-left-light {
    border-left: 0.35rem solid #f8f9fc !important;
}

.border-right-light {
    border-right: 0.35rem solid #f8f9fc !important;
}

.border-bottom-light {
    border-bottom: 0.35rem solid #f8f9fc !important;
}

.border-top-dark {
    border-top: 0.35rem solid #5a5c69 !important;
}

.border-left-dark {
    border-left: 0.35rem solid #5a5c69 !important;
}

.border-right-dark {
    border-right: 0.35rem solid #5a5c69 !important;
}

.border-bottom-dark {
    border-bottom: 0.35rem solid #5a5c69 !important;
}

/* Quotation */

.stat-bar {
    display: flex;
    gap: .75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stat-pill {
    flex: 1;
    min-width: 120px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .8rem 1rem;
}

.stat-pill .sl {
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 2px;
}

.stat-pill .sv {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.stat-pill.accent {
    border-color: var(--accent);
    background: var(--acc-lt);
}

.stat-pill.accent .sv {
    color: var(--accent);
}

.fc {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.fc-label {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin-bottom: .9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fc-label i {
    font-size: .85rem;
}

.db-block {
    border-radius: 8px;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
}

.db-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--brand);
    margin-bottom: 2px;
}

.db-meta {
    font-size: .74rem;
    color: var(--muted);
    line-height: 1.7;
}

.db-tag {
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--accent);
    margin-bottom: 6px;
}

/* Products table */
.prod-wrap {
    overflow-x: auto;
}

table.tbl {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

table.tbl thead th {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding: 6px 6px 10px;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
    background: #fff;
}

table.tbl thead th.r {
    text-align: right;
}

table.tbl tbody td {
    padding: 5px 3px;
    vertical-align: middle;
}

table.tbl tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

table.tbl tbody tr:hover {
    background: #fafbfc;
}

.inp-sm {
    font-size: .8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .33rem .5rem;
    width: 100%;
    font-family: var(--bs-body-font-family);
    transition: border-color .15s, box-shadow .15s;
}

.inp-sm:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .1);
}

.inp-sm[readonly] {
    background: #f8fafc;
    color: var(--muted);
    cursor: not-allowed;
}

.inp-sm.r {
    text-align: right;
}

.inp-sm.w-pct {
    width: 68px;
}

.inp-sm.w-qty {
    width: 76px;
}

.cell-total {
    font-size: .8rem;
    font-weight: 600;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
    padding-right: 4px;
}

.btn-del {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
}

.btn-del:hover {
    background: var(--danger-lt);
    color: #ef4444;
    border-color: #fca5a5;
}

.btn-add-row {
    width: 100%;
    margin-top: 10px;
    padding: 9px;
    background: transparent;
    border-radius: 8px;
    color: var(--muted);
    font-size: .78rem;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed var(--border);
    font-family: var(--bs-body-font-family);
    gap: 6px;
}

.btn-add-row:hover {
    background: var(--acc-lt);
    color: var(--accent);
    border-color: var(--accent);
    border-style: solid;
}

/* IVA summary */
table.iva-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

table.iva-tbl thead th {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    border-bottom: 2px solid var(--brand);
    padding: 4px 8px 8px;
}

table.iva-tbl td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
}

table.iva-tbl .taxa {
    font-weight: 700;
    color: var(--brand);
}

table.iva-tbl .num {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Totals */
.totals-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: .82rem;
    border-bottom: 1px solid #f1f5f9;
}

.tl:last-child {
    border-bottom: none;
}

.tl .ll {
    color: var(--muted);
}

.tl .lr {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--brand);
}

.tl.grand {
    border-top: 2px solid var(--brand);
    margin-top: 6px;
    padding-top: 10px;
    border-bottom: none;
}

.tl.grand .ll {
    font-size: .9rem;
    font-weight: 700;
    color: var(--brand);
}

.tl.grand .lr {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.tl.iva-line .lr {
    color: #059669;
}

.tl.disc-line .lr {
    color: #dc2626;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 1.5rem;
    margin-top: 1.5rem;
    align-items: start;
}

@media(max-width:768px) {
    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

.btn-pri {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .6rem 1.4rem;
    font-family: var(--bs-body-font-family);
    font-weight: 600;
    font-size: .82rem;
    cursor: pointer;
    transition: opacity .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-pri:hover {
    opacity: .85;
}

.btn-sec {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .6rem 1.4rem;
    font-family: var(--bs-body-font-family);
    font-weight: 500;
    font-size: .82rem;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sec:hover {
    background: var(--surface);
    border-color: #94a3b8;
}

.badge-isento {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    padding: 2px 6px;
}

.badge-iva {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--acc-lt);
    color: var(--accent);
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 2px 6px;
}

.db-readonly-note {
    font-size: .65rem;
    color: var(--muted);
    font-style: italic;
}