/* Identidad Corporativa Comunidad de Madrid — rojo Pantone 032 (#ff0000), negro, Arial */
:root {
  --cam-red: #ff0000;
  --cam-red-dark: #d40000;
  --cam-black: #1a1a1a;
  --cam-grey: #6b6b6b;
  --cam-grey-light: #f2f2f2;
  --cam-border: #dcdcdc;
  --ok: #1e7e34; --warn: #b8860b; --bad: #c40000; --na: #9a9a9a; --pending: #6b6b6b;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--cam-black);
  background: #fff; font-size: 14px; line-height: 1.45;
}
a { color: var(--cam-red-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* barra superior institucional */
.topbar {
  display: flex; align-items: center; gap: 16px;
  border-bottom: 4px solid var(--cam-red); padding: 10px 28px; background: #fff;
}
.topbar img.logo { height: 56px; }
.topbar .dept {
  border-left: 2px solid var(--cam-black); padding-left: 14px; line-height: 1.25;
}
.topbar .dept .dg { font-size: 13px; }
.topbar .dept .consj { font-size: 12.5px; font-weight: bold; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.topbar .user { font-size: 12.5px; color: var(--cam-grey); text-align: right; }

/* título de sección con filete rojo (estilo manual) */
h1.page-title, h2.section-title {
  font-weight: 900; letter-spacing: -0.2px;
  padding-right: 14px; border-right: 6px solid var(--cam-red);
  display: inline-block;
}
h1.page-title { font-size: 24px; margin: 26px 0 6px; }
h2.section-title { font-size: 17px; margin: 34px 0 12px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 28px 60px; }
.muted { color: var(--cam-grey); font-size: 12.5px; }

/* tablas */
table.cam { border-collapse: collapse; width: 100%; margin: 10px 0; }
table.cam th {
  text-align: left; background: var(--cam-black); color: #fff;
  padding: 8px 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px;
}
table.cam td { padding: 8px 10px; border-bottom: 1px solid var(--cam-border); vertical-align: top; }
table.cam tr:hover td { background: #fafafa; }
table.cam td.num, table.cam th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* botones */
.btn {
  display: inline-block; background: var(--cam-red); color: #fff; border: none;
  font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 13px; padding: 9px 18px;
  cursor: pointer; border-radius: 2px;
}
.btn:hover { background: var(--cam-red-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--cam-black); border: 1.5px solid var(--cam-black); }
.btn.secondary:hover { background: var(--cam-grey-light); }
.btn.small { padding: 5px 10px; font-size: 12px; }

/* formularios */
input[type=text], input[type=number], input[type=email], input[type=password], input[type=date], select {
  font-family: Arial; font-size: 13.5px; padding: 8px 10px;
  border: 1px solid var(--cam-border); border-radius: 2px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--cam-red); border-color: var(--cam-red); }
label { font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: .3px; display: block; margin: 10px 0 4px; }
form.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; align-items: end; }
form.grid .full { grid-column: 1 / -1; }

/* tarjetas / paneles */
.panel { border: 1px solid var(--cam-border); border-top: 4px solid var(--cam-red); padding: 18px 20px; margin: 14px 0; }
.kpis { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.kpi { border: 1px solid var(--cam-border); border-left: 5px solid var(--cam-red); padding: 10px 16px; min-width: 150px; }
.kpi .v { font-size: 20px; font-weight: 900; }
.kpi .l { font-size: 11px; text-transform: uppercase; color: var(--cam-grey); letter-spacing: .4px; }

/* semáforo */
.badge { display: inline-block; min-width: 20px; text-align: center; font-weight: bold;
  border-radius: 2px; padding: 2px 7px; font-size: 12px; color: #fff; }
.badge.ok { background: var(--ok); } .badge.warn { background: var(--warn); }
.badge.bad { background: var(--bad); } .badge.na { background: var(--na); }
.badge.pending { background: var(--pending); }
.origen-manual { font-size: 10.5px; color: var(--cam-red-dark); font-weight: bold; }

/* login */
.login-wrap { min-height: 100vh; display: flex; }
.login-left {
  flex: 1.1; background: var(--cam-red); color: #fff; display: flex; flex-direction: column;
  justify-content: center; padding: 60px;
}
.login-left h1 { font-size: 40px; font-weight: 900; line-height: 1.05; margin: 0 0 10px; letter-spacing: -1px; }
.login-left p { font-size: 15px; opacity: .95; max-width: 420px; }
.login-left .brand { position: absolute; bottom: 40px; }
.login-right { flex: 1; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; }
.login-card img { height: 84px; margin-bottom: 26px; }
.login-card h2 { font-size: 19px; font-weight: 900; margin: 0 0 4px;
  border-right: 5px solid var(--cam-red); display: inline-block; padding-right: 12px; }
.login-card .btn { width: 100%; margin-top: 18px; padding: 11px; }
.error { background: #fdecec; border-left: 4px solid var(--cam-red); color: var(--bad);
  padding: 9px 12px; font-size: 13px; margin-top: 14px; }

/* zona de subida */
.dropzone { border: 2px dashed var(--cam-border); padding: 26px; text-align: center; color: var(--cam-grey); }
.dropzone input { margin-top: 8px; }

details summary { cursor: pointer; font-weight: bold; font-size: 13px; margin: 6px 0; }
.doc-link { display: inline-block; font-size: 11.5px; background: var(--cam-grey-light);
  border: 1px solid var(--cam-border); border-radius: 2px; padding: 1px 7px; margin: 2px 3px 0 0;
  color: var(--cam-black); }
.doc-link:hover { border-color: var(--cam-red); color: var(--cam-red-dark); text-decoration: none; }
pre.json { background: var(--cam-grey-light); font-size: 11.5px; padding: 10px; overflow: auto; max-height: 260px; }

@media print {
  .topbar .user, .btn, form { display: none !important; }
}
