:root {
  --bg: #05070a;
  --panel: #0b1117;
  --panel-2: #0f1820;
  --line: rgba(75, 255, 214, 0.22);
  --text: #d8fff6;
  --muted: #7c9a9a;
  --cyan: #23d5ff;
  --green: #3dff9b;
  --yellow: #ffd166;
  --red: #ff4d6d;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(35, 213, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 255, 155, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 75% 10%, rgba(35, 213, 255, 0.16), transparent 32%),
    var(--bg);
  background-size: 44px 44px, 44px 44px, 100% 100%, 100% 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

.access {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(rgba(35, 213, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 255, 155, 0.028) 1px, transparent 1px),
    rgba(2, 5, 8, 0.96);
  background-size: 44px 44px;
}

.access.open {
  display: grid;
}

.access-box {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 24, 32, 0.96), rgba(6, 10, 14, 0.94));
  padding: 26px;
  box-shadow: var(--shadow);
}

.access-box h1 {
  font-size: 34px;
  margin-bottom: 18px;
}

.access-box .brand-mark {
  margin-bottom: 18px;
}

.access-box small {
  display: block;
  color: var(--muted);
  margin-top: 12px;
}

.auth-error {
  display: none;
  border: 1px solid rgba(255, 77, 109, 0.5);
  color: var(--red);
  background: rgba(255, 77, 109, 0.08);
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 14px;
}

.auth-error.show {
  display: block;
}

.auth-error.security-alert {
  position: relative;
  color: var(--yellow);
  border-color: rgba(255, 211, 102, 0.7);
  background:
    linear-gradient(90deg, rgba(255, 77, 109, 0.12), rgba(255, 211, 102, 0.07)),
    rgba(10, 3, 6, 0.82);
  padding-bottom: 48px;
  white-space: pre-line;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  box-shadow: 0 0 28px rgba(255, 77, 109, 0.18);
}

.auth-error.security-alert::before {
  content: "Enviando mensaje...";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 23px;
  color: var(--yellow);
  font-size: 12px;
}

.auth-error.security-alert.sent::before {
  content: "Mensaje enviado al administrador";
  color: var(--green);
}

.auth-error.security-alert::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 5px;
  border: 1px solid rgba(255, 211, 102, 0.5);
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(255, 211, 102, 0.9) 26%, transparent 44%),
    rgba(255, 211, 102, 0.08);
  background-size: 220% 100%;
  animation: securitySend 1.4s linear infinite;
}

.auth-error.security-alert.sent::after {
  background: rgba(61, 255, 155, 0.82);
  border-color: rgba(61, 255, 155, 0.68);
  animation: none;
}

@keyframes securitySend {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.secret-output {
  min-height: 96px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  background: rgba(3, 7, 10, 0.82);
  color: var(--text);
  padding: 12px;
  margin: 14px 0 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
}

.secret-editor {
  display: none;
  gap: 12px;
  margin-top: 14px;
}

.secret-editor.open {
  display: grid;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.secret-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.modal-copy {
  color: var(--muted);
  margin: 12px 0 16px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
  grid-column: 1 / -1;
}

.home-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 24, 32, 0.9), rgba(6, 10, 14, 0.88));
  box-shadow: var(--shadow);
  padding: 16px;
}

.home-panel h3 {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
  margin-bottom: 12px;
}

.ctpp-home-panel {
  border-color: rgba(61, 255, 155, 0.42);
}

.ctpp-home-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.ctpp-home-summary strong {
  color: var(--green);
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
}

.ctpp-home-summary span {
  color: var(--muted);
  line-height: 1.45;
}

.command-panel {
  grid-column: 1 / -1;
  border-color: rgba(61, 255, 155, 0.48);
  background:
    linear-gradient(90deg, rgba(61, 255, 155, 0.06), transparent 36%),
    linear-gradient(180deg, rgba(15, 24, 32, 0.96), rgba(3, 7, 10, 0.92));
}

.process-panel {
  grid-column: 1 / -1;
  border-color: rgba(0, 229, 255, 0.38);
}

.process-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.process-head h3 {
  margin-bottom: 4px;
}

.process-head span {
  color: var(--muted);
  font-size: 13px;
}

.process-head strong {
  border: 1px solid rgba(75, 255, 214, 0.32);
  color: var(--muted);
  padding: 7px 10px;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.process-head strong.running {
  color: var(--cyan);
  border-color: rgba(0, 229, 255, 0.58);
}

.process-head strong.complete {
  color: var(--green);
  border-color: rgba(61, 255, 155, 0.58);
}

.process-head strong.failed {
  color: var(--red);
  border-color: rgba(255, 67, 106, 0.64);
}

.process-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.process-actions button:disabled {
  cursor: wait;
  opacity: 0.45;
}

.process-progress {
  height: 12px;
  border: 1px solid rgba(75, 255, 214, 0.28);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  margin-bottom: 12px;
}

.process-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.82), rgba(61, 255, 155, 0.94));
  box-shadow: 0 0 18px rgba(61, 255, 155, 0.28);
  transition: width 340ms ease;
}

.process-console {
  display: grid;
  gap: 7px;
  min-height: 96px;
  border: 1px solid rgba(75, 255, 214, 0.16);
  background: rgba(0, 0, 0, 0.34);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  padding: 12px;
  overflow-wrap: anywhere;
}

.process-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid rgba(75, 255, 214, 0.16);
  padding-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.process-history > strong {
  color: var(--cyan);
  font-size: 12px;
}

.process-history div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.process-history div.ok small {
  color: var(--green);
}

.process-history div.fail small {
  color: var(--red);
}

.process-history div.idle small {
  color: var(--muted);
}

.command-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.command-head h3 {
  margin-bottom: 4px;
}

.command-head span {
  color: var(--muted);
  font-size: 13px;
}

.command-head strong {
  color: var(--green);
  border: 1px solid rgba(61, 255, 155, 0.5);
  padding: 7px 10px;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(61, 255, 155, 0.12);
}

.security-badge {
  min-width: 132px;
  text-align: center;
  transition: color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.terminal-box {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(75, 255, 214, 0.18);
  background: rgba(0, 0, 0, 0.38);
  padding: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.terminal-live {
  color: var(--text);
  border-bottom: 1px solid rgba(75, 255, 214, 0.12);
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.loader-dots::after {
  content: "";
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

.terminal-box strong,
.prompt {
  color: var(--green);
}

.presentation-mode .brand small::after {
  content: " // PRESENTACION";
  color: var(--yellow);
}

.notice-list {
  display: grid;
  gap: 10px;
}

.notice {
  border-top: 1px solid rgba(75, 255, 214, 0.12);
  padding-top: 10px;
  color: var(--muted);
}

.notice strong {
  display: block;
  color: var(--text);
  margin-bottom: 3px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid rgba(75, 255, 214, 0.16);
  padding: 12px;
  background: rgba(3, 7, 10, 0.4);
}

.metric strong {
  display: block;
  color: var(--green);
  font-size: 24px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.student-access-panel {
  grid-column: 1 / -1;
}

.student-access-panel.ok {
  border-color: rgba(61, 255, 155, 0.38);
}

.student-access-panel.warn {
  border-color: rgba(255, 211, 102, 0.58);
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.student-stat {
  border: 1px solid rgba(75, 255, 214, 0.16);
  background: rgba(3, 7, 10, 0.42);
  padding: 12px;
}

.student-stat strong {
  display: block;
  color: var(--green);
  font-size: 24px;
}

.student-stat span {
  color: var(--muted);
  font-size: 13px;
}

.student-stat.alert strong {
  color: var(--yellow);
}

.student-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(75, 255, 214, 0.12);
  margin-top: 12px;
  padding-top: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.student-status strong {
  color: var(--cyan);
}

.module-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.module-node,
.health-cell,
.radar-row,
.exposure-box,
.risk-meter {
  border: 1px solid rgba(75, 255, 214, 0.16);
  background: rgba(3, 7, 10, 0.42);
  padding: 10px;
}

.module-node strong,
.module-node span,
.health-cell strong,
.health-cell span {
  display: block;
}

.module-node strong,
.health-cell strong,
.radar-row span {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.module-node span,
.health-cell span {
  color: var(--muted);
  margin-top: 4px;
}

.module-node.ok,
.health-cell.ok {
  border-color: rgba(61, 255, 155, 0.42);
}

.module-node.warn,
.health-cell.warn {
  border-color: rgba(255, 211, 102, 0.55);
}

.module-node.idle {
  opacity: 0.62;
}

.pulse-monitor {
  display: grid;
  gap: 10px;
}

.pulse-line {
  height: 12px;
  border: 1px solid rgba(61, 255, 155, 0.32);
  background: rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.pulse-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--green));
  background-size: 180% 100%;
  animation: pulseScan 2.2s linear infinite;
}

@keyframes pulseScan {
  from { background-position: 0 0; }
  to { background-position: 180% 0; }
}

.pulse-meta,
.exposure-box,
.risk-meter {
  display: grid;
  gap: 4px;
}

.pulse-meta strong,
.exposure-box strong,
.risk-meter strong {
  color: var(--green);
}

.pulse-meta span,
.exposure-box span,
.risk-meter span {
  color: var(--muted);
  font-size: 13px;
}

.radar-list {
  display: grid;
  gap: 8px;
}

.radar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.radar-row strong {
  color: var(--green);
}

.radar-row.critica strong { color: var(--red); }
.radar-row.alta strong { color: var(--yellow); }
.radar-row.baja strong { color: var(--muted); }

.risk-panel.ok { border-color: rgba(61, 255, 155, 0.42); }
.risk-panel.warn { border-color: rgba(255, 211, 102, 0.55); }
.risk-panel.danger { border-color: rgba(255, 77, 109, 0.58); }
.risk-panel.warn .risk-meter strong { color: var(--yellow); }
.risk-panel.danger .risk-meter strong { color: var(--red); }

.tech-log {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.safe-mode {
  color: var(--yellow);
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(5, 9, 12, 0.78);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--green);
  color: var(--green);
  font: 800 20px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  box-shadow: 0 0 28px rgba(61, 255, 155, 0.2);
}

.brand strong, .eyebrow, h2, .panel-title, .status, .meta-label {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.nav-btn, .ghost, .primary, .copy, .icon {
  border: 1px solid var(--line);
  background: rgba(9, 16, 22, 0.86);
  color: var(--text);
  min-height: 40px;
}

.nav-btn {
  text-align: left;
  padding: 12px;
  color: var(--muted);
  position: relative;
}

.nav-alert {
  display: none;
  margin-left: 6px;
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 800;
}

.nav-alert.show {
  display: inline;
}

.nav-btn.active, .nav-btn:hover {
  color: var(--green);
  border-color: rgba(61, 255, 155, 0.5);
  background: rgba(61, 255, 155, 0.06);
}

.primary {
  background: linear-gradient(90deg, rgba(61, 255, 155, 0.2), rgba(35, 213, 255, 0.14));
  border-color: rgba(61, 255, 155, 0.58);
  color: var(--green);
  padding: 0 14px;
  font-weight: 800;
}

.ghost {
  color: var(--cyan);
  padding: 0 14px;
}

.full {
  width: 100%;
  margin-top: 10px;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar, .control-strip, .quick-grid, .content-head {
  display: grid;
  gap: 16px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.eyebrow {
  color: var(--cyan);
  margin: 0 0 8px;
  font-size: 13px;
}

h1, h2, h3 {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.98;
}

.system-card {
  border: 1px solid var(--line);
  background: rgba(11, 17, 23, 0.78);
  padding: 14px 16px;
  min-width: 170px;
  box-shadow: var(--shadow);
}

#modeDot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
  margin-right: 8px;
}

.system-card small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.control-strip {
  grid-template-columns: 1fr 140px 210px 210px;
  margin: 26px 0 18px;
}

.search-run {
  min-height: 48px;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(3, 7, 10, 0.78);
  padding: 0 14px;
}

.search span {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.search-scan {
  display: none;
  border: 1px solid rgba(75, 255, 214, 0.28);
  background:
    linear-gradient(90deg, rgba(0, 229, 255, 0.06), transparent 42%),
    rgba(3, 7, 10, 0.78);
  padding: 14px;
  margin: -4px 0 18px;
  box-shadow: var(--shadow);
}

.search-scan.show {
  display: grid;
  gap: 10px;
}

.search-scan-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.search-scan-head strong {
  display: block;
  color: var(--cyan);
  margin-bottom: 4px;
}

.search-scan-head span,
.search-scan-head small {
  color: var(--muted);
}

.search-scan-progress {
  height: 10px;
  border: 1px solid rgba(75, 255, 214, 0.22);
  background: rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.search-scan-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.86), rgba(61, 255, 155, 0.96));
  transition: width 220ms ease;
}

.search-scan-console {
  display: grid;
  gap: 6px;
  min-height: 88px;
  max-height: 190px;
  overflow: auto;
  border: 1px solid rgba(75, 255, 214, 0.16);
  background: rgba(0, 0, 0, 0.42);
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.search-scan-console div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  color: var(--muted);
}

.search-scan-console span {
  color: var(--cyan);
}

.search-scan-console .copying small {
  color: var(--text);
}

.search-scan-console .done span,
.search-scan-console .done small {
  color: var(--green);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(3, 7, 10, 0.82);
  color: var(--text);
  min-height: 46px;
  padding: 0 12px;
  outline: none;
}

.date-picker {
  position: relative;
}

.date-button {
  width: 100%;
  min-height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(3, 7, 10, 0.82);
  color: var(--text);
  padding: 0 12px;
}

.calendar-popover {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: min(320px, calc(100vw - 40px));
  border: 1px solid var(--line);
  background: #303235;
  color: #fff;
  padding: 12px;
  box-shadow: var(--shadow);
  max-height: 340px;
  overflow: auto;
}

.calendar-popover.open {
  display: block;
}

.calendar-head,
.calendar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-head strong {
  font-size: 14px;
  text-transform: lowercase;
}

.calendar-icon,
.calendar-actions button {
  border: 0;
  background: transparent;
  color: #bfefff;
  min-height: 32px;
  padding: 0 8px;
}

.calendar-days,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
  text-align: center;
}

.calendar-days span {
  font-size: 12px;
  font-weight: 800;
}

.calendar-day {
  border: 0;
  min-height: 30px;
  background: transparent;
  color: #fff;
  font-weight: 700;
}

.calendar-day.muted {
  color: #d5d5d5;
  opacity: 0.75;
}

.calendar-day.selected {
  background: #8eb9ec;
  color: #0a1a2d;
}

.calendar-actions {
  margin-top: 12px;
}

textarea {
  padding-top: 12px;
  resize: vertical;
}

.search input {
  border: 0;
  background: transparent;
  padding: 0;
}

.quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
}

.alert-panel, .site-card, .empty {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 24, 32, 0.9), rgba(6, 10, 14, 0.88));
  box-shadow: var(--shadow);
}

.alert-panel {
  padding: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  color: var(--cyan);
  margin-bottom: 12px;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-row {
  display: grid;
  grid-template-columns: 94px 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.mini-row strong {
  color: var(--text);
  font-weight: 700;
}

.mini-row button {
  min-height: 30px;
}

.content-head {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.entry-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}

.entry-section h3 {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
}

.cards.nested {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.done-list {
  display: grid;
  gap: 8px;
}

.done-row {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(75, 255, 214, 0.16);
  background: rgba(3, 7, 10, 0.52);
  padding: 10px 12px;
  color: var(--muted);
}

.done-row strong {
  display: block;
  color: var(--cyan);
  margin-bottom: 2px;
}

.done-row span {
  overflow-wrap: anywhere;
}

.done-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.done-actions .copy {
  min-height: 32px;
  font-size: 12px;
}

.compact-empty {
  min-height: 90px;
}

.settings-panel {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  background: rgba(3, 7, 10, 0.52);
  padding: 16px;
}

.settings-panel h3 {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
  margin-bottom: 12px;
}

.site-card {
  padding: 16px;
  min-height: 285px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(61, 255, 155, 0.55);
  background: rgba(61, 255, 155, 0.08);
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: none;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(61, 255, 155, 0.5);
  background: rgba(6, 16, 23, 0.96);
  color: var(--green);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.show {
  display: block;
}

.site-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--green);
  opacity: 0.8;
}

.site-card.revisar::before { background: var(--yellow); }
.site-card.pendiente::before, .site-card.critica::before { background: var(--red); }
.site-card.alta::before { background: var(--yellow); }
.site-card.baja::before { background: var(--muted); }
.site-card.en-proceso::before { background: var(--cyan); }
.site-card.archivado::before { background: var(--muted); }
.site-card.activo::before { background: var(--green); }
.site-card.revision-pendiente::before { background: var(--yellow); }

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.card-top h3 {
  font-size: 20px;
  line-height: 1.1;
}

.status {
  border: 1px solid currentColor;
  padding: 5px 8px;
  font-size: 12px;
  height: fit-content;
}

.status.activo, .status.admin { color: var(--green); }
.status.revisar { color: var(--yellow); }
.status.pendiente, .status.critica { color: var(--red); }
.status.alta { color: var(--yellow); }
.status.baja { color: var(--muted); }
.status.en-proceso, .status.usuario { color: var(--cyan); }
.status.archivado { color: var(--muted); }

.active-mode {
  border-color: rgba(255, 211, 102, 0.62) !important;
  color: var(--yellow) !important;
}

.meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.meta-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  min-width: 0;
}

.meta-label {
  color: var(--cyan);
}

.clip {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-stack {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.today-alert {
  border: 1px solid rgba(255, 77, 109, 0.45);
  background: rgba(255, 77, 109, 0.08);
  color: var(--red);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.today-alert strong {
  display: block;
  color: var(--text);
  margin-bottom: 3px;
}

.entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid rgba(75, 255, 214, 0.12);
  padding-top: 8px;
}

.entry.done {
  opacity: 0.45;
  text-decoration: line-through;
}

.entry button {
  min-height: 28px;
  padding: 0 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions a, .copy {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  color: var(--cyan);
  text-decoration: none;
  padding: 0 10px;
  background: rgba(3, 7, 10, 0.62);
  font-size: 13px;
}

.quick-dates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.copy.danger {
  color: var(--red);
  border-color: rgba(255, 77, 109, 0.42);
}

.copy.whatsapp {
  color: var(--green);
  border-color: rgba(61, 255, 155, 0.5);
}

.ctpp-head {
  grid-column: 1 / -1;
}

.ctpp-card {
  min-height: 245px;
}

.ctpp-card p {
  color: var(--muted);
  margin: 0;
  line-height: 1.35;
}

.ctpp-url {
  border: 1px solid rgba(75, 255, 214, 0.16);
  background: rgba(3, 7, 10, 0.54);
  color: var(--cyan);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ctpp-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: auto;
}

.ctpp-phone {
  min-height: 38px;
}

.empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.empty strong {
  display: block;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  margin-bottom: 8px;
}

.scan-empty {
  border-color: rgba(255, 211, 102, 0.42);
  background:
    linear-gradient(90deg, rgba(255, 211, 102, 0.06), transparent 38%),
    linear-gradient(180deg, rgba(15, 24, 32, 0.9), rgba(6, 10, 14, 0.88));
}

.scan-empty strong {
  color: var(--yellow);
}

.scan-empty small {
  display: block;
  color: var(--cyan);
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

dialog {
  border: 0;
  padding: 0;
  width: min(760px, calc(100vw - 28px));
  color: var(--text);
  background: transparent;
  overflow: visible;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.modal {
  border: 1px solid var(--line);
  background: #071017;
  padding: 18px;
  box-shadow: var(--shadow);
}

.entry-modal {
  overflow: visible;
}

.entry-modal #entryText {
  min-height: 84px;
}

#entryDialog {
  width: min(720px, calc(100vw - 28px));
}

.modal header, .modal footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.modal footer {
  margin-top: 18px;
  justify-content: flex-end;
}

.icon {
  width: 38px;
  min-height: 38px;
  color: var(--red);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.wide {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.nested { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body {
    background-size: 34px 34px, 34px 34px, 100% 100%, 100% 100%;
  }

  .access {
    align-items: start;
    padding: 14px;
    overflow-y: auto;
  }

  .access-box {
    padding: 18px;
    margin: 18px 0;
  }

  .access-box h1 {
    font-size: 30px;
    line-height: 1.05;
  }

  .shell { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding-bottom: 14px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  nav {
    display: flex;
    gap: 8px;
    margin: 14px 0;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 12px;
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
  }

  .sidebar .full {
    min-height: 46px;
  }

  .main {
    padding: 16px 14px 26px;
  }

  .topbar, .control-strip, .quick-grid, .content-head, .cards, .form-grid {
    grid-template-columns: 1fr;
  }

  .cards.nested {
    grid-template-columns: 1fr;
  }

  .done-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .done-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .module-map,
  .student-grid,
  .health-grid {
    grid-template-columns: 1fr;
  }

  .student-status {
    display: grid;
  }

  .command-head {
    display: grid;
  }

  .process-head,
  .process-actions {
    grid-template-columns: 1fr;
  }

  .process-head {
    display: grid;
  }

  .command-head strong {
    width: fit-content;
  }

  .topbar {
    align-items: stretch;
  }

  h1 {
    font-size: 34px;
    line-height: 1.03;
  }

  h2 {
    font-size: 18px;
  }

  .system-card {
    min-width: 0;
  }

  .control-strip {
    margin: 18px 0 14px;
  }

  .search,
  input,
  select,
  textarea {
    min-height: 50px;
    font-size: 16px;
  }

  .panel-title {
    font-size: 13px;
  }

  .mini-row {
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
  }

  .mini-row strong {
    grid-column: 1 / -1;
  }

  .content-head {
    gap: 10px;
  }

  .content-head .primary {
    min-height: 46px;
  }

  .site-card {
    min-height: auto;
    padding: 15px;
  }

  .card-top {
    align-items: flex-start;
  }

  .card-top h3 {
    font-size: 19px;
  }

  .status {
    max-width: 116px;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .meta-row {
    grid-template-columns: 82px 1fr;
    font-size: 13px;
  }

  .entry {
    grid-template-columns: 1fr auto;
  }

  .entry span:first-child {
    grid-column: 1 / -1;
    color: var(--cyan);
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ctpp-actions {
    grid-template-columns: 1fr;
  }

  .quick-dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions a,
  .copy {
    min-height: 42px;
    padding: 0 8px;
    text-align: center;
  }

  dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  dialog[open] {
    display: grid;
    align-items: start;
  }

  .modal {
    padding: 14px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
  }

  .entry-modal {
    overflow: visible;
  }

  #entryDialog {
    max-height: none;
  }

  #entryDialog .modal {
    max-height: none;
  }

  .modal header,
  .modal footer {
    align-items: stretch;
  }

  .modal footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal footer button {
    min-height: 46px;
  }
}

@media (max-width: 430px) {
  .actions {
    grid-template-columns: 1fr;
  }

  .quick-dates {
    grid-template-columns: 1fr;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .clip {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
