@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;800&family=Inter:wght@300;400;600&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

    --surface: #0f172a; /* Slate 900 */
    --surface-container-low: #1e293b; /* Slate 800 */
    --surface-content: #f8fafc;
    
    --primary: #38bdf8; /* Sky Blue Electric */
    --primary-dim: #0ea5e9;
    --primary-container: rgba(56, 189, 248, 0.1);
    --on-primary-container: #38bdf8;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;

    --text-dark: #f8fafc;
    --text-muted: #94a3b8; /* Slate 400 */
    --outline-variant: rgba(255, 255, 255, 0.05);

    --radius-xl: 32px;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-full: 9999px;

    --shadow-ambient: 0 20px 50px rgba(15, 23, 42, 0.05);
    --shadow-premium: 0 10px 30px -10px rgba(79, 70, 229, 0.3);

    --portal-max-width: 1200px;
    --portal-padding: 40px;
}

body {
    font-family: 'Inter', sans-serif !important;
    background-color: var(--surface) !important;
    color: var(--text-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.display-md,
.navbar-brand {
    font-family: 'Manrope', sans-serif !important;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* --- Regla No-Line: Separación por Tonos --- */
.card,
.admin-card {
    background-color: var(--surface-container-lowest);
    border: none !important;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-ambient);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-secondary {
    background-color: var(--surface-container-low);
    border: none !important;
}

.bg-main {
    background-color: var(--surface);
}

/* --- Glassmorphism & Tonal Layering --- */
.glass-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.glass-card {
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.surface-slab {
    background-color: var(--surface-container-highest);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

/* --- Botones Editorial --- */
.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--primary-dim));
    color: white !important;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.9rem 2rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-premium:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 35px -10px rgba(79, 70, 229, 0.4);
}

.btn-secondary-editorial {
    background: var(--primary-container);
    color: var(--on-primary-container) !important;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
}

/* --- Mando de Control Premium --- */
.btn-admin-pill {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--primary) !important;
    border-radius: 50px;
    padding: 8px 20px;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.btn-admin-pill:hover {
    background: var(--primary);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.2);
}

.status-badge-premium {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 6px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.glow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}


/* --- Formulario 'The Well' --- */
.form-control-premium {
    background-color: var(--surface-container-highest) !important;
    border: 2px solid transparent !important;
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-control-premium:focus {
    background-color: var(--surface-container-lowest) !important;
    border-color: var(--primary) !important;
    box-shadow: none;
    transform: translateY(-1px);
}

.extra-small {
    font-size: 0.8125rem !important;
}

.small {
    font-size: 0.8125rem !important;
}

/* --- Status Chips --- */
.status-pill {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background: var(--primary-container);
    color: var(--on-primary-container);
}

.status-pending {
    background: var(--tertiary-container);
    color: var(--on-tertiary-container);
}

/* --- Iconos Circle Premium --- */
.icon-circle-premium {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.cat-avisos {
    background-color: rgba(255, 193, 7, 0.1);
    color: #b45309;
}

.cat-incidencias {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.cat-votos {
    background-color: rgba(26, 82, 118, 0.1);
    color: var(--primary);
}

.cat-docs {
    background-color: rgba(14, 165, 233, 0.1);
    color: #0369a1;
}

.cat-reservas {
    background-color: rgba(16, 185, 129, 0.1);
    color: #047857;
}

/* --- Layout Asymmetry --- */
.editorial-grid {
    display: grid;
    gap: var(--space-8);
}

@media (min-width: 992px) {
    .editorial-header {
        margin-bottom: var(--space-12);
    }

    .display-md {
        font-size: 3.5rem;
        line-height: 1.1;
    }
}

/* --- Ajustes Móvil (Responsive) --- */
@media (max-width: 768px) {
    :root {
        --radius-xl: 18px;
        --radius-lg: 12px;
        --space-12: 2rem;
        --space-16: 2.5rem;
    }

    .display-md {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .glass-header {
        padding: 0.75rem 1rem !important;
    }

    main {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .card {
        padding: 1.5rem !important;
    }

    .icon-circle-premium {
        width: 48px;
        height: 48px;
    }

    .btn-premium {
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
    }

    .login-page {
        padding: 1rem !important;
    }

    .login-container {
        max-width: 100% !important;
    }
}

.premium-footer {
    border-top: 1px solid var(--outline-variant) !important;
    padding-top: var(--space-8);
    margin-top: var(--space-12);
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary);
}

/* --- Incident Specifics (Stitch Style) --- */
.photo-upload-card {
    border: 2px dashed var(--outline-variant) !important;
    background: var(--surface-container-low);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.photo-upload-card:hover {
    border-color: var(--primary) !important;
    background: var(--surface-container-highest);
}

.status-badge-premium {
    font-size: 0.65rem;
    font-weight: 900;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bg-status-pending {
    background: #f3e8ff;
    color: #7e22ce;
}

/* Lilac */
.bg-status-active {
    background: #e0f2fe;
    color: #0369a1;
}

/* Light Blue */
.bg-status-resolved {
    background: #dcfce7;
    color: #15803d;
}

/* Green */

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* --- Skeleton Loaders --- */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 8px;
    display: inline-block;
}

.skeleton-text { height: 1rem; width: 100%; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: 1rem; }
.skeleton-avatar { height: 40px; width: 40px; border-radius: 50%; }

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Dashboard Evolution (Stitch PC) --- */
.font-serif {
    font-family: 'Playfair Display', serif !important;
}

.text-small-caps {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-main {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #020617; /* Night Slate */
    border-right: 1px solid var(--outline-variant);
    z-index: 1050;
    padding: 2.5rem 1.25rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Scroll invisible core */
.sidebar-main::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    display: none;
}

.sidebar-main::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome, Safari and Opera */
}

.sidebar-main.collapsed {
    width: var(--sidebar-collapsed-width);
    padding: 2.5rem 0.75rem;
}

.sidebar-main.collapsed .sidebar-logo-text,
/* Category Picker (Premium Selector) */
.category-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: var(--surface-container-lowest);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-card:hover {
    background: white;
    transform: translateY(-5px);
    box-shadow: var(--shadow-ambient);
}

.category-card.selected {
    background: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-ambient);
}

.category-card i {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--secondary);
    transition: color 0.3s ease;
}

.category-card.selected i {
    color: var(--primary);
}

.category-card span {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.category-card.selected span {
    color: var(--dark);
}

.sidebar-main.collapsed .sidebar-logo-collapsed {
    display: block !important;
}

.sidebar-main.collapsed .link-text,
.sidebar-main.collapsed .user-info {
    display: none;
}

.sidebar-main.collapsed .sidebar-logo-collapsed {
    display: block !important;
}

.sidebar-main.collapsed .sidebar-header {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sidebar-main.collapsed .sidebar-header i {
    margin-right: 0 !important;
}

.sidebar-main.collapsed .sidebar-link {
    justify-content: center;
    padding: 0.85rem;
}

.sidebar-main.collapsed .sidebar-link i {
    margin-right: 0;
}

.sidebar-main.collapsed .user-pill {
    justify-content: center;
    padding: 0.5rem !important;
}

.sidebar-main.collapsed .user-pill div:first-child {
    margin-right: 0 !important;
}

.sidebar-main.collapsed .link-text,
.sidebar-main.collapsed .user-info {
    display: none !important;
}

#toggle-sidebar {
    position: fixed;
    left: calc(var(--sidebar-width) - 15px);
    top: 35px;
    background: white;
    border: 1px solid var(--outline-variant);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.sidebar-collapsed #toggle-sidebar {
    left: calc(var(--sidebar-collapsed-width) - 15px);
}

#toggle-sidebar:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-radius: 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-link i {
    font-size: 1.25rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.sidebar-link:hover {
    background: var(--surface-container-low);
    color: var(--primary);
}

.sidebar-link.active {
    background: var(--primary);
    color: white;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 4rem 0;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #111827, #0f172a);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* Nebula Reveal System */
.reveal-delay-1 { animation-delay: 0.1s; }
.reveal-delay-2 { animation-delay: 0.2s; }
.reveal-delay-3 { animation-delay: 0.3s; }
.reveal-delay-4 { animation-delay: 0.4s; }
.reveal-delay-5 { animation-delay: 0.5s; }

/* Sidebar Logo Refinement */
.sidebar-main.collapsed .sidebar-logo-text {
    display: none !important;
}

.sidebar-main.collapsed .sidebar-header {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sidebar-main.collapsed .sidebar-header i {
    margin: 0 !important;
}

/* Mobile Header */
.mobile-header {
    z-index: 1100;
}

@media (max-width: 992px) {
    .sidebar-main {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0 !important;
        padding: 2rem 1.5rem;
    }
}

/* SweetAlert customization */
.premium-swal-popup {
    border-radius: var(--radius-xl) !important;
    font-family: 'Inter', sans-serif !important;
}

/* --- Dashboard Premium Cards --- */
.card-stitch-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dim) 100%);
    color: white;
    border-radius: 28px;
    border: none;
    padding: 2.5rem;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(30, 58, 76, 0.15);
}

.card-stitch-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.card-stitch-primary:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(30, 58, 76, 0.25);
}

.card-stitch-primary:hover::before {
    transform: translate(10%, 10%);
}

.card-stitch-secondary {
    background: white;
    color: var(--text-dark);
    border-radius: 28px;
    border: 1px solid rgba(169, 180, 183, 0.1);
    padding: 2rem;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: var(--shadow-ambient);
    display: flex;
    flex-direction: column;
}

.card-stitch-secondary:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(42, 52, 55, 0.12);
    border-color: var(--primary-container);
}

.card-stitch-secondary .icon-box {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.card-stitch-secondary:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

.bg-soft-blue {
    background: #e0f2fe;
    color: #0369a1;
}

.bg-soft-green {
    background: #dcfce7;
    color: #15803d;
}

.bg-soft-purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.bg-soft-orange {
    background: #ffedd5;
    color: #c2410c;
}

.balance-card {
    background: white;
    border-radius: 24px;
    border-left: 8px solid var(--primary);
    padding: 1.8rem 2.2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.balance-card:hover {
    transform: scale(1.02);
}

/* --- Anuncios & Avisos Page (Stitch Style) --- */
/* --- Contenedor Estandarizado de Portal (Stitch Style) --- */
.portal-standard-container,
.content-container-vecino {
    max-width: var(--portal-max-width);
    margin: 0 auto;
    padding-left: var(--portal-padding);
    padding-right: var(--portal-padding);
}

.notices-container {
    max-width: var(--portal-max-width);
    margin: 0 auto;
}

.search-pill {
    background: var(--surface-container-highest);
    border: none;
    border-radius: var(--radius-full);
    padding: 0.8rem 1.5rem 0.8rem 3rem;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s ease;
}

.search-pill:focus {
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    outline: none;
}

.filter-tab {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: var(--surface-container-highest);
    color: var(--text-muted);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
}

.notice-card {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-ambient);
    border: 1px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.notice-card:hover {
    transform: translateY(-4px);
}

.badge-pill-editorial {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.badge-urgente {
    background: #fee2e2;
    color: #991b1b;
}

/* Salmon/Red Soft */
.badge-importante {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Lilac */
.badge-info {
    background: #e0f2fe;
    color: #075985;
}

/* Sky Blue */

.notice-link-serif {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.notice-link-serif:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.notice-date-group {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    opacity: 0.6;
    margin-bottom: 1.5rem;
    margin-top: 3rem;
    display: flex;
    align-items: center;
}

.notice-date-group::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--outline-variant);
    margin-left: 1rem;
}

/* --- Split-Screen Login (Premium) --- */
.login-split-wrapper {
    display: flex;
    min-height: 100vh;
    background: white;
    overflow: hidden;
}

.login-hero-side {
    flex: 1.2;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 5rem;
    color: white;
}

.login-hero-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(30, 58, 76, 0.9) 0%, rgba(30, 58, 76, 0.3) 50%, rgba(0, 0, 0, 0) 100%);
}

.login-hero-content {
    position: relative;
    z-index: 2;
}

.login-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5rem;
    background: white;
}

@media (max-width: 1200px) {
    .login-hero-side {
        padding: 3rem;
    }

    .login-form-side {
        padding: 3rem;
    }
}

@media (max-width: 992px) {
    .login-hero-side {
        display: none;
    }

    .login-form-side {
        flex: 1;
        padding: 2rem;
        align-items: center;
    }

    .login-form-side .form-container {
        width: 100%;
        max-width: 440px;
    }
}