:root {
    /* Surfaces */
    --bg-primary: #070b15;
    --bg-secondary: #0f1421;
    --bg-card: #161b2b;
    --bg-elevated: #1c2338;
    --bg-hover: #232b42;

    /* Primary palette */
    --blue-300: #93C5FD;
    --blue-400: #60A5FA;
    --blue-500: #3B82F6;
    --blue-600: #2563EB;
    --blue-700: #1D4ED8;

    --green-400: #34D399;
    --green-500: #10B981;
    --green-600: #059669;

    --orange-400: #FBBF24;
    --orange-500: #F59E0B;

    --purple-400: #A78BFA;
    --purple-500: #8B5CF6;
    --purple-600: #7C3AED;

    --red-400: #F87171;
    --red-500: #EF4444;

    /* Text */
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    /* Borders */
    --border: #232b42;
    --border-strong: #334155;

    /* Shadows (layered + colored) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 30px 80px rgba(0, 0, 0, 0.6);
    --shadow-blue: 0 10px 30px rgba(59, 130, 246, 0.35);
    --shadow-purple: 0 10px 30px rgba(139, 92, 246, 0.35);
    --shadow-green: 0 10px 30px rgba(16, 185, 129, 0.3);
    --shadow-red: 0 10px 30px rgba(239, 68, 68, 0.3);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3B82F6 0%, #6366F1 50%, #8B5CF6 100%);
    --gradient-accent: linear-gradient(135deg, #60A5FA 0%, #A78BFA 100%);
    --gradient-brand: linear-gradient(135deg, #38BDF8 0%, #3B82F6 45%, #8B5CF6 100%);
    --gradient-surface: linear-gradient(160deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.03) 60%, transparent);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    /* Legacy (compat) */
    --shadow: rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::selection {
    background: rgba(59, 130, 246, 0.35);
    color: #fff;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.55;
    font-weight: 400;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Background radial accents */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(1000px 600px at 10% -10%, rgba(59, 130, 246, 0.10), transparent 60%),
        radial-gradient(900px 600px at 110% 10%, rgba(139, 92, 246, 0.08), transparent 60%),
        radial-gradient(700px 500px at 50% 120%, rgba(16, 185, 129, 0.05), transparent 60%);
}

body > * { position: relative; z-index: 1; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
    border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Focus rings (accesibilidad + estética) */
:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
    border-radius: 6px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: none; }

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.02em;
    font-weight: 700;
}

/* ========== LOGIN ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-container::before {
    content: '';
    position: absolute;
    inset: -50%;
    background:
        radial-gradient(600px 400px at 30% 30%, rgba(59, 130, 246, 0.25), transparent 60%),
        radial-gradient(600px 400px at 70% 70%, rgba(139, 92, 246, 0.2), transparent 60%);
    filter: blur(40px);
    animation: floatGlow 12s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes floatGlow {
    0%   { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(40px, -30px) rotate(6deg); }
}

.login-card {
    position: relative;
    background: linear-gradient(160deg, var(--bg-card) 0%, rgba(22, 27, 43, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-xl);
    padding: 44px 34px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    z-index: 1;
    animation: cardIn 0.5s var(--ease-out);
}
.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(160deg, rgba(96, 165, 250, 0.35), transparent 40%, rgba(167, 139, 250, 0.25));
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    filter: drop-shadow(0 8px 24px rgba(59, 130, 246, 0.35));
}

.login-card h1 {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 36px;
    font-weight: 400;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:hover,
.input-group select:hover {
    border-color: var(--border-strong);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--blue-500);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.input-group select { cursor: pointer; }

/* ========== BUTTONS ========== */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--gradient-primary);
    background-size: 180% 180%;
    background-position: 0% 50%;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), background-position 0.4s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
    background-position: 100% 50%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    padding: 10px 18px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}
.btn-secondary:active {
    transform: translateY(0);
}

.btn-logout {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    color: var(--red-400);
    border-color: var(--red-500);
    background: rgba(239, 68, 68, 0.06);
}

.btn-camera {
    width: 100%;
    padding: 44px 20px;
    background: linear-gradient(160deg, var(--bg-secondary), var(--bg-card));
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
}

.btn-camera:hover {
    border-color: var(--blue-500);
    border-style: solid;
    color: var(--blue-400);
    background: linear-gradient(160deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.04));
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.btn-close {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s var(--ease);
}

.btn-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    transform: rotate(90deg);
}

/* ========== SPINNER ========== */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== ERROR MESSAGE ========== */
.error-message {
    margin-top: 16px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--red-500);
    border-radius: 8px;
    color: var(--red-400);
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

/* ========== MAIN CONTAINER ========== */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
}

/* ========== HEADER ========== */
.header {
    margin-bottom: 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: white;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
    flex-shrink: 0;
}

.avatar.admin {
    background: linear-gradient(135deg, var(--purple-500) 0%, var(--purple-400) 100%);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.user-info h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.role {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ========== STATS ========== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s var(--ease);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-surface);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}
.stat-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card:hover::before { opacity: 1; }
.stat-card > * { position: relative; z-index: 1; }

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.stat-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0.2;
    background: currentColor;
    filter: blur(12px);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue-400);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15) inset;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green-400);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15) inset;
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.12);
    color: var(--orange-400);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15) inset;
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.12);
    color: var(--purple-400);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.15) inset;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

/* ========== DATE DISPLAY ========== */
.date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ========== ZONES LIST ========== */
.zones-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zone-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: all 0.25s var(--ease);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.zone-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}

.zone-card:hover {
    border-color: var(--border-strong);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}
.zone-card:hover::before { opacity: 1; }

.zone-card.completed {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.07) 100%);
}
.zone-card.completed::before {
    background: var(--green-500);
    opacity: 1;
}

.zone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.zone-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.zone-status {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.zone-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange-400);
}

.zone-status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green-400);
    display: flex;
    align-items: center;
    gap: 4px;
}

.zone-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 6, 14, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    animation: modalBackdrop 0.2s var(--ease);
}

@keyframes modalBackdrop {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(160deg, var(--bg-card), var(--bg-elevated));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.35s var(--ease-out);
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(24px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.photo-capture {
    padding: 20px;
}

.photo-preview {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid var(--border);
}

.photo-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-content .btn-primary {
    margin: 0 20px 20px 20px;
}

/* ========== FILTERS ========== */
.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ========== TIMELINE ========== */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.timeline-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: all 0.25s var(--ease);
}

.timeline-item:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.timeline-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.timeline-item-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-item-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-item-date {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 6px;
}

.timeline-item-photo {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.timeline-item-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.timeline-item-photo:hover img {
    transform: scale(1.05);
}

.timeline-item-photo::after {
    content: '🔍';
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.timeline-item-photo:hover::after {
    opacity: 1;
}

/* ========== IMAGE MODAL ========== */
.image-modal {
    max-width: 90vw;
    max-height: 90vh;
    padding: 20px;
}

.image-modal img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 16px;
}

.image-modal-info {
    text-align: center;
}

.image-modal-info h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.image-modal-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
    .main-container {
        padding: 16px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .filters-container {
        grid-template-columns: 1fr;
    }
    
    .timeline-item-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .timeline-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 400px) {
    .login-card {
        padding: 30px 20px;
    }

    .user-info h2 {
        font-size: 16px;
    }

    .stat-value {
        font-size: 20px;
    }
}

/* =========================================================
   ADMIN PANEL PRO
   ========================================================= */

.admin-body {
    overflow-x: hidden;
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 24px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gradient-brand);
    background-size: 180% 180%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.brand-text strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.brand-text span {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-align: left;
    width: 100%;
    position: relative;
}
.nav-item svg { flex-shrink: 0; transition: transform 0.2s var(--ease); }
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-item:hover svg { transform: translateX(2px); }

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(139, 92, 246, 0.1));
    color: var(--blue-300);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.sidebar-user-info strong {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-info span {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}
.sidebar-backdrop.show { display: block; }

/* ============ MAIN CONTENT ============ */
.admin-main {
    min-width: 0;
    padding: 28px 32px 60px;
    background: var(--bg-primary);
}

.admin-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    margin: -28px -32px 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
}
.icon-btn:hover {
    background: var(--bg-hover);
    border-color: var(--blue-500);
}

.avatar.small {
    width: 36px;
    height: 36px;
    font-size: 14px;
    border-radius: 10px;
}
.avatar.mini {
    width: 32px;
    height: 32px;
    font-size: 12px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* ============ TAB CONTENT ============ */
.tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ PAGE HEADER ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

.btn-primary.inline {
    width: auto;
    padding: 10px 18px;
    font-size: 14px;
}

/* ============ STATS GRID PRO ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card-pro {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}
.stat-card-pro::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-surface);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.stat-card-pro::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease-out);
}
.stat-card-pro:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.stat-card-pro:hover::before { opacity: 1; }
.stat-card-pro:hover::after { transform: scaleX(1); }
.stat-card-pro > * { position: relative; z-index: 1; }

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
    padding: 3px 10px;
    border-radius: 20px;
}

.stat-card-pro .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}
.stat-card-pro .stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

/* ============ DASHBOARD GRID ============ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-header h3 {
    font-size: 15px;
    font-weight: 600;
}
.panel-meta {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: capitalize;
}
.panel-body {
    padding: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.activity-row:hover { background: var(--bg-hover); }

.activity-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
}
.activity-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.activity-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.activity-info strong {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-info span {
    font-size: 12px;
    color: var(--text-secondary);
}
.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    flex-shrink: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
}
.summary-row:hover { background: var(--bg-hover); }
.summary-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.summary-name strong {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.summary-metrics {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.metric-pill {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    white-space: nowrap;
}
.metric-pill.primary {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-400);
}

/* ============ EMPLOYEES GRID ============ */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.employee-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}
.employee-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-surface);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.employee-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.employee-card:hover::before { opacity: 1; }
.employee-card > * { position: relative; z-index: 1; }

.employee-card.inactive {
    opacity: 0.55;
    background: var(--bg-secondary);
}

.employee-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.employee-card-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.employee-card-title strong {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.employee-card-title span {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.role-badge.admin {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple-400);
}
.role-badge.staff {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-400);
}
.role-badge.capitan {
    background: rgba(56, 189, 248, 0.15);
    color: #38BDF8;
}
.role-badge.mantenimiento {
    background: rgba(245, 158, 11, 0.15);
    color: var(--orange-400);
}

.avatar.capitan {
    background: linear-gradient(135deg, #0EA5E9 0%, #38BDF8 100%);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}
.avatar.mantenimiento {
    background: linear-gradient(135deg, var(--orange-500) 0%, var(--orange-400) 100%);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.employee-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.meta-pill.ok {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-400);
}
.meta-pill.muted {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

.employee-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn-icon {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--blue-500);
}
.btn-icon.danger:hover {
    color: var(--red-400);
    border-color: var(--red-500);
}
.btn-icon.warning:hover {
    color: var(--orange-400);
    border-color: var(--orange-500);
}
.btn-icon.success:hover {
    color: var(--green-400);
    border-color: var(--green-500);
}

/* ============ ZONES GRID ============ */
.zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.zone-card-pro {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.25s var(--ease);
    position: relative;
    overflow: hidden;
}
.zone-card-pro::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--purple-400), var(--blue-500));
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s var(--ease-out);
}
.zone-card-pro:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.zone-card-pro:hover::before { transform: scaleY(1); }

.zone-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.zone-order {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.zone-card-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}
.zone-card-title strong {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    /* permite nombres largos en 2+ líneas, sin ellipsis */
    word-break: break-word;
}
.zone-card-title span {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.zone-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* Botón Tareas crece para llenar el espacio, edit/delete quedan pequeños */
.btn-secondary.sm.tasks-button {
    flex: 1;
    justify-content: center;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
}

/* ============ FILTERS BAR ============ */
.filters-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
}

.input-group.compact { margin-bottom: 0; }
.input-group.compact label {
    font-size: 12px;
    margin-bottom: 4px;
}
.input-group.compact input,
.input-group.compact select {
    padding: 8px 12px;
    font-size: 13px;
}

/* ============ REPORTS ============ */
.reports-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.report-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s var(--ease);
}
.report-block:hover {
    box-shadow: var(--shadow-lg);
}

.report-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.report-block-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.report-block-user strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}
.report-block-user span {
    font-size: 12px;
    color: var(--text-secondary);
}

.report-block-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}
.mini-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mini-stat strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    margin-top: 2px;
}

.report-block-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-day {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.report-day-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

.report-day-date strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
}
.report-day-date span {
    font-size: 12px;
    color: var(--text-secondary);
}

.report-day-times {
    display: flex;
    gap: 8px;
}

.time-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 8px;
    text-align: center;
    min-width: 60px;
}
.time-box span {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.time-box strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}
.time-box.highlight {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--blue-500);
}
.time-box.highlight strong { color: var(--blue-400); }

.report-day-gallery {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.gallery-thumb {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s var(--ease);
}
.gallery-thumb:hover {
    border-color: var(--blue-500);
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-blue);
}
.gallery-thumb img { transition: transform 0.4s var(--ease); }
.gallery-thumb:hover img { transform: scale(1.08); }
.gallery-thumb img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}
.gallery-thumb-info {
    padding: 8px 10px;
}
.gallery-thumb-info strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-thumb-info span {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============ MODALS EXTRAS ============ */
.modal-content.small { max-width: 400px; }
.modal-body {
    padding: 20px;
}
.modal-body .input-group:last-of-type { margin-bottom: 0; }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary,
.modal-actions .btn-danger {
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-danger {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--red-500), #dc2626);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.btn-close.floating {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}
.input-group textarea:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group .hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.zones-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.checkbox-item:hover { background: var(--bg-hover); }
.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue-500);
    cursor: pointer;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}
.switch-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue-500);
    cursor: pointer;
}

.form-error {
    color: var(--red-400);
    font-size: 13px;
    margin-top: 12px;
    min-height: 16px;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
    white-space: pre-line;
}

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

.btn-secondary.danger-outline {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--red-400);
}
.btn-secondary.danger-outline:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--red-500);
    color: var(--red-400);
}

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: 0 10px 30px var(--shadow);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    min-width: 240px;
    max-width: 340px;
}
.toast.show { transform: translateX(0); }
.toast.success { border-color: var(--green-500); border-left: 3px solid var(--green-500); }
.toast.error { border-color: var(--red-500); border-left: 3px solid var(--red-500); }
.toast.info { border-left: 3px solid var(--blue-500); }

/* ============ LOADING OVERLAY ============ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity 0.3s;
}
.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.spinner.large {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--blue-500);
}

.empty-state.small {
    padding: 30px 20px;
}
.empty-state.small p { font-size: 13px; }

.empty-state-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}
.empty-state-actions .btn-primary.inline,
.empty-state-actions .btn-secondary {
    width: auto;
    padding: 10px 20px;
}

/* ============ ADMIN RESPONSIVE ============ */
@media (max-width: 960px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 10px 0 40px rgba(0,0,0,0.4);
    }
    .sidebar.open { transform: translateX(0); }

    .admin-main { padding: 20px 16px 60px; }
    .admin-topbar {
        display: flex;
        margin: -20px -16px 16px;
    }

    .dashboard-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 24px; }
}

@media (max-width: 640px) {
    .employees-grid,
    .zones-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stat-card-pro { padding: 14px; }
    .stat-card-pro .stat-value { font-size: 22px; }

    .page-header {
        align-items: stretch;
    }
    .page-header .btn-primary.inline,
    .page-actions .btn-secondary,
    .page-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }
    .page-actions {
        width: 100%;
        flex-direction: column;
    }

    .report-block-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .report-day-times { width: 100%; }
    .time-box { flex: 1; }

    .report-day-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-actions {
        flex-direction: column-reverse;
    }
    .modal-actions button { width: 100%; }

    .toast-container {
        left: 12px;
        right: 12px;
    }
    .toast { min-width: 0; max-width: 100%; }
}

@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .report-day-gallery { grid-template-columns: 1fr; }
}

/* =========================================================
   JORNADA (personal de limpieza)
   ========================================================= */

.jornada-section {
    margin-bottom: 20px;
}

.jornada-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.jornada-card.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 14px;
}
.jornada-card.loading .spinner {
    border-color: rgba(255,255,255,0.2);
    border-top-color: var(--blue-400);
}

/* IDLE (sin jornada activa) */
.jornada-card.idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    background: linear-gradient(160deg, var(--bg-card), rgba(59, 130, 246, 0.04));
}
.jornada-card.idle::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(400px 200px at 50% 0%, rgba(59, 130, 246, 0.12), transparent 70%);
    pointer-events: none;
}
.jornada-card.idle > * { position: relative; z-index: 1; }

.jornada-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue-400);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2) inset;
    position: relative;
}
.jornada-icon::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: rgba(59, 130, 246, 0.2);
    filter: blur(18px);
    z-index: -1;
}

.jornada-info h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}
.jornada-info p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

.jornada-btn {
    width: auto;
    min-width: 220px;
    padding: 14px 28px;
    font-size: 15px;
    margin-top: 4px;
}

/* ACTIVE (jornada en curso) */
.jornada-card.active {
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-card) 60%);
    border-color: rgba(16, 185, 129, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}
.jornada-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-400), var(--green-500), var(--green-400));
    background-size: 200% 100%;
    animation: shimmer 2.5s linear infinite;
}
@keyframes shimmer {
    0%   { background-position: 0% 0; }
    100% { background-position: -200% 0; }
}

.jornada-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--green-400);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green-400);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.8s infinite;
    flex-shrink: 0;
}
.pulse-dot.tiny {
    width: 6px;
    height: 6px;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.jornada-timer {
    font-family: 'Poppins', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 52px;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text-primary);
    background: linear-gradient(180deg, #fff, #a7f3d0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 4px 0;
}

.jornada-meta {
    font-size: 13px;
    color: var(--text-secondary);
}
.jornada-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.jornada-warning {
    font-size: 12px;
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange-400);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    margin-top: 2px;
}

/* Bloqueo de zonas cuando no hay jornada activa */
.zone-card.blocked {
    opacity: 0.55;
    cursor: not-allowed !important;
    filter: grayscale(0.3);
}
.zone-card.blocked:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: none;
}
.zone-card.blocked:hover::before { opacity: 0; }

.zone-status.blocked {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Live tag (reportes / dashboard) */
.live-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--green-400);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    vertical-align: middle;
}
.live-tag.small { font-size: 10px; padding: 1px 6px; }

.report-day.in-progress {
    border-color: rgba(16, 185, 129, 0.3);
}

.summary-name-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.summary-name-text strong {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive jornada */
@media (max-width: 640px) {
    .jornada-card { padding: 20px 16px; }
    .jornada-timer { font-size: 44px; }
    .jornada-btn {
        width: 100%;
        min-width: 0;
    }
}

/* =========================================================
   CHARTER
   ========================================================= */

.charter-section { margin-bottom: 20px; }

.charter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.charter-card.loading {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}
.charter-card.loading .spinner {
    border-color: rgba(255,255,255,0.2);
    border-top-color: var(--purple-400);
}

.charter-card.idle {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, var(--bg-card), rgba(139, 92, 246, 0.04));
}

.charter-card.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, var(--bg-card) 60%);
    border-color: rgba(139, 92, 246, 0.3);
}
.charter-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--purple-400), var(--blue-400), var(--purple-400));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.charter-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.charter-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.12);
    color: var(--purple-400);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2) inset;
    flex-shrink: 0;
}
.charter-icon.active {
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple-400);
}

.charter-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.charter-info strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.charter-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.charter-action {
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}
.charter-action.full { width: 100%; justify-content: center; }
.charter-action.sm { padding: 8px 14px; font-size: 12px; }

/* =========================================================
   MODAL FULLSCREEN + CHECKLIST
   ========================================================= */

.modal-content.fullscreen {
    max-width: 720px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.modal-content.large {
    max-width: 720px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.modal-header.sticky {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--bg-card), rgba(28, 35, 56, 0.98));
    backdrop-filter: blur(8px);
    z-index: 5;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-weight: 400;
}
.modal-subtitle strong {
    color: var(--blue-300);
    font-weight: 600;
}

.modal-footer.sticky {
    position: sticky;
    bottom: 0;
    background: linear-gradient(0deg, var(--bg-card), rgba(28, 35, 56, 0.98));
    backdrop-filter: blur(8px);
    z-index: 5;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.checklist-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px;
}

.checklist-zone {
    margin-bottom: 20px;
}
.checklist-zone:last-child { margin-bottom: 0; }

.checklist-zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
}
.checklist-zone-header h4 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.checklist-zone-progress {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 100px;
}
.checklist-zone-progress.complete {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-400);
}

.checklist-tasks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checklist-task {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.2s var(--ease);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.checklist-task:hover {
    border-color: var(--border-strong);
}
.checklist-task.done {
    background: linear-gradient(135deg, var(--bg-card), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.3);
}

.task-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.task-ref-thumb {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border);
    transition: all 0.2s var(--ease);
}
.task-ref-thumb:hover {
    transform: scale(1.03);
    border-color: var(--blue-500);
}
.task-ref-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.task-ref-thumb.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: default;
}
.task-ref-thumb .ref-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 9px;
    padding: 2px 4px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-name {
    display: flex;
    align-items: center;
    gap: 8px;
}
.task-name strong {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.task-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.task-check.done {
    background: var(--green-500);
    border-color: var(--green-500);
    color: white;
}

.task-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 82px;
}

.btn-primary.sm {
    width: auto;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
}

.task-done-thumb {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--green-500);
    flex-shrink: 0;
}
.task-done-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================================
   ADMIN TASKS (gestión)
   ========================================================= */

.task-form {
    padding: 6px 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.task-form .input-group { margin-bottom: 14px; }

.task-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.task-ref-uploader {
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-ref-preview {
    width: 140px;
    height: 100px;
    border-radius: 10px;
    border: 2px dashed var(--border);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-size: 12px;
    overflow: hidden;
    flex-shrink: 0;
}
.task-ref-preview:hover {
    border-color: var(--blue-500);
    color: var(--blue-400);
}
.task-ref-preview.has-image {
    border-style: solid;
    padding: 0;
}
.task-ref-preview.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-secondary.sm {
    padding: 7px 12px;
    font-size: 12px;
}

.tasks-divider {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-task-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s var(--ease);
}
.admin-task-item:hover {
    border-color: var(--border-strong);
    background: var(--bg-elevated);
}

.admin-task-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.admin-task-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.admin-task-thumb {
    position: relative;
}
.admin-task-thumb .thumb-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    letter-spacing: 0.3px;
}

.admin-task-info {
    flex: 1;
    min-width: 0;
}
.admin-task-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.admin-task-title strong {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-task-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.35;
}
.admin-task-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.task-type-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.task-type-pill.general {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-400);
}
.task-type-pill.finalizacion {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple-400);
}

.task-plantilla-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.task-plantilla-pill.completa {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green-400);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.task-plantilla-pill.express {
    background: rgba(245, 158, 11, 0.12);
    color: var(--orange-400);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Campo estrecho para Orden standalone */
.input-group.inline-narrow input {
    max-width: 180px;
}

/* =========================================================
   EXPRESS MANAGER (admin)
   ========================================================= */

.express-empty-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.03));
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.express-empty-banner > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.express-empty-banner strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--orange-400);
}
.express-empty-banner span {
    font-size: 12.5px;
    color: var(--text-secondary);
}
.express-empty-banner .btn-primary.sm {
    flex-shrink: 0;
}

.express-zone-block {
    margin-bottom: 20px;
}
.express-zone-block:last-child { margin-bottom: 0; }

.express-zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
}
.express-zone-header h4 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.express-zone-tasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 520px) {
    .express-empty-banner { flex-direction: column; align-items: stretch; }
    .express-empty-banner .btn-primary.sm { width: 100%; justify-content: center; }
}

/* =========================================================
   MULTI IMAGE UPLOADER (reutilizable)
   ========================================================= */

.multi-uploader {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.mu-thumb {
    position: relative;
    width: 94px;
    height: 94px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: all 0.2s var(--ease);
}
.mu-thumb:hover {
    border-color: var(--blue-500);
    transform: scale(1.03);
}
.mu-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mu-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s var(--ease);
}
.mu-remove:hover {
    background: var(--red-500);
}

.multi-uploader-add {
    width: 94px;
    height: 94px;
    border-radius: 10px;
    border: 2px dashed var(--border-strong);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 500;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s var(--ease);
}
.multi-uploader-add:hover {
    border-color: var(--blue-500);
    color: var(--blue-400);
    background: rgba(59, 130, 246, 0.06);
    border-style: solid;
}
.multi-uploader-add svg {
    opacity: 0.8;
}

/* Row of reference thumbs para display (read-only) */
.ref-thumbs-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.ref-thumbs-row .task-ref-thumb {
    width: 80px;
    height: 80px;
}

/* Galería en tareas completadas */
.done-thumbs-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.done-thumbs-row .task-done-thumb {
    width: 46px;
    height: 46px;
}
.done-thumbs-row .more-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 8px;
    white-space: nowrap;
}

/* =========================================================
   OPERACIÓN (Capitán / Mantenimiento)
   ========================================================= */

.operacion-container {
    max-width: 720px;
}

.op-main {
    padding: 10px 0;
}

.op-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.op-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* IDLE */
.op-state-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}
.op-state-idle::before {
    content: '';
    position: absolute;
    inset: -30%;
    background: radial-gradient(400px 250px at 50% 0%, rgba(56, 189, 248, 0.12), transparent 70%);
    pointer-events: none;
}
.op-state-idle > * { position: relative; z-index: 1; }

.op-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-400);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2) inset;
    position: relative;
}
.op-icon::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    background: rgba(59, 130, 246, 0.2);
    filter: blur(24px);
    z-index: -1;
}

.op-state-idle h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 2px;
}
.op-state-idle p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 420px;
}

/* ACTIVE */
.op-state-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}
.op-state-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-400), var(--green-500), var(--green-400));
    background-size: 200% 100%;
    animation: shimmer 2.5s linear infinite;
}

.op-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--green-400);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.op-state-active h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-top: 4px;
}

.op-inicio-meta {
    font-size: 13px;
    color: var(--text-secondary);
}
.op-inicio-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.op-progress-wrap {
    width: 100%;
    margin-top: 10px;
}
.op-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.op-progress-label strong {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.op-pct {
    font-weight: 700;
    color: var(--blue-400);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.op-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
    flex-wrap: wrap;
}

.op-big-btn {
    flex: 1;
    min-width: 200px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 520px) {
    .op-card { padding: 28px 20px; }
    .op-big-btn { min-width: 0; }
}

/* =========================================================
   STARTUP CHECKLIST (dentro del modal)
   ========================================================= */

.startup-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    transition: all 0.2s var(--ease);
}
.startup-item.done {
    background: linear-gradient(135deg, var(--bg-secondary), rgba(16, 185, 129, 0.06));
    border-color: rgba(16, 185, 129, 0.3);
}

.startup-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.startup-item-header strong {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.req-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--orange-400);
    border: 1px solid rgba(245, 158, 11, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.startup-desc-group {
    margin-bottom: 10px;
}
.startup-desc-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.startup-desc-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    resize: vertical;
    transition: all 0.2s var(--ease);
}
.startup-desc-input:focus {
    outline: none;
    border-color: var(--blue-500);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.startup-item-footer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.startup-instructions {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
    padding: 8px 10px;
    background: var(--bg-card);
    border-left: 3px solid var(--blue-500);
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}

.startup-ref-row {
    display: flex;
    margin-bottom: 10px;
}
.startup-ref-row .task-ref-thumb {
    width: 100px;
    height: 80px;
}

.startup-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--green-500);
    flex-shrink: 0;
    transition: transform 0.2s var(--ease);
}
.startup-thumb:hover { transform: scale(1.04); }
.startup-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================================
   TEMPLATE PICKER (personal de limpieza)
   ========================================================= */

.template-picker-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-option {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}
.template-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-surface);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}
.template-option:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.template-option:hover::before { opacity: 1; }
.template-option > * { position: relative; z-index: 1; }

.template-option-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.template-option-icon.completa {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green-400);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2) inset;
}
.template-option-icon.express {
    background: rgba(245, 158, 11, 0.12);
    color: var(--orange-400);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2) inset;
}

.template-option-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.template-option-info strong {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.template-option-info span {
    font-size: 13px;
    color: var(--text-secondary);
}

.template-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue-400);
    margin-top: 4px;
}

.template-option-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}
.template-option:hover .template-option-arrow {
    color: var(--text-primary);
    transform: translateX(4px);
}

.admin-task-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.admin-task-actions .btn-icon {
    width: 30px;
    height: 30px;
}

/* Tasks button badge en zone cards */
.btn-secondary.sm.tasks-button {
    padding: 7px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.count-badge {
    background: var(--blue-500);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 640px) {
    .charter-card.idle { flex-wrap: wrap; }
    .charter-action { width: 100%; justify-content: center; }

    .task-form-row { grid-template-columns: 1fr; }
    .task-ref-uploader { flex-direction: column; align-items: stretch; }
    .task-ref-preview { width: 100%; height: 140px; }

    .checklist-body { padding: 12px 14px; }
    .modal-header.sticky { padding: 14px 16px; }
    .modal-footer.sticky { padding: 12px 16px; flex-direction: column-reverse; }
    .modal-footer.sticky button { width: 100%; }

    .task-actions { padding-left: 0; }
    .task-ref-thumb { width: 60px; height: 60px; }

    .admin-task-item { flex-wrap: wrap; }
    .admin-task-thumb { width: 44px; height: 44px; }
}

/* =========================================================
   CHARTERS (ADMIN)
   ========================================================= */

.charters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.charter-admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.25s var(--ease);
    position: relative;
    overflow: hidden;
}
.charter-admin-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.charter-admin-card.active {
    border-color: rgba(16, 185, 129, 0.3);
}
.charter-admin-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--green-400), var(--green-500), var(--green-400));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.charter-admin-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.charter-admin-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.12);
    color: var(--purple-400);
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2) inset;
}
.charter-admin-icon.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-400);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2) inset;
}

.charter-admin-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.charter-admin-title strong {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.charter-admin-title span {
    font-size: 12px;
    color: var(--text-secondary);
}

.charter-admin-stats {
    display: flex;
    gap: 8px;
}
.charter-admin-stats .mini-stat {
    flex: 1;
}

.charter-admin-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}
.charter-admin-meta span {
    color: var(--text-muted);
    margin-right: 4px;
}

.btn-secondary.full-width {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
}

/* =========================================================
   CHARTER DETAIL
   ========================================================= */

.charter-detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.charter-stat-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.charter-stat-box span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.charter-stat-box strong {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.charter-stat-box strong small {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-card);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 4px;
}
.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 100px;
    transition: width 0.4s var(--ease-out);
}

.detail-zone {
    margin-bottom: 24px;
}
.detail-zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
}
.detail-zone-header h4 {
    font-size: 14px;
    font-weight: 600;
}
.detail-zone-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-task {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}
.detail-task.done {
    border-color: rgba(16, 185, 129, 0.25);
}
.detail-task.missing {
    border-color: rgba(239, 68, 68, 0.2);
    background: linear-gradient(135deg, var(--bg-card), rgba(239, 68, 68, 0.03));
}

.detail-task-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.detail-task-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.detail-task-title strong {
    font-size: 14px;
    font-weight: 600;
}

.status-tag.missing {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-400);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.detail-task-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.45;
}

.detail-task-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-photos-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.detail-photo-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.photo-col-label {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}
.photo-col-label.ref {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue-400);
}
.photo-col-label.real {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green-400);
    text-transform: none;
    letter-spacing: 0.3px;
    font-weight: 500;
}
.detail-photo-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.detail-photo-thumb {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    background: var(--bg-secondary);
    flex-shrink: 0;
    transition: transform 0.2s var(--ease);
}
.detail-photo-thumb:hover {
    transform: scale(1.04);
    border-color: var(--blue-500);
}
.detail-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.detail-photo-thumb.empty {
    cursor: default;
    border-style: dashed;
}
.detail-photo-thumb.empty:hover {
    transform: none;
    border-color: var(--border);
}
.detail-photo-thumb .photo-count {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.compare-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px;
}
.compare-stack-img {
    width: 100%;
    max-height: 45vh;
    object-fit: contain;
    border-radius: 6px;
    background: #000;
}

.detail-photo {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    aspect-ratio: 4/3;
    transition: transform 0.2s var(--ease);
}
.detail-photo.clickable {
    cursor: pointer;
}
.detail-photo.clickable:hover {
    transform: scale(1.02);
    border-color: var(--blue-500);
}
.detail-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent);
    color: white;
}
.photo-label.ref { background: linear-gradient(0deg, rgba(59, 130, 246, 0.9), transparent); }
.photo-label.real { background: linear-gradient(0deg, rgba(16, 185, 129, 0.9), transparent); }

.no-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 12px;
}
.no-photo-placeholder.missing { color: var(--red-400); }
.no-photo-placeholder.large { font-size: 14px; padding: 40px; }

/* =========================================================
   COMPARE MODAL
   ========================================================= */

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
}
.compare-side {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.compare-side img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    display: block;
    background: #000;
}
.compare-label {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.compare-label.ref {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-400);
}
.compare-label.real {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green-400);
}
.compare-desc {
    grid-column: 1 / -1;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .compare-grid { grid-template-columns: 1fr; }
    .detail-task-photos { grid-template-columns: 1fr; }
    .charter-admin-stats { flex-wrap: wrap; }
    .charter-admin-stats .mini-stat { min-width: 80px; }
}
