/* Monitor SIF — ElevenPlus — Estilos */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #f9f9f9;
    --header-bg: #3e4a32;
    --header-text: #ffffff;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.06);
    --text: #3e4a32;
    --text-muted: #6b7c5e;
    --accent: #b9a374;
    --accent-light: #e5c064;
    --accent-dark: #b38a2e;
    --success: #4caf50;
    --error: #d63031;
    --info: #0984e3;
    --warning: #f79e1b;
    --border: #e0e0e0;
    --row-new: rgba(185,163,116,0.25);
    --primary: #3e4a32;
    --primary-hover: #2d4030;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ── Header ── */
.header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--accent);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    height: 28px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    opacity: 0.95;
    filter: brightness(10);
}

.header h1 {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    transition: background 0.3s;
}

.status-dot.online {
    background: var(--success);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.btn-logout {
    color: var(--accent-light);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border: 1px solid var(--accent);
    border-radius: 7px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-logout:hover {
    background: var(--accent);
    color: var(--header-bg);
}

/* ── Container ── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Tarjetas ── */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    border-bottom: 4px solid var(--accent);
    transition: all 0.3s ease-in-out;
    position: relative;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.card-success { border-bottom-color: var(--success); }
.card-error { border-bottom-color: var(--error); }
.card-info { border-bottom-color: var(--info); }

.card-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.card-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}

/* ── Gráficas ── */
.charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-box, .chart-full {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.chart-box canvas {
    max-height: 220px;
}

.chart-box h3, .chart-full h3, .table-section h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.chart-full {
    margin-bottom: 24px;
}

.chart-full canvas {
    max-height: 250px;
}

/* ── Tabla ── */
.table-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.table-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.table-header h3 {
    margin-bottom: 0;
}

.table-filters {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input[type="date"] {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    color: var(--text);
    background: #fafafa;
    outline: none;
    transition: all 0.2s;
}

.filter-group input[type="date"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(185,163,116,0.15);
    background: #fff;
}

.btn-filter {
    padding: 7px 16px;
    border: none;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--primary);
    color: #fff;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: var(--primary-hover);
}

.btn-filter-clear {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-filter-clear:hover {
    background: var(--bg);
    color: var(--text);
}

/* ── Paginación ── */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-page {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
}

.btn-page:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-page:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    padding: 0 8px;
    min-width: 60px;
    text-align: center;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    background: var(--bg);
    padding: 12px 12px;
    text-align: left;
    font-weight: 700;
    color: var(--header-bg);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--accent);
    white-space: nowrap;
}

tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-weight: 400;
}

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: rgba(185,163,116,0.08);
}

.loading-cell {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
    font-style: italic;
}

/* Badges de estado */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-error {
    background: #fde8e8;
    color: #c62828;
}

.badge-warning {
    background: #fff8e1;
    color: #e65100;
}

/* Animación de fila nueva */
@keyframes highlightNew {
    0% { background-color: var(--row-new); }
    100% { background-color: transparent; }
}

tr.row-new {
    animation: highlightNew 2s ease-out;
}

/* ── Footer ── */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 16px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.footer::before {
    content: '';
    display: none;
}

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3e4a32 0%, #2d4030 40%, #1a2a1e 100%);
}

.login-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border-bottom: 4px solid var(--accent);
    transition: all 0.3s ease-in-out;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    height: 36px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 20px;
    color: var(--header-bg);
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s;
    outline: none;
    background: #fafafa;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(185,163,116,0.15);
    background: #fff;
}

.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    width: 100%;
    background: var(--header-bg);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(62,74,50,0.3);
}

.alert {
    padding: 12px 16px;
    border-radius: 7px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
}

.alert-error {
    background: #fde8e8;
    color: var(--error);
    border: 1px solid #f5c6c6;
}

/* ── Separador decorativo ── */
.divider {
    height: 1px;
    background: rgba(150, 150, 150, 0.2);
    margin: 4px 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts {
        grid-template-columns: 1fr;
    }
    .header h1 {
        font-size: 13px;
    }
    .header-logo {
        height: 24px;
    }
    .container {
        padding: 12px;
    }
    .header {
        padding: 0 16px;
    }
    .table-header {
        flex-direction: column;
    }
    .table-filters {
        width: 100%;
    }
    .table-pagination {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .login-container {
        margin: 16px;
        padding: 32px 24px 28px;
    }
}
