/* SIGDEP Caazapá - Design System
   Colores institucionales y estilos base premium
*/

:root {
    /* Color Palette */
    --primary-color: #0c2340;
    /* Blue Dark (Institutional) */
    --secondary-color: #1a3c61;
    /* Refined Medium Blue */
    --accent-color: #d4af37;
    /* Gold Metallic (Premium) */
    --accent-hover: #b8860b;
    /* Dark Goldenrod */
    --accent-light: rgba(212, 175, 55, 0.15);

    --success-color: #2e7d32;
    --warning-color: #ed6c02;
    --danger-color: #d32f2f;

    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    /* Slate 300 */
    --bg-dark: #050c1a;
    /* Deeper Dark */
    --bg-sidebar: #020814;
    --bg-header: rgba(255, 255, 255, 0.95);
    --header-text: #1e293b;
    --header-border: rgba(0, 0, 0, 0.1);
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);

    /* Vibrant Module Colors */
    --color-noticias: #ff4757;
    /* Coral Red */
    --color-dashboard: #2ed573;
    /* Emerald */
    --color-obras: #ffa502;
    /* Orange Orbit */
    --color-mapa: #1e90ff;
    /* Dodger Blue */
    --color-panel: #a29bfe;
    /* Shy Moment (Purple) */
    --color-sugerencias: #00d2d3;
    /* Jade Dust */
    --color-registros: #747d8c;
    /* 2/3 Gray */

    /* Layout Constants */
    --sidebar-width: 260px;
    --header-height: 105px;
    /* Unified height for both main header and sidebar header */
    --transition-speed: 0.4s;
    --border-radius: 14px;

    --shadow-premium: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(15, 25, 45, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* Flatpickr Input Fixes */
input.flatpickr-input,
.flatpickr-mobile,
input[readonly].flatpickr-input,
.flatpickr-alt-input {
    background: var(--glass-bg) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
    padding: 0.65rem 0.85rem !important;
    font-size: 0.85rem !important;
    width: 100% !important;
    outline: none !important;
    box-sizing: border-box !important;
    min-height: 48px !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Main Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    /* fallback */
    height: 100dvh;
    /* dynamic height for mobile browsers */
    z-index: 1000;
    transition: transform var(--transition-speed);
}


.sidebar-header {
    height: var(--header-height);
    min-height: var(--header-height);
    background: var(--bg-header);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 1rem;
    border-bottom: 2px solid var(--accent-color);
    box-sizing: border-box;
    gap: 5px;
}

.system-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: var(--accent-color);
    padding: 3px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
    white-space: nowrap;
}

.sidebar-header img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-color);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0.75rem;
    list-style: none;
    overflow-y: auto;
    /* Allow scrolling if items overflow on short screens */
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.45rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    margin-bottom: 0.2rem;
    border: 1px solid transparent;
    font-size: 0.82rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transform: translateX(5px);
}

.nav-link.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    border-color: rgba(212, 175, 55, 0.2);
}

.nav-icon-container {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.nav-icon-container i {
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

/* Vibrant Icon Colors (Transparent background) */
.nav-link[data-view="noticias"] .nav-icon-container {
    background: transparent;
    box-shadow: none;
}

.nav-link[data-view="noticias"] i {
    color: var(--color-noticias);
}

.nav-link[data-view="dashboard"] .nav-icon-container {
    background: transparent;
    box-shadow: none;
}

.nav-link[data-view="dashboard"] i {
    color: var(--color-dashboard);
}

.nav-link[data-view="obras"] .nav-icon-container {
    background: transparent;
    box-shadow: none;
}

.nav-link[data-view="obras"] i {
    color: var(--color-obras);
}

.nav-link[data-view="mapa"] .nav-icon-container {
    background: transparent;
    box-shadow: none;
}

.nav-link[data-view="mapa"] i {
    color: var(--color-mapa);
}

.nav-link[data-view="estrategico"] .nav-icon-container {
    background: transparent;
    box-shadow: none;
}

.nav-link[data-view="estrategico"] i {
    color: var(--color-panel);
}

.nav-link[data-view="sugerencias"] .nav-icon-container {
    background: transparent;
    box-shadow: none;
}

.nav-link[data-view="sugerencias"] i {
    color: var(--color-sugerencias);
}

.nav-link[data-view="registros"] .nav-icon-container {
    background: transparent;
    box-shadow: none;
}

.nav-link[data-view="registros"] i {
    color: var(--color-registros);
}

.nav-link:hover .nav-icon-container {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover .nav-icon-container img {
    transform: scale(1.1);
}

.nav-link.active .nav-icon-container {
    background: var(--accent-light);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.nav-link.active i {
    color: var(--accent-color);
}

/* Header */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

header {
    height: var(--header-height);
    min-height: var(--header-height);
    background: var(--bg-header);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    height: 100%;
    align-self: center;
    /* Ensure vertical centering in the flex container */
}

/* Legacy container cleanup */
.header-logo-container {
    display: none;
}

.header-logo {
    height: 100%;
    object-fit: contain;
    opacity: 0.95;
}

.logo-box {
    height: 90px;
    width: auto;
    padding: 10px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    border: none;
    margin-right: 1.5rem;
    align-self: center;
}

.logo-box img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
}

.header-left h2 {
    font-size: 1.25rem;
    color: var(--header-text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-divider {
    height: 40px;
    width: 2px;
    background: var(--accent-color);
    opacity: 0.3;
    margin: 0 1.5rem;
}

.view-info {
    display: flex;
    flex-direction: column;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

#user-name {
    color: var(--header-text) !important;
}

#current-date {
    color: rgba(30, 41, 59, 0.6) !important;
}


.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(197, 160, 89, 0.15);
    color: #a87f2b;
    /* Darker gold for light background */
}

/* Content Area */
.content-body {
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    /* allow it to grow so footer stays at bottom */
    display: flex;
    flex-direction: column;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-speed);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-premium);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-hover), var(--accent-color));
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}


/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--accent-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

.grid-responsive {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

/* Responsive Form Grids */
.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem 1.25rem;
}

.form-grid-4col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .form-grid-4col {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .form-grid-2col {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid-4col {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile Controls */
#mobile-menu-btn {
    display: none;
    margin-right: 1rem;
    padding: 0.5rem;
    color: var(--primary-color) !important;
    border-color: rgba(12, 35, 64, 0.2) !important;
    /* lightened primary color */
}

#mobile-menu-btn:hover {
    background: rgba(12, 35, 64, 0.05);
    /* very light primary hover */
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* fallback */
    height: 100dvh;
    /* dynamic height */
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 990;
    /* Just below sidebar 1000 */
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 1024px) {
    #mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    }

    /* Compact sidebar nav to fit all items without scroll */
    .sidebar-header {
        min-height: 72px !important;
        height: 72px !important;
        padding: 6px 1rem;
    }

    .nav-links {
        padding: 0.5rem 0.5rem;
    }

    .nav-link {
        padding: 0.35rem 0.75rem;
        margin-bottom: 0.1rem;
        font-size: 0.8rem;
    }

    .nav-icon-container {
        width: 34px;
        height: 34px;
    }

    .nav-icon-container i {
        font-size: 1.2rem;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    header {
        padding: 0 1rem;
    }

    .content-body {
        padding: 1rem;
    }

    .login-container {
        flex-direction: column;
    }

    .login-box {
        width: 100%;
        margin-bottom: 2rem;
    }

    .public-access-box {
        margin: 1rem;
        width: auto;
    }

    .fb-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .grid-responsive {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-left h2 {
        font-size: 0.75rem;
        line-height: 1.2;
        white-space: normal;
        max-width: 180px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        /* Standard property */
        overflow: hidden;
    }

    .header-divider {
        display: none;
    }

    .user-profile {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    #user-name,
    #user-role {
        display: none;
        /* Hide name/role text, keep only the icon container */
    }

    .logo-box {
        height: 60px;
        margin-right: 0.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .weather-temp {
        font-size: 2.5rem;
    }

    .stack-mobile {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    /* Compact obras table for mobile */
    #obras-table-list table {
        min-width: 0 !important;
        font-size: 0.65rem;
    }

    #obras-table-list th,
    #obras-table-list td {
        padding: 0.35rem 0.4rem !important;
    }

    /* Hide less critical columns on mobile */
    #obras-table-list th:nth-child(1),
    /* Cantidad */
    #obras-table-list td:nth-child(1),
    #obras-table-list th:nth-child(2),
    /* Unidad */
    #obras-table-list td:nth-child(2),
    #obras-table-list th:nth-child(4),
    /* Lugar */
    #obras-table-list td:nth-child(4),
    #obras-table-list th:nth-child(9),
    /* Fuente */
    #obras-table-list td:nth-child(9),
    #obras-table-list th:nth-child(11),
    /* Ente ejecutor */
    #obras-table-list td:nth-child(11) {
        display: none;
    }

    /* Filter bar - Intelligent stacking on mobile */
    .filter-bar .filter-selects {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem;
    }

    .filter-bar .filter-selects select,
    .filter-bar .filter-selects input {
        width: 100% !important;
        min-width: 0;
    }

    /* Hide the "Filtros:" label on mobile to save space if needed, or keep it as a header */
    .filter-bar .filter-selects>div:first-child {
        margin-bottom: 0.25rem;
    }

    .filter-bar .filter-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        margin-top: 1rem;
    }

    .filter-bar .filter-actions>div {
        margin-left: 0 !important;
        text-align: left !important;
        width: 100%;
    }

    .filter-bar .filter-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Filter Grid Layout */
.filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.filter-group-row {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.filter-group-row.full-width {
    width: 100%;
}

.filter-group-row.half-width {
    flex: 1;
    min-width: 300px;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.filter-date-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    width: 100%;
}

.date-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.date-input-group span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.date-input-group input {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.3rem 0.5rem;
    outline: none;
    font-size: 0.8rem;
    border-radius: 4px;
}

/* Mobile Adjustments for Filters (5-Row Layout) */
@media (max-width: 768px) {
    .filter-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Fila 1: Buscador (Full) */
    .filter-group-row.full-width {
        width: 100%;
    }

    /* Fila 2 & 3: Splits */
    .filter-group-row.half-width {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        width: 100%;
        min-width: 0;
    }

    /* Fila 4: Checkboxes */
    .filter-group-row.wrap-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        width: 100%;
    }

    .filter-checkbox-label {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.4rem !important;
    }

    /* Fila 5: Fechas */
    .filter-date-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .date-inputs {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        width: 100%;
    }

    .date-input-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .date-input-group input {
        width: 100%;
    }

    .filter-bar .filter-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        margin-top: 1rem;
    }

    .filter-bar .filter-actions>div {
        margin-left: 0 !important;
        text-align: left !important;
        width: 100%;
    }
}

/* Ensure dropdowns are readable on dark background */
select.glass option {
    background-color: var(--primary-color);
    color: white;
}

/* Compact Table Utilities */
.table-compact {
    font-size: 0.8rem !important;
}

.table-compact th,
.table-compact td {
    padding: 0.5rem 0.4rem !important;
}

.table-compact thead tr {
    font-size: 0.75rem !important;
}

.table-container-scroll {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Filter bar - base (desktop) layout */
.filter-bar .filter-selects {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-bar .filter-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Fix calendar icon visibility on dark backgrounds */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.weather-card {
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 100, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.weather-temp {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

.weather-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.weather-stat span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.weather-stat strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.weather-icon-large {
    color: var(--accent-color);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

.app-footer {
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-secondary);
    padding: 1rem;
    margin-top: auto;
    width: 100%;
}

/* Calendar Module Styles */
.calendar-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
}

.calendar-day-head {
    background: var(--secondary-color);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-color);
}

.calendar-day {
    background: var(--bg-card);
    min-height: 100px;
    padding: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.calendar-day:hover {
    background: rgba(212, 175, 55, 0.05);
}

.calendar-day.empty {
    background: rgba(0, 0, 0, 0.1);
    cursor: default;
}

.calendar-day.today {
    background: rgba(212, 175, 55, 0.1);
    outline: 1px solid var(--accent-color);
    z-index: 1;
}

.day-number {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.day-events {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.calendar-day.today .day-number {
    color: var(--accent-color);
}

.plurianual-tag {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-color);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(212, 175, 55, 0.3);
    text-transform: uppercase;
}

.all-distritos-tag {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.event-label {
    font-size: 0.65rem;
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-color);
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 2px;
    border-left: 2px solid var(--accent-color);
    line-height: 1.2;
}

.activity-card {
    border-radius: 8px;
    transition: transform 0.2s;
}

.activity-card:hover {
    transform: scale(1.01);
}

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .calendar-day {
        min-height: 60px;
        padding: 0.25rem;
    }

    .day-number {
        font-size: 0.75rem;
    }

    .calendar-day-head {
        padding: 0.5rem 0.2rem;
        font-size: 0.7rem;
    }

    .event-label {
        font-size: 0.55rem;
        padding: 1px 2px;
        border-left-width: 1px;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Premium Modal & Form Styles */
.premium-card {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease;
}

.premium-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.5);
}

.form-container-premium {
    padding: 0.5rem;
}

.premium-form .form-group-premium {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.premium-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-row-premium {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.glass-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    color: white !important;
    font-size: 0.95rem !important;
    transition: all 0.2s ease !important;
    width: 100%;
    outline: none !important;
}

.glass-input:focus {
    border-color: var(--accent-color) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2) !important;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-icon-only {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border-radius: 50% !important;
}

@media (max-width: 600px) {
    .form-row-premium {
        grid-template-columns: 1fr;
    }
}

/* Evidence Gallery */
.img-evidence-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    margin: 2px;
}

.img-evidence-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.img-evidence-wrapper.mini {
    width: 60px;
    height: 60px;
    border-radius: 6px;
}

.img-evidence-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-evidence-wrapper .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.img-evidence-wrapper.pending::after {
    content: "Pendiente";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(197, 160, 89, 0.8);
    color: #000;
    font-size: 8px;
    text-align: center;
    font-weight: bold;
    padding: 2px 0;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Row Expansion & Plurianual Styles */
.plurianual-row { 
    cursor: pointer; 
    transition: background 0.2s; 
    border-left: 4px solid var(--accent-color) !important;
}
.plurianual-row:hover { 
    background: rgba(255,255,255,0.05) !important; 
}
.row-expanded-content { 
    animation: fadeIn 0.3s ease; 
    background: rgba(0,0,0,0.15);
}
.subtable-anio { 
    font-size: 0.8rem; 
    width: 100%; 
    border-collapse: collapse; 
    margin: 0.5rem 0; 
    background: rgba(255,255,255,0.02); 
    border-radius: 8px; 
    overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.05);
}
.subtable-anio th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: var(--accent-color);
    font-size: 0.7rem;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.subtable-anio td { 
    padding: 0.5rem 0.75rem; 
    border-bottom: 1px solid rgba(255,255,255,0.03); 
}
.subtable-anio tr:last-child td { 
    border-bottom: none; 
}
.chevron-icon { 
    transition: transform 0.3s; 
    vertical-align: middle; 
    color: var(--accent-color);
}
.expanded .chevron-icon { 
    transform: rotate(180deg); 
}

.plurianual-tag {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--accent-light);
    color: var(--accent-color);
    font-weight: 700;
    margin-left: 0.4rem;
}

.filter-header-label { 
    font-size: 0.65rem; 
    color: var(--accent-color); 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    margin-bottom: 0.4rem; 
    display: block; 
    font-weight: 700; 
    opacity: 0.8; 
}

/* POI Searchable Autocomplete */
.poi-suggestions-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-card, #1a2332);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin-top: 4px;
}

.poi-suggestion-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-primary, #e0e0e0);
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}

.poi-suggestion-item:hover {
    background: rgba(197, 160, 89, 0.15);
    color: var(--accent-color);
}

.poi-suggestion-item:last-child {
    border-bottom: none;
}

/* Action Cover Photo Styles */
.work-photo-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.work-photo-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
}

/* Zoom Modal */
.zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zoom-modal.active {
    display: flex;
    opacity: 1;
}

.zoom-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.zoom-modal.active .zoom-modal-content {
    transform: scale(1);
}

.zoom-modal img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.1);
}

.zoom-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

/* 
   Corrección visual para filtros de secretario 
   Asegura que etiquetas largas no se desborden en móviles
*/
.filter-sec-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
    overflow: hidden;
}

.filter-sec-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

@media (max-width: 768px) {
    .filter-sec-label {
        flex: 1 1 100% !important;
        padding: 0.2rem 0;
    }
    .filter-sec-label span {
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }
}