:root {
    --sr-ink: #10201C;
    --sr-forest: #173F35;
    --sr-green: #2F6F4E;
    --sr-green-2: #4F8A5B;
    --sr-lime: #A7C957;
    --sr-mint: #E8F3EA;

    --sr-teal: #6EC6D3;
    --sr-glacier: #BDE8EE;
    --sr-ice: #F2FAFB;

    --sr-earth: #8A6A43;
    --sr-sand: #E7D8B6;

    --sr-bg: #F6F9F6;
    --sr-white: #FFFFFF;
    --sr-muted: #66756F;
    --sr-muted-2: #8B9A94;
    --sr-line: #DCE7DF;
    --sr-line-soft: #EAF1EC;

    --sr-danger: #B42318;
    --sr-danger-bg: #FFF3F0;
    --sr-success: #267A4A;
    --sr-success-bg: #ECFDF3;
    --sr-warning: #8A6A43;
    --sr-warning-bg: #F8F1E2;

    --shadow-sm: 0 8px 22px rgba(16, 32, 28, 0.07);
    --shadow-md: 0 18px 46px rgba(16, 32, 28, 0.14);
    --shadow-lg: 0 28px 70px rgba(16, 32, 28, 0.24);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --topbar-height: 72px;
    --sidebar-width: 252px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--sr-bg);
}

body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--sr-ink);
    background:
        radial-gradient(circle at top left, rgba(167, 201, 87, 0.18), transparent 34rem),
        radial-gradient(circle at top right, rgba(110, 198, 211, 0.16), transparent 32rem),
        linear-gradient(180deg, #FBFDFB 0%, var(--sr-bg) 46%, #EEF5EF 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

/* ==============================
   Guest / Login
================================= */

.guest-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(16, 32, 28, 0.95), rgba(23, 63, 53, 0.92) 44%, rgba(47, 111, 78, 0.88)),
        radial-gradient(circle at 18% 20%, rgba(167, 201, 87, 0.20), transparent 28rem),
        radial-gradient(circle at 85% 18%, rgba(110, 198, 211, 0.18), transparent 24rem),
        linear-gradient(180deg, #10201C, #173F35);
    position: relative;
    overflow: hidden;
}

.guest-body::before {
    content: "";
    position: fixed;
    inset: auto -10vw -22vh -10vw;
    height: 48vh;
    background:
        linear-gradient(135deg, transparent 0 34%, rgba(255, 255, 255, 0.08) 34% 35%, transparent 35%),
        linear-gradient(25deg, transparent 0 52%, rgba(255, 255, 255, 0.06) 52% 53%, transparent 53%),
        linear-gradient(180deg, rgba(167, 201, 87, 0.10), rgba(255, 255, 255, 0));
    transform: skewY(-5deg);
    pointer-events: none;
}

.guest-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    align-items: center;
    gap: 64px;
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0;
}

.guest-wrapper::before {
    content: "Portal de agencias";
    color: rgba(255, 255, 255, 0.94);
    font-size: clamp(44px, 6vw, 82px);
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: -0.06em;
    max-width: 620px;
    text-transform: uppercase;
    text-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.login-card {
    width: 100%;
    position: relative;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-xl);
    padding: 34px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(167, 201, 87, 0.12), transparent 32%),
        linear-gradient(315deg, rgba(110, 198, 211, 0.10), transparent 36%);
}

.login-logo-wrap {
    position: relative;
    background:
        linear-gradient(135deg, #10201C, #173F35 58%, #2F6F4E);
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 28px;
    text-align: center;
    overflow: hidden;
}

.login-logo-wrap::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -70px;
    top: -90px;
    border-radius: 50%;
    background: rgba(167, 201, 87, 0.15);
}

.login-logo {
    position: relative;
    max-width: 220px;
    height: auto;
    z-index: 1;
}

.login-card h1 {
    position: relative;
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.035em;
    color: var(--sr-ink);
}

.login-subtitle {
    position: relative;
    margin: 0 0 26px;
    color: var(--sr-muted);
    line-height: 1.45;
}

.login-form {
    position: relative;
    display: grid;
    gap: 14px;
}

.login-form label,
.field label {
    font-weight: 800;
    font-size: 13px;
    color: var(--sr-forest);
    letter-spacing: 0.01em;
}

.login-form input,
.field input,
.field textarea,
.field select {
    width: 100%;
    border: 1px solid var(--sr-line);
    border-radius: 14px;
    padding: 14px 15px;
    font-size: 15px;
    color: var(--sr-ink);
    background: #FBFDFB;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-form input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--sr-green-2);
    background: var(--sr-white);
    box-shadow: 0 0 0 4px rgba(47, 111, 78, 0.14);
}

.login-form button,
.button-primary {
    border: 0;
    border-radius: 14px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--sr-forest), var(--sr-green));
    color: var(--sr-white);
    font-weight: 900;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 12px 22px rgba(47, 111, 78, 0.24);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, background .16s ease;
}

.login-form button {
    margin-top: 8px;
    width: 100%;
}

.login-form button:hover,
.button-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--sr-green), var(--sr-green-2));
    box-shadow: 0 16px 30px rgba(47, 111, 78, 0.30);
    filter: saturate(1.04);
}

.login-form button:active,
.button-primary:active {
    transform: translateY(0);
}

.login-help {
    position: relative;
    color: var(--sr-muted);
    font-size: 13px;
    margin: 24px 0 0;
    text-align: center;
}

.login-form button:focus-visible,
.button-primary:focus-visible,
.button-secondary:focus-visible {
    outline: 3px solid rgba(167, 201, 87, 0.45);
    outline-offset: 3px;
}

/* ==============================
   Alerts / Flash
================================= */

.alert {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.45;
}

.alert-danger {
    background: var(--sr-danger-bg);
    color: var(--sr-danger);
    border: 1px solid rgba(180, 35, 24, 0.22);
}

.alert ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

.guest-content-stack {
    width: 100%;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.flash {
    border-radius: 16px;
    padding: 13px 15px;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.4;
    box-shadow: 0 8px 18px rgba(16, 32, 28, 0.06);
}

.flash-success {
    background: var(--sr-success-bg);
    color: var(--sr-success);
    border: 1px solid rgba(38, 122, 74, 0.16);
}

.flash-error {
    background: var(--sr-danger-bg);
    color: var(--sr-danger);
    border: 1px solid rgba(180, 35, 24, 0.16);
}

.flash-info {
    background: var(--sr-ice);
    color: var(--sr-forest);
    border: 1px solid rgba(110, 198, 211, 0.18);
}


/* Flash flotante del portal autenticado */

.flash-stack[data-flash-stack] {
    position: fixed;
    top: calc(var(--topbar-height) + 18px);
    right: 24px;
    z-index: 100;
    width: min(420px, calc(100vw - 48px));
    max-height: calc(100vh - var(--topbar-height) - 36px);
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: none;
}

.flash-stack[data-flash-stack] .flash {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 15px 14px 18px 17px;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(16, 32, 28, 0.18);
    backdrop-filter: blur(14px);
    pointer-events: auto;
    animation: flash-enter 0.28s ease both;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        margin 0.25s ease;
}

.flash-stack[data-flash-stack] .flash.flash-timer-active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: currentColor;
    opacity: 0.48;
    transform: scaleX(1);
    transform-origin: left center;
    animation-name: flash-countdown;
    animation-duration: var(--flash-timeout, 7000ms);
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.flash-stack[data-flash-stack] .flash:hover::after,
.flash-stack[data-flash-stack] .flash:focus-within::after,
.flash-stack[data-flash-stack] .flash.flash-timer-paused::after {
    animation-play-state: paused;
}

.flash-stack[data-flash-stack] .flash-content {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 1px;
    overflow-wrap: anywhere;
}

.flash-stack[data-flash-stack] .flash-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin: -5px -4px 0 0;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: currentColor;
    font-size: 23px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    opacity: 0.62;
    transition:
        opacity 0.16s ease,
        background 0.16s ease,
        transform 0.16s ease;
}

.flash-stack[data-flash-stack] .flash-close:hover {
    background: rgba(16, 32, 28, 0.08);
    opacity: 1;
    transform: scale(1.04);
}

.flash-stack[data-flash-stack] .flash-close:focus-visible {
    outline: 3px solid rgba(47, 111, 78, 0.22);
    outline-offset: 2px;
    opacity: 1;
}

.flash-stack[data-flash-stack] .flash-leaving {
    margin-bottom: -10px;
    opacity: 0;
    transform: translateX(32px);
    pointer-events: none;
}

@keyframes flash-enter {
    from {
        opacity: 0;
        transform: translateX(32px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes flash-countdown {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 720px) {
    .flash-stack[data-flash-stack] {
        top: 122px;
        right: 14px;
        left: 14px;
        width: auto;
        max-height: calc(100vh - 138px);
    }

    .flash-stack[data-flash-stack] .flash {
        padding: 14px 12px 17px 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flash-stack[data-flash-stack] .flash {
        animation: none;
        transition: none;
    }

    .flash-stack[data-flash-stack] .flash::after {
        display: none;
    }
}

/* ==============================
   App Shell
================================= */

.app-body {
    background:
        radial-gradient(circle at top left, rgba(167, 201, 87, 0.18), transparent 38rem),
        radial-gradient(circle at top right, rgba(110, 198, 211, 0.14), transparent 34rem),
        linear-gradient(180deg, #FBFDFB 0%, var(--sr-bg) 44%, #EEF5EF 100%);
}

.topbar {
    height: var(--topbar-height);
    background:
        linear-gradient(135deg, rgba(16, 32, 28, 0.98), rgba(23, 63, 53, 0.96) 52%, rgba(47, 111, 78, 0.94)),
        radial-gradient(circle at 12% 20%, rgba(167, 201, 87, 0.22), transparent 22rem),
        radial-gradient(circle at 88% 8%, rgba(110, 198, 211, 0.14), transparent 20rem);
    color: var(--sr-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 28px rgba(16, 32, 28, 0.16);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-logo-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.topbar-logo {
    height: 40px;
    width: auto;
    display: block;
}

.topbar-product {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-left: 2px;
}

.topbar-product strong {
    color: var(--sr-white);
    font-size: 15px;
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.topbar-product span {
    color: rgba(232, 243, 234, 0.78);
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}

.topbar-user {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.topbar-user-data {
    display: grid;
    gap: 2px;
    text-align: right;
    min-width: 0;
}

.topbar-agency {
    color: rgba(255, 255, 255, 0.96);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user-data small {
    color: rgba(232, 243, 234, 0.72);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.1;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-logout {
    color: var(--sr-white);
    font-weight: 900;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background .16s ease, color .16s ease, transform .16s ease;
    flex: 0 0 auto;
}

.topbar-logout:hover {
    background: rgba(255, 255, 255, 0.17);
    color: var(--sr-white);
    transform: translateY(-1px);
}

.menu-toggle,
.menu-toggle.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    margin: 0;
    background: rgba(255, 255, 255, 0.12);
    color: var(--sr-white);
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}

.menu-toggle span,
.menu-toggle.sidebar-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.menu-toggle:hover,
.menu-toggle.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: calc(100vh - var(--topbar-height));
}

/* ==============================
   Sidebar lateral
================================= */

.sidebar {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(246, 249, 246, 0.82)),
        radial-gradient(circle at top left, rgba(167, 201, 87, 0.18), transparent 18rem);
    border-right: 1px solid rgba(220, 231, 223, 0.92);
    padding: 18px 14px;
    backdrop-filter: blur(14px);
}

.sidebar::before {
    content: "";
    position: absolute;
    top: 18px;
    right: -1px;
    bottom: 18px;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(47, 111, 78, 0.20), transparent);
    pointer-events: none;
}

.sidebar-inner,
.sidebar nav {
    display: grid;
    gap: 6px;
    position: sticky;
    top: calc(var(--topbar-height) + 18px);
}

.sidebar-section-title {
    margin: 6px 9px 8px;
    font-size: 10px;
    color: var(--sr-muted-2);
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .11em;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 13px;
    color: var(--sr-forest);
    font-weight: 850;
    font-size: 14px;
    letter-spacing: -0.015em;
    border: 1px solid transparent;
    transition: background .16s ease, color .16s ease, transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(220, 231, 223, 0.95);
    box-shadow: 0 8px 18px rgba(16, 32, 28, 0.05);
    transform: translateX(2px);
}

.sidebar-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: rgba(47, 111, 78, 0.09);
    color: var(--sr-green);
    font-size: 14px;
    font-weight: 950;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(47, 111, 78, 0.05);
}

.sidebar-link-label {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-link-primary {
    background:
        linear-gradient(135deg, var(--sr-forest), var(--sr-green));
    color: var(--sr-white);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 24px rgba(47, 111, 78, 0.17);
}

.sidebar-link-primary:hover {
    background:
        linear-gradient(135deg, var(--sr-green), var(--sr-green-2));
    color: var(--sr-white);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 28px rgba(47, 111, 78, 0.22);
}

.sidebar-link-primary .sidebar-link-icon {
    background: rgba(255, 255, 255, 0.14);
    color: var(--sr-white);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}

.sidebar-link.is-active:not(.sidebar-link-primary) {
    background:
        linear-gradient(135deg, rgba(232, 243, 234, 0.96), rgba(255, 255, 255, 0.86));
    color: var(--sr-forest);
    border-color: rgba(47, 111, 78, 0.16);
    box-shadow:
        inset 3px 0 0 var(--sr-green),
        0 8px 18px rgba(16, 32, 28, 0.04);
}

.sidebar-link.is-active:not(.sidebar-link-primary) .sidebar-link-icon {
    background: rgba(47, 111, 78, 0.14);
    color: var(--sr-forest);
}

.sidebar-link-primary.is-active {
    outline: 2px solid rgba(167, 201, 87, 0.28);
    outline-offset: 2px;
}

.sidebar-backdrop {
    display: none;
}

.main-content {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 32px 0 52px;
}

.app-body.sidebar-collapsed {
    --sidebar-width: 82px;
}

.app-body.sidebar-collapsed .sidebar {
    padding-left: 12px;
    padding-right: 12px;
}

.app-body.sidebar-collapsed .sidebar-section-title {
    height: 16px;
    margin: 4px 0 8px;
    text-align: center;
    font-size: 0;
}

.app-body.sidebar-collapsed .sidebar-section-title::after {
    content: "•";
    font-size: 16px;
    color: var(--sr-muted-2);
}

.app-body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    min-height: 40px;
    padding-left: 7px;
    padding-right: 7px;
}

.app-body.sidebar-collapsed .sidebar-link-label {
    display: none;
}

.app-body.sidebar-collapsed .sidebar-link-icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
}

.app-body.sidebar-collapsed .main-content {
    width: min(1240px, calc(100% - 48px));
}

/* ==============================
   Page Header / Buttons
================================= */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1;
    letter-spacing: -0.055em;
    color: var(--sr-ink);
}

.page-header p {
    margin: 0;
    color: var(--sr-muted);
    font-size: 15px;
}

.button-secondary {
    border: 1px solid var(--sr-line);
    border-radius: 14px;
    padding: 13px 18px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--sr-forest);
    font-weight: 900;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 18px rgba(16, 32, 28, 0.05);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.button-secondary:hover {
    transform: translateY(-1px);
    border-color: rgba(47, 111, 78, 0.40);
    box-shadow: 0 12px 26px rgba(16, 32, 28, 0.08);
}

/* ==============================
   Cards / Panels
================================= */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card,
.panel {
    background: rgba(255, 255, 255, 0.90);
    border: 1px solid rgba(220, 231, 223, 0.96);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.stat-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    right: -58px;
    top: -70px;
    border-radius: 50%;
    background: rgba(167, 201, 87, 0.14);
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22px;
    bottom: 22px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--sr-green), var(--sr-lime));
}

.stat-label {
    display: block;
    color: var(--sr-muted);
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.stat-card strong {
    display: block;
    font-size: 40px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.panel {
    padding: 26px;
}

.panel h2 {
    margin: 0 0 20px;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.panel-header h2 {
    margin: 0 0 6px;
}

.panel-header p {
    margin: 0;
    color: var(--sr-muted);
    font-size: 14px;
}

.empty-state {
    border: 1px dashed #C9D8CE;
    border-radius: 18px;
    padding: 34px;
    color: var(--sr-muted);
    text-align: center;
    background:
        linear-gradient(135deg, rgba(232, 243, 234, 0.92), rgba(255, 255, 255, 0.78));
}

/* ==============================
   Tables
================================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: left;
    font-size: 12px;
    color: var(--sr-muted);
    border-bottom: 1px solid var(--sr-line);
    padding: 0 14px 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.data-table td {
    border-bottom: 1px solid var(--sr-line-soft);
    padding: 16px 14px;
    vertical-align: middle;
    font-size: 14px;
}

.data-table tbody tr {
    transition: background .14s ease;
}

.data-table tbody tr:hover {
    background: rgba(232, 243, 234, 0.72);
}

.table-actions {
    text-align: right;
    font-weight: 900;
    color: var(--sr-forest);
    white-space: nowrap;
}

.table-actions a {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(167, 201, 87, 0.16);
    color: var(--sr-forest);
}

.table-actions a:hover {
    background: rgba(167, 201, 87, 0.26);
}

.data-table td,
.data-table th {
    white-space: nowrap;
}

.data-table td:nth-child(4),
.data-table th:nth-child(4) {
    white-space: normal;
    min-width: 220px;
}

/* ==============================
   Badges
================================= */

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.badge-pending {
    background: var(--sr-warning-bg);
    color: var(--sr-warning);
    border: 1px solid rgba(138, 106, 67, 0.18);
}

.badge-success {
    background: var(--sr-success-bg);
    color: var(--sr-success);
    border: 1px solid rgba(38, 122, 74, 0.14);
}

.badge-danger {
    background: var(--sr-danger-bg);
    color: var(--sr-danger);
    border: 1px solid rgba(180, 35, 24, 0.14);
}

.badge-warning {
    background: var(--sr-warning-bg);
    color: var(--sr-warning);
    border: 1px solid rgba(138, 106, 67, 0.18);
}

.badge-muted {
    background: #EEF2EF;
    color: var(--sr-muted);
    border: 1px solid rgba(102, 117, 111, 0.18);
}

/* ==============================
   Forms
================================= */

.form-grid {
    display: grid;
    gap: 30px;
}

.form-section {
    border-bottom: 1px solid var(--sr-line);
    padding-bottom: 26px;
}

.form-section:last-of-type {
    border-bottom: 0;
}

.form-section h2 {
    margin: 0 0 18px;
    font-size: 21px;
    letter-spacing: -0.035em;
    color: var(--sr-ink);
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 17px;
}

.field textarea {
    resize: vertical;
    min-height: 110px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 4px;
}

/* ==============================
   Detail
================================= */

.detail-panel {
    display: grid;
    gap: 24px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--sr-line);
    padding-bottom: 22px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.detail-label {
    display: block;
    color: var(--sr-muted);
    font-size: 12px;
    font-weight: 950;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.detail-grid strong,
.detail-header strong {
    font-size: 16px;
    color: var(--sr-ink);
}

.detail-notes {
    border-top: 1px solid var(--sr-line);
    padding-top: 22px;
}

.detail-notes p {
    margin: 0;
    line-height: 1.6;
    color: var(--sr-forest);
}

/* ==============================
   Sistema / Estado / Errores
================================= */

.system-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--sr-line);
}

.error-panel {
    max-width: 720px;
    margin: 40px auto;
}

.error-panel h1 {
    margin-top: 0;
}

/* ==============================
   Estados interactivos
================================= */

button:disabled,
input[type="submit"]:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none !important;
}

/* ==============================
   Responsive
================================= */

@media (max-width: 980px) {
    :root {
        --sidebar-width: 270px;
    }

    .guest-wrapper {
        grid-template-columns: 1fr;
        gap: 28px;
        width: min(540px, calc(100% - 36px));
    }

    .guest-wrapper::before {
        font-size: clamp(34px, 10vw, 54px);
        text-align: center;
        max-width: none;
    }

    .app-shell {
        display: block;
        min-height: calc(100vh - var(--topbar-height));
    }

    .sidebar {
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        bottom: 0;
        width: min(306px, 86vw);
        transform: translateX(-105%);
        transition: transform .22s ease;
        z-index: 35;
        overflow-y: auto;
        overflow-x: hidden;
        border-right: 1px solid var(--sr-line);
        border-bottom: 0;
        padding: 18px 14px;
        box-shadow: 18px 0 46px rgba(16, 32, 28, 0.20);
    }

    .sidebar::before {
        display: none;
    }

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

    .sidebar-inner,
    .sidebar nav {
        display: grid;
        gap: 7px;
        position: static;
        min-width: 0;
    }

    .sidebar-section-title {
        height: auto;
        margin: 6px 9px 8px;
        text-align: left;
        font-size: 10px;
    }

    .sidebar-section-title::after {
        content: none;
    }

    .sidebar-link {
        justify-content: flex-start;
        gap: 10px;
        white-space: normal;
        min-height: 40px;
        padding: 9px 10px;
    }

    .sidebar-link-label {
        display: inline-block;
        white-space: nowrap;
    }

    .sidebar-link-icon {
        flex: 0 0 26px;
        width: 26px;
        height: 26px;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: var(--topbar-height) 0 0;
        background: rgba(16, 32, 28, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 30;
    }

    .mobile-menu-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-body.sidebar-collapsed {
        --sidebar-width: 270px;
    }

    .app-body.sidebar-collapsed .sidebar {
        padding: 18px 14px;
    }

    .app-body.sidebar-collapsed .sidebar-section-title {
        height: auto;
        margin: 6px 9px 8px;
        text-align: left;
        font-size: 10px;
    }

    .app-body.sidebar-collapsed .sidebar-section-title::after {
        content: none;
    }

    .app-body.sidebar-collapsed .sidebar-link {
        justify-content: flex-start;
        gap: 10px;
        padding: 9px 10px;
    }

    .app-body.sidebar-collapsed .sidebar-link-label {
        display: inline-block;
    }

    .app-body.sidebar-collapsed .sidebar-link-icon {
        flex: 0 0 26px;
        width: 26px;
        height: 26px;
    }

    .main-content,
    .app-body.sidebar-collapsed .main-content {
        width: min(100% - 32px, 1180px);
        padding: 28px 0 44px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .system-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar {
        height: auto;
        min-height: 106px;
        padding: 14px 16px;
        align-items: stretch;
        gap: 12px;
        flex-direction: column;
    }

    .topbar-brand {
        width: 100%;
        justify-content: space-between;
        min-width: 0;
    }

    .topbar-logo {
        height: 34px;
    }

    .topbar-product {
        display: none;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .topbar-user-data {
        text-align: left;
    }

    .topbar-agency,
    .topbar-user-data small {
        max-width: calc(100vw - 122px);
    }

    .sidebar {
        top: 106px;
    }

    .sidebar-backdrop {
        inset: 106px 0 0;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-row,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions a,
    .form-actions button,
    .page-header a {
        width: 100%;
    }

    .panel,
    .stat-card,
    .login-card {
        border-radius: 20px;
    }

    .panel {
        padding: 20px;
    }

    .panel-header {
        flex-direction: column;
    }

    .panel-header .button-secondary {
        width: 100%;
    }

    .table-responsive {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        padding: 0 20px;
    }
}

/* ==============================
   Dashboard
================================= */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--sr-green);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .09em;
}

.dashboard-hero {
    margin-bottom: 22px;
}

.dashboard-hero p strong {
    color: var(--sr-forest);
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-stats {
    gap: 14px;
    margin-bottom: 22px;
}

.dashboard-stats .stat-card {
    padding: 20px 20px 18px;
    min-height: 132px;
}

.dashboard-stats .stat-card strong {
    font-size: 36px;
}

.dashboard-stats .stat-card small {
    display: block;
    margin-top: 9px;
    color: var(--sr-muted);
    font-size: 13px;
    font-weight: 700;
}

.stat-card-primary {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 243, 234, 0.92));
    border-color: rgba(47, 111, 78, 0.18);
}

.dashboard-panel {
    padding: 22px;
}

.dashboard-panel .panel-header {
    margin-bottom: 16px;
}

.dashboard-table th {
    padding-bottom: 10px;
}

.dashboard-table td {
    padding-top: 13px;
    padding-bottom: 13px;
}

.table-code {
    color: var(--sr-muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: -0.01em;
}

.table-main-text {
    color: var(--sr-ink);
    font-weight: 900;
}

.dashboard-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 32px 20px;
}

.dashboard-empty strong {
    color: var(--sr-forest);
    font-size: 17px;
}

.dashboard-empty span {
    color: var(--sr-muted);
    font-size: 14px;
    max-width: 460px;
}

.dashboard-empty .button-primary {
    margin-top: 10px;
}

@media (max-width: 720px) {
    .page-actions {
        width: 100%;
        justify-content: stretch;
    }

    .page-actions a {
        width: 100%;
    }

    .dashboard-stats .stat-card {
        min-height: 0;
    }

    .dashboard-panel {
        padding: 18px;
    }
}

/* ==============================
   Reservas / listado
================================= */

.reservations-header {
    margin-bottom: 22px;
}

.reservations-panel {
    padding: 22px;
}

.reservations-panel-header {
    margin-bottom: 14px;
}

.reservations-table th {
    padding-bottom: 10px;
}

.reservations-table td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.table-date {
    color: var(--sr-forest);
    font-weight: 850;
}

.table-service {
    max-width: 340px;
    color: var(--sr-forest);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pax-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(47, 111, 78, 0.09);
    color: var(--sr-forest);
    font-size: 12px;
    font-weight: 950;
}

.reservations-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 32px 20px;
}

.reservations-empty strong {
    color: var(--sr-forest);
    font-size: 17px;
}

.reservations-empty span {
    color: var(--sr-muted);
    font-size: 14px;
    max-width: 460px;
}

.reservations-empty .button-primary {
    margin-top: 10px;
}

@media (max-width: 720px) {
    .reservations-panel {
        padding: 18px;
    }

    .table-service {
        max-width: 220px;
    }
}

/* ==============================
   Reservas / formulario
================================= */

.reservation-form-header {
    margin-bottom: 22px;
}

.reservation-form-panel {
    padding: 24px;
}

.reservation-form {
    gap: 22px;
}

.form-alert {
    margin-bottom: 18px;
}

.form-section-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.form-section-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
    letter-spacing: -0.025em;
}

.form-section-header p {
    margin: 0;
    color: var(--sr-muted);
    font-size: 13px;
    line-height: 1.35;
}

.form-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(47, 111, 78, 0.10);
    color: var(--sr-forest);
    font-size: 13px;
    font-weight: 950;
    box-shadow: inset 0 0 0 1px rgba(47, 111, 78, 0.08);
}

.reservation-form .form-section {
    padding-bottom: 22px;
}

.reservation-form .field {
    margin-bottom: 0;
}

.reservation-form .field label {
    font-size: 12px;
}

.reservation-form .field input,
.reservation-form .field textarea,
.reservation-form .field select {
    padding: 12px 13px;
    border-radius: 12px;
    font-size: 14px;
}

.reservation-form .field textarea {
    min-height: 96px;
}

.reservation-form .form-row {
    gap: 14px;
    margin-bottom: 14px;
}

.reservation-form .form-row:last-child {
    margin-bottom: 0;
}

.form-row-compact {
    max-width: 460px;
}

.reservation-form-actions {
    position: sticky;
    bottom: 0;
    margin: 0 -24px -24px;
    padding: 16px 24px;
    background:
        linear-gradient(180deg, rgba(246, 249, 246, 0.74), rgba(255, 255, 255, 0.96) 42%);
    border-top: 1px solid var(--sr-line);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@media (min-width: 981px) {
    .reservation-form .field-wide {
        grid-column: span 1;
    }
}

@media (max-width: 720px) {
    .reservation-form-panel {
        padding: 18px;
    }

    .reservation-form-actions {
        position: static;
        margin: 0 -18px -18px;
        padding: 16px 18px;
    }

    .form-section-header {
        gap: 10px;
    }
}

/* ==============================
   Reservas / detalle
================================= */

.reservation-detail-header {
    margin-bottom: 22px;
}

.reservation-detail-panel {
    padding: 24px;
}

.detail-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: stretch;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--sr-line);
}

.detail-summary-main {
    min-width: 0;
}

.detail-summary-main strong {
    display: block;
    margin-top: 4px;
    color: var(--sr-ink);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1;
    letter-spacing: -0.055em;
}

.detail-summary-main small {
    display: block;
    margin-top: 9px;
    color: var(--sr-muted);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
}

.detail-summary-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, auto));
    gap: 12px;
}

.detail-summary-meta>div,
.detail-item {
    border: 1px solid var(--sr-line);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 246, 0.82));
    padding: 14px 15px;
    min-width: 0;
}

.detail-summary-meta strong,
.detail-item strong {
    display: block;
    color: var(--sr-ink);
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.detail-summary-meta small {
    display: block;
    margin-top: 4px;
    color: var(--sr-muted);
    font-size: 12px;
    font-weight: 750;
}

.reservation-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.reservation-detail-notes {
    border-top: 1px solid var(--sr-line);
    padding-top: 22px;
}

.reservation-detail-notes p {
    border: 1px solid var(--sr-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    padding: 16px;
    color: var(--sr-forest);
}

@media (max-width: 980px) {
    .detail-summary {
        grid-template-columns: 1fr;
    }

    .detail-summary-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .reservation-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .reservation-detail-panel {
        padding: 18px;
    }

    .detail-summary-meta,
    .reservation-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================
   Login refinado
================================= */

.login-heading {
    position: relative;
}

.login-heading .eyebrow {
    margin-bottom: 10px;
}

.login-card .alert {
    position: relative;
}

.login-card .field {
    margin-bottom: 0;
}

.login-card .field label {
    font-size: 12px;
}

.login-card .field input {
    padding: 13px 14px;
    border-radius: 13px;
    font-size: 14px;
}

.login-help {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(232, 243, 234, 0.72);
    border: 1px solid rgba(47, 111, 78, 0.10);
    text-align: left;
}

.login-help strong {
    color: var(--sr-forest);
    font-size: 13px;
    font-weight: 950;
}

.login-help span {
    color: var(--sr-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

/* ==============================
   Login mobile spacing fix
================================= */

@media (max-width: 720px) {
    .guest-body {
        min-height: 100svh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .guest-wrapper {
        min-height: 100svh;
        width: min(100% - 28px, 540px);
        padding: 28px 0 40px;
        align-items: start;
    }

    .login-card {
        padding: 24px;
        margin-bottom: 20px;
        border-radius: 22px;
    }

    .login-logo-wrap {
        padding: 18px;
        margin-bottom: 22px;
        border-radius: 18px;
    }

    .login-logo {
        max-width: 190px;
    }

    .login-card h1 {
        font-size: 26px;
    }
}

@media (max-width: 420px) {
    .guest-wrapper {
        width: min(100% - 22px, 540px);
        padding-top: 22px;
        padding-bottom: 44px;
    }

    .login-card {
        padding: 20px;
    }
}


/* ==============================
   Application shell refinado v2
================================= */

.app-body {
    min-height: 100vh;
    background: #F5F7F5;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns .22s ease;
}

.app-workspace {
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar clara y compacta */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 28px;
    color: var(--sr-ink);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(220, 231, 223, 0.92);
    box-shadow: 0 4px 18px rgba(16, 32, 28, 0.045);
    backdrop-filter: blur(16px);
}

.topbar-start,
.topbar-end,
.topbar-profile {
    display: flex;
    align-items: center;
    min-width: 0;
}

.topbar-start {
    gap: 14px;
}

.topbar-end {
    gap: 14px;
}

.topbar-context,
.topbar-profile-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-eyebrow {
    color: var(--sr-muted);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .10em;
}

.topbar-context strong {
    max-width: 520px;
    overflow: hidden;
    color: var(--sr-ink);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.topbar-profile {
    gap: 10px;
    padding-right: 4px;
}

.topbar-profile-avatar,
.sidebar-footer-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sr-forest), var(--sr-green));
    color: var(--sr-white);
    font-weight: 900;
    letter-spacing: .02em;
}

.topbar-profile-avatar {
    width: 38px;
    height: 38px;
    font-size: 12px;
    box-shadow: 0 8px 18px rgba(47, 111, 78, 0.20);
}

.topbar-profile-copy strong,
.topbar-profile-copy small {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-profile-copy strong {
    color: var(--sr-ink);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.15;
}

.topbar-profile-copy small {
    color: var(--sr-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
}

.topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--sr-line);
    border-radius: 11px;
    background: var(--sr-white);
    color: var(--sr-forest);
    box-shadow: 0 5px 14px rgba(16, 32, 28, 0.04);
    font-size: 12px;
    font-weight: 900;
    transition:
        border-color .16s ease,
        background .16s ease,
        color .16s ease,
        transform .16s ease,
        box-shadow .16s ease;
}

.topbar-logout:hover {
    background: var(--sr-mint);
    color: var(--sr-forest);
    border-color: rgba(47, 111, 78, 0.22);
    box-shadow: 0 8px 18px rgba(16, 32, 28, 0.07);
    transform: translateY(-1px);
}

.menu-toggle,
.menu-toggle.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--sr-line);
    border-radius: 11px;
    background: var(--sr-white);
    color: var(--sr-forest);
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(16, 32, 28, 0.04);
    transition:
        border-color .16s ease,
        background .16s ease,
        transform .16s ease;
}

.menu-toggle span,
.menu-toggle.sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.menu-toggle:hover,
.menu-toggle.sidebar-toggle:hover {
    background: var(--sr-mint);
    border-color: rgba(47, 111, 78, 0.22);
    transform: translateY(-1px);
}

/* Sidebar de producto */

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.97);
    border-right: 1px solid rgba(220, 231, 223, 0.96);
    box-shadow: 8px 0 28px rgba(16, 32, 28, 0.035);
    backdrop-filter: blur(16px);
    transition:
        width .22s ease,
        transform .22s ease;
}

.sidebar::before {
    display: none;
}

.sidebar-brand {
    flex: 0 0 var(--topbar-height);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--sr-line-soft);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    width: 100%;
}

.sidebar-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--sr-white);
    border: 1px solid var(--sr-line);
    box-shadow: 0 8px 18px rgba(16, 32, 28, 0.06);
    overflow: hidden;
}

.sidebar-brand-mark img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.sidebar-brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.sidebar-brand-copy strong {
    color: var(--sr-ink);
    font-size: 15px;
    font-weight: 950;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.sidebar-brand-copy small {
    color: var(--sr-muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.1;
    white-space: nowrap;
}

.sidebar-navigation {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 117, 111, 0.26) transparent;
}

.sidebar-inner,
.sidebar nav {
    position: static;
    display: grid;
    gap: 18px;
}

.sidebar-action,
.sidebar-menu-group,
.sidebar-menu-list {
    display: grid;
}

.sidebar-action,
.sidebar-menu-list {
    gap: 5px;
}

.sidebar-menu-group {
    gap: 7px;
}

.sidebar-section-title {
    height: auto;
    margin: 0;
    padding: 0 10px;
    color: var(--sr-muted-2);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.sidebar-section-title::after {
    content: none;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: #33413C;
    box-shadow: none;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    transition:
        background .16s ease,
        color .16s ease,
        border-color .16s ease,
        transform .16s ease;
}

.sidebar-link:hover {
    background: #F5F8F5;
    color: var(--sr-forest);
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.sidebar-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 0;
    background: transparent;
    color: var(--sr-muted);
    box-shadow: none;
}

.sidebar-link-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-link-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-link.is-active:not(.sidebar-link-primary) {
    background: linear-gradient(90deg, rgba(232, 243, 234, 0.96), rgba(245, 249, 246, 0.94));
    color: var(--sr-forest);
    border-color: rgba(47, 111, 78, 0.08);
    box-shadow: inset 3px 0 0 var(--sr-green);
}

.sidebar-link.is-active:not(.sidebar-link-primary) .sidebar-link-icon {
    background: transparent;
    color: var(--sr-green);
}

.sidebar-link-primary {
    min-height: 45px;
    color: var(--sr-white);
    background: linear-gradient(135deg, var(--sr-forest), var(--sr-green));
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(47, 111, 78, 0.18);
}

.sidebar-link-primary:hover {
    color: var(--sr-white);
    background: linear-gradient(135deg, var(--sr-green), var(--sr-green-2));
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(47, 111, 78, 0.22);
    transform: translateY(-1px);
}

.sidebar-link-primary .sidebar-link-icon {
    color: var(--sr-white);
    background: transparent;
    box-shadow: none;
}

.sidebar-link-primary.is-active {
    outline: none;
    box-shadow:
        0 12px 24px rgba(47, 111, 78, 0.22),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 14px 18px;
    border-top: 1px solid var(--sr-line-soft);
    background: rgba(250, 252, 250, 0.94);
}

.sidebar-footer-avatar {
    width: 34px;
    height: 34px;
    font-size: 11px;
    box-shadow: 0 7px 16px rgba(47, 111, 78, 0.16);
}

.sidebar-footer-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.sidebar-footer-copy strong,
.sidebar-footer-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer-copy strong {
    color: var(--sr-ink);
    font-size: 12px;
    font-weight: 900;
}

.sidebar-footer-copy small {
    color: var(--sr-muted);
    font-size: 10px;
    font-weight: 750;
}

/* Contenido */

.main-content {
    flex: 1 1 auto;
    width: min(1240px, calc(100% - 56px));
    margin: 0 auto;
    padding: 30px 0 52px;
}

.sidebar-backdrop {
    display: none;
}

/* Sidebar colapsado */

.app-body.sidebar-collapsed {
    --sidebar-width: 78px;
}

.app-body.sidebar-collapsed .sidebar-brand {
    padding-left: 19px;
    padding-right: 19px;
}

.app-body.sidebar-collapsed .sidebar-brand-link {
    justify-content: center;
}

.app-body.sidebar-collapsed .sidebar-brand-copy,
.app-body.sidebar-collapsed .sidebar-footer-copy,
.app-body.sidebar-collapsed .sidebar-link-label {
    display: none;
}

.app-body.sidebar-collapsed .sidebar-navigation {
    padding-left: 13px;
    padding-right: 13px;
}

.app-body.sidebar-collapsed .sidebar-section-title {
    height: 10px;
    padding: 0;
    font-size: 0;
    text-align: center;
}

.app-body.sidebar-collapsed .sidebar-section-title::after {
    content: "•";
    display: block;
    color: var(--sr-muted-2);
    font-size: 14px;
}

.app-body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    padding-left: 8px;
    padding-right: 8px;
}

.app-body.sidebar-collapsed .sidebar-link-icon {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
}

.app-body.sidebar-collapsed .sidebar-footer {
    justify-content: center;
    padding-left: 12px;
    padding-right: 12px;
}

.app-body.sidebar-collapsed .main-content {
    width: min(1280px, calc(100% - 56px));
}

/* Flash alineado con la nueva topbar */

.flash-stack[data-flash-stack] {
    top: calc(var(--topbar-height) + 16px);
}

/* Tablet / menú lateral flotante */

@media (max-width: 980px) {
    :root {
        --sidebar-width: 286px;
    }

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

    .app-workspace {
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 60;
        width: min(306px, 88vw);
        height: 100dvh;
        transform: translateX(-105%);
        box-shadow: 20px 0 48px rgba(16, 32, 28, 0.20);
    }

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

    .sidebar-brand {
        padding: 0 18px;
    }

    .sidebar-navigation {
        padding: 18px 14px;
    }

    .sidebar-inner,
    .sidebar nav {
        position: static;
    }

    .sidebar-section-title {
        height: auto;
        padding: 0 10px;
        font-size: 10px;
        text-align: left;
    }

    .sidebar-section-title::after {
        content: none;
    }

    .sidebar-link,
    .app-body.sidebar-collapsed .sidebar-link {
        justify-content: flex-start;
        gap: 11px;
        min-height: 43px;
        padding: 9px 11px;
    }

    .sidebar-link-label,
    .app-body.sidebar-collapsed .sidebar-link-label,
    .app-body.sidebar-collapsed .sidebar-brand-copy,
    .app-body.sidebar-collapsed .sidebar-footer-copy {
        display: block;
    }

    .sidebar-footer {
        justify-content: flex-start;
        padding: 14px 18px;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 50;
        background: rgba(16, 32, 28, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        backdrop-filter: blur(2px);
    }

    .mobile-menu-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-body.sidebar-collapsed {
        --sidebar-width: 286px;
    }

    .topbar {
        padding-left: 20px;
        padding-right: 20px;
    }

    .main-content,
    .app-body.sidebar-collapsed .main-content {
        width: min(100% - 36px, 1180px);
        padding: 26px 0 44px;
    }
}

/* Mobile */

@media (max-width: 720px) {
    :root {
        --topbar-height: 64px;
    }

    .topbar {
        height: var(--topbar-height);
        min-height: var(--topbar-height);
        padding: 0 14px;
        gap: 10px;
        flex-direction: row;
        align-items: center;
    }

    .topbar-start {
        flex: 1 1 auto;
        gap: 10px;
        min-width: 0;
    }

    .topbar-context {
        min-width: 0;
    }

    .topbar-eyebrow {
        display: none;
    }

    .topbar-context strong {
        max-width: calc(100vw - 164px);
        font-size: 14px;
    }

    .topbar-profile-copy,
    .topbar-logout span {
        display: none;
    }

    .topbar-profile {
        padding: 0;
    }

    .topbar-profile-avatar {
        width: 36px;
        height: 36px;
    }

    .topbar-logout {
        width: 36px;
        min-width: 36px;
        min-height: 36px;
        padding: 0;
        border-radius: 10px;
    }

    .topbar-logout::before {
        content: "↗";
        font-size: 17px;
        line-height: 1;
        transform: rotate(45deg);
    }

    .menu-toggle,
    .menu-toggle.sidebar-toggle {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .sidebar {
        width: min(300px, 88vw);
    }

    .main-content,
    .app-body.sidebar-collapsed .main-content {
        width: min(100% - 28px, 1180px);
        padding: 22px 0 38px;
    }

    .flash-stack[data-flash-stack] {
        top: calc(var(--topbar-height) + 12px);
    }
}

@media (max-width: 420px) {
    .topbar-context strong {
        max-width: calc(100vw - 152px);
    }

    .main-content,
    .app-body.sidebar-collapsed .main-content {
        width: min(100% - 22px, 1180px);
    }
}

@media (prefers-reduced-motion: reduce) {

    .app-shell,
    .sidebar,
    .sidebar-link,
    .topbar-logout,
    .menu-toggle,
    .menu-toggle.sidebar-toggle {
        transition: none;
    }
}

/* ==============================
   Reservas / alta avanzada
================================= */

.reservation-sections {
    display: grid;
    gap: 16px;
}

.reservation-section {
    border: 1px solid var(--sr-line, #dfe4e7);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.reservation-section summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    cursor: pointer;
    list-style: none;
    font-weight: 900;
}

.reservation-section summary::-webkit-details-marker {
    display: none;
}

.reservation-section summary::after {
    content: "⌄";
    margin-left: auto;
    color: var(--sr-muted, #667085);
    transition: transform .2s ease;
}

.reservation-section[open] summary::after {
    transform: rotate(180deg);
}

.reservation-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 10px;
    background: rgba(47, 111, 78, .1);
    color: var(--sr-forest, #2f6f4e);
    font-size: 13px;
}

.reservation-section-copy strong {
    display: block;
}

.reservation-section-copy small {
    display: block;
    margin-top: 3px;
    color: var(--sr-muted, #667085);
    font-size: 12px;
    font-weight: 600;
}

.reservation-section-body {
    padding: 18px;
    border-top: 1px solid var(--sr-line, #dfe4e7);
}

.reservation-pax-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.reservation-pax-total {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(47, 111, 78, .07);
    color: var(--sr-forest, #2f6f4e);
    font-weight: 900;
}

.reservation-field-message {
    min-height: 18px;
    margin-top: 5px;
    color: var(--sr-muted, #667085);
    font-size: 12px;
    line-height: 18px;
}

.reservation-field-message:empty::before {
    content: "\00a0";
}

.reservation-field-message.is-error {
    color: #b42318;
}

.reservation-field-message.is-warning {
    color: #9a6700;
}

.reservation-form [aria-invalid="true"] {
    border-color: #d92d20;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, .10);
}

.reservation-form .iti {
    width: 100%;
}

.reservation-form .iti input {
    width: 100%;
}

.iti--container {
    z-index: 100000 !important;
}

.reservation-actions-status {
    margin-right: auto;
    color: var(--sr-muted, #667085);
    font-size: 12px;
}

.reservation-form .iti {
    width: 100%;
}

.reservation-form .iti input {
    width: 100%;
}

@media (max-width: 720px) {
    .reservation-pax-grid {
        grid-template-columns: 1fr;
    }

    .reservation-section summary {
        align-items: flex-start;
    }
}

/* intl-tel-input se carga desde app.js solamente en la pantalla de alta. */
.reservation-form .iti {
    width: 100%;
}

.reservation-form .iti input {
    width: 100%;
}

.iti--container {
    z-index: 100000 !important;
}

/* ==============================
   Reservas / listado ampliado
   Selectores encapsulados
================================= */

.reservations-table .table-secondary-text {
    display: block;
    margin-top: 4px;
    color: var(--sr-muted);
    font-size: 11px;
    font-weight: 750;
}

.reservations-table .pax-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.reservations-table .pax-summary small {
    color: var(--sr-muted);
    font-size: 11px;
    font-weight: 750;
}

/* ==============================
   Reservas / detalle ampliado
   Selectores encapsulados
================================= */

.reservation-show {
    display: grid;
    gap: 0;
    padding: 24px;
}

.reservation-show .reservation-show-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: stretch;
    padding-bottom: 22px;
}

.reservation-show .reservation-show-identity {
    min-width: 0;
}

.reservation-show .reservation-show-identity>strong {
    display: block;
    margin-top: 4px;
    color: var(--sr-ink);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1;
    letter-spacing: -0.055em;
}

.reservation-show .reservation-show-identity>small {
    display: block;
    margin-top: 9px;
    color: var(--sr-muted);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
}

.reservation-show .reservation-show-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, auto));
    gap: 12px;
}

.reservation-show .reservation-show-summary>div,
.reservation-show .reservation-show-card {
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid var(--sr-line);
    border-radius: 16px;
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.92),
            rgba(246, 249, 246, 0.82));
}

.reservation-show .reservation-show-summary strong,
.reservation-show .reservation-show-card strong {
    display: block;
    color: var(--sr-ink);
    font-size: 15px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.reservation-show .reservation-show-summary small {
    display: block;
    margin-top: 4px;
    color: var(--sr-muted);
    font-size: 12px;
    font-weight: 750;
}

.reservation-show .reservation-show-section {
    display: grid;
    gap: 16px;
    padding: 24px 0;
    border-top: 1px solid var(--sr-line);
}

.reservation-show .reservation-show-section-title h2 {
    margin: 0;
    color: var(--sr-ink);
    font-size: 19px;
    letter-spacing: -0.03em;
}

.reservation-show .reservation-show-section-title .eyebrow {
    margin-bottom: 5px;
}

.reservation-show .reservation-show-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.reservation-show .reservation-show-grid-main {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.reservation-show .reservation-show-main-code,
.reservation-show .reservation-show-main-date,
.reservation-show .reservation-show-main-language {
    grid-column: span 2;
}

.reservation-show .reservation-show-main-service {
    grid-column: 1 / -1;
}

.reservation-show .reservation-show-main-email,
.reservation-show .reservation-show-main-phone {
    grid-column: span 3;
}

.reservation-show .reservation-show-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.reservation-show .reservation-show-logistics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.reservation-show .reservation-show-logistics-wide {
    grid-column: 1 / -1;
}

.reservation-show .reservation-show-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.reservation-show .reservation-show-note {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--sr-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.reservation-show .reservation-show-note p {
    margin: 0;
    color: var(--sr-forest);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.reservation-show .reservation-show-operation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding: 14px 16px;
    border: 1px solid rgba(47, 111, 78, 0.14);
    border-radius: 14px;
    background: var(--sr-mint);
}

.reservation-show .reservation-show-operation .detail-label {
    margin: 0;
}

.reservation-show .reservation-show-operation strong {
    color: var(--sr-forest);
}

@media (max-width: 980px) {
    .reservation-show .reservation-show-hero {
        grid-template-columns: 1fr;
    }

    .reservation-show .reservation-show-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .reservation-show .reservation-show-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reservation-show .reservation-show-grid-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reservation-show .reservation-show-main-code,
    .reservation-show .reservation-show-main-date,
    .reservation-show .reservation-show-main-language,
    .reservation-show .reservation-show-main-email,
    .reservation-show .reservation-show-main-phone {
        grid-column: span 1;
    }

    .reservation-show .reservation-show-main-service {
        grid-column: 1 / -1;
    }

    .reservation-show .reservation-show-notes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .reservations-table .pax-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .reservation-show {
        padding: 18px;
    }

    .reservation-show .reservation-show-summary,
    .reservation-show .reservation-show-grid,
    .reservation-show .reservation-show-grid-main,
    .reservation-show .reservation-show-logistics {
        grid-template-columns: 1fr;
    }

    .reservation-show .reservation-show-main-code,
    .reservation-show .reservation-show-main-date,
    .reservation-show .reservation-show-main-language,
    .reservation-show .reservation-show-main-service,
    .reservation-show .reservation-show-main-email,
    .reservation-show .reservation-show-main-phone,
    .reservation-show .reservation-show-logistics-wide {
        grid-column: auto;
    }

    .reservation-show .reservation-show-operation {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==============================
   Reservas / diferencias con Pex
================================= */

.reservation-show .reservation-show-change-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 16px 18px;
    border: 1px solid rgba(138, 106, 67, 0.24);
    border-radius: 16px;
    background: linear-gradient(135deg, var(--sr-warning-bg), rgba(255, 255, 255, .92));
}

.reservation-show .reservation-show-change-notice div {
    display: grid;
    gap: 3px;
}

.reservation-show .reservation-show-change-notice strong {
    color: var(--sr-earth);
    font-size: 15px;
}

.reservation-show .reservation-show-change-notice span {
    color: var(--sr-muted);
    font-size: 13px;
}

.reservation-show .reservation-show-change-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sr-earth);
    color: var(--sr-white) !important;
    font-size: 14px !important;
    font-weight: 950;
}

.reservation-show .is-changed,
.reservation-show-card.is-changed,
.reservation-show-note.is-changed {
    border-color: rgba(138, 106, 67, 0.42) !important;
    background:
        linear-gradient(135deg, rgba(248, 241, 226, 0.96), rgba(255, 255, 255, 0.92)) !important;
    box-shadow: inset 4px 0 0 var(--sr-earth);
}

.reservation-show-identity.is-changed {
    padding: 14px 16px;
    border: 1px solid rgba(138, 106, 67, 0.42);
    border-radius: 16px;
}

.reservation-show .reservation-show-original {
    display: block;
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px dashed rgba(138, 106, 67, 0.30);
    color: var(--sr-muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.reservation-show .reservation-show-original span {
    display: block;
    margin-bottom: 2px;
    color: var(--sr-earth);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
}

@media (max-width: 720px) {
    .reservation-show .reservation-show-change-notice {
        align-items: flex-start;
    }
}

/* ==============================
   Reservas / trazabilidad Pex
================================= */

.reservation-show .reservation-show-processing {
    display: grid;
    gap: 13px;
    margin-top: 24px;
    padding: 17px 18px;
    border: 1px solid rgba(38, 122, 74, 0.18);
    border-radius: 16px;
    background: linear-gradient(135deg, var(--sr-success-bg), rgba(255, 255, 255, 0.94));
}

.reservation-show .reservation-show-processing.is-rejected {
    border-color: rgba(180, 35, 24, 0.20);
    background: linear-gradient(135deg, var(--sr-danger-bg), rgba(255, 255, 255, 0.94));
}

.reservation-show .reservation-show-processing-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.reservation-show .reservation-show-processing-heading strong {
    display: block;
    color: var(--sr-success);
    font-size: 16px;
}

.reservation-show .reservation-show-processing.is-rejected .reservation-show-processing-heading strong {
    color: var(--sr-danger);
}

.reservation-show .reservation-show-processing-heading time {
    flex: 0 0 auto;
    color: var(--sr-muted);
    font-size: 12px;
    font-weight: 800;
}

.reservation-show .reservation-show-processing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--sr-muted);
    font-size: 12px;
    font-weight: 750;
}

.reservation-show .reservation-show-rejection-reason {
    padding-top: 13px;
    border-top: 1px solid rgba(180, 35, 24, 0.14);
}

.reservation-show .reservation-show-rejection-reason p {
    margin: 0;
    color: var(--sr-danger);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .reservation-show .reservation-show-processing-heading {
        flex-direction: column;
        gap: 7px;
    }
}


/* ==============================
   Reservas / buscador y listado paginado
================================= */

.reservations-filter-panel {
    margin-bottom: 18px;
    padding: 20px 22px;
}

.reservations-filters {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr)) 100px auto;
    gap: 14px;
    align-items: end;
}

.reservations-filters .field {
    margin: 0;
}

.reservations-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reservations-filter-actions .button-primary,
.reservations-filter-actions .button-secondary {
    min-height: 46px;
    padding: 12px 16px;
    white-space: nowrap;
}

.table-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: inherit;
}

.table-sort-link span {
    color: var(--sr-green);
    font-size: 13px;
}

.reservations-table-sortable tbody .reservation-row {
    cursor: pointer;
}

.reservations-table-sortable tbody .reservation-row:focus-within {
    background: rgba(232, 243, 234, 0.82);
}

.reservations-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--sr-line);
}

.reservations-pagination>span {
    color: var(--sr-muted);
    font-size: 13px;
    font-weight: 750;
}

.reservations-pagination .is-disabled {
    opacity: .45;
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1180px) {
    .reservations-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .reservations-search-field {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .reservations-filter-panel {
        padding: 18px;
    }

    .reservations-filters {
        grid-template-columns: 1fr;
    }

    .reservations-search-field {
        grid-column: auto;
    }

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

    .reservations-filter-actions .button-primary,
    .reservations-filter-actions .button-secondary {
        width: 100%;
    }

    .reservations-pagination {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .reservations-pagination .button-secondary {
        width: 100%;
    }
}
