:root {
    --rs-bg: #f4efe6;
    --rs-surface: #fffdf8;
    --rs-card: #ffffff;
    --rs-border: #dfd4c2;
    --rs-primary: #14532d;
    --rs-accent: #c2410c;
    --rs-text: #1f2937;
    --rs-muted: #6b7280;
    --rs-dark: #122018;
    --rs-shadow: 0 18px 50px rgba(18, 32, 24, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--rs-text);
    background:
        radial-gradient(circle at top left, rgba(194, 65, 12, 0.12), transparent 24%),
        radial-gradient(circle at bottom right, rgba(20, 83, 45, 0.12), transparent 22%),
        var(--rs-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

.guest-shell {
    min-height: 100vh;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--rs-primary), #1d4ed8);
}

.brand-copy strong {
    display: block;
    font-size: 1rem;
}

.brand-copy span {
    display: block;
    font-size: 0.85rem;
    color: var(--rs-muted);
}

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

.sidebar {
    width: 292px;
    padding: 1.25rem;
    background: rgba(18, 32, 24, 0.96);
    color: #f9fafb;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 1040;
}

.sidebar-card {
    padding: 1rem;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.25rem;
}

.sidebar small,
.sidebar .section-title {
    color: rgba(255, 255, 255, 0.68);
}

.section-title {
    margin: 1.1rem 0 0.55rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.nav-link-rs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    color: rgba(255, 255, 255, 0.88);
    border-radius: 16px;
    margin-bottom: 0.45rem;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-link-rs:hover,
.nav-link-rs:focus,
.nav-link-rs:active,
.nav-link-rs.active {
    color: #fff;
    background: rgba(217, 249, 157, 0.14);
    text-decoration: none;
    transform: translateX(2px);
}

.content-wrap {
    flex: 1;
    min-width: 0;
    margin-left: 292px;
    padding: 1.2rem;
}

.topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 22px;
    background: rgba(255, 253, 248, 0.78);
    backdrop-filter: blur(10px);
    box-shadow: var(--rs-shadow);
    margin-bottom: 1rem;
}

.page-panel {
    background: rgba(255, 253, 248, 0.86);
    border: 1px solid rgba(223, 212, 194, 0.85);
    border-radius: 28px;
    padding: 1.35rem;
    box-shadow: var(--rs-shadow);
}

.page-panel .table-responsive {
    border-radius: 18px;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    z-index: 1030;
}

.btn-rs {
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1.2rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn-rs-primary {
    color: #fff !important;
    background: linear-gradient(135deg, var(--rs-primary), #166534);
    box-shadow: 0 10px 22px rgba(20, 83, 45, 0.22);
}

.btn-rs-primary:hover,
.btn-rs-primary:focus,
.btn-rs-primary:active {
    color: #fff !important;
    background: linear-gradient(135deg, #166534, #15803d);
    box-shadow: 0 14px 28px rgba(20, 83, 45, 0.28);
    filter: brightness(1.03);
}

.btn-rs-danger {
    color: #fff !important;
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    box-shadow: 0 10px 22px rgba(185, 28, 28, 0.22);
}

.btn-rs-danger:hover,
.btn-rs-danger:focus,
.btn-rs-danger:active {
    color: #fff !important;
    background: linear-gradient(135deg, #991b1b, #ef4444);
    box-shadow: 0 14px 28px rgba(185, 28, 28, 0.28);
    filter: brightness(1.03);
}

.btn-rs-light {
    color: var(--rs-primary);
    background: rgba(20, 83, 45, 0.08);
    box-shadow: inset 0 0 0 1px rgba(20, 83, 45, 0.08);
}

.btn-rs-light:hover,
.btn-rs-light:focus,
.btn-rs-light:active {
    color: var(--rs-primary);
    background: rgba(20, 83, 45, 0.14);
    filter: brightness(1.02);
}

.btn-rs:hover,
.btn-rs:focus,
.btn-rs:active {
    text-decoration: none;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.table-actions form {
    margin: 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.btn-rs-action {
    min-width: 108px;
    min-height: 38px;
    padding: 0.58rem 0.9rem;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn-rs-action:hover,
.btn-rs-action:focus,
.btn-rs-action:active {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-rs-action-primary,
.btn-rs-action-edit {
    color: #ecfdf5 !important;
    background: linear-gradient(135deg, var(--rs-primary), #166534);
    box-shadow: 0 10px 18px rgba(20, 83, 45, 0.16);
}

.btn-rs-action-primary:hover,
.btn-rs-action-primary:focus,
.btn-rs-action-primary:active,
.btn-rs-action-edit:hover,
.btn-rs-action-edit:focus,
.btn-rs-action-edit:active {
    color: #f0fdf4 !important;
    background: linear-gradient(135deg, #166534, #15803d);
    box-shadow: 0 14px 24px rgba(20, 83, 45, 0.22);
}

.btn-rs-action-secondary {
    color: var(--rs-primary) !important;
    background: rgba(20, 83, 45, 0.08);
    border-color: rgba(20, 83, 45, 0.12);
    box-shadow: inset 0 0 0 1px rgba(20, 83, 45, 0.02);
}

.btn-rs-action-secondary:hover,
.btn-rs-action-secondary:focus,
.btn-rs-action-secondary:active {
    color: #14532d !important;
    background: rgba(20, 83, 45, 0.14);
    border-color: rgba(20, 83, 45, 0.18);
    box-shadow: 0 10px 18px rgba(20, 83, 45, 0.08);
}

.btn-rs-action-delete {
    color: #991b1b !important;
    background: rgba(254, 242, 242, 0.96);
    border-color: rgba(248, 113, 113, 0.42);
    box-shadow: 0 10px 18px rgba(127, 29, 29, 0.08);
}

.btn-rs-action-delete:hover,
.btn-rs-action-delete:focus,
.btn-rs-action-delete:active {
    color: #fff !important;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border-color: transparent;
    box-shadow: 0 14px 24px rgba(185, 28, 28, 0.2);
}

.form-control,
.form-select {
    border-radius: 14px;
}

.form-control-lg,
.form-select-lg {
    min-height: 3rem;
}

.form-check-input {
    cursor: pointer;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.flash-stack > * + * {
    margin-top: 0.75rem;
}

.page-login {
    --login-bg: #050b07;
    --login-bg2: #0d1711;
    --login-bg3: #122119;
    --login-line: rgba(74, 222, 128, 0.22);
    --login-primary: #22c55e;
    --login-primary-soft: #bbf7d0;
    --login-primary-dark: #15803d;
    --login-text: #f0fdf4;
    --login-muted: #a7f3d0;
    background: url("/img/img_login/fondo-app.png") center/cover no-repeat fixed;
    position: relative;
}

.page-login::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 700px at 10% -10%, rgba(34, 197, 94, 0.18), transparent 60%),
        radial-gradient(1000px 650px at 105% 0%, rgba(16, 185, 129, 0.14), transparent 55%),
        linear-gradient(180deg, rgba(3, 10, 7, 0.52), rgba(3, 10, 7, 0.9));
    z-index: 0;
}

.page-login .guest-shell,
.page-login .guest-shell > main {
    min-height: 100vh;
    min-height: 100dvh;
}

.page-login .guest-shell {
    position: relative;
    isolation: isolate;
}

.page-login .login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding: clamp(0.65rem, 1.75vh, 1rem) 0;
    position: relative;
    z-index: 1;
}

.page-login .container {
    position: relative;
    z-index: 1;
}

.page-login .login-card {
    width: 100%;
    max-width: min(660px, calc(100vw - 1.25rem));
    margin-inline: auto;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(7, 16, 11, 0.74), rgba(4, 10, 7, 0.9));
    border: 1px solid rgba(74, 222, 128, 0.24);
    border-radius: 1.6rem;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(14px);
    position: relative;
}

.page-login .login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(187, 247, 208, 0.5), transparent);
}

.page-login .login-card .card-body {
    padding: clamp(1.5rem, 3.8vw, 2rem);
    position: relative;
}

.page-login .login-header {
    text-align: center;
    margin-bottom: clamp(1rem, 2.5vh, 1.75rem);
}

.page-login .brand-badge {
    width: auto;
    height: auto;
    min-width: 74px;
    padding: 0.65rem 1.15rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #ecfdf5;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(110, 231, 183, 0.08));
    border: 1.5px solid var(--login-primary);
    box-shadow: 0 0 0 1px rgba(187, 247, 208, 0.16), 0 0 26px rgba(34, 197, 94, 0.18);
}

.page-login .login-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: var(--login-primary-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.page-login .login-title {
    margin: 0;
    font-size: clamp(1.95rem, 4vw, 2.45rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--login-text);
}

.page-login .login-sub {
    max-width: 26rem;
    margin: 0.55rem auto 0;
    color: rgba(220, 252, 231, 0.76);
    font-size: 0.98rem;
    line-height: 1.5;
}

.page-login .alert-danger-custom {
    background: rgba(127, 29, 29, 0.28);
    border: 1px solid rgba(248, 113, 113, 0.55);
    color: #fecaca;
    border-radius: 0.95rem;
    padding: 0.85rem 1rem;
    font-size: 0.94rem;
}

.page-login .login-form .form-label {
    display: block;
    margin-bottom: 0.55rem;
    font-weight: 700;
    color: #ecfdf5;
}

.page-login .input-wrap {
    position: relative;
}

.page-login .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(187, 247, 208, 0.78);
    pointer-events: none;
}

.page-login .input-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page-login .form-control {
    min-height: clamp(3rem, 5.2vh, 3.35rem);
    padding: 0.82rem 1rem 0.82rem 3rem;
    border-radius: 1rem;
    border: 1px solid rgba(110, 231, 183, 0.16);
    background: rgba(2, 10, 6, 0.74);
    color: var(--login-text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.page-login .form-control::placeholder {
    color: rgba(167, 243, 208, 0.54);
}

.page-login .form-control:hover {
    border-color: rgba(74, 222, 128, 0.28);
}

.page-login .form-control:focus {
    color: var(--login-text);
    border-color: var(--login-primary);
    box-shadow: 0 0 0 0.25rem rgba(34, 197, 94, 0.16);
    background: rgba(2, 12, 8, 0.88);
}

.page-login .form-control.is-invalid {
    border-color: rgba(248, 113, 113, 0.72);
    background: rgba(35, 10, 10, 0.68);
}

.page-login .invalid-feedback {
    color: #fecaca;
    margin-top: 0.45rem;
}

.page-login .form-check {
    margin-top: 0.2rem;
    padding: 0.82rem 1rem 0.82rem 2.25rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(110, 231, 183, 0.12);
}

.page-login .form-check-input {
    margin-top: 0.22rem;
    margin-left: -1.35rem;
    background-color: rgba(2, 10, 6, 0.72);
    border-color: rgba(167, 243, 208, 0.44);
}

.page-login .form-check-input:checked {
    background-color: var(--login-primary);
    border-color: var(--login-primary);
}

.page-login .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.18);
}

.page-login .form-check-label {
    color: rgba(240, 253, 244, 0.88);
}

.page-login .login-submit {
    border: none;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    color: #052e16 !important;
    font-weight: 800;
    letter-spacing: 0.01em;
    background: linear-gradient(180deg, #4ade80 0%, #bbf7d0 100%);
    box-shadow: 0 16px 28px rgba(22, 163, 74, 0.26);
}

.page-login .login-submit:hover,
.page-login .login-submit:focus,
.page-login .login-submit:active {
    color: #052e16 !important;
    background: linear-gradient(180deg, #86efac 0%, #dcfce7 100%);
    box-shadow: 0 18px 30px rgba(22, 163, 74, 0.3);
    filter: none;
    transform: translateY(-1px);
}

.page-login .login-submit:focus {
    box-shadow: 0 0 0 0.25rem rgba(34, 197, 94, 0.2), 0 18px 30px rgba(22, 163, 74, 0.28);
}

.page-login .login-help {
    margin-top: clamp(0.95rem, 2vh, 1.4rem);
    padding: 0.9rem 1rem;
    font-size: 0.92rem;
    color: #dcfce7;
    background: rgba(20, 83, 45, 0.18);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 1.1rem;
    backdrop-filter: blur(8px);
}

.page-login .login-help strong {
    display: block;
    margin-bottom: 0.45rem;
    color: #f0fdf4;
}

.page-login .login-help code {
    color: #f0fdf4;
    background: rgba(2, 10, 6, 0.52);
    border: 1px solid rgba(110, 231, 183, 0.12);
    border-radius: 0.45rem;
    padding: 0.12rem 0.45rem;
    word-break: break-word;
}

.page-login .small-note {
    text-align: center;
    font-size: 0.82rem;
    color: rgba(220, 252, 231, 0.62);
    margin-top: 0.8rem;
}

.page-dashboard .dashboard-summary-card h2 {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.page-dashboard .dashboard-actions {
    gap: 0.75rem;
}

.page-clientes-index .clientes-header {
    gap: 1rem;
}

.page-clientes-index .clientes-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-clientes-index .clientes-table td,
.page-clientes-index .clientes-table th,
.page-reservas-index .reservas-table td,
.page-reservas-index .reservas-table th,
.page-ventas-index .ventas-table td,
.page-ventas-index .ventas-table th {
    vertical-align: middle;
}

.page-reservas-index .reservas-header {
    gap: 1rem;
}

.page-reservas-index .reservas-table td,
.page-reservas-index .reservas-table th {
    white-space: nowrap;
}

.page-ventas-index .ventas-total {
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    margin-bottom: 0;
}

@media (min-width: 576px) {
    .page-login .login-card .card-body {
        padding: 2.35rem;
    }
}

@media (min-width: 992px) {
    .page-login .login-shell {
        padding: clamp(0.9rem, 2vh, 1.5rem) 0;
    }

    .page-login .login-card .card-body {
        padding: 3rem;
    }
}

@media (max-height: 860px) and (min-width: 576px) {
    .page-login .login-shell {
        padding: 0.65rem 0;
    }

    .page-login .login-card {
        max-width: min(600px, calc(100vw - 1.5rem));
    }

    .page-login .login-card .card-body {
        padding: 1.7rem;
    }

    .page-login .login-header {
        margin-bottom: 1rem;
    }

    .page-login .brand-badge {
        min-width: 68px;
        padding: 0.55rem 1rem;
        font-size: 0.94rem;
    }

    .page-login .login-title {
        font-size: clamp(1.7rem, 3vw, 2rem);
    }

    .page-login .login-sub {
        font-size: 0.92rem;
        line-height: 1.4;
    }

    .page-login .form-control {
        min-height: 2.9rem;
        padding-top: 0.72rem;
        padding-bottom: 0.72rem;
    }

    .page-login .form-check {
        padding-top: 0.72rem;
        padding-bottom: 0.72rem;
    }

    .page-login .login-submit {
        padding: 0.78rem 1rem;
    }

    .page-login .login-help {
        margin-top: 0.9rem;
        padding: 0.8rem 0.9rem;
        font-size: 0.88rem;
    }

    .page-login .small-note {
        margin-top: 0.65rem;
        font-size: 0.78rem;
    }
}

@media (max-height: 720px) and (min-width: 576px) {
    .page-login .login-header {
        margin-bottom: 0.8rem;
    }

    .page-login .login-kicker {
        font-size: 0.68rem;
    }

    .page-login .login-sub,
    .page-login .small-note {
        display: none;
    }

    .page-login .login-help {
        margin-top: 0.75rem;
        padding: 0.72rem 0.85rem;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content-wrap {
        margin-left: 0;
        padding: 0.85rem;
    }

    .topbar {
        display: flex;
        position: sticky;
        top: 0.75rem;
        z-index: 1020;
    }

    .overlay.show {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        width: min(86vw, 320px);
        padding: 1rem 0.85rem;
    }

    .topbar {
        padding: 0.75rem 0.85rem;
        border-radius: 18px;
    }

    .page-panel {
        border-radius: 22px;
        padding: 1rem;
    }

    .btn-rs {
        width: 100%;
        justify-content: center;
    }

    .table-actions {
        width: 100%;
        justify-content: stretch;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions form {
        flex: 1 1 100%;
    }

    .btn-rs-action {
        width: 100%;
        min-width: 0;
    }

    .table {
        font-size: 0.92rem;
    }

    .page-clientes-index .clientes-header,
    .page-reservas-index .reservas-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-clientes-index .clientes-header .btn,
    .page-reservas-index .reservas-header .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .brand-badge {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 0.95rem;
    }

    .page-login .login-card {
        border-radius: 1.35rem;
    }

    .page-login .login-card .card-body {
        padding: 1.35rem 1.2rem;
    }

    .page-login .brand-badge {
        min-width: 68px;
        padding: 0.58rem 1rem;
        font-size: 0.94rem;
    }

    .page-login .login-title {
        font-size: 1.8rem;
    }

    .content-wrap {
        padding: 0.65rem;
    }

    .topbar {
        gap: 0.75rem;
        padding: 0.7rem 0.8rem;
    }

    .topbar .btn-rs {
        width: auto;
        padding: 0.7rem 0.95rem;
        font-size: 0.92rem;
    }

    .page-panel {
        border-radius: 18px;
        padding: 0.85rem;
    }

    .flash-stack .alert {
        font-size: 0.92rem;
    }
}
