/* ==========================================================================
   NFC SEGURIDAD INFANTIL - PREMIUM CHILD SAFETY ID CARD SYSTEM
   ========================================================================== */

:root {
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-card: 40px;
    --radius-btn: 30px;
    --radius-box: 22px;
    
    /* DEFAULT BOY THEME COLORS */
    --bg-page: linear-gradient(180deg, #0252a1 0%, #0284c7 35%, #38bdf8 65%, #bae6fd 100%);
    --card-bg: rgba(255, 255, 255, 0.96);
    --text-title: #1e3a8a;
    --text-sub: #475569;
    --border-card: rgba(255, 255, 255, 0.9);
    --shadow-card: 0 25px 60px rgba(2, 82, 161, 0.35);
}

/* ==========================================================================
   THEME IDENTITIES: BOY (👦) VS GIRL (👧)
   ========================================================================== */

/* BOY THEME (👦 Soft Sky Blue Gradient Background) */
html.theme-boy,
html.theme-boy body,
body.theme-boy {
    --bg-page: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 45%, #bae6fd 100%);
    --card-bg: #ffffff;
    --text-title: #0369a1;
    --text-sub: #0284c7;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 45%, #bae6fd 100%) !important;
    background-color: #f0f9ff !important;
}

html.theme-boy .app-header {
    background: transparent !important;
    color: #0369a1 !important;
}

html.theme-boy .app-header .brand-logo {
    color: #0369a1 !important;
}

html.theme-boy .app-header .brand-icon {
    background: rgba(2, 132, 199, 0.15) !important;
    color: #0284c7 !important;
}

/* GIRL THEME (👧 Soft Fairytale Pink Gradient Background) */
html.theme-girl,
html.theme-girl body,
body.theme-girl {
    --bg-page: linear-gradient(180deg, #fdf2f8 0%, #fbcfe8 45%, #f472b6 100%);
    --card-bg: #ffffff;
    --text-title: #be185d;
    --text-sub: #db2777;
    background: linear-gradient(180deg, #fdf2f8 0%, #fbcfe8 45%, #f472b6 100%) !important;
    background-color: #fdf2f8 !important;
}

html.theme-girl .app-header {
    background: transparent !important;
    color: #be185d !important;
}

html.theme-girl .app-header .brand-logo {
    color: #be185d !important;
}

html.theme-girl .app-header .brand-icon {
    background: rgba(236, 72, 153, 0.15) !important;
    color: #ec4899 !important;
}

/* PET THEME (🐾 Warm Organic Beige & Forest Green Background) */
html.theme-pet,
html.theme-pet body,
body.theme-pet {
    --bg-page: linear-gradient(180deg, #f4efe4 0%, #e6decb 45%, #d8cdb4 100%) !important;
    --card-bg: #fffdf7 !important;
    --text-title: #1c3818 !important;
    --text-sub: #4a5d3e !important;
    background: linear-gradient(180deg, #f4efe4 0%, #e6decb 45%, #d8cdb4 100%) !important;
    background-color: #f4efe4 !important;
}

html.theme-pet .app-header {
    background: transparent !important;
    color: #1c3818 !important;
}

html.theme-pet .app-header .brand-logo {
    color: #1c3818 !important;
}

html.theme-pet .app-header .brand-icon {
    background: rgba(45, 90, 39, 0.15) !important;
    color: #2d5a27 !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
    -webkit-tap-highlight-color: transparent;
}

html {
    background-color: #070d18;
    overscroll-behavior-y: none;
    overscroll-behavior-x: hidden;
}

body {
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 0 !important;
}

body.admin-page-active,
html:has(body.admin-page-active) {
    background: #070d18 !important;
    background-color: #070d18 !important;
    overscroll-behavior-y: auto;
    overscroll-behavior-x: hidden;
}

/* Background Dynamic Glow Bubbles */
.bg-bubbles {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    animation: floatGlow 14s ease-in-out infinite alternate;
}

.bubble-1 {
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.5) 0%, rgba(0, 0, 0, 0) 70%);
    top: -80px; left: -80px;
}
.bubble-2 {
    width: 440px; height: 440px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -100px; right: -80px;
    animation-delay: 4s;
}
.bubble-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    top: 35%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 2s;
}

html.theme-girl .bg-bubbles .bubble-1,
body.theme-girl .bg-bubbles .bubble-1 {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.5) 0%, rgba(0, 0, 0, 0) 70%);
}
html.theme-girl .bg-bubbles .bubble-2,
body.theme-girl .bg-bubbles .bubble-2 {
    background: radial-gradient(circle, rgba(192, 132, 252, 0.45) 0%, rgba(0, 0, 0, 0) 70%);
}

@keyframes floatGlow {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-25px) scale(1.06); }
}

/* Floating Ambient Infantile Decorators */
.floating-decorators {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.decorator {
    position: absolute;
    color: #ffffff;
    opacity: 0.35;
    font-size: 1.6rem;
    animation: floatDecorator 9s ease-in-out infinite alternate;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.dec-1 { top: 8%; left: 6%; animation-delay: 0s; font-size: 1.8rem; }
.dec-2 { top: 20%; right: 8%; animation-delay: 1.5s; font-size: 2.1rem; }
.dec-3 { top: 55%; left: 5%; animation-delay: 3.2s; font-size: 1.5rem; }
.dec-4 { top: 78%; right: 6%; animation-delay: 2s; font-size: 1.9rem; }
.dec-5 { top: 42%; left: 88%; animation-delay: 4.5s; font-size: 1.7rem; }
.dec-6 { top: 86%; left: 12%; animation-delay: 2.8s; font-size: 1.8rem; }

@keyframes floatDecorator {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-20px) rotate(14deg); }
}

/* Header */
.app-header {
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.3px;
}

.brand-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
}

/* ==========================================================================
   PUBLIC SINGLE PROFILE CARD LAYOUT (MATCHING MOCKUP IMAGE 100%)
   ========================================================================== */
.container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 0.6rem 0.5rem 0.6rem;
    position: relative;
    z-index: 10;
}

.profile-container {
    width: 100%;
    margin-top: 0.2rem;
}

.profile-card {
    background: var(--card-bg);
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 1.25rem 1.15rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* Top Bar Header */
.profile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.top-bar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
}

.brand-shield-icon {
    width: 34px; height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

html.theme-girl .brand-shield-icon,
body.theme-girl .brand-shield-icon {
    background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.verified-badge-pill {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.38rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

html.theme-girl .verified-badge-pill,
body.theme-girl .verified-badge-pill {
    background: rgba(236, 72, 153, 0.14);
    color: #db2777;
    border-color: rgba(236, 72, 153, 0.3);
}

/* Arch Photo Avatar Frame & Decorations */
.hero-arch-wrapper {
    position: relative;
    width: 145px;
    height: 145px;
    margin: 0.1rem auto 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arch-photo-container {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    overflow: hidden;
    border: 3.5px solid #ffffff;
    box-shadow: 0 12px 30px rgba(2, 132, 199, 0.3), 0 0 0 4px rgba(56, 189, 248, 0.4);
    background: #ffffff;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

html.theme-girl .arch-photo-container,
body.theme-girl .arch-photo-container {
    box-shadow: 0 16px 40px rgba(236, 72, 153, 0.35), 0 0 0 5px rgba(244, 114, 182, 0.45);
}

.arch-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: block;
}

.arch-deco {
    position: absolute;
    font-size: 1.8rem;
    z-index: 3;
    animation: decoPulse 3s ease-in-out infinite alternate;
}

.deco-top-left {
    top: -4px; left: -10px;
    color: #0284c7;
    filter: drop-shadow(0 4px 10px rgba(2, 132, 199, 0.4));
}

.deco-top-right {
    top: 6px; right: -12px;
    color: #38bdf8;
    filter: drop-shadow(0 4px 10px rgba(56, 189, 248, 0.4));
}

.deco-bottom-right {
    bottom: -6px; right: -8px;
    color: #0d9488;
    filter: drop-shadow(0 4px 10px rgba(13, 148, 136, 0.4));
}

html.theme-girl .deco-top-left,
body.theme-girl .deco-top-left { color: #ec4899; }

html.theme-girl .deco-top-right,
body.theme-girl .deco-top-right { color: #c084fc; }

html.theme-girl .deco-bottom-right,
body.theme-girl .deco-bottom-right { color: #fb7185; }

html.theme-pet .deco-top-left,
body.theme-pet .deco-top-left { color: #2d5a27; }

html.theme-pet .deco-top-right,
body.theme-pet .deco-top-right { color: #5e8c31; }

html.theme-pet .deco-bottom-right,
body.theme-pet .deco-bottom-right { color: #84a955; }

html.theme-senior .arch-deco,
body.theme-senior .arch-deco,
html.theme-senior .name-spark,
body.theme-senior .name-spark {
    display: none !important;
}

html.theme-pet .profile-card,
body.theme-pet .profile-card {
    background: #fffdf7 !important;
    border: 2px solid #a4c27b !important;
    box-shadow: 0 25px 60px rgba(45, 90, 39, 0.22) !important;
}

html.theme-pet .brand-shield-icon,
body.theme-pet .brand-shield-icon {
    background: linear-gradient(135deg, #2d5a27 0%, #5e8c31 100%) !important;
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3) !important;
}

html.theme-pet .verified-badge-pill,
body.theme-pet .verified-badge-pill {
    background: #eaf4df !important;
    color: #2d5a27 !important;
    border-color: #a4c27b !important;
}

html.theme-pet .brand-shield-icon,
body.theme-pet .brand-shield-icon {
    background: linear-gradient(135deg, #2d5a27 0%, #1e401b 100%) !important;
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3) !important;
}

html.theme-pet .verified-badge-pill,
body.theme-pet .verified-badge-pill {
    background: rgba(45, 90, 39, 0.14) !important;
    color: #1e401b !important;
    border-color: rgba(94, 140, 49, 0.35) !important;
}

html.theme-pet .arch-photo-container,
body.theme-pet .arch-photo-container {
    border: 5px solid #2d5a27 !important;
    box-shadow: 0 16px 40px rgba(45, 90, 39, 0.3), 0 0 0 5px rgba(94, 140, 49, 0.4) !important;
    border-radius: 50% !important;
}

html.theme-pet .security-ribbon,
body.theme-pet .security-ribbon {
    background: linear-gradient(135deg, #2d5a27 0%, #1e401b 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(45, 90, 39, 0.35) !important;
    border: 1px solid #5e8c31 !important;
}

html.theme-pet .btn-whatsapp,
body.theme-pet .btn-whatsapp {
    background: linear-gradient(135deg, #2d5a27 0%, #1e401b 100%) !important;
    box-shadow: 0 12px 28px rgba(45, 90, 39, 0.35) !important;
    border: 1px solid #5e8c31 !important;
}

html.theme-pet .btn-whatsapp:hover,
body.theme-pet .btn-whatsapp:hover {
    box-shadow: 0 16px 36px rgba(45, 90, 39, 0.45) !important;
}

html.theme-pet .btn-maps,
body.theme-pet .btn-maps {
    background: #f2ebe0 !important;
    color: #1c3818 !important;
    border: 1.5px solid #a4c27b !important;
    box-shadow: 0 8px 20px rgba(45, 90, 39, 0.12) !important;
}

html.theme-pet .btn-maps .btn-icon-circle,
body.theme-pet .btn-maps .btn-icon-circle {
    background: #2d5a27 !important;
    color: #ffffff !important;
}

html.theme-pet .info-card-box,
body.theme-pet .info-card-box {
    background: #f8f4eb;
    border: 1.5px solid #d8cdb4;
}

html.theme-pet .icon-age,
body.theme-pet .icon-age {
    background: rgba(45, 90, 39, 0.12);
    color: #2d5a27;
}

html.theme-pet .icon-parent,
body.theme-pet .icon-parent {
    background: rgba(94, 140, 49, 0.12);
    color: #5e8c31;
}

html.theme-pet .bg-bubbles .bubble-1,
body.theme-pet .bg-bubbles .bubble-1 {
    background: radial-gradient(circle, rgba(94, 140, 49, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
}

html.theme-pet .bg-bubbles .bubble-2,
body.theme-pet .bg-bubbles .bubble-2 {
    background: radial-gradient(circle, rgba(45, 90, 39, 0.35) 0%, rgba(0, 0, 0, 0) 70%);
}

/* ==========================================================================
   THEME: SENIOR (ADULTO MAYOR - WARM ELEGANT AMBER & ORANGE)
   ========================================================================== */
html.theme-senior,
html.theme-senior body,
body.theme-senior {
    --bg-page: linear-gradient(180deg, #fff7ed 0%, #ffedd5 45%, #fed7aa 100%);
    --card-bg: #ffffff;
    --text-title: #2b1e16;
    --text-sub: #786355;
    --border-color: #fce8d5;
    --accent-main: #f77f00;
    --accent-gradient: linear-gradient(135deg, #f77f00 0%, #d65a00 100%);
    --accent-glow: rgba(247, 127, 0, 0.25);
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 45%, #fed7aa 100%) !important;
    background-color: #fff7ed !important;
}

html.theme-senior .app-header {
    background: transparent !important;
    color: #7c2d12 !important;
}

html.theme-senior .app-header .brand-logo {
    color: #7c2d12 !important;
}

html.theme-senior .app-header .brand-icon {
    background: rgba(247, 127, 0, 0.15) !important;
    color: #f77f00 !important;
}

html.theme-senior .brand-shield-icon,
body.theme-senior .brand-shield-icon {
    background: linear-gradient(135deg, #f77f00 0%, #d65a00 100%) !important;
    box-shadow: 0 4px 12px rgba(247, 127, 0, 0.3) !important;
}

html.theme-senior .verified-badge-pill,
body.theme-senior .verified-badge-pill {
    background: rgba(247, 127, 0, 0.14) !important;
    color: #d65a00 !important;
    border-color: rgba(247, 127, 0, 0.35) !important;
}

html.theme-senior .arch-photo-container,
body.theme-senior .arch-photo-container {
    box-shadow: 0 16px 40px rgba(247, 127, 0, 0.35), 0 0 0 5px rgba(247, 127, 0, 0.45) !important;
}

html.theme-senior .avatar-ring,
body.theme-senior .avatar-ring {
    border-color: #f77f00 !important;
    box-shadow: 0 0 0 8px rgba(247, 127, 0, 0.15), 0 14px 32px rgba(214, 90, 0, 0.22) !important;
}

html.theme-senior .security-ribbon,
body.theme-senior .security-ribbon {
    background: linear-gradient(135deg, #f77f00 0%, #d65a00 100%) !important;
    box-shadow: 0 6px 16px rgba(247, 127, 0, 0.35) !important;
}

html.theme-senior .btn-whatsapp,
body.theme-senior .btn-whatsapp {
    background: linear-gradient(135deg, #f77f00 0%, #d65a00 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(247, 127, 0, 0.35) !important;
    border: none !important;
}

html.theme-senior .btn-whatsapp .btn-icon-circle,
body.theme-senior .btn-whatsapp .btn-icon-circle {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

html.theme-senior .btn-maps,
body.theme-senior .btn-maps {
    background: #ffffff !important;
    color: #2b1e16 !important;
    border: 1.5px solid #fbd38d !important;
    box-shadow: 0 8px 20px rgba(247, 127, 0, 0.08) !important;
}

html.theme-senior .btn-maps .btn-icon-circle,
body.theme-senior .btn-maps .btn-icon-circle {
    background: linear-gradient(135deg, #f77f00 0%, #d65a00 100%) !important;
    color: #ffffff !important;
}

html.theme-senior .info-card-box,
body.theme-senior .info-card-box {
    background: #ffffff;
    border: 1.5px solid #fce8d5;
}

html.theme-senior .icon-age,
body.theme-senior .icon-age {
    background: rgba(247, 127, 0, 0.12);
    color: #f77f00;
}

html.theme-senior .icon-blood,
body.theme-senior .icon-blood {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

html.theme-senior .bg-bubbles .bubble-1,
body.theme-senior .bg-bubbles .bubble-1 {
    background: radial-gradient(circle, rgba(247, 127, 0, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
}

html.theme-senior .bg-bubbles .bubble-2,
body.theme-senior .bg-bubbles .bubble-2 {
    background: radial-gradient(circle, rgba(214, 90, 0, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
}

.pill-senior {
    background: rgba(247, 127, 0, 0.15) !important;
    color: #d65a00 !important;
    border: 1px solid rgba(247, 127, 0, 0.3) !important;
}

@keyframes decoPulse {
    0% { transform: translateY(0px) scale(0.95); }
    100% { transform: translateY(-8px) scale(1.1); }
}

/* Identity Section (Name & Ribbon) */
.profile-identity-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.name-spark-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.name-spark {
    color: #fbbf24;
    font-size: 1rem;
    font-weight: 800;
}

.profile-hero-name {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-title);
    letter-spacing: -0.2px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    line-height: 1.15;
}

.security-ribbon {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 0.38rem 1.2rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 5px 14px rgba(2, 132, 199, 0.32);
}

html.theme-girl .security-ribbon,
body.theme-girl .security-ribbon {
    background: linear-gradient(135deg, #ec4899 0%, #c026d3 100%);
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.35);
}

/* Information Cards Row (Edad & Tipo de Sangre) */
.info-cards-grid {
    width: 100%;
}

.info-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    width: 100%;
}

.info-card-box {
    background: #ffffff;
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    padding: 0.72rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.info-card-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.09);
}

.info-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.icon-age {
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
}

html.theme-girl .icon-age,
body.theme-girl .icon-age {
    background: rgba(236, 72, 153, 0.12);
    color: #ec4899;
}

.icon-blood {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

html.theme-girl .icon-blood,
body.theme-girl .icon-blood {
    background: rgba(236, 72, 153, 0.14);
    color: #ec4899;
}

.icon-school {
    background: rgba(147, 51, 234, 0.12);
    color: #9333ea;
}

html.theme-girl .icon-school,
body.theme-girl .icon-school {
    background: rgba(219, 39, 119, 0.12);
    color: #db2777;
}

.icon-grade {
    background: rgba(79, 70, 229, 0.12);
    color: #4f46e5;
}

html.theme-girl .icon-grade,
body.theme-girl .icon-grade {
    background: rgba(192, 38, 211, 0.12);
    color: #c026d3;
}

/* Medical Special Care Box (Enfermedad o Condición) */
.special-care-box {
    background: #fff8f8;
    border: 1.5px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 14px;
    padding: 0.75rem 0.95rem;
    margin-top: 0.15rem;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.06);
    transition: var(--transition);
}

.special-care-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(239, 68, 68, 0.1);
}

.special-care-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #991b1b;
    margin-bottom: 0.28rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.special-care-header i {
    font-size: 1.05rem;
    color: #dc2626;
}

.special-care-body {
    font-size: 0.92rem;
    font-weight: 700;
    color: #7f1d1d;
    line-height: 1.38;
    word-break: break-word;
}

/* Important Medications Box */
.medications-box {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-left: 4px solid #16a34a;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.08);
}

.medications-box .special-care-header {
    color: #166534;
}

.medications-box .special-care-header i {
    color: #16a34a;
}

.medications-box .special-care-body {
    color: #14532d;
}

html.theme-senior .medications-box,
body.theme-senior .medications-box {
    background: #fffbe6;
    border: 1.5px solid #fef08a;
    border-left: 4px solid #f59e0b;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.08);
}

html.theme-senior .medications-box .special-care-header,
body.theme-senior .medications-box .special-care-header {
    color: #b45309;
}

html.theme-senior .medications-box .special-care-header i,
body.theme-senior .medications-box .special-care-header i {
    color: #f59e0b;
}

html.theme-senior .medications-box .special-care-body,
body.theme-senior .medications-box .special-care-body {
    color: #78350f;
}

.info-card-text {
    display: flex;
    flex-direction: column;
}

.info-card-text .label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}

.info-card-text .val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

/* Action Buttons Stack (WhatsApp & Location) */
.profile-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.hidden-btn {
    display: none !important;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.68rem 1rem;
    border-radius: 16px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
}

.btn-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.btn-text-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    margin-left: 0.8rem;
}

.btn-main-text {
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.15;
}

.btn-sub-text {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.9;
}

.btn-arrow {
    font-size: 1rem;
    opacity: 0.85;
}

/* WhatsApp Action Button */
.btn-whatsapp {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(34, 197, 94, 0.38);
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 18px 38px rgba(34, 197, 94, 0.52);
    transform: translateY(-2px);
}

html.theme-girl .btn-whatsapp,
body.theme-girl .btn-whatsapp {
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(236, 72, 153, 0.42);
}

html.theme-girl .btn-whatsapp:hover,
body.theme-girl .btn-whatsapp:hover {
    background: linear-gradient(135deg, #db2777 0%, #c026d3 100%);
    box-shadow: 0 18px 38px rgba(236, 72, 153, 0.58);
    transform: translateY(-2px);
}

/* Location Action Button */
.btn-maps {
    background: #ffffff;
    color: #0284c7;
    border: 2px solid rgba(2, 132, 199, 0.22);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}

.btn-maps .btn-icon-circle {
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
}

.btn-maps:hover {
    background: #f8fafc;
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 15px 32px rgba(2, 132, 199, 0.2);
}

html.theme-girl .btn-maps,
body.theme-girl .btn-maps {
    background: #ffffff;
    color: #ec4899;
    border: 2px solid rgba(236, 72, 153, 0.22);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}

html.theme-girl .btn-maps .btn-icon-circle,
body.theme-girl .btn-maps .btn-icon-circle {
    background: rgba(236, 72, 153, 0.12);
    color: #ec4899;
}

html.theme-girl .btn-maps:hover,
body.theme-girl .btn-maps:hover {
    background: #fdf2f8;
    border-color: #ec4899;
    transform: translateY(-2px);
    box-shadow: 0 15px 32px rgba(236, 72, 153, 0.2);
}

/* Bottom Scene & Footer Love Badge */
.bottom-scene-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.4rem;
}

.scene-item {
    font-size: 1.4rem;
    color: #3b82f6;
    opacity: 0.75;
}

html.theme-girl .scene-item,
body.theme-girl .scene-item {
    color: #ec4899;
}

html.theme-pet .scene-item,
body.theme-pet .scene-item {
    color: #2d5a27 !important;
}

html.theme-senior .scene-item,
body.theme-senior .scene-item {
    color: #f77f00 !important;
}

html.theme-senior .security-ribbon i,
body.theme-senior .security-ribbon i {
    color: #f77f00 !important;
}

.footer-love-pill {
    text-align: center;
    font-size: 0.88rem;
    font-weight: 800;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.48rem 1.1rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ==========================================================================
   ADMIN PANEL STYLES (PRESERVED 100% UNCHANGED & RESPONSIVE)
   ========================================================================== */
.view-section {
    display: none !important;
}

.view-section.active-view {
    display: block !important;
}

/* Pre-paint Authenticated View Override (Eliminates 1ms Login Screen Flash) */
html.is-authenticated-init #admin-login-screen {
    display: none !important;
}

html.is-authenticated-init #admin-dashboard-screen {
    display: block !important;
}

.admin-login-card {
    max-width: 420px;
    margin: 3.5rem auto;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 28px;
    padding: 2.5rem 2rem;
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
}

.dashboard-banner {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 28px;
    padding: 1.8rem 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    color: #f8fafc;
}
.dashboard-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    border: 1px solid rgba(56, 189, 248, 0.25);
}
.dashboard-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
}
.dashboard-subtitle {
    color: #94a3b8;
    font-size: 0.92rem;
    margin-top: 0.4rem;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 20px;
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.icon-total { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }

.stat-label {
    display: block;
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f8fafc;
}

.admin-toolbar {
    margin-bottom: 1.5rem;
}
.search-box {
    position: relative;
    width: 100%;
}
.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
}
.search-input {
    width: 100%;
    padding: 0.95rem 1.2rem 0.95rem 3.2rem;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    -webkit-text-size-adjust: 100%;
}
.search-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.3rem;
    contain: content;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

.admin-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 28px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(16px);
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color: #f8fafc;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    contain: paint layout;
}
.admin-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.admin-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.admin-card-avatar {
    width: 58px; height: 58px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    border: 2.5px solid #38bdf8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.admin-card-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.admin-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gender-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.pill-boy {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.pill-girl {
    background: rgba(244, 114, 182, 0.15);
    color: #f472b6;
    border: 1px solid rgba(244, 114, 182, 0.3);
}

.pill-pet {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

/* CATEGORY FILTER TABS BAR IN ADMIN PANEL */
.category-tabs-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
}
.category-tabs-bar::-webkit-scrollbar {
    display: none;
}
.category-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.15rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.category-tab:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}
.category-tab.active {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}
.tab-badge {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 800;
}
.category-tab.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.url-pill-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}
.url-slug-text {
    font-family: monospace;
    font-size: 0.85rem;
    color: #38bdf8;
    font-weight: 700;
}
.btn-copy-mini {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-copy-mini:hover {
    background: #38bdf8;
    color: #0f172a;
}

.card-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.meta-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meta-item-full {
    grid-column: 1 / -1;
}

.admin-card-footer {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-top: 0.9rem;
    margin-top: auto;
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    width: 100%;
}
.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
    background: #ef4444;
    color: #fff;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}
.btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
    color: #fff;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.35);
}
.btn-sm {
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    min-height: auto;
    border-radius: 10px;
}

/* Scroll Lock & Heavy Background Blur when Modal is Active */
body.modal-open {
    overflow: hidden;
}

body.modal-open .app-header,
body.modal-open .container,
body.modal-open .dashboard-banner,
body.modal-open .admin-toolbar,
body.modal-open .admin-grid {
    filter: blur(20px) !important;
    opacity: 0.05 !important;
    pointer-events: none !important;
    transition: filter 0.25s ease, opacity 0.25s ease;
}

/* Modal Form Overlay - Starts cleanly from TOP for PC & Cellphones */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgba(7, 13, 24, 0.98) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    display: flex;
    align-items: flex-start; /* Aligned cleanly from TOP */
    justify-content: center;
    z-index: 999999;
    padding: 1.2rem 0.8rem 2.5rem 0.8rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal-container {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 28px;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.85);
    color: #f8fafc;
    overflow: hidden;
}
.modal-header {
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
}
.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    line-height: 1.35;
    margin: 0;
}

.modal-info-banner {
    font-size: 0.76rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

.modal-info-banner i {
    color: #38bdf8;
    font-size: 0.85rem;
}

.modal-form-section {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 1.1rem 1.2rem 0.4rem 1.2rem;
    margin-bottom: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.modal-form-section .modal-section-title {
    margin-top: 0;
}
.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: var(--transition);
}
.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}
.modal-body {
    padding: 1.6rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}
.modal-footer {
    padding: 1.2rem 1.6rem;
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    background: rgba(30, 41, 59, 0.98);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 0.5rem;
    width: 100%;
}
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
    width: 100%;
}
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.45rem;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1.1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(15, 23, 42, 0.7);
    color: #f8fafc;
    font-size: 16px;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: all 0.25s ease;
    -webkit-text-size-adjust: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #38bdf8;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}
.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%3c38bdf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.1rem;
    padding-right: 2.8rem;
}

.modal-section-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 1.2rem 0 0.8rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.photo-avatar-wrapper {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}
.photo-preview-img {
    width: 84px; height: 84px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    border: 3px solid #38bdf8;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    display: block;
}
.btn-remove-photo-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    border: 2px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
}
.field-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.2rem;
    display: block;
}
.hidden { display: none !important; }

/* ==========================================================================
   PULL-TO-REFRESH MOBILE STYLES & MULTI-DEVICE RESPONSIVE SYSTEM
   ========================================================================== */

.pull-to-refresh-container {
    position: fixed;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 30px;
    padding: 0.65rem 1.3rem;
    color: #38bdf8;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    transition: top 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.pull-to-refresh-container.visible {
    top: 24px;
    opacity: 1;
}

.pull-to-refresh-container.refreshing .pull-spinner i {
    animation: pullSpin 0.75s linear infinite !important;
}

@keyframes pullSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 1. Large Desktops & Wide Monitors (> 1200px) */
@media (min-width: 1200px) {
    body:has(#admin-dashboard-screen.active-view) .container,
    .admin-page-active .container {
        max-width: 1140px;
        margin: 0 auto;
    }
    .admin-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem;
    }
}

/* 2. Laptops & Standard Desktops (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    body:has(#admin-dashboard-screen.active-view) .container,
    .admin-page-active .container {
        max-width: 960px;
        margin: 0 auto;
    }
    .admin-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.3rem;
    }
}

/* 3. Tablets & iPad Screens (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    body:has(#admin-dashboard-screen.active-view) .container,
    .admin-page-active .container {
        max-width: 720px;
        padding-left: 1.2rem;
        padding-right: 1.2rem;
        margin: 0 auto;
    }
    .dashboard-banner {
        padding: 1.6rem;
        gap: 1.2rem;
    }
    .admin-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.2rem;
    }
}

/* 4. Cellphones & Compact Mobile Devices (< 768px) */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden !important;
        width: 100vw;
    }
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }
    .app-header {
        padding: 0.8rem 0.9rem;
    }
    .brand-logo {
        font-size: 1.15rem;
    }
    .dashboard-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1.3rem 1rem;
        gap: 1rem;
        border-radius: 20px;
    }
    .dashboard-title {
        font-size: 1.4rem;
    }
    .dashboard-subtitle {
        font-size: 0.85rem;
    }
    .dashboard-actions, .dashboard-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .admin-toolbar {
        margin-bottom: 1.2rem;
    }
    .search-input {
        font-size: 0.88rem;
        padding: 0.85rem 1rem 0.85rem 2.8rem;
    }
    .search-icon {
        left: 1rem;
    }
    .admin-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    .admin-card {
        padding: 1.1rem 1rem;
        border-radius: 20px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .admin-card-header {
        gap: 0.8rem;
    }
    .admin-card-avatar {
        width: 48px;
        height: 48px;
    }
    .admin-card-name {
        font-size: 1.05rem;
        word-break: break-word;
    }
    .url-pill-bar {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.4rem 0.6rem;
    }
    .url-slug-text {
        font-size: 0.8rem;
        word-break: break-all;
    }
    .card-meta-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    .meta-item {
        font-size: 0.82rem;
    }
    .admin-card-footer {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.45rem !important;
        margin-top: 0.8rem !important;
        padding-top: 0.8rem !important;
        width: 100% !important;
    }
    .admin-card-footer .btn-primary,
    .admin-card-footer .btn-secondary {
        flex: 1 1 0% !important;
        padding: 0.65rem 0.5rem !important;
        font-size: 0.82rem !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        justify-content: center !important;
    }
    .admin-card-footer .btn-danger {
        flex: 0 0 38px !important;
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 12px !important;
    }

    .modal-overlay {
        padding: 0.6rem 0.4rem 2rem 0.4rem !important;
        align-items: flex-start !important;
    }
    .modal-container {
        border-radius: 20px;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
    }
    .modal-header {
        padding: 1rem;
    }
    .modal-header h3 {
        font-size: 1.1rem;
    }
    .modal-body {
        padding: 1rem 0.85rem;
    }
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    .form-input, .form-select, .form-textarea {
        font-size: 0.92rem;
        padding: 0.75rem 0.9rem;
    }
    .modal-footer {
        flex-direction: column-reverse;
        gap: 0.6rem;
        padding: 0.9rem 0.85rem;
    }
    .modal-footer .btn {
        width: 100%;
        padding: 0.85rem;
        font-size: 0.95rem;
        justify-content: center;
    }

    /* Mobile Hardware Acceleration & Fluidity Boost */
    .bg-bubbles, .floating-decorators {
        display: none !important;
    }

    .profile-card, .admin-card, .dashboard-banner, .modal-container, .admin-login-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    }

    .stat-card, .search-input, .admin-card, .btn {
        will-change: transform;
    }
}

/* Ocultar el molde de la tarjeta hasta que Firebase inyecte los datos */
html:not(.ready) .container {
    opacity: 0 !important;
    visibility: hidden;
}
html.ready .container {
    opacity: 1 !important;
    visibility: visible;
    transition: opacity 0.4s ease;
}

