:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0b1220;
    --sidebar-hover: #151e32;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f8fafc;
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.14);
    --page-bg: #f4f6f9;
    --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --topbar-height: 68px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--page-bg);
    color: #1e293b;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.9rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.65rem 1.25rem;
    color: #fff;
    text-decoration: none;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.1;
}

.brand-tag {
    font-size: 0.75rem;
    color: #94a3b8;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link,
.sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    font-weight: 500;
    text-align: left;
}

.sidebar-link:hover,
.sidebar-toggle:hover,
.sidebar-link.active {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-link.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-link i,
.sidebar-toggle i {
    width: 1.15rem;
    text-align: center;
}

.submenu {
    padding: 0.15rem 0 0.45rem 0.4rem;
}

.submenu .sidebar-link {
    padding-left: 2.35rem;
    font-size: 0.95rem;
}

.submenu .sidebar-toggle {
    padding-left: 2.35rem;
    font-size: 0.95rem;
}

.submenu-nested {
    padding-left: 0.75rem;
}

.submenu-nested .sidebar-link {
    padding-left: 2.75rem;
    font-size: 0.9rem;
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-content {
    padding: 1.5rem;
}

.page-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: #64748b;
}

.content-card {
    background: #fff;
    border: 0;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.black-color {
    background-color: #212529;
}

.black-color i {
    font-size: 54px;
    margin-right: 0;
    flex-shrink: 0;
}

.company-name {
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(52vw, 560px);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.table-dark th {
    background-color: #212529;
    color: #fff;
    border-color: #373b3e;
}

.grid-row {
    cursor: pointer;
}

tr.conta-vencida,
tr.conta-vencida > td {
    color: #dc3545 !important;
    font-weight: 700;
}

tr.conta-vencendo,
tr.conta-vencendo > td {
    color: #d4a017 !important;
    font-weight: 700;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.toUppercase {
    text-transform: uppercase;
}

.pagination {
    --bs-pagination-color: #2780e3;
    --bs-pagination-hover-color: #1967b3;
    --bs-pagination-active-bg: #2780e3;
    --bs-pagination-active-border-color: #2780e3;
    margin-top: 1rem;
    margin-bottom: 0;
}

.sidebar-backdrop {
    display: none;
}

.menu-toggle {
    display: none;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .sidebar-backdrop.is-visible {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1035;
    }
}

.app-spinner-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    background-color: rgba(51, 51, 51, 0.8);
}

.app-spinner-overlay.is-visible {
    display: block;
}

.app-spinner-overlay > .la-ball-scale-multiple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
}

.app-spinner-text {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -60%);
    margin: 0;
    font-size: 20px;
    color: #fff;
}

.la-ball-scale-multiple {
    display: block;
    font-size: 0;
    width: 32px;
    height: 32px;
}

.la-ball-scale-multiple.la-2x {
    width: 64px;
    height: 64px;
}

.la-ball-scale-multiple > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border-radius: 100%;
    background-color: currentColor;
    opacity: 0;
    animation: ball-scale-multiple 1s 0s linear infinite;
}

.la-ball-scale-multiple.la-2x > div {
    width: 64px;
    height: 64px;
}

.la-ball-scale-multiple > div:nth-child(2) {
    animation-delay: 0.2s;
}

.la-ball-scale-multiple > div:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ball-scale-multiple {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    5% {
        opacity: 0.75;
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eceff3;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #f8f9fa;
}

.auth-card h3 {
    font-weight: 700;
    color: #334155;
}

.auth-card .btn-primary {
    padding: 0.6rem 1rem;
}

.stat-card {
    background: #fff;
    border: 2px solid #2780e3;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    height: 100%;
    text-align: right;
}

.stat-card-total {
    border-color: #2780e3;
    background: linear-gradient(180deg, #eef5ff 0%, #ffffff 72%);
}

.stat-card-estoque {
    border-color: #0d9488;
    background: linear-gradient(180deg, #e6fffb 0%, #ffffff 72%);
}

.stat-card-alugado {
    border-color: #16a34a;
    background: linear-gradient(180deg, #ecfdf3 0%, #ffffff 72%);
}

.stat-card-selecionado {
    border-color: #16a34a;
    background: linear-gradient(180deg, #ecfdf3 0%, #ffffff 72%);
}

.stat-card-selecionado .stat-icon {
    color: #16a34a;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
    color: #475569;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 1.25rem;
    color: #2780e3;
}

.stat-card-estoque .stat-icon {
    color: #0d9488;
}

.stat-card-alugado .stat-icon {
    color: #16a34a;
}

.stat-card-disponivel .stat-icon {
    color: #d97706;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

.produto-disponibilidade-titulo {
    margin: 1.75rem 0 1.15rem;
    padding: 0.35rem 0 0.15rem;
}

.produto-disponibilidade-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #2780e3;
    margin-bottom: 0.2rem;
}

.produto-disponibilidade-titulo h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: #0f172a;
}

.flatpickr-calendar {
    z-index: 20050 !important;
}

.input-group-text[data-toggle] {
    cursor: pointer;
    background: #fff;
}

.aluguel-form input[type=number]::-webkit-inner-spin-button,
.aluguel-form input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.aluguel-form input[type=number] {
    -moz-appearance: textfield;
}

.aluguel-form input[readonly] {
    background-color: transparent !important;
}

#modalNovoLocalEvento,
#modalPesquisarCidade {
    z-index: 1070;
}

.aluguel-form .aluguel-tabs-bar {
    border-bottom: 1px solid #dee2e6;
}

.aluguel-form .aluguel-tabs-bar .nav-tabs.nav-primary {
    border-bottom: 0;
}

.aluguel-form .aluguel-tabs-bar .btn-add {
    flex-shrink: 0;
    margin-bottom: 0.35rem;
}

.aluguel-form .nav-tabs.nav-primary {
    border-bottom: 1px solid #dee2e6;
}

.aluguel-form .nav-tabs.nav-primary .nav-link {
    color: #334155;
    font-weight: 600;
}

.aluguel-form .nav-tabs.nav-primary .nav-link.active {
    color: #2780e3;
    border-color: #dee2e6 #dee2e6 #fff;
}

.aluguel-form .table-produtos thead th {
    font-weight: 400;
}

.aluguel-form .table-produtos td {
    vertical-align: middle;
}

.aluguel-form .total-produtos-label {
    font-size: 0.95rem;
    font-weight: 400;
    color: #334155;
}

.aluguel-form .total-produtos-label .total_prod {
    font-weight: 400;
}

.aluguel-form .select2-container {
    width: 100% !important;
}

.aluguel-form .select2-container .select2-selection.is-invalid,
.aluguel-form .select2-container--bootstrap-5 .select2-selection.is-invalid {
    border-color: #dc3545;
}

.select2-container {
    width: 100% !important;
    z-index: 1200;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
    width: 100% !important;
}

#formFiltroAluguel .select2-container,
#modalPesquisarDisponibilidade .select2-container {
    width: 100% !important;
}

#modalPesquisarDisponibilidade .modal-body {
    overflow: visible;
}

.aluguel-form .d-cliente .form-control:disabled,
.aluguel-form .d-cliente .form-select:disabled {
    background-color: #f1f5f9;
    color: #334155;
    opacity: 1;
    cursor: not-allowed;
}

.aluguel-form .d-cliente .select2-container--disabled .select2-selection {
    background-color: #f1f5f9 !important;
    cursor: not-allowed;
    opacity: 1;
}

.swal-modal {
    border-radius: 16px;
    padding: 0.35rem 0.5rem 1rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.swal-title {
    color: #0f172a !important;
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem !important;
}

.swal-icon--warning {
    border-color: #dc3545 !important;
}

.swal-icon--warning__body,
.swal-icon--warning__dot {
    background-color: #dc3545 !important;
}

.swal-msg {
    text-align: center;
}

.swal-msg-text {
    margin: 0;
    color: #1e293b;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.5;
}

.swal-msg-detail {
    margin: 0.9rem 0 0;
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.5;
}

.swal-msg-detail strong {
    color: #1d6fd1;
    font-size: 1.28rem;
    font-weight: 800;
    margin-left: 0.4rem;
}

.swal-button.swal-ok-btn {
    background: #1d6fd1 !important;
    color: #fff !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    border-radius: 10px !important;
    padding: 0.62rem 1.85rem !important;
    box-shadow: 0 8px 18px rgba(29, 111, 209, 0.38);
}

.swal-button.swal-ok-btn:hover,
.swal-button.swal-ok-btn:focus {
    background: #155db8 !important;
}

.swal-button.swal-btn-cancel {
    background: #dc3545 !important;
    color: #fff !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    padding: 0.62rem 1.5rem !important;
    box-shadow: 0 8px 18px rgba(220, 53, 69, 0.32);
}

.swal-button.swal-btn-cancel:hover {
    background: #bb2d3b !important;
}

.swal-button.swal-btn-confirm {
    background: #198754 !important;
    color: #fff !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    padding: 0.62rem 1.85rem !important;
    box-shadow: 0 8px 18px rgba(25, 135, 84, 0.32);
}

.swal-button.swal-btn-confirm:hover {
    background: #157347 !important;
}

.dash-kpi-row > [class*="col-"] {
    display: flex;
}

.dash-kpi {
    width: 100%;
    min-height: 110px;
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
}

.dash-kpi::after {
    content: "";
    position: absolute;
    inset: auto -20% -45% auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.dash-kpi-body {
    min-width: 0;
    flex: 1;
    z-index: 1;
}

.dash-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.95;
    line-height: 1.25;
    margin-bottom: 0.65rem;
}

.dash-kpi-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.dash-kpi-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
    z-index: 1;
    transform: rotate(45deg);
}

.dash-kpi-icon i {
    transform: rotate(-45deg);
    font-size: 1.05rem;
}

.dash-kpi-receber {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}

.dash-kpi-pagar {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.dash-kpi-produtos {
    background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
}

.dash-kpi-clientes {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
}

.dash-kpi-alugueis {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
}

@media (min-width: 1200px) {
    .dash-kpi-row > .col-xl {
        flex: 1 1 0;
        max-width: 20%;
    }
}

