/* ==========================================================================
   ESTILOS DASHBOARD EJECUTIVO - SACYR REPORTES
   ========================================================================== */

:root {
    --primary-color: #002B49;     /* Azul Sacyr */
    --secondary-color: #0080FF;   /* Azul Acento */
    --accent-green: #28a745;      /* Verde Excel / Estado */
    --bg-light: #f4f6f9;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e2e8f0;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-main: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* NAVBAR */
.navbar {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 16px 24px;
    box-shadow: var(--shadow-soft);
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 32px;
    color: #ffc107;
}

.nav-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-subtitle {
    font-size: 13px;
    opacity: 0.85;
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* BOTONES */
.btn-secondary {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.btn-excel {
    background: linear-gradient(135deg, #1d6f42 0%, #28a745 100%);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
    transition: all 0.2s ease;
}

.btn-excel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(40, 167, 69, 0.4);
}

.btn-excel:disabled {
    background: #a5d6a7;
    cursor: not-allowed;
    transform: none;
}

/* CONTENEDOR PRINCIPAL */
.main-container {
    max-width: 1280px;
    margin: 24px auto;
    padding: 0 16px;
    flex: 1;
    width: 100%;
}

/* TARJETA DE CONTROLES Y FILTROS */
.controls-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-main);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;

}

.filter-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--secondary-color);
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.date-filter select {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
}

/* ALTERNADOR DE VISTAS */
.view-toggle {
    display: flex;
    background-color: var(--bg-light);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.toggle-btn.active {
    background-color: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

/* CARGA Y ESTADOS VACÍOS */
.loading-box, .empty-box {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
}

.spinner {
    font-size: 40px;
    color: var(--secondary-color);
    margin-bottom: 16px;
}

.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* VISTA DE TARJETAS (ESTILO CALENDARIO / GALERÍA AIRTABLE) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.report-card {
    background: var(--card-bg);
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.report-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    background: var(--primary-color);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-date {
    font-size: 16px;
    font-weight: 700;
}

.card-time-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.card-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    background: #000;
    height: 160px;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.gallery-img:hover {
    opacity: 0.85;
}

.card-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.info-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.4;
}

.pill-summary {
    background: #f8fafc;
    border-left: 3px solid var(--secondary-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}

/* VISTA DE TABLA EJECUTIVA */
.table-card {
    background: var(--card-bg);
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    background: var(--primary-color);
    color: #ffffff;
    padding: 14px 16px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.data-table tr:hover {
    background: #f8fafc;
}

.table-thumb-container {
    display: flex;
    gap: 6px;
}

.table-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

/* MODAL DE FOTOS HD */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.modal-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-caption {
    margin-top: 14px;
    color: #ffffff;
    font-size: 14px;
}

/* FIRMA DE CREDITO INSTITUCIONAL */
.author-credits {
    text-align: center;
    padding: 24px 16px;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    font-size: 13px;
    color: var(--text-muted);
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #25d366;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.hidden {
    display: none !important;
}
