:root {
    --primary-color: #2b7a61;
    --primary-hover: #22624d;
    --success-color: #16a34a;
    --success-hover: #15803d;
    --warning-color: #eab308;
    --warning-hover: #ca8a04;
    --danger-color: #dc2626;
    --bg-color: #f0f4f2;
    --surface-color: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: #d1d5db;
    --sidebar-bg: #1e3f31;
    --sidebar-hover: #2a5a46;
    --sidebar-text: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Views Management */
.view {
    display: none;
    height: 100%;
    width: 100%;
}
.view.active-view {
    display: flex;
    flex-direction: column;
}

.sub-view {
    display: none;
}
.sub-view.active-sub-view {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Auth View */
.auth-container {
    margin: auto;
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    max-width: 400px;
    width: 90%;
}
.auth-container h1 {
    margin: 1rem 0 0.5rem;
    font-size: 1.5rem;
}
.auth-container p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}
.logo {
    width: 100px;
    height: 100px;
    display: block;
    margin: 0 auto;
}

/* Landing Page Premium (Nexus Dark Theme) */
.landing-view {
    background: #030712;
    color: #f3f4f6;
    font-family: 'Inter', sans-serif;
    overflow-y: auto;
    height: 100vh;
    width: 100vw;
}
.landing-view.active-view {
    display: flex !important;
    flex-direction: column;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    border-bottom: 1px solid #1f2937;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nexus-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
}

.landing-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 4rem 5%;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .landing-hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        padding: 2rem 5%;
    }
}

.hero-text h1 {
    font-size: 2.8rem;
    line-height: 1.2;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.hero-text p {
    font-size: 1.1rem;
    color: #9ca3af;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-mockup-container img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px #1f2937;
    object-fit: cover;
}

.landing-features {
    padding: 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: #3b82f6;
}

.feature-card h4 {
    font-size: 1.2rem;
    color: #fff;
    margin: 1rem 0 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: #9ca3af;
    line-height: 1.5;
}

/* Quick Access Section (Exact match to image) */
.quick-access-section {
    padding: 2rem 5% 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.quick-access-box {
    background: #0b1329;
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    gap: 2.5rem;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .quick-access-box {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

.qr-container {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 180px;
    flex-shrink: 0;
}

.qr-image {
    width: 150px;
    height: 150px;
    background: white;
    border-radius: 8px;
    padding: 6px;
}

.qr-link {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.quick-access-text {
    flex: 1;
}

.quick-access-text h5 {
    color: #60a5fa;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.quick-access-text h3 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.quick-access-text p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.quick-access-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.badge-device {
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Footer matching the image */
.nexus-footer {
    border-top: 1px solid #1f2937;
    background: #020617;
    padding: 2.5rem 5%;
    margin-top: auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 480px) {
    .footer-top {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #64748b;
    border-top: 1px solid #111827;
    padding-top: 1.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column-reverse;
        gap: 1rem;
        text-align: center;
    }
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.footer-links a:hover {
    color: #3b82f6;
}

.btn-contact-nexus {
    background: #2563eb;
    color: white !important;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-contact-nexus:hover {
    background: #1d4ed8;
}

/* ================================ */
/* Layout Overhaul (Sidebar + Main) */
/* ================================ */
.app-layout {
    display: flex;
    flex-direction: row !important;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-color);
}

/* Sidebar Navigation */
.app-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 20;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    max-height: 60px;
    border-radius: 6px;
    object-fit: contain;
}

.app-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    flex: 1;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.2s, color 0.2s, border-left 0.2s;
    border-left: 4px solid transparent;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background-color: var(--primary-color);
    color: #fff;
    border-left: 4px solid #fff;
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    padding: 0.75rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.btn-logout:hover {
    background-color: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
}

/* Main Panel and Topbar */
.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-topbar {
    background-color: var(--surface-color);
    height: 70px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-mobile-menu {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.gadget-clock {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    background: #eef2f0;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid #d1d5db;
}

.btn-pwa-install {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #eef2f0;
    color: var(--primary-color);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-pwa-install:hover {
    background: #e2ebe7;
    border-color: var(--primary-color);
}

.btn-pwa-install svg {
    display: block;
}

.user-profile img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

@media (max-width: 768px) {
    .btn-mobile-menu {
        display: block;
    }
    
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .app-sidebar.show-mobile {
        transform: translateX(0);
    }
    
    .gadget-clock {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
    
    .app-topbar {
        padding: 0 1rem;
    }
}

/* App Content */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.search-bar input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
.search-bar input:focus {
    border-color: var(--primary-color);
}

.pacientes-letter-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.pacientes-letter-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.pacientes-letter-row > span {
    width: 72px;
    flex-shrink: 0;
    padding-top: 4px;
}

.pacientes-letter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pacientes-letter-btn {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f4c81;
    border-radius: 3px;
    padding: 3px 7px;
    font-size: 0.75rem;
    line-height: 1.2;
    cursor: pointer;
}

.pacientes-letter-btn.active {
    background: #0f4c81;
    color: #fff;
    border-color: #0f4c81;
}

/* Pacientes List */
.pacientes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.paciente-item {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    border: 1px solid var(--border-color);
}
.paciente-item:active {
    transform: scale(0.98);
}
.paciente-item .info h4 {
    margin: 0 0 0.25rem 0;
}
.paciente-item .info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
}
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 0;
}

/* Paciente View */
.view-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.view-header h3 {
    margin: 0;
    flex: 1;
}
.paciente-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.paquetes-container {
    margin-bottom: 1.5rem;
}
.paquete-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}
.paquete-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.progreso-sesiones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.sesion-dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: bold;
}
.sesion-dot.asistida {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}
.sesion-dot.no-asistio {
    background: #1f2937;
    border-color: #111827;
    color: white;
}
.sesion-dot.pendiente {
    /* Estado por defecto */
}

.deuda-indicator {
    font-weight: bold;
}
.deuda-verde { color: var(--success-color); }
.deuda-amarilla { color: var(--warning-color); }
.deuda-roja { color: var(--danger-color); }

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.2s;
}
.modal.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-content {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    transform: translateY(0);
    transition: transform 0.2s;
}
.modal.hidden .modal-content {
    transform: translateY(20px);
}
.modal h3 { margin-bottom: 1rem; }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    background: var(--bg-color);
    color: var(--text-primary);
    transition: opacity 0.2s, background-color 0.2s;
}
.btn:active { opacity: 0.8; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
}
.btn-success {
    background: var(--success-color);
    color: white;
}
.btn-warning {
    background: var(--warning-color);
    color: white;
}
.btn-danger {
    background: #dc2626;
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}
.btn-large {
    padding: 1rem;
    font-size: 1rem;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
}
.btn-whatsapp {
    background: #25D366;
    color: #fff;
    border: 1px solid #25D366;
    text-decoration: none;
}
.btn-whatsapp:hover {
    background: #20bd5a;
    border-color: #20bd5a;
}
.btn-icon-text .btn-icon {
    flex-shrink: 0;
}
.btn-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem;
    cursor: pointer;
}
.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
}

/* Citas / FullCalendar */
#calendar-container {
    min-height: 420px;
    position: relative;
}
.calendar-loading,
.calendar-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary, #666);
    font-size: 0.95rem;
}
.calendar-error {
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 8px;
    flex-direction: column;
    gap: 0.5rem;
}
.calendar-error-detail {
    font-size: 0.8rem;
    color: #991b1b;
    opacity: 0.85;
}

/* Utilities */
.hidden { display: none !important; }

/* Login View Layout Overrides */
#login-view.view {
    display: none;
}
#login-view.view.active-view {
    display: flex !important;
}

/* Auth session restore loading */
.auth-loading-screen {
    background: #030712;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    color: #f3f4f6;
    font-family: 'Inter', sans-serif;
}
#auth-loading-view.view.active-view {
    display: flex !important;
}
.auth-loading-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    max-width: 360px;
    width: 90%;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    text-align: center;
}
.auth-loading-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.75rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}
.auth-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 1.25rem;
    border: 3px solid #1e293b;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: auth-spin 0.85s linear infinite;
}
@keyframes auth-spin {
    to { transform: rotate(360deg); }
}
.auth-loading-title {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f3f4f6;
}
.auth-loading-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}
#btn-login:disabled,
#btn-login-header:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    background: #333;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    animation: toastIn 0.3s forwards;
}
@keyframes toastIn {
    to { opacity: 1; transform: translateY(-10px); }
}

/* Switch Toggle Styles (for Admin panel) */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

input:checked + .slider {
  background-color: var(--success-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--success-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Tienda de servicios add-on */
.addon-store-intro {
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 1rem;
}

.addon-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.addon-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.addon-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.addon-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.addon-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.addon-badge-active {
  background: rgba(43, 122, 97, 0.15);
  color: var(--success-color);
}

.addon-badge-inactive {
  background: rgba(0, 0, 0, 0.06);
  color: #888;
}

.addon-card-price {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 8px;
}

.addon-card-bullets {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: #666;
  flex: 1;
}

.addon-card-bullets li {
  margin-bottom: 4px;
}

.addon-pending-msg {
  font-size: 0.8rem;
  color: var(--success-color);
  margin: 10px 0 0;
}

.addon-contact-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.addon-contact-actions .btn {
  width: 100%;
}

.btn-addon-whatsapp {
  background: #25d366;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-addon-whatsapp:hover {
  background: #1ebe57;
}

.addon-lock-banner {
  font-size: 0.85rem;
  color: #666;
  background: rgba(0, 0, 0, 0.04);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
}

/* Citas — acciones de asistencia (modal gestionar) */
.mgc-acciones-asistencia {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.mgc-accion-btn {
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
  color: var(--text-color);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mgc-accion-asistio {
  background: #22c55e;
  border-color: #16a34a;
  color: #fff;
}

.mgc-accion-asistio:hover:not(:disabled) {
  background: #16a34a;
}

.mgc-accion-no-asistio {
  background: #1f2937;
  border-color: #111827;
  color: #fff;
}

.mgc-accion-no-asistio:hover:not(:disabled) {
  background: #111827;
}

.mgc-accion-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.mgc-revertir-wrap {
  text-align: center;
  margin: 0 0 15px;
}

.mgc-revertir-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
}

.mgc-revertir-link:hover:not(:disabled) {
  color: #334155;
}

.mgc-revertir-link:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Citas — check de asistencia en calendario */
.fc-event-inner-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding-right: 12px;
  min-width: 0;
}

.fc-event-estado-check {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 2px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
}

.fc-event-estado-asistio {
  color: #4ade80;
}

.fc-event-estado-no_asistio {
  color: #1f2937;
}

.fc-event-compact {
  font-size: 0.72em;
  font-weight: 600;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-event {
  padding: 0 4px;
  border-radius: 4px;
  overflow: hidden;
}

.fc-timeGridWeek-view .fc-event-compact {
  font-size: 0.68em;
  line-height: 1;
}

/* Citas — barra de contadores día/semana */
.citas-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.citas-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-color);
}

.citas-stat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.citas-stat-dot-asistio {
  background: #22c55e;
}

.citas-stat-dot-agendados {
  background: #6366f1;
}

.citas-stat-dot-no-asistio {
  background: #1f2937;
}

.citas-stat-count {
  font-weight: 700;
  min-width: 1.25rem;
}

/* Citas — contadores compactos bajo cada columna de día */
.citas-day-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.citas-day-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  line-height: 1;
}

.citas-day-stat-num {
  font-weight: 700;
  color: var(--text-color);
  min-width: 0.85rem;
  text-align: left;
}

.citas-day-stats .citas-stat-dot {
  width: 6px;
  height: 6px;
}

.fc-col-header-cell-cushion .citas-day-stats {
  padding-bottom: 2px;
}

.citas-stats-bar--day .citas-stat-label {
  display: none;
}

@media print {
    body { height: auto; overflow: visible; background: white; }
    .app-header, .search-bar, .quick-actions, .view-header button, .paciente-actions { display: none; }
    .paquete-card { border: none; }
}
