/* ═══════════════════════════════════════════════════
   CRONOGRAMA DE EMERGENCIAS — Estilos
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ── Variables ── */
:root {
    --c-bg:        #f4f5f7;
    --c-surface:   #ffffff;
    --c-border:    #dde1e9;
    --c-primary:   #1a56db;
    --c-primary-h: #1044b8;
    --c-accent:    #e3501a;
    --c-text:      #1c2033;
    --c-muted:     #6b7385;
    --c-row-even:  #f9fafb;
    --c-success:   #0a7c42;
    --radius:      8px;
    --shadow:      0 2px 12px rgba(0,0,0,.08);
    --font-sans:   'IBM Plex Sans', sans-serif;
    --font-mono:   'IBM Plex Mono', monospace;
}

/* ── Contenedor principal ── */
#crono-app {
    font-family: var(--font-sans);
    color: var(--c-text);
    max-width: 860px;
    margin: 0 auto;
    background: var(--c-bg);
    padding: 24px;
    border-radius: 12px;
}

/* ── Cabecera ── */
.crono-header {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px 24px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.crono-header-top {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 14px;
}

.crono-logo {
    font-size: 32px;
    line-height: 1;
    padding-bottom: 2px;
}

.crono-title-block {
    flex: 1;
}

.crono-fecha-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

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

.crono-titulo-preview {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--c-primary);
    background: #eef3fc;
    border: 1px solid #c5d6f8;
    border-radius: var(--radius);
    padding: 8px 14px;
    letter-spacing: .3px;
}

/* ── Labels e inputs ── */
.crono-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--c-muted);
    margin-bottom: 5px;
}

.crono-input {
    font-family: var(--font-sans);
    font-size: 15px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    padding: 8px 12px;
    outline: none;
    transition: border-color .2s;
    width: 100%;
    box-sizing: border-box;
    color: var(--c-text);
    background: var(--c-surface);
}

.crono-input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

.crono-input--fecha {
    width: auto;
    min-width: 170px;
    font-family: var(--font-mono);
}

/* ── Área de pegado ── */
.crono-paste-section {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.crono-textarea {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    resize: vertical;
    outline: none;
    color: var(--c-text);
    transition: border-color .2s;
    margin-bottom: 12px;
    height: 250px;
    min-height: 250px;
}

.crono-textarea:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

/* ── Botones ── */
.crono-btn {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    padding: 10px 20px;
    cursor: pointer;
    transition: background .2s, transform .1s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.crono-btn:active { transform: scale(.97); }

.crono-btn--primary {
    background: var(--c-primary);
    color: #fff;
}
.crono-btn--primary:hover { background: var(--c-primary-h); }

.crono-btn--secondary {
    background: var(--c-accent);
    color: #fff;
}
.crono-btn--secondary:hover { background: #c4401a; }

.crono-btn--ghost {
    background: transparent;
    color: var(--c-primary);
    border: 1.5px solid var(--c-primary);
}
.crono-btn--ghost:hover { background: #eef3fc; }

.crono-btn--full {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    color: var(--c-muted);
    border-color: var(--c-border);
}
.crono-btn--full:hover { background: var(--c-bg); color: var(--c-text); }

.crono-copiar-wrap {
    padding: 16px 20px;
    border-top: 1px solid var(--c-border);
    background: #f0f9f0;
    display: flex;
    justify-content: center;
}

.crono-btn--copiar {
    background: #1a7a3c;
    color: #fff;
    font-size: 15px;
    padding: 12px 32px;
    border-radius: var(--radius);
    letter-spacing: .3px;
}
.crono-btn--copiar:hover { background: #155f2f; }
.crono-btn--copiar:disabled { background: #4caf7d; cursor: default; }

/* ── Tabla ── */
.crono-tabla-wrap {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.crono-tabla-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--c-border);
    background: #f8f9fb;
    font-weight: 700;
    font-size: 15px;
}

.crono-tabla-actions {
    display: flex;
    gap: 8px;
}

.crono-tabla {
    width: 100%;
    border-collapse: collapse;
}

.crono-tabla thead th {
    background: #edf0f7;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--c-muted);
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--c-border);
}

.crono-tabla tbody tr {
    border-bottom: 1px solid var(--c-border);
    transition: background .15s;
}

.crono-tabla tbody tr:nth-child(even) { background: var(--c-row-even); }
.crono-tabla tbody tr:hover { background: #eef3fc; }

.crono-tabla td {
    padding: 10px 16px;
    vertical-align: middle;
}

.col-horario { width: 160px; }
.col-acciones { width: 70px; text-align: center; }

/* Input de horario dentro de la tabla */
.crono-horario-input {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--c-primary);
    border: 1.5px solid var(--c-border);
    border-radius: 6px;
    padding: 6px 10px;
    width: 130px;
    outline: none;
    background: #f0f5ff;
    transition: border-color .2s;
}

.crono-horario-input:focus {
    border-color: var(--c-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

.crono-horario-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

/* Texto de tarea */
.crono-tarea-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--c-text);
}

/* Botón eliminar fila */
.crono-eliminar-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #c0c4d0;
    border-radius: 4px;
    padding: 4px 6px;
    transition: color .15s, background .15s;
}
.crono-eliminar-btn:hover { color: var(--c-accent); background: #fef0eb; }

/* ═══════════════════════════════════════════════════
   ESTILOS DE IMPRESIÓN
═══════════════════════════════════════════════════ */
.crono-print-view { display: none; }

@media print {

    body * { visibility: hidden; }

    #crono-print-view,
    #crono-print-view * {
        visibility: visible;
    }

    #crono-print-view {
        display: block !important;
        position: fixed;
        top: 0; left: 0;
        width: 100%;
        padding: 30px 40px;
        box-sizing: border-box;
        font-family: 'IBM Plex Sans', sans-serif;
        color: #000;
    }

    #crono-print-view h1 {
        font-size: 18pt;
        font-weight: 700;
        margin: 0 0 16px;
        padding-bottom: 8px;
        border-bottom: 2.5px solid #1a56db;
        color: #1a56db;
    }

    #print-tabla {
        width: 100%;
        border-collapse: collapse;
        font-size: 11pt;
    }

    #print-tabla thead th {
        background: #1a56db;
        color: #fff;
        padding: 8px 12px;
        text-align: left;
        font-weight: 700;
    }

    #print-tabla tbody tr:nth-child(even) { background: #f0f5ff; }

    #print-tabla td {
        padding: 8px 12px;
        border-bottom: 1px solid #d0d8ec;
    }

    #print-tabla td:first-child {
        font-family: 'IBM Plex Mono', monospace;
        font-weight: 700;
        color: #1a56db;
        white-space: nowrap;
        width: 130px;
    }

    .no-print { display: none !important; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    #crono-app { padding: 12px; }
    .crono-header-top { flex-direction: column; align-items: flex-start; }
    .crono-tabla-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .col-horario { width: 120px; }
    .crono-horario-input { width: 108px; font-size: 13px; }
}
