/* =====================================================
   PUNTO DE ENCUENTRO INCLUSIVO - STYLES
   Warm Kiosk: Chunky, tactile, cognitively accessible
   ===================================================== */

@font-face {
    font-family: 'Lexend';
    src: url('../fonts/Lexend-Variable.ttf') format('truetype');
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

/* --- Reset & Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --red: #E31E24;
    --red-dark: #B91820;
    --green: #22c55e;
    --green-dark: #16a34a;
    --green-light: #dcfce7;
    --blue: #3b82f6;
    --blue-dark: #2563eb;
    --blue-light: #dbeafe;
    --orange: #f97316;
    --orange-dark: #ea580c;
    --orange-light: #ffedd5;
    --yellow: #eab308;
    --yellow-dark: #ca8a04;
    --yellow-light: #fef9c3;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --text: #1a1a1a;
    --text-muted: #555;
    --bg: #f8f9fa;
    --white: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
    --transition: 0.2s ease;
    --font: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --app-height: 100dvh;
    --visual-viewport-height: 100dvh;
    --visual-viewport-offset-top: 0px;
    --visual-viewport-offset-bottom: 0px;
    --install-banner-offset: 0px;
}

html {
    height: 100%;
    font-size: clamp(16px, 2.5vw, 22px);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    height: var(--app-height);
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: var(--app-height);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow: hidden;
}

#app {
    position: relative;
    min-height: 100%;
    height: 100%;
}

@media (display-mode: standalone) {
    body { overscroll-behavior: none; }
}

/* --- Screen System --- */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8%);
    transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding-bottom: var(--install-banner-offset);
    will-change: transform, opacity;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
    transform: translateX(0);
}

.screen.leaving {
    opacity: 0;
    transform: translateX(-8%);
    pointer-events: none;
    z-index: 0;
}

.screen.no-transition {
    transition: none !important;
}

#screen-menu,
#screen-schedule,
#screen-guia,
#screen-admin {
    overflow: hidden;
}

html.install-banner-active #screen-menu,
html.install-banner-active #screen-schedule,
html.install-banner-active #screen-guia {
    overflow-y: auto;
    overflow-x: hidden;
}

/* --- Utility --- */
.hidden,
.btn-xlarge.hidden { display: none !important; }

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}
.pin-dots.shake { animation: shake 0.5s ease-in-out; }

/* --- Buttons base --- */
button {
    font-family: var(--font);
    font-size: 1rem;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:focus-visible {
    outline: 4px solid var(--blue);
    outline-offset: 2px;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: var(--red);
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:active { transform: scale(0.94); filter: brightness(0.92); transition: transform 0.1s cubic-bezier(0.22, 1, 0.36, 1); }

.btn-secondary {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: var(--gray-200);
    color: var(--text);
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.btn-secondary:hover { background: var(--gray-300); }
.btn-secondary:active { transform: scale(0.94); filter: brightness(0.95); transition: transform 0.1s cubic-bezier(0.22, 1, 0.36, 1); }

/* --- Screen Header --- */
.screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--white);
    border-bottom: 2px solid var(--gray-200);
    flex-shrink: 0;
}

.screen-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    min-width: 0;
    line-height: 1.15;
    overflow-wrap: break-word;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--text);
    transition: background var(--transition);
}
.back-btn:hover { background: var(--gray-200); }

/* =====================================================
   PIN SCREEN
   ===================================================== */
.pin-container {
    --pin-keypad-gap: clamp(10px, 1.7vh, 12px);
    --pin-keypad-button-size: clamp(54px, 9.6vh, 72px);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: clamp(16px, 3.5vh, 24px) clamp(14px, 5vw, 24px);
    gap: clamp(10px, 2vh, 18px);
    background: linear-gradient(170deg, var(--gray-900) 0%, #2d1b1c 100%);
    color: var(--white);
}

.pin-header {
    text-align: center;
    margin-bottom: clamp(10px, 2.2vh, 24px);
}

.pin-logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--red);
    margin-bottom: 8px;
    max-width: 14ch;
    margin-inline: auto;
    line-height: 1.1;
    text-wrap: balance;
}

.pin-clock {
    font-size: clamp(2rem, 7.3vh, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.pin-date {
    font-size: clamp(0.74rem, 1.7vh, 0.85rem);
    color: var(--gray-400);
    margin-top: 4px;
    text-transform: capitalize;
}

.pin-prompt {
    font-size: clamp(0.95rem, 2.3vh, 1.1rem);
    font-weight: 600;
    margin-bottom: clamp(10px, 2vh, 20px);
    color: var(--gray-300);
    text-align: center;
    text-wrap: balance;
}

.pin-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(10px, 2vw, 12px);
    min-height: 14px;
    margin-bottom: clamp(10px, 2vh, 16px);
}

.pin-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--red);
    opacity: 0;
    transform: scale(0.2);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.pin-dot.filled {
    background: var(--red);
    opacity: 1;
    transform: scale(1);
}

.pin-toast {
    position: fixed;
    bottom: calc(40px + var(--install-banner-offset));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #ff4444;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    text-align: center;
}

.pin-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.offline-clock-banner {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100vw - 24px), 32rem);
    padding: 12px 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(17,24,39,0.96), rgba(31,41,55,0.96));
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--white);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 18px 44px rgba(15,23,42,0.28);
    z-index: 260;
    pointer-events: none;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    gap: var(--pin-keypad-gap);
    width: min(100%, calc(var(--pin-keypad-button-size) * 3 + var(--pin-keypad-gap) * 2));
    max-width: calc(var(--pin-keypad-button-size) * 3 + var(--pin-keypad-gap) * 2);
    margin-inline: auto;
    align-self: center;
}

.pin-keypad .key-btn {
    min-height: var(--pin-keypad-button-size);
    aspect-ratio: 1.12;
    font-size: clamp(1.35rem, 3.6vh, 1.8rem);
}

.key-btn {
    width: 100%;
    aspect-ratio: 1.3;
    min-height: 64px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    user-select: none;
}

.key-btn:hover { background: rgba(255,255,255,0.14); }

.key-btn:active {
    background: rgba(255,255,255,0.22);
    transform: scale(0.95);
}

.key-empty {
    background: transparent !important;
    border-color: transparent !important;
}

.key-clear {
    color: var(--gray-400);
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}

.pin-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: clamp(10px, 2vh, 20px);
    font-weight: 600;
    color: var(--gray-300);
}

.pin-back-btn {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 10;
}

.pin-back-btn:hover {
    background: rgba(255,255,255,0.18);
}

/* =====================================================
   MENU SCREEN
   ===================================================== */
.menu-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 24px 20px;
    background: var(--bg);
    gap: 18px;
}

.menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.greeting {
    flex: 1;
    min-width: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.menu-login-btn {
    flex-shrink: 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--red);
    border: none;
    color: var(--white);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 20px rgba(227,30,36,0.18);
    white-space: nowrap;
}

.menu-login-btn:hover {
    background: #c91a20;
}

.menu-login-btn:active {
    transform: scale(0.97);
}

.menu-admin-shortcut {
    flex-shrink: 0;
    height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--red);
    font-size: 0.9rem;
    font-weight: 700;
    transition: all var(--transition);
}

.menu-direct-shortcut {
    flex-shrink: 0;
    height: 40px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--gray-900);
    color: var(--white);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: none;
    transition: all var(--transition);
}

.menu-direct-shortcut:hover {
    background: #0f172a;
}

.menu-direct-shortcut:active {
    transform: scale(0.97);
}

.menu-admin-shortcut:active {
    background: rgba(227, 30, 36, 0.08);
    transform: scale(0.95);
}

.menu-clock {
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-500);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    flex: 1;
    min-height: 0;
    align-content: stretch;
    grid-auto-rows: minmax(150px, auto);
}

.menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
    border-radius: var(--radius-lg);
    border: 3px solid transparent;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.2s ease;
    min-height: 150px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.menu-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition);
    background: rgba(0,0,0,0.06);
}

.menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
}
.menu-card:active::before { opacity: 1; }
.menu-card:active { transform: scale(0.94) translateY(1px); transition: transform 0.1s cubic-bezier(0.22, 1, 0.36, 1); }

.menu-card.is-locked,
.menu-card[aria-disabled="true"] {
    opacity: 0.52;
    cursor: default;
    box-shadow: none;
}

.menu-card.is-locked::before,
.menu-card[aria-disabled="true"]::before {
    opacity: 0;
}

.menu-card.is-locked:hover,
.menu-card[aria-disabled="true"]:hover {
    transform: none;
    box-shadow: none;
}

.menu-card.is-locked:active,
.menu-card[aria-disabled="true"]:active {
    transform: none;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-emoji {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.card-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    position: absolute;
    top: 12px;
    right: 12px;
}

.card-blue {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue-dark);
}
.card-blue .card-icon { color: var(--blue); }
.card-blue:hover { box-shadow: 0 6px 24px rgba(59, 130, 246, 0.18), 0 2px 6px rgba(0,0,0,0.04); }

.card-green {
    background: var(--green-light);
    border-color: var(--green);
    color: var(--green-dark);
}
.card-green .card-icon { color: var(--green); }
.card-green:hover { box-shadow: 0 6px 24px rgba(34, 197, 94, 0.18), 0 2px 6px rgba(0,0,0,0.04); }

.card-orange {
    background: var(--orange-light);
    border-color: var(--orange);
    color: var(--orange-dark);
}
.card-orange .card-icon { color: var(--orange); }
.card-orange:hover { box-shadow: 0 6px 24px rgba(249, 115, 22, 0.18), 0 2px 6px rgba(0,0,0,0.04); }

.card-yellow {
    background: var(--yellow-light);
    border-color: var(--yellow);
    color: var(--yellow-dark);
}
.card-yellow .card-icon { color: var(--yellow); }
.card-yellow:hover { box-shadow: 0 6px 24px rgba(234, 179, 8, 0.18), 0 2px 6px rgba(0,0,0,0.04); }

.card-admin {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
    min-height: 132px;
}
.card-admin .card-icon { color: var(--gray-500); }
.card-admin:hover { box-shadow: 0 6px 24px rgba(107, 114, 128, 0.15), 0 2px 6px rgba(0,0,0,0.04); }

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
    padding: 14px;
    font-weight: 600;
    color: var(--gray-500);
    border-radius: var(--radius);
    background: var(--gray-100);
    transition: all var(--transition);
    width: 100%;
    flex-shrink: 0;
}
.logout-btn:hover { background: var(--gray-200); color: var(--text); }

/* =====================================================
   SCHEDULE SCREEN
   ===================================================== */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--white);
}

.week-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--text);
    transition: background var(--transition);
}
.week-arrow:hover { background: var(--gray-200); }
.week-arrow:active { background: var(--gray-300); }

.week-label {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 50px repeat(5, 1fr);
    gap: 4px;
    padding: 12px;
    flex: 1;
}

.sched-header {
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
    padding: 8px 2px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sched-time {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.sched-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    min-height: 56px;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    padding: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
    user-select: none;
    line-height: 1.2;
    word-break: break-word;
}

.sched-cell:active { transform: scale(0.94); }


.sched-mine {
    background: var(--blue);
    border: 2px solid var(--blue-dark);
    color: var(--white);
}

.sched-taken {
    background: var(--gray-200);
    border: 2px solid var(--gray-300);
    color: var(--gray-500);
    cursor: default;
}
.sched-taken:active { transform: none; }

.schedule-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-600);
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-free { background: var(--green-light); border: 2px dashed var(--green); }
.legend-mine { background: var(--blue); }
.legend-taken { background: var(--gray-200); border: 2px solid var(--gray-300); }

/* =====================================================
   CLOCK SCREEN
   ===================================================== */
.clock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 24px;
    text-align: center;
    gap: 24px;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.1), transparent 30%),
        radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.06), transparent 30%),
        linear-gradient(180deg, rgba(255,255,255,0.76) 0%, rgba(245,247,245,0.94) 100%);
    position: relative;
    overflow: hidden;
}

.clock-container::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -15%;
    width: 50%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.06);
    pointer-events: none;
}

.clock-container::after {
    content: '';
    position: absolute;
    bottom: -25%;
    left: -10%;
    width: 40%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.04);
    pointer-events: none;
}

.clock-time {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--gray-900);
    text-shadow: 0 1px 2px rgba(0,0,0,0.04);
    position: relative;
    z-index: 1;
}

.clock-today-slot {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--gray-600);
    min-height: 24px;
    padding: 8px 18px;
    background: rgba(255,255,255,0.85);
    border-radius: 999px;
    border: 1px solid rgba(17,24,39,0.06);
    position: relative;
    z-index: 1;
}

.clock-status {
    font-size: 1rem;
    font-weight: 800;
    padding: 12px 28px;
    border-radius: 999px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
    border: 2px solid transparent;
}

.status-pending-in {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: var(--green-dark);
    border-color: rgba(34, 197, 94, 0.2);
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.1);
}

.status-pending-out {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.2);
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.1);
}

.status-pending-sync {
    background: linear-gradient(135deg, #fffbeb 0%, #fde68a 100%);
    color: #a16207;
    border-color: rgba(245, 158, 11, 0.22);
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.12);
}

.status-done {
    background: linear-gradient(135deg, #f0f4ff 0%, #dbeafe 100%);
    color: var(--blue-dark);
    border-color: rgba(59, 130, 246, 0.15);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.08);
}

.clock-btn {
    width: 100%;
    max-width: 320px;
    padding: 28px 32px;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--white);
    border-radius: var(--radius-lg);
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    z-index: 1;
}

.clock-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.clock-btn-in {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3),
                0 2px 6px rgba(34, 197, 94, 0.2),
                inset 0 1px 0 rgba(255,255,255,0.2);
}
.clock-btn-in:hover {
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.35),
                0 4px 8px rgba(34, 197, 94, 0.25),
                inset 0 1px 0 rgba(255,255,255,0.2);
}

.clock-btn-out {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3),
                0 2px 6px rgba(220, 38, 38, 0.2),
                inset 0 1px 0 rgba(255,255,255,0.2);
}
.clock-btn-out:hover {
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.35),
                0 4px 8px rgba(220, 38, 38, 0.25),
                inset 0 1px 0 rgba(255,255,255,0.2);
}

.clock-feedback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.feedback-icon {
    font-size: 3rem;
    line-height: 1;
}

.feedback-msg {
    font-size: 1.2rem;
    font-weight: 700;
}

.feedback-success .feedback-icon::after { content: '\2705'; }
.feedback-success .feedback-msg { color: var(--green-dark); }
.feedback-error .feedback-icon::after { content: '\274C'; }
.feedback-error .feedback-msg { color: #dc2626; }
.feedback-warning {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid rgba(249,115,22,0.16);
}
.feedback-warning .feedback-msg { color: var(--orange-dark); }

.feedback-schedule-btn {
    margin-top: 14px;
    padding: 10px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.feedback-schedule-btn:hover { background: #1d4ed8; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* =====================================================
   GUIA PICKUP SCREEN
   ===================================================== */
.guia-home {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: min(100%, 1100px);
    margin-inline: auto;
    gap: 14px;
}

.guia-steps,
.guia-complete {
    flex: 1;
    min-height: 0;
    width: min(100%, 1100px);
    margin-inline: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.guia-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    flex: 1;
    min-height: 0;
    align-content: stretch;
    grid-auto-rows: minmax(150px, auto);
    margin-inline: auto;
}

.guia-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    justify-self: stretch;
    gap: 10px;
    padding: 28px 16px 22px;
    background: var(--white);
    border: .5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    min-height: 150px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.guia-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.guia-card:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.guia-card:active::after {
    opacity: 1;
}

/* Repartidor cards — warm orange tint */
.guia-card-repartidor {
    background: linear-gradient(160deg, #fff8f0 0%, #fff1e0 100%);
    border-color: rgba(249, 115, 22, 0.15);
}
.guia-card-repartidor::after {
    background: rgba(249, 115, 22, 0.08);
}

/* Cliente cards — cool blue tint */
.guia-card-cliente {
    background: linear-gradient(160deg, #f0f7ff 0%, #e0eeff 100%);
    border-color: rgba(59, 130, 246, 0.15);
}
.guia-card-cliente::after {
    background: rgba(59, 130, 246, 0.08);
}

.guia-card-icon {
    font-size: 4rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.guia-card-title {
    display: block;
    width: 100%;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.01em;
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
}

.guia-card-desc {
    display: block;
    width: 100%;
    font-size: 0.8rem;
    color: var(--gray-600);
    line-height: 1.35;
    font-weight: 500;
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: pretty;
}

.guia-media-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.guia-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-inline: auto;
    gap: 12px;
    flex: 1;
    min-height: 0;
    cursor: pointer;
}
.guia-content:active { opacity: 0.92; }

/* Guia Steps */
.guia-steps {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.guia-progress {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.guia-image-wrap {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: var(--shadow-card);
    flex: 1;
    min-height: 0;
}

.guia-image-wrap img {
    width: min(100%, 520px);
    max-width: 100%;
    height: auto;
    max-height: 60vh;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.guia-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 20px;
    background: var(--blue-light);
    border-radius: var(--radius);
    text-align: center;
    min-height: 180px;
    box-shadow: var(--shadow-card);
    flex: 1;
    min-height: 0;
}

.guia-no-image-icon { color: var(--blue); }

.guia-no-image-text {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--blue-dark);
}

.guia-instruction {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    padding: 18px;
    background: var(--white);
    border-radius: var(--radius);
    border-left: 4px solid var(--red);
    min-height: 80px;
    width: 100%;
}

.guia-instruction strong {
    color: var(--red);
}


/* Guia Complete */
.guia-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px;
    text-align: center;
    gap: 16px;
}

.complete-check { animation: fadeIn 0.4s ease; }

.guia-complete h3 {
    font-size: 1.5rem;
    font-weight: 800;
}

.complete-msg {
    font-size: 1rem;
    color: var(--gray-600);
}

.complete-warning {
    background: #fef9c3;
    border: 2px solid var(--yellow);
    border-radius: var(--radius);
    padding: 14px 20px;
    font-weight: 700;
    color: var(--yellow-dark);
    width: 100%;
}

.complete-notes {
    width: 100%;
    list-style: none;
    text-align: left;
    padding: 0;
}

.complete-notes li {
    padding: 10px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.complete-notes li::before {
    content: '\2022 ';
    color: var(--red);
    font-weight: 800;
}

/* =====================================================
   PAYMENT SCREEN
   ===================================================== */
.payment-container {
    padding: 16px 16px calc(22px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    min-height: 0;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 22%),
        radial-gradient(circle at 0% 38%, rgba(227, 30, 36, 0.06), transparent 24%);
}

.payment-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
    flex-shrink: 0;
    padding: 10px 12px;
    border-radius: 28px;
    background: rgba(255,255,255,0.68);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
}

.payment-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 auto;
    min-height: 0;
}

.pay-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 18px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
    min-height: 0;
}

.pay-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 55%;
    aspect-ratio: 1;
    border-radius: 50%;
    opacity: 0.12;
    pointer-events: none;
}

.pay-card-hours {
    background: linear-gradient(135deg, #eef4ff 0%, #dbe8fe 100%);
    border: 2px solid rgba(59, 130, 246, 0.15);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.08), 0 0 0 1px rgba(59, 130, 246, 0.04);
}

.pay-card-hours::before {
    background: var(--blue);
}

.pay-card-total {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid rgba(34, 197, 94, 0.2);
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.1), 0 0 0 1px rgba(34, 197, 94, 0.05);
}

.pay-card-total::before {
    background: var(--green);
}

.pay-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    flex-shrink: 0;
}

.pay-card-hours .pay-icon {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue);
}

.pay-card-total .pay-icon {
    background: rgba(34, 197, 94, 0.14);
    color: var(--green-dark);
}

.pay-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pay-label {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pay-card-hours .pay-label {
    color: rgba(59, 130, 246, 0.7);
}

.pay-card-total .pay-label {
    color: rgba(22, 163, 74, 0.75);
}

.pay-value {
    font-size: clamp(2.25rem, 8vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.pay-card-hours .pay-value {
    color: #1e40af;
}

.pay-value-big {
    font-size: clamp(2.25rem, 8vw, 2.9rem);
    color: #15803d;
}

.payment-status {
    margin-top: 0;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    align-self: flex-start;
    flex-shrink: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.payment-status-pending {
    background: var(--gray-100);
    color: var(--gray-600);
}

.payment-status-calculated {
    background: var(--blue-light);
    color: var(--blue-dark);
}

.payment-status-review {
    background: var(--yellow-light);
    color: var(--yellow-dark);
}

.payment-status-confirmed {
    background: var(--green-light);
    color: var(--green-dark);
}

.payment-note {
    text-align: left;
    font-size: 0.84rem;
    color: #64748b;
    margin-top: -2px;
    padding: 0 2px;
    max-width: 34rem;
}

@keyframes valuePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pay-value-loading {
    animation: valuePulse 1.5s ease-in-out infinite;
    color: var(--gray-300) !important;
}

/* =====================================================
   ADMIN SCREEN
   ===================================================== */
.admin-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.admin-build {
    margin: 12px 16px 0;
    padding: 10px 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(227, 30, 36, 0.08), rgba(15, 23, 42, 0.05));
    color: var(--gray-600);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--gray-100);
    flex-shrink: 0;
}

.admin-tab {
    flex: 1;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gray-500);
    border-radius: 12px;
    background: transparent;
    transition: all var(--transition);
    white-space: nowrap;
    text-align: center;
}

.admin-tab.active {
    color: var(--white);
    background: var(--red);
    box-shadow: 0 2px 8px rgba(227, 30, 36, 0.3);
}

.admin-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.admin-section.hidden { display: none; }

/* --- Admin: Payment Month Navigation --- */
.admin-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 16px;
    gap: 12px;
    flex-shrink: 0;
}

/* --- Admin: Payment Summary Card --- */
.admin-pay-summary {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid rgba(234, 179, 8, 0.2);
    border-radius: 20px;
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.admin-pay-summary::before {
    display: none;
}

.admin-pay-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.admin-pay-summary-row + .admin-pay-summary-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(234, 179, 8, 0.15);
}

.admin-pay-summary-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(146, 112, 0, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-pay-summary-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #92400e;
    letter-spacing: -0.02em;
}

.admin-pay-summary-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(234, 179, 8, 0.15);
    color: #92400e;
}

.admin-pay-summary-badge.badge-configured {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green-dark);
}

.admin-pay-summary-badge.badge-calculated {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue-dark);
}

/* --- Admin: Payment Form --- */
.admin-pay-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.admin-pay-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.admin-pay-inline .form-row {
    flex: 1 1 260px;
    min-width: 0;
}

.admin-pay-inline .btn-compact {
    padding: 14px 20px;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-full { width: 100%; }

.btn-secondary.btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text);
}

.admin-pay-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-pay-results {
    margin-top: 4px;
    flex-shrink: 0;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-600);
}

.form-row input,
.form-row select {
    padding: 14px 16px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    min-height: 56px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    transition: border-color var(--transition);
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--blue);
}

.form-row select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 44px;
    line-height: 1.35;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--gray-500) 50%),
        linear-gradient(135deg, var(--gray-500) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.input-euro {
    position: relative;
}

.input-euro input {
    width: 100%;
    padding-right: 40px;
}

.euro-sign {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--gray-400);
    font-size: 1.1rem;
}

.pay-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.pay-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 700;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pay-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
}

.pay-table tfoot td {
    font-weight: 800;
    border-top: 2px solid var(--gray-300);
    padding-top: 14px;
}
.pay-table tfoot .tfoot-rate td { color: #6b7280; font-weight: 600; border-top: none; padding-top: 8px; }
.pay-table tfoot .tfoot-org td { color: #2563eb; }

/* --- Admin: Add Employee Button --- */
.btn-add-emp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--white);
    color: var(--red);
    border: 2px dashed var(--red);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 16px;
}

.btn-add-emp:active {
    transform: scale(0.97);
    background: rgba(227, 30, 36, 0.04);
}

.btn-add-emp.open {
    background: var(--red);
    color: var(--white);
    border-style: solid;
}

.btn-add-emp.open svg {
    transform: rotate(45deg);
}

.btn-add-emp svg {
    transition: transform var(--transition);
}

/* --- Admin: Collapsible New Employee Form --- */
.admin-emp-form-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.admin-emp-form-wrap.open {
    max-height: 600px;
}

/* --- Employee Form --- */
.employee-form {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.employee-form .form-row {
    margin-bottom: 12px;
}

.employee-form-feedback {
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
}

.feedback-success {
    background: var(--green-light);
    color: var(--green-dark);
}

.feedback-error {
    background: rgba(239,68,68,0.1);
    color: #b91c1c;
}

/* --- Employee List & Cards --- */
.employee-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#admin-employee-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.employee-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition);
}

.employee-item:active {
    transform: scale(0.98);
}

.employee-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--gray-600);
    flex-shrink: 0;
}

.employee-avatar.avatar-admin {
    background: rgba(227, 30, 36, 0.1);
    color: var(--red);
}

.employee-info {
    flex: 1;
    min-width: 0;
}

.employee-name {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.employee-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-active { background: var(--green-light); color: var(--green-dark); }
.badge-inactive { background: var(--gray-200); color: var(--gray-500); }
.badge-admin { background: rgba(227, 30, 36, 0.1); color: var(--red); }

.employee-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    border-radius: 14px;
    background: var(--gray-300);
    border: none;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
    padding: 0;
}

.toggle-switch.active {
    background: var(--green);
}

.toggle-knob {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--white);
    top: 3px;
    left: 3px;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    pointer-events: none;
}

.toggle-switch.active .toggle-knob {
    transform: translateX(20px);
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-600);
}

.edit-emp-toggle-row {
    padding-top: 4px;
}

/* --- Edit Employee Icon Button --- */
.btn-edit-emp {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-600);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition);
}

.btn-edit-emp:active {
    background: var(--gray-200);
    transform: scale(0.92);
}

.loading-text {
    text-align: center;
    color: var(--gray-400);
    font-weight: 600;
    padding: 32px;
}

/* =====================================================
   MODAL
   ===================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    max-width: 380px;
    width: 100%;
    max-height: min(82vh, 720px);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.modal-body {
    font-size: 0.95rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    flex: 1;
    min-width: 0;
    text-align: center;
}

#modal-edit-emp .modal-card {
    display: grid;
    row-gap: 12px;
}

#modal-edit-emp .modal-title,
#modal-edit-emp .employee-form-feedback,
#modal-edit-emp .modal-actions {
    margin-bottom: 0;
}


/* =====================================================
   ACCESSIBLE SCHEDULE REDESIGN
   ===================================================== */
:root {
    --wa-color-brand-95: var(--wa-color-red-95);
    --wa-color-brand-90: var(--wa-color-red-90);
    --wa-color-brand-80: var(--wa-color-red-80);
    --wa-color-brand-70: var(--wa-color-red-70);
    --wa-color-brand-60: var(--wa-color-red-60);
    --wa-color-brand-50: var(--wa-color-red-50);
    --wa-color-brand-40: var(--wa-color-red-40);
    --wa-color-brand-30: var(--wa-color-red-30);
    --wa-color-brand-20: var(--wa-color-red-20);
    --wa-color-brand-10: var(--wa-color-red-10);
    --wa-shadow-blur-scale: 1.15;
}

body {
    background:
        radial-gradient(circle at top left, rgba(227,30,36,0.08), transparent 28%),
        linear-gradient(180deg, #f5f0eb 0%, #f7f7f5 38%, #eef1ef 100%);
}

.screen-header {
    background: rgba(255,255,255,0.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(17,24,39,0.08);
}

.screen-header h2 {
    font-family: var(--font-display);
    letter-spacing: -0.04em;
}


.schedule-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    padding: 16px 12px 22px;
    background:
        radial-gradient(circle at top right, rgba(227, 30, 36, 0.12), transparent 26%),
        linear-gradient(180deg, rgba(255,255,255,0.76) 0%, rgba(245,247,245,0.94) 100%);
}

.schedule-context {
    padding: 0 4px;
    color: var(--gray-600);
    font-size: 0.88rem;
    line-height: 1.45;
}


.week-label {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.05em;
}

.schedule-range {
    margin-top: 4px;
    color: var(--gray-600);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


.week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    background: transparent;
}

.schedule-week-nav {
    padding-inline: 4px;
}

.week-nav-center {
    flex: 1;
    text-align: center;
}

.week-arrow {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(17,24,39,0.08);
    box-shadow: 0 14px 28px rgba(17,24,39,0.08);
}

.week-arrow:hover { background: var(--white); }
.week-arrow:active { background: #f8fafc; }

.schedule-board {
    display: flex;
    flex: 1;
    min-height: 0;
    padding: 8px;
    border-radius: 30px;
    background: rgba(250,251,250,0.92);
    border: 1px solid rgba(17,24,39,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 28px 40px rgba(24,39,75,0.08);
    overflow-x: auto;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 44px repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 0;
    flex: 1;
    min-height: 0;
    width: 100%;
    align-content: stretch;
    align-items: stretch;
}

.sched-header,
.sched-time {
    min-height: 52px;
    border-radius: 22px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(17,24,39,0.06);
}

.sched-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--gray-700);
    padding: 10px 6px;
    font-size: 0.72rem;
}

.sched-corner {
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--gray-500);
}

.sched-day-letter {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sched-day-date {
    font-size: 0.8rem;
    font-weight: 700;
}

.sched-header-today {
    background: rgba(243,244,246,0.96);
    border-color: rgba(148,163,184,0.2);
}

.sched-time {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--gray-600);
    font-size: 0.68rem;
    font-weight: 800;
}

.sched-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    align-self: stretch;
    justify-self: stretch;
    min-height: 80px;
    width: 100%;
    height: 100%;
    padding: 10px 8px 9px;
    border-radius: 24px;
    border: 1px solid transparent;
    text-align: left;
    line-height: 1.15;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    box-shadow: 0 14px 24px rgba(15,23,42,0.06);
    cursor: pointer;
}

.sched-cell:hover {
    transform: translateY(-1px);
}

.sched-cell:active {
    transform: translateY(1px) scale(0.985);
}

.sched-cell-today {
    box-shadow: 0 14px 24px rgba(15,23,42,0.06);
}

.sched-status {
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.sched-meta {
    color: inherit;
    opacity: 0.76;
    font-size: 0.6rem;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.sched-free {
    background: linear-gradient(180deg, rgba(229,231,235,0.9), rgba(243,244,246,0.96));
    border-color: rgba(203,213,225,0.34);
    color: transparent;
    box-shadow: none;
    padding: 0;
}

.sched-mine {
    background: linear-gradient(180deg, rgba(227,30,36,0.92), rgba(169,15,23,0.96));
    border-color: rgba(127, 18, 18, 0.38);
    color: var(--white);
    align-items: center;
    justify-content: center;
}

.sched-taken {
    background: linear-gradient(180deg, rgba(31,41,55,0.92), rgba(17,24,39,0.98));
    border-color: rgba(17,24,39,0.2);
    color: var(--white);
    align-items: center;
    justify-content: center;
}

.sched-empty {
    cursor: pointer;
    background: linear-gradient(180deg, rgba(229,231,235,0.9), rgba(243,244,246,0.96));
    border-color: rgba(203,213,225,0.34);
    color: transparent;
    box-shadow: none;
    padding: 0;
}

.sched-empty:active {
    transform: scale(0.96);
    background: linear-gradient(180deg, rgba(209,213,219,0.95), rgba(229,231,235,0.98));
}


.schedule-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border-top: none;
}

.legend-item {
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.76);
    border: 1px solid rgba(17,24,39,0.06);
    color: var(--gray-600);
}

.legend-dot {
    width: 15px;
    height: 15px;
    border-radius: 6px;
}

.legend-free { background: #d1fae5; border: 1px solid rgba(34,197,94,0.28); }
.legend-mine { background: linear-gradient(180deg, #ef4444, #b91c1c); }
.legend-taken { background: linear-gradient(180deg, #374151, #111827); }
.legend-empty { background: #e2e8f0; border: 1px solid rgba(148,163,184,0.3); }

.admin-container {
    width: 100%;
    padding: 0 0 24px;
}

.admin-section {
    padding: 18px 16px 16px;
}


.schedule-loading {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-slot-dialog::part(panel) {
    width: min(92vw, 32rem);
    border-radius: 28px;
}

.slot-dialog-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 4px;
}

.slot-dialog-badge {
    align-self: flex-start;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(227,30,36,0.08);
    color: var(--red-dark);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}


.slot-dialog-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.slot-dialog-summary,
.slot-dialog-body {
    color: var(--gray-600);
    font-size: 0.92rem;
    line-height: 1.45;
}

.slot-dialog-focus {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 14px 2px;
    text-align: center;
}

.slot-dialog-focus-day {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.slot-dialog-focus-time {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 6vw, 2.35rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--gray-900);
}

.slot-dialog-note {
    color: var(--gray-500);
    font-size: 0.84rem;
    line-height: 1.4;
    font-weight: 650;
}

.slot-dialog-admin {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(203, 213, 225, 0.55);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.slot-dialog-field {
    gap: 8px;
}

.slot-dialog-field label {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.slot-dialog-field select {
    width: 100%;
}

.slot-dialog-helper {
    color: var(--gray-600);
    font-size: 0.82rem;
    line-height: 1.4;
}

.schedule-slot-dialog.compact-create::part(panel) {
    width: min(92vw, 28rem);
}

.schedule-slot-dialog.compact-create .slot-dialog-stack {
    gap: 10px;
    padding-top: 2px;
}

.schedule-slot-dialog.compact-create .slot-dialog-badge,
.schedule-slot-dialog.compact-create .slot-dialog-title,
.schedule-slot-dialog.compact-create .slot-dialog-summary {
    text-align: center;
    align-self: center;
}

.schedule-slot-dialog.compact-create .slot-dialog-badge {
    padding-inline: 14px;
}

.schedule-slot-dialog.compact-create .slot-dialog-title {
    font-size: 1.35rem;
}


/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Small tablets and landscape phones (600px+) */
@media (min-width: 600px) {
    .pin-keypad {
        width: min(100%, 360px);
        max-width: 360px;
    }
    .key-btn { font-size: 1.8rem; min-height: 72px; }
    .menu-container { padding: 24px 20px; }
    .clock-container { padding: 0 20px 24px; }
    .payment-container { padding: 12px 20px 24px; }
    .guia-home, .guia-steps, .guia-complete { padding-left: 20px; padding-right: 20px; }
    .schedule-shell { padding: 18px 18px 24px; }
    .admin-container { padding: 0 20px 24px; }
}

/* Tablet portrait (768px+) */
@media (min-width: 768px) {
    .screen-header {
        padding-left: 18px;
        padding-right: 18px;
    }
    .menu-container,
    .clock-container,
    .payment-container,
    .admin-container {
        width: 100%;
        padding-left: 24px;
        padding-right: 24px;
    }
    .guia-home, .guia-steps, .guia-complete {
        width: min(100%, 1024px);
        padding-left: 18px;
        padding-right: 18px;
    }
    .schedule-shell {
        width: 100%;
        padding: 18px 24px 26px;
    }
    .menu-grid {
        gap: 20px;
        grid-auto-rows: minmax(170px, auto);
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .menu-card {
        padding: 28px 20px;
    }
    .schedule-board {
        padding: 10px;
        overflow-x: hidden;
    }
    .schedule-grid {
        grid-template-columns: 46px repeat(5, minmax(0, 1fr));
        column-gap: 6px;
        row-gap: 10px;
    }
    .sched-header,
    .sched-time {
        min-height: 56px;
    }
    .sched-cell {
        min-height: 94px;
        padding: 12px 10px;
    }
    .guia-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .guia-content {
        display: grid;
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr);
        align-items: start;
        gap: 16px;
    }

    .guia-image-wrap,
    .guia-no-image {
        min-height: 300px;
    }

    .guia-instruction {
        min-height: 200px;
        display: flex;
        align-items: center;
    }
    .guia-card {
        min-height: 210px;
        padding: 32px 20px 26px;
        gap: 12px;
    }
    .guia-card-icon { font-size: 4.8rem; }
    .guia-card-title { font-size: 1.15rem; }
    .guia-card-desc { font-size: 0.88rem; }
    .payment-cards {
        gap: 20px;
    }
    .pay-card {
        padding: 32px 28px;
        gap: 22px;
    }
    .pay-icon {
        width: 68px;
        height: 68px;
        border-radius: 18px;
    }
    .pay-value {
        font-size: 3.2rem;
    }
    .pay-value-big {
        font-size: 3.2rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .schedule-board {
        padding: 12px 14px;
    }

    .schedule-grid {
        grid-template-columns: 58px repeat(5, minmax(0, 1fr));
        column-gap: 10px;
        row-gap: 12px;
    }

    .sched-time {
        padding: 8px 10px 8px 4px;
        font-size: 0.72rem;
    }
}

/* Mobile 2-column: cards fill viewport equally */
@media (max-width: 833px) {
    .menu-grid {
        height: 100%;
        min-height: 0;
        align-content: stretch;
        grid-auto-rows: minmax(0, 1fr);
    }
    .menu-grid[data-card-count="4"] {
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }
    .menu-grid[data-card-count="5"] {
        grid-template-rows: repeat(3, minmax(0, 1fr));
    }
    .menu-card {
        min-height: 0;
        height: auto;
    }
    .menu-grid.odd-cards > .card-admin {
        grid-column: 1 / -1;
        min-height: 0;
        flex-direction: row;
        gap: 16px;
        padding: 16px 24px;
    }
}

/* Small phones: compact spacing */
@media (max-width: 599px) {
    .screen-header {
        align-items: flex-start;
    }

    .screen-header h2 {
        font-size: 1.05rem;
        line-height: 1.15;
    }

    .menu-container {
        padding: 16px 14px 14px;
        gap: 12px;
    }
    .menu-header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .greeting {
        font-size: 1.42rem;
        flex-basis: 100%;
        text-align: center;
    }
    .menu-direct-shortcut {
        order: 2;
        min-width: 108px;
        margin-inline: auto;
        border-radius: 16px;
        padding: 0 18px;
    }
    .menu-admin-shortcut,
    .menu-login-btn,
    .menu-clock {
        order: 3;
    }
    .menu-login-btn {
        padding: 9px 12px;
        font-size: 0.74rem;
    }
    .menu-clock {
        font-size: 0.96rem;
    }
    .menu-grid {
        gap: 12px;
    }
    .menu-card {
        padding: 16px 12px 14px;
        gap: 8px;
        border-radius: 22px;
    }
    .card-icon svg {
        width: 38px;
        height: 38px;
    }
    .card-emoji {
        font-size: 2.4rem;
    }
    .card-title {
        font-size: 0.94rem;
    }
    .menu-grid.odd-cards > .card-admin {
        padding: 14px 18px;
        gap: 14px;
    }
    .logout-btn {
        padding: 11px 12px;
    }

    .schedule-shell {
        gap: 12px;
        padding: 12px 10px 14px;
    }
    .schedule-week-nav {
        padding-inline: 0;
    }
    .schedule-board {
        padding: 6px;
        border-radius: 22px;
        overflow: hidden;
    }
    .schedule-grid {
        grid-template-columns: 38px repeat(5, minmax(0, 1fr));
        gap: 5px;
        padding-top: 2px;
    }
    .sched-header,
    .sched-time {
        min-height: 0;
        border-radius: 18px;
    }
    .sched-header {
        padding: 6px 2px;
        font-size: 0.62rem;
        gap: 3px;
    }
    .sched-day-letter {
        font-size: 0.56rem;
    }
    .sched-day-date {
        font-size: 0.74rem;
    }
    .sched-time {
        padding: 4px;
        font-size: 0.58rem;
    }
    .sched-cell {
        min-height: 0;
        padding: 0;
        border-radius: 18px;
    }
    .sched-mine,
    .sched-taken {
        padding: 8px 6px;
    }
    .sched-status {
        font-size: clamp(0.76rem, 1.8vh, 0.86rem);
    }
    .sched-meta {
        font-size: 0.52rem;
    }
    .week-arrow {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }
    .week-label {
        font-size: 1.1rem;
    }
    .schedule-range {
        font-size: 0.68rem;
    }
    .schedule-context {
        padding: 0 2px;
        font-size: 0.78rem;
        line-height: 1.3;
    }
    .schedule-legend {
        gap: 6px;
    }
    .legend-item {
        padding: 6px 8px;
        font-size: 0.6rem;
    }
    .legend-dot {
        width: 10px;
        height: 10px;
        border-radius: 4px;
    }

    .guia-home {
        padding: 12px 12px 14px;
        gap: 10px;
    }
    .guia-grid {
        gap: 10px;
    }
    .guia-home .guia-card {
        justify-content: center;
        padding: 18px 12px 18px;
        gap: 10px;
        min-height: 0;
        overflow: hidden;
    }
    .guia-home .guia-card-icon {
        font-size: clamp(2.45rem, 5vh, 3.15rem);
    }
    .guia-home .guia-card-title {
        font-size: clamp(0.88rem, 1.95vh, 1rem);
        line-height: 1.18;
    }
    .guia-home .guia-card-desc {
        font-size: clamp(0.72rem, 1.65vh, 0.8rem);
        line-height: 1.3;
    }

    .admin-pay-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-pay-inline .btn-compact {
        width: 100%;
    }

    .modal {
        padding: 16px;
    }

    .modal-card {
        padding: 22px 18px;
    }

    .modal-actions {
        gap: 10px;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-secondary {
        padding: 15px 18px;
        font-size: 1rem;
    }

    #modal-edit-emp .form-row {
        gap: 5px;
    }

    #modal-edit-emp .form-row label {
        font-size: 0.78rem;
    }

    #modal-edit-emp .modal-card {
        padding: 20px 16px;
        max-height: calc(100vh - 24px);
        row-gap: 10px;
    }

    #modal-edit-emp .form-row input,
    #modal-edit-emp .form-row select {
        min-height: 52px;
        padding: 12px 14px;
    }

    #modal-edit-emp .modal-actions .btn-primary,
    #modal-edit-emp .modal-actions .btn-secondary {
        padding: 14px 16px;
    }
    .guia-steps,
    .guia-complete {
        padding-left: 14px;
        padding-right: 14px;
    }
    .guia-steps {
        padding-top: 12px;
        padding-bottom: 14px;
    }
    .guia-progress {
        margin-bottom: 10px;
        font-size: 0.74rem;
    }
    .guia-content {
        gap: 10px;
    }
    .guia-image-wrap,
    .guia-no-image {
        padding: 12px;
    }
    .guia-image-wrap img {
        width: auto;
        max-height: 100%;
    }
    .guia-no-image {
        gap: 10px;
    }
    .guia-no-image-icon svg {
        width: 34px;
        height: 34px;
    }
    .guia-no-image-text {
        font-size: clamp(0.88rem, 2vh, 0.98rem);
        line-height: 1.3;
    }
    .guia-instruction {
        min-height: 0;
        padding: 14px;
        font-size: clamp(0.88rem, 1.95vh, 1rem);
        line-height: 1.35;
    }

    .admin-build {
        margin: 10px 12px 0;
        padding: 8px 12px;
        border-radius: 14px;
        font-size: 0.68rem;
    }

    .admin-tabs {
        gap: 6px;
        padding: 10px 12px;
    }

    .admin-tab {
        padding: 10px 12px;
        font-size: 0.78rem;
    }

    .admin-section {
        gap: 12px;
        padding: 12px;
    }

    .admin-month-nav {
        padding-bottom: 10px;
        gap: 8px;
    }

    .admin-pay-summary {
        padding: 14px 16px;
        border-radius: 18px;
    }

    .admin-pay-summary-row + .admin-pay-summary-row {
        margin-top: 8px;
        padding-top: 8px;
    }

    .admin-pay-summary-label {
        font-size: 0.72rem;
    }

    .admin-pay-summary-value {
        font-size: 1.3rem;
    }

    .admin-pay-summary-badge {
        font-size: 0.68rem;
        padding: 4px 10px;
    }

    .admin-pay-inline {
        gap: 8px;
    }

    .admin-pay-inline .btn-compact {
        padding: 12px 16px;
    }

    .admin-section-title {
        margin-bottom: 6px;
    }

    .btn-add-emp {
        margin-bottom: 12px;
        padding: 12px 16px;
    }

    .employee-form {
        padding: 14px;
        margin-bottom: 12px;
    }

    .employee-item {
        padding: 12px 14px;
        gap: 10px;
    }

    .employee-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.8rem;
    }

    .employee-name {
        font-size: 0.84rem;
    }

    .employee-meta {
        gap: 4px;
    }

    .btn-edit-emp {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .payment-container {
        padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
        gap: 12px;
    }
    .payment-month-nav {
        padding: 8px 10px;
        border-radius: 22px;
    }
    .payment-cards {
        gap: 10px;
    }
    .pay-card {
        gap: 12px;
        padding: 16px 14px;
        border-radius: 20px;
    }
    .pay-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
    .pay-icon svg {
        width: 24px;
        height: 24px;
    }
    .pay-label {
        font-size: 0.68rem;
    }
    .pay-value,
    .pay-value-big {
        font-size: clamp(2rem, 10vw, 2.45rem);
    }
    .payment-note {
        font-size: 0.78rem;
        text-align: center;
        max-width: none;
        padding: 0;
    }
    .receipt-section {
        gap: 12px;
    }
    .receipt-banner {
        padding: 14px;
        border-radius: 20px;
    }
    .receipt-banner-text {
        font-size: 0.9rem;
    }
    .receipt-doc-header {
        padding: 12px 14px;
        font-size: 0.84rem;
    }
    .receipt-doc-header::after {
        font-size: 0.62rem;
        padding: 4px 8px;
    }
    .receipt-doc-body {
        padding: 16px 14px 18px;
        gap: 14px;
    }
    .receipt-doc-grid {
        padding: 12px 13px;
        gap: 10px;
    }
    .receipt-field {
        gap: 10px;
    }
    .receipt-field-label {
        font-size: 0.74rem;
    }
    .receipt-field-value {
        font-size: 0.98rem;
    }
}

@media (max-width: 599px) and (max-height: 740px) {
    .pin-container {
        --pin-keypad-gap: 8px;
        --pin-keypad-button-size: clamp(48px, 15vw, 60px);
        padding: 14px 12px;
        gap: 8px;
    }

    .pin-header {
        margin-bottom: 8px;
    }

    .pin-logo {
        font-size: 1.12rem;
        margin-bottom: 6px;
    }

    .pin-clock {
        font-size: clamp(1.85rem, 8vh, 2.35rem);
    }

    .pin-prompt {
        margin-bottom: 8px;
    }

    .pin-dots {
        margin-bottom: 8px;
    }
}

@media (max-width: 399px), (max-height: 660px) {
    .pin-container {
        --pin-keypad-gap: 8px;
        --pin-keypad-button-size: clamp(44px, 15vw, 54px);
        padding: 12px 10px;
        gap: 6px;
    }

    .pin-logo {
        font-size: 1rem;
    }

    .pin-clock {
        font-size: clamp(1.65rem, 7.2vh, 2.05rem);
    }

    .pin-date {
        font-size: 0.72rem;
    }

    .pin-prompt {
        font-size: 0.9rem;
    }

    .admin-build {
        display: none;
    }
}

@media (max-height: 480px) and (min-width: 520px) {
    #screen-admin .screen-header {
        gap: 10px;
        padding: 8px 12px;
    }

    #screen-admin .screen-header h2 {
        font-size: 1rem;
    }

    #screen-admin .back-btn {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .admin-build {
        display: none;
    }

    .admin-tabs {
        padding: 6px 12px;
    }

    .admin-tab {
        padding: 9px 10px;
        font-size: 0.74rem;
    }

    #screen-admin .week-arrow {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    #screen-admin .week-label {
        font-size: 1rem;
    }

    #admin-payments {
        display: grid;
        grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
        align-content: start;
        align-items: start;
        gap: 10px 12px;
    }

    #admin-payments .admin-month-nav,
    #admin-payments .admin-pay-results,
    #admin-payments #admin-pay-feedback {
        grid-column: 1 / -1;
    }

    #admin-payments .admin-pay-summary,
    #admin-payments .admin-pay-form {
        min-width: 0;
    }

    #admin-payments .admin-month-nav {
        padding-bottom: 8px;
    }

    #admin-payments .admin-pay-summary {
        padding: 12px 14px;
    }

    #admin-payments .admin-pay-summary-label {
        font-size: 0.68rem;
    }

    #admin-payments .admin-pay-summary-value {
        font-size: 1.1rem;
    }

    #admin-payments .admin-pay-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 8px;
        align-items: end;
    }

    #admin-payments .admin-pay-inline {
        display: contents;
    }

    #admin-payments .admin-pay-inline .form-row {
        min-width: 0;
    }

    #admin-payments .admin-pay-inline .btn-compact,
    #admin-payments #admin-pay-calculate {
        width: auto;
        padding: 10px 12px;
        white-space: nowrap;
    }

    #admin-payments #admin-pay-feedback {
        grid-column: 1 / -1;
    }

    #admin-employees {
        display: grid;
        grid-template-columns: minmax(188px, 220px) minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        align-content: start;
        align-items: start;
        gap: 10px 12px;
        overflow: hidden;
    }

    #admin-employees .btn-add-emp,
    #admin-employees .admin-emp-form-wrap {
        grid-column: 1;
    }

    #admin-employees .btn-add-emp {
        margin-bottom: 0;
    }

    #admin-employees #admin-employee-list {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: stretch;
        height: 100%;
        padding-right: 4px;
    }

    #admin-employees .employee-item {
        padding: 10px 12px;
    }

    #admin-employees .employee-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.74rem;
    }

    #modal-edit-emp {
        padding: 8px;
    }

    #modal-edit-emp .modal-card {
        max-width: min(94vw, 720px);
        max-height: calc(100vh - 16px);
        padding: 14px 16px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 8px;
    }

    #modal-edit-emp .modal-title,
    #modal-edit-emp .edit-emp-toggle-row,
    #modal-edit-emp .employee-form-feedback,
    #modal-edit-emp .modal-actions {
        grid-column: 1 / -1;
    }

    #modal-edit-emp .form-row {
        gap: 4px;
    }

    #modal-edit-emp .form-row input,
    #modal-edit-emp .form-row select {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 0.92rem;
    }

    #modal-edit-emp .modal-actions {
        gap: 10px;
    }

    #modal-edit-emp .modal-actions .btn-primary,
    #modal-edit-emp .modal-actions .btn-secondary {
        padding: 12px 16px;
        min-width: 0;
    }
}

/* Schedule dialog: position above keyboard on phones */
@media (max-width: 767px) {
    .schedule-grid {
        height: 100%;
        grid-template-rows: var(--schedule-grid-rows-mobile, auto);
    }
    .schedule-slot-dialog::part(panel) {
        width: min(94vw, 28rem);
        border-radius: 20px;
        align-self: flex-start;
        margin-top: calc(max(12px, env(safe-area-inset-top)) + var(--visual-viewport-offset-top));
        margin-bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--visual-viewport-offset-bottom));
        max-height: calc(var(--visual-viewport-height) - 24px);
        overflow-y: auto;
    }
    .slot-dialog-stack {
        gap: 10px;
    }
    .slot-dialog-admin {
        padding: 12px;
        gap: 8px;
    }
    .slot-dialog-field select {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
}

/* Guia home grid: 2x3 cards fill the viewport on mobile */
@media (max-width: 767px) {
    .guia-home .guia-grid {
        height: 100%;
        grid-template-rows: repeat(3, minmax(0, 1fr));
        grid-auto-rows: minmax(0, 1fr);
        align-content: stretch;
    }
    .guia-home .guia-card {
        overflow: hidden;
        min-height: 0;
    }
    .guia-steps {
        padding-top: 14px;
        padding-bottom: 16px;
    }
    .guia-content,
    .guia-media-area {
        min-height: 0;
    }
    .guia-image-wrap,
    .guia-no-image {
        min-height: 0;
    }
    .guia-image-wrap img {
        max-height: 100%;
    }
    .guia-instruction {
        min-height: 0;
    }
}

@media (max-width: 599px) and (max-height: 740px) {
    .menu-container {
        padding: 14px 12px 12px;
        gap: 10px;
    }
    .menu-grid {
        gap: 10px;
    }
    .menu-card {
        padding: 12px 10px;
        gap: 6px;
    }
    .card-icon svg {
        width: 34px;
        height: 34px;
    }
    .card-emoji {
        font-size: 2rem;
    }
    .card-title {
        font-size: 0.88rem;
    }
    .menu-grid.odd-cards > .card-admin {
        padding: 12px 16px;
        gap: 12px;
    }

    .schedule-shell {
        gap: 10px;
        padding: 10px 8px 12px;
    }
    .week-arrow {
        width: 42px;
        height: 42px;
    }
    .legend-item {
        padding: 5px 7px;
        font-size: 0.56rem;
    }

    .guia-home {
        padding: 10px 10px 12px;
        gap: 8px;
    }
    .guia-home .guia-grid {
        gap: 8px;
    }
    .guia-home .guia-card {
        padding: 14px 10px 14px;
        gap: 8px;
    }
    .guia-home .guia-card-icon {
        font-size: clamp(2.05rem, 4.35vh, 2.65rem);
    }
    .guia-home .guia-card-title {
        font-size: 0.8rem;
        line-height: 1.16;
    }
    .guia-home .guia-card-desc {
        font-size: 0.66rem;
        line-height: 1.2;
    }
    .guia-steps {
        padding-top: 10px;
        padding-bottom: 12px;
    }
    .guia-progress {
        margin-bottom: 8px;
    }
    .guia-content {
        gap: 8px;
    }
    .guia-instruction {
        padding: 12px;
        font-size: 0.84rem;
    }
    .guia-no-image-text {
        font-size: 0.84rem;
    }
}

/* iPad / tablets grandes (834px+) */
@media (min-width: 834px) {
    .menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .card-admin {
        grid-column: 1 / -1;
    }

    .payment-cards {
        flex-direction: row;
        gap: 20px;
    }
    .pay-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 36px 32px;
    }
    .pay-value {
        font-size: 3.4rem;
    }
    .pay-value-big {
        font-size: 3.4rem;
    }
    .schedule-grid {
        grid-template-columns: 50px repeat(5, minmax(0, 1fr));
    }
}

/* Tablet landscape / small desktop (1024px+) */
@media (min-width: 1024px) {
    .screen-header,
    .menu-container,
    .clock-container,
    .payment-container,
    .admin-container,
    .guia-home,
    .guia-steps,
    .guia-complete,
    .schedule-shell {
        padding-left: 24px;
        padding-right: 24px;
    }

    .guia-home,
    .guia-steps,
    .guia-complete {
        width: min(100%, 1060px);
        padding-left: 24px;
        padding-right: 24px;
    }

    .guia-grid {
        gap: 22px;
    }
    .guia-card {
        min-height: 240px;
        padding: 36px 24px 28px;
    }
    .guia-card-icon { font-size: 5.2rem; }
    .guia-card-title { font-size: 1.2rem; }
    .guia-card-desc { font-size: 0.92rem; }

    .sched-cell {
        min-height: 108px;
    }
}

/* Desktop amplio (1280px+) */
@media (min-width: 1280px) {
    .menu-container,
    .clock-container,
    .payment-container,
    .admin-container,
    .guia-home,
    .guia-steps,
    .guia-complete {
        max-width: 1180px;
        margin: 0 auto;
    }
    .schedule-shell {
        max-width: 1240px;
        margin: 0 auto;
    }
}


/* =====================================================
   UPDATE BUTTON
   ===================================================== */
.update-btn {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--blue);
    color: var(--white);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
    cursor: pointer;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: background var(--transition), transform var(--transition);
}

.update-btn:hover { background: var(--blue-dark); }
.update-btn:active { transform: scale(0.95); }
.update-btn:disabled { opacity: 0.7; cursor: wait; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   INSTALL BANNERS
   ===================================================== */
@media (display-mode: standalone) {
    .install-banner { display: none !important; }
    #screen-payment .payment-container {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.install-banner.install-banner-visible {
    transform: translateY(0);
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.install-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}

.install-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.install-banner-text strong {
    font-size: 1rem;
    font-weight: 800;
}

.install-banner-text span {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.install-banner-actions {
    display: flex;
    gap: 12px;
}

.install-banner-actions .install-dismiss {
    flex: 1;
    padding: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius);
    background: var(--gray-100);
    color: var(--gray-600);
    font-family: var(--font);
    border: none;
    cursor: pointer;
}

.install-btn-primary {
    flex: 1;
    padding: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius);
    background: var(--red);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: background var(--transition);
}
.install-btn-primary:hover { background: var(--red-dark); }
.install-btn-primary:active { transform: scale(0.97); }

.install-banner-instructions {
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--blue-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.6;
}

.install-banner-instructions p {
    margin: 0;
}

.install-dismiss-ios {
    display: block;
    width: 100%;
    padding: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius);
    background: var(--gray-100);
    color: var(--text);
    text-align: center;
    font-family: var(--font);
    border: none;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   SCREEN ACUERDO — firma digital de participación (RD 2274/1985)
   ═══════════════════════════════════════════════════════════════ */

.acuerdo-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
    height: calc(100% - 56px - 40px);
}

/* Barra de pasos */
.acuerdo-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    background: var(--color-surface, #f8f9fa);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.acuerdo-step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d1d5db;
    transition: background 0.3s, transform 0.3s;
    flex-shrink: 0;
}
.acuerdo-step-dot.active  { background: var(--color-blue, #2563eb); }
.acuerdo-step-dot.current { transform: scale(1.35); }
.acuerdo-step-line {
    flex: 1;
    height: 2px;
    background: #d1d5db;
    max-width: 52px;
}

.acuerdo-step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}
.acuerdo-step.hidden { display: none; }

/* Tarjeta documento */
.acuerdo-doc-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.acuerdo-doc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--color-blue, #2563eb);
    color: #fff;
}
.acuerdo-doc-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}
.acuerdo-doc-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.acuerdo-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.acuerdo-field:last-of-type { border-bottom: none; padding-bottom: 0; }
.acuerdo-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}
.acuerdo-field-value {
    font-size: 1rem;
    font-weight: 500;
    color: #1e293b;
}

.acuerdo-notice {
    background: #eff6ff;
    border-left: 4px solid var(--color-blue, #2563eb);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1e40af;
}
.acuerdo-notice--gray {
    background: #f8fafc;
    border-left-color: #94a3b8;
    color: #475569;
}

/* Documento legal scrollable */
.acuerdo-legal-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}
.acuerdo-legal-doc {
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    padding: 24px 20px;
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.acuerdo-legal-title {
    text-align: center;
    text-transform: uppercase;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.02em;
    margin: 0 0 20px;
}
.acuerdo-legal-opening {
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    margin: 0 0 20px;
}
.acuerdo-legal-name {
    font-weight: 700;
    color: #1e293b;
}
.acuerdo-clause {
    margin: 0 0 16px;
}
.acuerdo-clause-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px;
}
.acuerdo-clause-text {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}
.acuerdo-legal-footer {
    font-style: italic;
    font-size: 1rem;
    line-height: 1.6;
    color: #475569;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
    margin: 20px 0 0;
}

.acuerdo-pin-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    border: 2px solid #dbeafe;
    border-radius: 12px;
}

.acuerdo-pin-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 6px 0 2px;
}

.acuerdo-pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid #93c5fd;
    background: #fff;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.acuerdo-pin-dot.filled {
    background: #2563eb;
    border-color: #2563eb;
    transform: scale(1.05);
}

.acuerdo-pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.acuerdo-pin-key {
    min-height: 60px;
    border: none;
    border-radius: 14px;
    background: #eff6ff;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.acuerdo-pin-key--ghost {
    font-size: 1rem;
    background: #f8fafc;
    color: #475569;
}

.acuerdo-pin-key--brand {
    background: #2563eb;
    color: #fff;
}

/* Instrucción de firma */
.sign-instruction {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    padding: 4px 0;
}
.sign-instruction--admin { color: var(--color-blue, #2563eb); }

/* Canvas de firma */
.sign-canvas-wrap {
    position: relative;
    background: #ffffff;
    border: 3px solid var(--color-blue, #2563eb);
    border-radius: 12px;
    overflow: hidden;
    min-height: 180px;
    flex: 1;
}
.sign-canvas {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 180px;
    touch-action: none;
    cursor: crosshair;
}
.sign-guide-line {
    position: absolute;
    bottom: 28%;
    left: 5%;
    right: 5%;
    height: 0;
    border-bottom: 2px dashed #cbd5e1;
    pointer-events: none;
}

/* Botones de acción firma */
.sign-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Botón extra grande (mínimo 64px) */
.btn-xlarge {
    min-height: 64px !important;
    font-size: 1.05rem !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Vista previa firma */
.preview-question {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    color: #1e293b;
    margin: 0;
}
.preview-img-wrap {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    flex: 1;
}
.preview-img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

/* Pantalla de éxito */
.acuerdo-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex: 1;
    text-align: center;
    padding: 2rem 0;
}
.acuerdo-success-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-green, #16a34a);
    animation: acuerdo-pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.acuerdo-success-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-green, #16a34a);
    margin: 0;
}
.acuerdo-success-sub {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

@keyframes acuerdo-pop-in {
    0%   { transform: scale(0.2); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

/* ── ADMIN TAB: Acuerdos ─────────────────────────────────── */

.admin-acuerdo-form-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.admin-acuerdo-form-wrap.open {
    max-height: 700px;
}

.acuerdo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
}
.acuerdo-row-info { flex: 1; min-width: 0; }
.acuerdo-row-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.acuerdo-row-date {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}

.acuerdo-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.acuerdo-status--pending { background: #fef9c3; color: #854d0e; }
.acuerdo-status--signed  { background: #dcfce7; color: #166534; }
.acuerdo-status--cancel  { background: #fee2e2; color: #991b1b; }

.btn-acuerdo-iniciar {
    background: var(--color-blue, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 48px;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: var(--font);
}
.btn-acuerdo-descargar {
    background: #166534;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 48px;
    min-width: 80px;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-acuerdo-descargar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =====================================================
   RECEIPT (Recibos de Pago Mensuales)
   ===================================================== */
.receipt-section {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* Banner */
.receipt-banner {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid transparent;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
}
.receipt-banner--pending {
    background:
        linear-gradient(135deg, rgba(255, 248, 240, 0.98) 0%, rgba(255, 237, 213, 0.94) 100%),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 48%);
    border-color: rgba(249, 115, 22, 0.16);
}
.receipt-banner--pending .receipt-banner-icon { color: var(--orange); }
.receipt-banner--signed {
    background:
        linear-gradient(135deg, rgba(236, 253, 245, 0.98) 0%, rgba(209, 250, 229, 0.94) 100%),
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 48%);
    border-color: rgba(34, 197, 94, 0.18);
}
.receipt-banner--signed .receipt-banner-icon { color: var(--green-dark); }
.receipt-banner-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.78);
    display: flex;
    align-items: center;
    justify-content: center;
}
.receipt-banner-text {
    font-size: 0.96rem;
    font-weight: 500;
    line-height: 1.55;
    color: #1f2937;
}
.receipt-banner-text strong {
    font-weight: 800;
    display: block;
    font-size: 1.08rem;
    letter-spacing: -0.03em;
    margin-bottom: 2px;
}

/* Document view */
.receipt-document {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,249,0.96));
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
}
.receipt-doc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1f4db5 0%, #3568d4 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.receipt-doc-header::after {
    content: 'Lectura previa';
    margin-left: auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.receipt-doc-body {
    padding: 18px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
}
.receipt-doc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.receipt-doc-kicker {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
}
.receipt-doc-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.receipt-doc-chip--pending {
    background: #fff7ed;
    color: #c2410c;
}
.receipt-doc-chip--signed {
    background: #dcfce7;
    color: #166534;
}
.receipt-doc-title {
    font-family: var(--font-display);
    font-size: clamp(1.16rem, 4.8vw, 1.38rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
    line-height: 1.12;
}
.receipt-doc-paragraph {
    margin: 0;
    color: #475569;
}
.receipt-doc-mark {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(22, 101, 52, 0.18);
    background:
        linear-gradient(135deg, rgba(220, 252, 231, 0.92), rgba(240, 253, 244, 0.98)),
        radial-gradient(circle at top right, rgba(22, 163, 74, 0.14), transparent 58%);
    color: #14532d;
}
.receipt-doc-mark-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}
.receipt-doc-mark-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.receipt-doc-mark-eyebrow {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #15803d;
}
.receipt-doc-mark-title {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.4;
    color: #14532d;
}
.receipt-doc-mark-meta {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #166534;
}
.receipt-doc-grid {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(248, 250, 252, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.14);
}
.receipt-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.receipt-field:last-child { border-bottom: none; padding-bottom: 0; }
.receipt-field--highlight {
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(227,30,36,0.08), rgba(227,30,36,0.02));
    border: 1px solid rgba(227,30,36,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.receipt-field-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}
.receipt-field-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    text-align: right;
}
.receipt-field-value--big {
    font-size: 1.3rem;
    font-weight: 800;
    color: #15803d;
}
.receipt-doc-footer {
    padding-top: 10px;
    border-top: 1px solid rgba(15,23,42,0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.receipt-doc-footer-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}
.receipt-doc-footer-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}
.receipt-doc-footer-value--signed {
    color: #166534;
}

/* Signing steps */
.receipt-step { display: flex; flex-direction: column; gap: 16px; }
.receipt-step.hidden { display: none; }

/* Signed signature preview in banner */
.receipt-signed-sig {
    max-width: 160px;
    max-height: 60px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: #fff;
    margin-top: 4px;
}

/* Admin receipt section */
.admin-receipt-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e40af;
}
.admin-receipt-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Receipt list rows (reuses acuerdo-row pattern) */
.receipt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
}
.receipt-row-info { flex: 1; min-width: 0; }
.receipt-row-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.receipt-row-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.receipt-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.receipt-status--pending { background: #fef9c3; color: #854d0e; }
.receipt-status--signed  { background: #dcfce7; color: #166534; }
.receipt-status--superseded { background: var(--gray-100); color: var(--gray-500); }

.btn-receipt-pdf {
    background: var(--blue-dark);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 48px;
    min-width: 80px;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-receipt-pdf:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
