/* Status Page - estilos */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f6f8fa;
    color: #2c3e50;
    line-height: 1.5;
    font-size: 15px;
}
a { color: #2980b9; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* Header */
.topbar {
    background: #ffffff;
    border-bottom: 1px solid #ebecf0;
    padding: 28px 0 24px;
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.topbar .brand-logo img { display: block; max-height: 84px; width: auto; }
.topbar .brand-logo .brand-fallback {
    font-size: 28px;
    font-weight: 700;
    color: #1d8cf8;
    letter-spacing: -0.5px;
}
.btn-subscribe {
    background: #1f6feb;
    color: #fff !important;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 14px 28px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}
.btn-subscribe:hover {
    background: #1a5fd0;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(31, 111, 235, 0.28);
}
.btn-subscribe:active {
    background: #174ba8;
    transform: translateY(1px);
}
.btn-subscribe:focus-visible {
    outline: 3px solid rgba(31, 111, 235, 0.35);
    outline-offset: 2px;
}
@media (max-width: 600px) {
    .btn-subscribe {
        padding: 12px 20px;
        font-size: 12px;
        letter-spacing: 0.8px;
    }
}

/* Banner grande */
.banner {
    color: #fff;
    padding: 22px 28px;
    border-radius: 4px;
    margin: 28px 0 32px;
    font-size: 20px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.banner .banner-head { display: flex; align-items: center; gap: 12px; }
.banner .banner-head .state-icon { flex-shrink: 0; }
.banner .sub { font-size: 13px; font-weight: 400; opacity: 0.92; margin-top: 6px; padding-left: 38px; }

/* About */
.about-section { margin: 0 0 36px; }
.about-section h2 {
    font-size: 26px;
    font-weight: 500;
    color: #172b4d;
    margin: 0 0 10px;
}
.about-section p {
    color: #5e6c84;
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}

/* Encabezado global del gráfico de uptime (sobre la lista de componentes) */
.uptime-global-header {
    display: flex;
    justify-content: flex-end;
    font-size: 12px;
    color: #6b778c;
    margin: 0 0 10px;
}
.uptime-global-header a { margin-left: 6px; }

/* Cards */
.card {
    background: #fff;
    border: 1px solid #e1e6ea;
    border-radius: 8px;
    margin-bottom: 22px;
    overflow: hidden;
}
.card h2 {
    margin: 0;
    padding: 16px 22px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2d3d;
    border-bottom: 1px solid #edf0f3;
    background: #fafbfc;
}
.card .body { padding: 4px 22px; }

/* Components list */
.component-group { padding: 14px 0 10px; border-bottom: 1px solid #f0f2f5; }
.component-group:last-child { border-bottom: none; }
.component-group .group-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #95a5a6;
    font-weight: 600;
    margin-bottom: 8px;
}
.component-row {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    border-bottom: 1px dashed #eef0f3;
}
.component-row:last-child { border-bottom: none; }
.component-row .component-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.component-row .name { font-weight: 500; color: #2c3e50; }
.component-row .desc { font-size: 12px; color: #7f8c8d; margin-top: 2px; }
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600;
    padding: 4px 12px 4px 6px; border-radius: 999px;
    border: 1px solid transparent;
    background: #f4f5f7;
}
.status-badge .state-icon { flex-shrink: 0; }
.status-badge.status-operational    { color: #006644; background: #e3fcef; border-color: #abf5d1; }
.status-badge.status-degraded       { color: #7a4f01; background: #fff7d6; border-color: #ffe380; }
.status-badge.status-partial_outage { color: #974f0c; background: #fff1e6; border-color: #ffd6b3; }
.status-badge.status-major_outage   { color: #a62518; background: #ffebe6; border-color: #ffbdad; }
.status-badge.status-maintenance    { color: #07327b; background: #deebff; border-color: #b3d4ff; }

/* Incidents */
.incident {
    padding: 14px 0;
    border-bottom: 1px solid #f0f2f5;
}
.incident:last-child { border-bottom: none; }
.incident .title { font-weight: 600; font-size: 15px; color: #1f2d3d; }
.incident .meta { font-size: 12px; color: #7f8c8d; margin: 3px 0 8px; }
.incident .update {
    padding: 8px 12px;
    border-left: 3px solid #3498db;
    background: #f6f8fa;
    margin: 6px 0;
    font-size: 13px;
}
.incident .update strong { color: #2c3e50; }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}
.tag.investigating { background: #e67e22; }
.tag.identified    { background: #c0392b; }
.tag.monitoring    { background: #2980b9; }
.tag.resolved      { background: #00875a; }
.tag.scheduled     { background: #3498db; }
.tag.in_progress   { background: #f1c40f; color: #333; }
.tag.completed     { background: #00875a; }

/* Subscribe dialog (modal moderno con backdrop borroso) */
.subscribe-dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    width: min(480px, calc(100vw - 32px));
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28), 0 4px 12px rgba(15, 23, 42, 0.08);
    background: #fff;
    color: #2c3e50;
    overflow: hidden;
    animation: subscribe-dialog-in 0.22s ease-out;
}
.subscribe-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
@keyframes subscribe-dialog-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
body.subscribe-open { overflow: hidden; }

.subscribe-dialog-close {
    position: absolute; top: 10px; right: 12px;
    background: transparent; border: none; cursor: pointer;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 22px; line-height: 1; color: #7f8c8d;
    transition: background 0.15s ease, color 0.15s ease;
}
.subscribe-dialog-close:hover { background: #f1f3f5; color: #2c3e50; }
.subscribe-dialog-close:focus-visible { outline: 2px solid #1f6feb; outline-offset: 2px; }

.subscribe-dialog-body { padding: 28px 28px 24px; }
.subscribe-dialog-body h3 { margin: 0 0 6px 0; font-size: 18px; font-weight: 600; }
.subscribe-dialog-lead { margin: 0 0 18px 0; font-size: 13.5px; color: #5a6a7a; line-height: 1.45; }

.subscribe-field { display: block; margin-bottom: 16px; }
.subscribe-field > span {
    display: block; font-size: 12px; font-weight: 600;
    color: #5a6a7a; margin-bottom: 6px; letter-spacing: 0.2px;
}
.subscribe-field input[type=email] {
    width: 100%; box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid #d4dae0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.subscribe-field input[type=email]:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.subscribe-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.btn-ghost {
    background: transparent; color: #5a6a7a; border: 1px solid #d4dae0;
    padding: 10px 18px; border-radius: 8px; cursor: pointer;
    font-size: 14px; font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover { background: #f1f3f5; color: #2c3e50; }
.btn-primary {
    background: #1f6feb; color: #fff; border: none;
    padding: 10px 22px; border-radius: 8px; cursor: pointer;
    font-size: 14px; font-weight: 600;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover { background: #1a5fd0; box-shadow: 0 2px 8px rgba(31, 111, 235, 0.28); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.subscribe-alert {
    padding: 11px 13px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px;
    border: 1px solid transparent;
}
.subscribe-alert.success { background: #e8f7ef; color: #0b6b3a; border-color: #b9e4c9; }
.subscribe-alert.error   { background: #fdecea; color: #a11313; border-color: #f5c2bd; }
.subscribe-alert.info    { background: #e8f1fd; color: #174ba8; border-color: #c7dafc; }

@media (max-width: 480px) {
    .subscribe-dialog-body { padding: 24px 20px 20px; }
    .subscribe-actions { flex-direction: column-reverse; }
    .subscribe-actions .btn-primary, .subscribe-actions .btn-ghost { width: 100%; }
}
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    background: #3498db;
    color: #fff;
    text-decoration: none;
}
.btn:hover { background: #2980b9; text-decoration: none; }
.btn.btn-secondary { background: #ecf0f1; color: #2c3e50; }
.btn.btn-secondary:hover { background: #dce2e5; }
.btn.btn-danger { background: #e74c3c; }
.btn.btn-danger:hover { background: #c0392b; }

/* Uptime chart: barras diarias de 90 dias por componente */
.uptime-component { padding: 8px 0 2px; width: 100%; }
.uptime-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    color: #6b778c;
    margin-bottom: 6px;
}
.uptime-header .pct { color: #172b4d; font-weight: 500; }
.uptime-chart {
    display: flex;
    gap: 2px;
    align-items: stretch;
    height: 34px;
    margin: 0 0 4px;
}
.uptime-bar {
    flex: 1 1 0;
    min-width: 2px;
    background: #dfe1e6;
    border-radius: 1px;
    transition: transform 0.1s ease;
}
.uptime-bar:hover { transform: scaleY(1.15); }
.uptime-bar.operational    { background: #00875a; }
.uptime-bar.degraded       { background: #dfb317; }
.uptime-bar.partial_outage { background: #f1a23b; }
.uptime-bar.major_outage   { background: #de350b; }
.uptime-bar.maintenance    { background: #0052cc; }
.uptime-scale {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6b778c;
    padding-top: 2px;
}
.uptime-scale .middle { color: #8993a4; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 6px; margin: 12px 0; font-size: 14px; }
.flash.success { background: #d4f5e2; color: #1c6b3d; border: 1px solid #b3e6c7; }
.flash.error   { background: #fde4e1; color: #8f2d20; border: 1px solid #f0b9b1; }
.flash.info    { background: #dceefb; color: #1f4e79; border: 1px solid #b6d5f0; }

/* Footer */
.footer {
    text-align: center;
    padding: 28px 0 40px;
    font-size: 12px;
    color: #95a5a6;
}

/* History */
.history-day { margin-bottom: 22px; }
.history-day .day-title { font-size: 14px; font-weight: 600; color: #1f2d3d; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #e1e6ea; }
.history-day .no-issues { font-size: 13px; color: #7f8c8d; padding: 6px 0; }

/* Admin */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #1f2d3d; color: #cbd5e0; padding: 20px 0; }
.admin-sidebar .brand { color: #fff; padding: 0 20px 18px; font-size: 16px; border-bottom: 1px solid #2d3e52; }
.admin-sidebar nav a { display: block; padding: 10px 20px; color: #cbd5e0; font-size: 14px; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: #2d3e52; color: #fff; text-decoration: none; }
.admin-main { flex: 1; padding: 28px 36px; background: #f6f8fa; }
.admin-main h1 { margin-top: 0; font-size: 22px; color: #1f2d3d; }

table.data { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e1e6ea; border-radius: 6px; overflow: hidden; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #edf0f3; font-size: 14px; }
table.data th { background: #fafbfc; font-size: 12px; text-transform: uppercase; color: #7f8c8d; letter-spacing: 0.5px; }
table.data tr:last-child td { border-bottom: none; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: #2c3e50; }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=password],
.form-row input[type=datetime-local], .form-row select, .form-row textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d4dae0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}
.form-row textarea { min-height: 100px; resize: vertical; }
.form-row .hint { font-size: 11px; color: #95a5a6; margin-top: 3px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1f2d3d; }
.login-box { background: #fff; padding: 32px; border-radius: 8px; width: 360px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.login-box h1 { margin: 0 0 8px 0; font-size: 20px; }
.login-box p { color: #7f8c8d; margin: 0 0 20px 0; font-size: 13px; }

@media (max-width: 640px) {
    .component-row .component-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .uptime-chart { gap: 1px; height: 28px; }
    .admin-sidebar { width: 100%; }
    .admin-layout { flex-direction: column; }
    .admin-main { padding: 20px; }
}
