* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #f3f6fb; color: #1f2937; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 245px; background: #111827; color: #fff; padding: 22px; }
.sidebar h2 { margin: 0 0 6px; }
.sidebar p { margin: 0 0 28px; color: #cbd5e1; }
.sidebar a { display: block; color: #fff; text-decoration: none; padding: 12px 14px; border-radius: 10px; background: #1f2937; }
.sidebar a.active { background: #2563eb; }
.content { flex: 1; padding: 24px; overflow: auto; }
.content.single { max-width: 1100px; margin: auto; }
.topbar { margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 24px; }
.card { background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 8px 24px rgba(15, 23, 42, .08); margin-bottom: 18px; }
.filters { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; align-items: end; }
label { display: grid; gap: 6px; font-size: 13px; color: #475569; }
input, select { height: 38px; border: 1px solid #cbd5e1; border-radius: 9px; padding: 0 10px; }
button, .btn { height: 38px; border: 0; border-radius: 9px; padding: 0 12px; cursor: pointer; background: #e5e7eb; color: #111827; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 13px; }
button:hover, .btn:hover { filter: brightness(.97); }
button.primary, .btn.primary { background: #2563eb; color: white; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1100px; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e5e7eb; vertical-align: top; font-size: 13px; }
th { text-align: left; background: #f8fafc; color: #334155; position: sticky; top: 0; }
small { color: #64748b; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.error { background: #fee2e2; color: #991b1b; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; padding: 30px; color: #64748b; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.output { background: #0f172a; color: #d1fae5; padding: 16px; border-radius: 12px; overflow: auto; max-height: 520px; }
hr { border: 0; border-top: 1px solid #e5e7eb; margin: 18px 0; }
@media (max-width: 900px) { .layout { display:block; } .sidebar { width:100%; } .filters { grid-template-columns: 1fr 1fr; } .grid2 { grid-template-columns: 1fr; } }

/* Login IPS */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #e0ecff, #f8fafc); padding: 20px; }
.login-card { width: min(440px, 100%); background: #fff; border-radius: 18px; padding: 28px; box-shadow: 0 18px 50px rgba(15, 23, 42, .14); }
.login-brand h1 { margin: 0; font-size: 30px; color: #111827; }
.login-brand p { margin: 6px 0 22px; color: #64748b; }
.login-form { display: grid; gap: 14px; }
.login-form input { height: 44px; }
.full { width: 100%; height: 44px; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #fee2e2; color: #991b1b; }
.login-help { color: #64748b; font-size: 13px; line-height: 1.45; margin: 18px 0 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.session-info { margin: 6px 0 0; color: #64748b; font-size: 13px; }
.btn.danger, .danger { background: #fee2e2; color: #991b1b; }
.detail-top { display: flex; justify-content: space-between; margin-bottom: 14px; }
.sidebar a + a { margin-top: 8px; }
.output-card { margin-bottom: 16px; }
.output { background:#111827; color:#e5e7eb; padding:14px; border-radius:10px; max-height:320px; overflow:auto; white-space:pre-wrap; }
.btn.success { background:#15803d; color:#fff; }
.btn[disabled] { opacity:.55; cursor:not-allowed; }

/* Acciones compactas */
.actions .btn,
.actions button,
.service-actions .btn,
.service-actions button,
.btn.mini,
.btn.mini-action {
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 7px;
  line-height: 1;
}
.actions { gap: 4px; align-items: flex-start; }

/* Prevalidación */
.alert.ok{background:#dcfce7;color:#166534;border:1px solid #86efac;padding:10px;border-radius:8px;margin:8px 0;}
.alert.warn{background:#fef3c7;color:#92400e;border:1px solid #fcd34d;padding:10px;border-radius:8px;margin:8px 0;}
.alert.error{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5;padding:10px;border-radius:8px;margin:8px 0;}
.preval-title{font-size:14px;margin:12px 0 6px;}
.preval-title.error{color:#991b1b;}
.preval-title.warn{color:#92400e;}
.mini-table code{font-size:11px;white-space:normal;}
.output-card .output{white-space:normal;}
