* { 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;}

/* Dashboard profesional FEV-RIPS */
body { background: #eef3f8; }
.sidebar { background: linear-gradient(180deg, #0b1f33 0%, #102a43 55%, #0b1f33 100%); box-shadow: 8px 0 30px rgba(15,23,42,.08); }
.sidebar h2 { font-size: 24px; letter-spacing: -.4px; }
.sidebar p { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; opacity: .8; }
.sidebar a { background: transparent; color: #d9e6f2; border: 1px solid transparent; font-weight: 600; }
.sidebar a:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.08); }
.sidebar a.active { background: linear-gradient(135deg, #1677ff, #0f5bc7); box-shadow: 0 10px 24px rgba(22,119,255,.24); color: #fff; }
.content { padding: 28px 30px 40px; }
.topbar { background: #fff; border-radius: 18px; padding: 20px 22px; box-shadow: 0 10px 30px rgba(15,23,42,.06); border: 1px solid #e5edf5; }
.topbar h1 { font-size: 26px; letter-spacing: -.5px; color: #102a43; }
.card { border: 1px solid #e4ebf3; box-shadow: 0 10px 28px rgba(15,23,42,.055); }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.metric-card { background:#fff; border:1px solid #e4ebf3; border-radius:16px; padding:18px; display:flex; align-items:center; gap:14px; box-shadow:0 9px 26px rgba(15,23,42,.05); min-height:112px; }
.metric-card .metric-icon { width:46px; height:46px; border-radius:13px; display:grid; place-items:center; flex:0 0 46px; font-weight:800; font-size:14px; }
.metric-card span { display:block; color:#64748b; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.045em; margin-bottom:5px; }
.metric-card strong { display:block; color:#102a43; font-size:25px; line-height:1.1; letter-spacing:-.4px; }
.metric-card small { display:block; margin-top:6px; font-size:11px; }
.metric-primary .metric-icon { background:#e8f1ff; color:#1469d8; }
.metric-success .metric-icon { background:#e8f8ef; color:#147a43; }
.metric-info .metric-icon { background:#e8f7fb; color:#08738a; }
.metric-warning .metric-icon { background:#fff4dd; color:#a15c00; }
.dashboard-financial { padding:20px 22px; }
.dashboard-section-title { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:16px; }
.dashboard-section-title h3, .card-heading h3 { margin:0; color:#102a43; font-size:17px; }
.dashboard-section-title p, .card-heading p { margin:5px 0 0; color:#7b8da1; font-size:12px; }
.status-chip { background:#e8f1ff; color:#1469d8; border:1px solid #cfe0fb; border-radius:999px; padding:7px 10px; font-size:11px; font-weight:800; letter-spacing:.06em; }
.financial-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.financial-item { background:#f7f9fc; border:1px solid #e6edf5; border-radius:13px; padding:14px 16px; }
.financial-item span { display:block; color:#64748b; font-size:12px; margin-bottom:5px; }
.financial-item strong { font-size:20px; color:#1e3a56; }
.financial-item.emphasized { background:#eef8f2; border-color:#cee9d8; }
.financial-item.emphasized strong { color:#166534; }
.progress-row { margin-top:16px; }
.progress-row > div:first-child { display:flex; justify-content:space-between; font-size:12px; color:#64748b; margin-bottom:7px; }
.progress-track { height:8px; background:#e8eef5; overflow:hidden; border-radius:999px; }
.progress-track i { display:block; height:100%; background:linear-gradient(90deg,#1677ff,#38a3ff); border-radius:999px; }
.filter-card { padding-top:16px; }
.card-heading { margin-bottom:14px; }
.filters input, .filters select { background:#fbfcfe; border-color:#d8e2ec; }
.filters input:focus, .filters select:focus { outline:2px solid #d9e9ff; border-color:#6aa7f8; }
table { border:1px solid #e8edf3; border-radius:12px; overflow:hidden; }
th { background:#f4f7fb; color:#38516a; font-size:11px; text-transform:uppercase; letter-spacing:.045em; }
tbody tr:hover { background:#f9fbfd; }
@media (max-width: 1250px) { .dashboard-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) { .dashboard-grid,.financial-grid { grid-template-columns:1fr; } .content { padding:16px; } }
