:root {
    --cp-bg: #f4f6fb;
    --cp-surface: #ffffff;
    --cp-surface-soft: #f8fafc;
    --cp-border: #dde5ee;
    --cp-text: #172033;
    --cp-muted: #657289;
    --cp-primary: #0f766e;
    --cp-primary-dark: #115e59;
    --cp-accent: #2563eb;
    --cp-danger: #dc2626;
    --cp-warning: #d97706;
    --cp-radius: 8px;
    --cp-shadow: 0 12px 32px rgba(23, 32, 51, .08);
    --cp-shadow-soft: 0 6px 18px rgba(23, 32, 51, .06);
}

body.theme-dark {
    --cp-bg: #0f172a;
    --cp-surface: #1e293b;
    --cp-surface-soft: #162033;
    --cp-border: #2c3c56;
    --cp-text: #f8fafc;
    --cp-muted: #94a3b8;
    --cp-primary: #2dd4bf;
    --cp-primary-dark: #5eead4;
    --cp-accent: #60a5fa;
    --cp-shadow: 0 18px 38px rgba(0, 0, 0, .34);
    --cp-shadow-soft: 0 10px 22px rgba(0, 0, 0, .24);
    color-scheme: dark;
}

html,
body {
    background: var(--cp-bg);
    color: var(--cp-text);
}

body.theme-dark,
body.theme-dark.cp-shell {
    background: var(--cp-bg) !important;
    color: var(--cp-text);
}

body.cp-shell {
    min-height: 100vh;
    font-size: 14px;
}

.cp-shell .page {
    background:
        linear-gradient(180deg, rgba(15, 118, 110, .08) 0, rgba(15, 118, 110, 0) 260px),
        var(--cp-bg);
}

.cp-shell .container-xl {
    max-width: 1440px;
}

.cp-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid rgba(221, 229, 238, .9);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(160%) blur(12px);
    box-shadow: 0 1px 0 rgba(23, 32, 51, .03);
}

body.theme-dark .cp-topbar {
    border-bottom-color: rgba(44, 60, 86, .95);
    background: rgba(15, 23, 42, .96);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .04);
}

.cp-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    color: var(--cp-text);
    text-decoration: none;
}

.cp-brand:hover {
    color: var(--cp-primary-dark);
    text-decoration: none;
}

.cp-brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: var(--cp-radius);
    background: #fff;
    box-shadow: var(--cp-shadow-soft);
}

body.theme-dark .cp-brand-mark {
    border-color: rgba(94, 234, 212, .22);
    background: #f8fafc;
}

.cp-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.cp-brand-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0;
}

.cp-brand-subtitle {
    display: block;
    color: var(--cp-muted);
    font-size: 12px;
    line-height: 1.3;
}

.cp-header-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.cp-icon-action {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--cp-radius);
    color: var(--cp-muted);
}

.cp-icon-action:hover {
    border-color: var(--cp-border);
    background: var(--cp-surface-soft);
    color: var(--cp-primary-dark);
}

body.theme-dark .cp-icon-action:hover,
body.theme-dark .cp-user-trigger:hover {
    border-color: var(--cp-border);
    background: rgba(255, 255, 255, .06);
    color: var(--cp-primary-dark);
}

.cp-user-trigger {
    gap: .65rem;
    padding: .35rem .45rem;
    border: 1px solid transparent;
    border-radius: var(--cp-radius);
}

.cp-user-trigger:hover {
    border-color: var(--cp-border);
    background: var(--cp-surface-soft);
}

.cp-user-meta {
    max-width: 190px;
}

.cp-user-name {
    color: var(--cp-text);
    font-weight: 650;
}

.cp-user-role {
    color: var(--cp-muted);
    font-size: 12px;
}

.cp-nav-wrap {
    position: sticky;
    top: 65px;
    z-index: 1015;
    border-bottom: 1px solid var(--cp-border);
    background: rgba(248, 250, 252, .96);
    backdrop-filter: saturate(160%) blur(12px);
}

body.theme-dark .cp-nav-wrap {
    border-bottom-color: var(--cp-border);
    background: rgba(15, 23, 42, .94);
}

.cp-nav-wrap .navbar {
    min-height: 46px;
    background: transparent;
}

body.theme-dark .cp-nav-wrap .navbar {
    background: transparent;
}

.cp-nav-wrap .navbar-nav {
    gap: .2rem;
    align-items: center;
}

.cp-nav-wrap .nav-link {
    min-height: 38px;
    padding: .55rem .75rem;
    border-radius: var(--cp-radius);
    color: #344054;
    font-weight: 600;
}

body.theme-dark .cp-nav-wrap .nav-link {
    color: #e2e8f0;
}

.cp-nav-wrap .nav-link:hover,
.cp-nav-wrap .nav-link:focus {
    background: #fff;
    color: var(--cp-primary-dark);
    box-shadow: inset 0 0 0 1px var(--cp-border);
}

body.theme-dark .cp-nav-wrap .nav-link:hover,
body.theme-dark .cp-nav-wrap .nav-link:focus {
    background: rgba(255, 255, 255, .07);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px var(--cp-border);
}

.cp-nav-wrap .dropdown-menu {
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
}

body.theme-dark .cp-nav-wrap .dropdown-menu {
    background: var(--cp-surface);
    border-color: var(--cp-border);
}

.cp-nav-wrap .dropdown-item {
    border-radius: 6px;
    color: #344054;
    font-weight: 500;
}

body.theme-dark .cp-nav-wrap .dropdown-item {
    color: #e2e8f0;
}

.cp-nav-wrap .dropdown-item:hover,
.cp-nav-wrap .dropdown-item:focus {
    background: rgba(15, 118, 110, .08);
    color: var(--cp-primary-dark);
}

body.theme-dark .cp-nav-wrap .dropdown-item:hover,
body.theme-dark .cp-nav-wrap .dropdown-item:focus {
    background: rgba(45, 212, 191, .12);
    color: #ffffff;
}

.cp-shell .page-wrapper {
    min-height: calc(100vh - 112px);
}

.cp-shell .page-body {
    margin-top: 1rem;
}

.cp-shell .card {
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow-soft);
}

body.theme-dark.cp-shell .card,
body.theme-dark.cp-shell .modal-content {
    background: var(--cp-surface);
    border-color: var(--cp-border);
    color: var(--cp-text);
}

.cp-shell .card-header {
    border-bottom-color: var(--cp-border);
    background: var(--cp-surface);
}

body.theme-dark.cp-shell .card-header,
body.theme-dark.cp-shell .card-footer {
    background: var(--cp-surface);
    border-color: var(--cp-border);
    color: var(--cp-text);
}

.cp-shell .btn {
    border-radius: 7px;
    font-weight: 600;
}

.cp-shell .btn-pill {
    border-radius: 999px;
}

.cp-shell .btn-icon {
    width: 2.25rem;
    height: 2.25rem;
}

.cp-shell .form-control,
.cp-shell .form-select,
.cp-shell .select2-container--default .select2-selection--single {
    border-color: var(--cp-border);
    border-radius: 7px;
}

body.theme-dark.cp-shell .form-control,
body.theme-dark.cp-shell .form-select,
body.theme-dark.cp-shell .select2-container--default .select2-selection--single {
    background-color: #162033;
    border-color: #cbd5e1;
    color: #ffffff;
}

body.theme-dark.cp-shell .form-control:focus,
body.theme-dark.cp-shell .form-select:focus {
    border-color: var(--cp-primary);
    box-shadow: 0 0 0 .2rem rgba(45, 212, 191, .16);
}

body.theme-dark.cp-shell .form-control::placeholder {
    color: #94a3b8;
}

body.theme-dark.cp-shell label,
body.theme-dark.cp-shell .form-label,
body.theme-dark.cp-shell .form-check-label {
    color: #cbd5e1;
}

body.theme-dark.cp-shell .text-muted,
body.theme-dark.cp-shell .form-text {
    color: #94a3b8 !important;
}

.cp-shell .modal-content {
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
}

.cp-shell .alert {
    border-radius: var(--cp-radius);
}

.cp-shell table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
}

.cp-shell table.dataTable thead th {
    background: var(--cp-surface-soft);
    color: #344054;
    font-size: 12px;
    text-transform: uppercase;
}

body.theme-dark.cp-shell table.dataTable,
body.theme-dark.cp-shell .table {
    color: var(--cp-text);
}

body.theme-dark.cp-shell table.dataTable thead th {
    background: var(--cp-surface-soft);
    color: #cbd5e1;
}

body.theme-dark.cp-shell table.dataTable tbody td,
body.theme-dark.cp-shell .table td {
    border-color: var(--cp-border);
}

body.theme-dark.cp-shell .dataTables_wrapper .dataTables_length,
body.theme-dark.cp-shell .dataTables_wrapper .dataTables_filter,
body.theme-dark.cp-shell .dataTables_wrapper .dataTables_info,
body.theme-dark.cp-shell .dataTables_wrapper .dataTables_paginate {
    color: var(--cp-text) !important;
}

body.theme-dark.cp-shell .dataTables_wrapper .dataTables_filter input,
body.theme-dark.cp-shell .dataTables_wrapper .dataTables_length select {
    background-color: #162033;
    border: 1px solid #cbd5e1;
    color: #ffffff;
}

.cp-panel {
    overflow: hidden;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    background: var(--cp-surface);
    box-shadow: var(--cp-shadow);
}

.cp-panel-toolbar {
    padding: 1rem;
    border-bottom: 1px solid var(--cp-border);
    background: linear-gradient(180deg, #ffffff 0, #f8fafc 100%);
}

.cp-panel-title {
    margin: 0;
    color: var(--cp-text);
    font-size: 18px;
    font-weight: 750;
    letter-spacing: 0;
}

.cp-panel-kicker {
    margin-top: .15rem;
    color: var(--cp-muted);
    font-size: 12px;
}

.cp-panel-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
}

.cp-room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
    padding: 1rem;
}

.cp-room-cell {
    min-width: 0;
}

.cp-room-card {
    position: relative;
    display: flex;
    min-height: 92px;
    height: 100%;
    align-items: center;
    gap: .75rem;
    padding: .85rem;
    border: 1px solid rgba(23, 32, 51, .14);
    border-radius: var(--cp-radius);
    color: #101828;
    cursor: pointer;
    box-shadow: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.cp-room-card:hover {
    transform: translateY(-2px);
    border-color: rgba(23, 32, 51, .26);
    box-shadow: var(--cp-shadow-soft);
}

.cp-room-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: var(--cp-radius);
    background: rgba(255, 255, 255, .72);
}

.cp-room-icon .icon {
    width: 24px;
    height: 24px;
}

.cp-room-info {
    min-width: 0;
    text-align: left;
}

.cp-room-number {
    display: block;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.cp-room-name {
    display: block;
    margin-top: .2rem;
    overflow: hidden;
    color: rgba(16, 24, 40, .76);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.cp-room-state-dot {
    position: absolute;
    right: .7rem;
    top: .7rem;
    width: .55rem;
    height: .55rem;
    border: 2px solid rgba(255, 255, 255, .8);
    border-radius: 999px;
    background: currentColor;
}

.libre .cp-room-state-dot {
    color: #16a34a;
}

.ocupado .cp-room-state-dot,
.dormida .cp-room-state-dot {
    color: #dc2626;
}

.promocion .cp-room-state-dot {
    color: #7c3aed;
}

.facturando .cp-room-state-dot {
    color: #2563eb;
}

.pendiente .cp-room-state-dot,
.limpiando .cp-room-state-dot {
    color: #d97706;
}

.cp-shell .footer {
    color: var(--cp-muted);
}

#preloader {
    background: var(--cp-bg) !important;
}

body.theme-dark #preloader {
    background: var(--cp-bg) !important;
}

#preloader .loader {
    border-color: rgba(15, 118, 110, .15);
    border-top-color: var(--cp-primary);
}

@media (max-width: 767.98px) {
    .cp-topbar {
        position: sticky;
    }

    .cp-nav-wrap {
        top: 61px;
    }

    .cp-brand-title {
        font-size: 14px;
    }

    .cp-brand-subtitle,
    .cp-user-meta {
        display: none;
    }

    .cp-panel-toolbar {
        padding: .85rem;
    }

    .cp-panel-actions {
        justify-content: flex-start;
        margin-top: .75rem;
    }

    .cp-room-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
        padding: .75rem;
    }
}

.cp-auth {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(15, 118, 110, .11) 0, rgba(15, 118, 110, 0) 360px),
        var(--cp-bg);
}

.cp-auth-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.cp-auth-card {
    width: min(100%, 420px);
    overflow: hidden;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    background: var(--cp-surface);
    box-shadow: var(--cp-shadow);
}

.cp-auth-brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1.25rem 1.35rem;
    border-bottom: 1px solid var(--cp-border);
    background: linear-gradient(180deg, #ffffff 0, #f8fafc 100%);
}

.cp-auth-logo {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: var(--cp-radius);
    background: #fff;
}

.cp-auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.cp-auth-title {
    display: block;
    color: var(--cp-text);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.2;
}

.cp-auth-subtitle {
    display: block;
    color: var(--cp-muted);
    font-size: 12px;
}

.cp-auth-head {
    padding: 1.35rem 1.35rem .5rem;
    text-align: left;
}

.cp-auth-head h4 {
    margin: 0;
    color: var(--cp-text);
    font-size: 22px;
    font-weight: 800;
}

.cp-auth-head p {
    margin: .35rem 0 0;
    color: var(--cp-muted);
}

.cp-auth-body {
    padding: .75rem 1.35rem 1.35rem;
}

.cp-auth-field.form-gp {
    margin-bottom: 1.15rem;
}

.cp-auth-field.form-gp label {
    color: var(--cp-muted);
    font-size: 12px;
    font-weight: 700;
}

.cp-auth-field.form-gp input {
    height: 44px;
    border-bottom-color: var(--cp-border);
    color: var(--cp-text);
    font-size: 15px;
}

.cp-auth-field.form-gp input:focus {
    border-bottom-color: var(--cp-primary);
}

.cp-auth-field.form-gp i {
    color: var(--cp-muted);
}

.cp-auth-submit button {
    height: 44px;
    border-radius: 7px;
    background: var(--cp-primary);
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
}

.cp-auth-submit button:hover {
    background: var(--cp-primary-dark);
}

/* Paginacion global para listas Laravel/Bootstrap dentro de GAM. */
.cp-content nav[role="navigation"] {
    width: 100%;
}

.cp-content nav[role="navigation"] > div:first-child {
    display: none !important;
}

.cp-content .pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}

.cp-content .page-item {
    list-style: none;
}

.cp-content .page-link {
    align-items: center;
    border: 1px solid #dbe3ef;
    border-radius: 6px;
    color: #2563eb;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    height: 34px;
    justify-content: center;
    line-height: 1;
    min-width: 34px;
    padding: 0 10px;
    text-decoration: none;
}

.cp-content .page-link svg {
    height: 16px;
    width: 16px;
}

.cp-content .page-item.active .page-link {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.cp-content .page-item.disabled .page-link {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.cp-content .page-link[rel="prev"],
.cp-content .page-link[rel="next"] {
    min-width: 42px;
}

@media (max-width: 768px) {
    .cp-content .pagination {
        justify-content: flex-start;
    }
}
