* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: #1a1a1a; background: #f5f6f8; }

header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 20px; background: #fff; border-bottom: 1px solid #e6e6e6; position: sticky; top: 0; z-index: 10; }
header .izq { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
header h1 { font-size: 16px; margin: 0; font-weight: 700; }
.breadcrumb { font-size: 13px; color: #555; }
.breadcrumb a { color: #0a66c2; cursor: pointer; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.controles { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.actualizado { color: #888; font-size: 12px; }
.link { background: none; border: none; color: #0a66c2; cursor: pointer; font-size: 13px; padding: 0; }
.btn { font-size: 13px; border: 1px solid #d6d6d6; background: #fff; border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.btn:hover { background: #f0f0f0; }
select { font-size: 13px; padding: 5px 8px; border-radius: 6px; border: 1px solid #d6d6d6; background: #fff; }
.switch { font-size: 12px; color: #444; display: flex; align-items: center; gap: 5px; cursor: pointer; }

.aviso { display: none; margin: 12px 20px 0; padding: 10px 12px; background: #fff7e6; border: 1px solid #f0c36d; border-radius: 6px; font-size: 13px; }
.vacio { margin: 30px 20px; padding: 16px; background: #fff; border: 1px dashed #ccc; border-radius: 8px; color: #666; }

.resumen { margin: 14px 20px 0; background: #fff; border: 1px solid #e6e6e6; border-radius: 10px; overflow: hidden; }
.resumen .cab { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fbfbfc; border-bottom: 1px solid #eee; }
.resumen h2 { font-size: 14px; margin: 0; }
.resumen .ia { font-size: 10px; background: #0a66c2; color: #fff; border-radius: 10px; padding: 1px 7px; vertical-align: middle; }
.resumen .cuando { color: #999; font-size: 11px; margin-left: auto; }
.resumen .cuerpo { padding: 14px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; }

table { width: calc(100% - 40px); margin: 16px 20px 40px; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
th, td { padding: 9px 12px; border-bottom: 1px solid #f0f0f0; text-align: left; white-space: nowrap; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: #888; cursor: pointer; user-select: none; background: #fafafb; }
th:hover { color: #333; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #f8fbff; }

.creativo { display: flex; align-items: center; gap: 9px; }
.creativo img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: #eee; }
.creativo span { font-weight: 600; }
.creativo small { color: #999; text-transform: uppercase; font-size: 9px; margin-left: 4px; }
.creativo.drill { cursor: pointer; }
.creativo.drill:hover span { color: #0a66c2; }
.creativo.drill small { color: #0a66c2; }

.flagb { font-size: 9px; font-weight: 700; text-transform: uppercase; border-radius: 10px; padding: 1px 7px; }
.f-escalar { background: #e3f9ee; color: #178a52; }
.f-apagar { background: #fde3e3; color: #b3261e; }
.f-vigilar { background: #fdf4d6; color: #9a7b12; }

td.acc { display: flex; gap: 8px; align-items: center; }
button.accion { font-size: 12px; border: 1px solid #ddd; background: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
button.accion:hover { background: #f0f0f0; }

tfoot td { color: #999; font-style: italic; background: #fafafa; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { background: #fff; border-radius: 12px; padding: 22px; max-width: 680px; width: calc(100% - 40px); max-height: 85vh; overflow: auto; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-card .cerrar { position: absolute; top: 12px; right: 12px; border: none; background: none; font-size: 18px; cursor: pointer; color: #888; }
.modal-card h3 { margin: 0 0 14px; }
.modal-card ul { padding-left: 18px; line-height: 1.7; }
.modal-card iframe { width: 100%; height: 520px; border: 1px solid #eee; border-radius: 8px; }
.cambio { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.cambio .det small { color: #999; }
.cambio.deshecho { opacity: .5; }

.login { display: flex; align-items: center; justify-content: center; height: 100vh; }
.card-login { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 12px; width: 300px; }
.card-login h1 { margin: 0; font-size: 18px; }
.card-login .sub { margin: -6px 0 6px; color: #888; font-size: 13px; }
.card-login input, .card-login button { padding: 11px; border-radius: 8px; border: 1px solid #ddd; font-size: 14px; }
.card-login button { background: #1a1a1a; color: #fff; border: none; cursor: pointer; font-weight: 600; }
.card-login .error { color: #b3261e; font-size: 12px; margin: 0; }
