/* Color, layout and shared components for the three classrooms. */
body[data-role] {
  --deep:#061b44;
  --green:#064b9d;
  --light:#1367cb;
  --mint:#e1edff;
  --paper:#eef4fd;
  --accent:#ffd352;
  --ink:#081b3d;
  --muted:#354968;
  --border:#b8cbe7;
  --shadow:0 3px 4px #12264d32,0 12px 30px #17366912;
  min-height:100vh;
  background:var(--paper);
  color:var(--ink);
}
body[data-role=teacher] {
  --deep:#301144; --green:#5c258b; --light:#7b32b6; --mint:#f0ddff;
  --paper:#f7f0ff; --accent:#ffc17e; --ink:#2e163e; --muted:#583c66; --border:#d8c0e8;
}
body[data-role=student] {
  --deep:#064237; --green:#006557; --light:#087c6b; --mint:#d9f7ec;
  --paper:#fffaeb; --accent:#ffe477; --ink:#12382e; --muted:#36584e; --border:#9bd0be;
}
body[data-role] .topbar {
  padding:12px clamp(12px,2vw,32px);
  background:linear-gradient(130deg,var(--deep) 20%,var(--light) 52%,var(--deep) 85%);
  color:white;
  border-bottom:3px solid var(--accent);
}
.topbar .brand,.topbar .brand small,.topbar .user-chip {color:white}
.topbar .brand {font-size:clamp(1.05rem,2vw,1.65rem);line-height:1.13}
.topbar .brand b {color:var(--accent)}
.brandmark {width:52px;height:52px;background:transparent;flex:none}
.role-banner {
  color:white;background:var(--deep);
  border:2px solid var(--accent);box-shadow:0 0 0 2px #ffffff24,inset 0 0 14px #ffffff24;
  border-radius:99px;padding:.42em .85em;text-align:center;line-height:1.2;
}
.top-actions {gap:8px}
.top-actions .user-chip {max-width:13ch;overflow-wrap:anywhere}
body[data-role] .layout {grid-template-columns:minmax(205px,17%) minmax(0,1fr)}
body[data-role] .sidebar {
  background:radial-gradient(ellipse at 60% 86%,var(--green),transparent 66%),var(--deep);
  color:white;padding:14px 9px 140px;position:relative;overflow:hidden;
}
.sidebar::after {
  content:"";position:absolute;bottom:45px;left:-20%;width:150%;height:46px;
  border-radius:55%;transform:rotate(-23deg);
  background:linear-gradient(175deg,#ffefaa,var(--accent) 46%,#975911 75%,#ffd56d);
  pointer-events:none;opacity:.8;
}
body[data-role] .nav-button {
  display:flex;align-items:center;gap:11px;color:white;padding:.55em .6em;font-size:.96em;
  min-height:47px;line-height:1.21;
}
body[data-role] .nav-button span {flex:0 0 32px;width:32px;text-align:center;font-size:1.4em;filter:drop-shadow(0 2px 2px #0006)}
body[data-role] .nav-button.active,body[data-role] .nav-button:hover {
  background:linear-gradient(125deg,#fff4b2,var(--accent) 40%,#e6a62b);color:#17233a;
  box-shadow:inset 0 0 0 1px #ffe681,0 2px 4px #0006;
}
.mobile-nav,.sidebar .side-help {display:none}
body[data-role] .main {padding:0 18px 28px;min-width:0;max-width:1700px}
body[data-role] .main>h1,body[data-role] .main>.section-head:first-child {
  border-radius:16px;padding:.48em .62em;
  background:linear-gradient(110deg,var(--deep),var(--light));color:white;
  box-shadow:var(--shadow);margin-block:18px;
}
.main>.section-head:first-child .button {border:1px solid #ffffffa0}
.dash-hero {
  display:grid;grid-template-columns:56% 44%;min-height:260px;
  overflow:hidden;margin:0 -18px 14px;border-bottom:4px solid var(--accent);
  background:radial-gradient(ellipse at 80% 20%,var(--light),var(--deep));
  color:white;box-shadow:var(--shadow);
}
.dash-hero .hero-photo {width:100%;height:100%;max-height:365px;object-fit:cover;object-position:center 45%}
.mouse-art {
  background:url('/media/referencia-administracion.png') 29.13% 15.13% / 245.88% 313.67%;
  min-height:260px;
}
body[data-role=admin] .dash-hero {
  grid-template-columns:51% 49%;
  background:radial-gradient(ellipse at 80% 55%,#155349,#062b2c 75%);
  border-bottom-color:#dba239;
}
.dash-welcome {padding:clamp(18px,3vw,45px);align-self:center}
.dash-welcome h1 {font-size:clamp(1.65rem,3.35vw,3.25rem);margin:0 0 .25em;line-height:1.05;text-wrap:balance}
.dash-welcome p {font-size:1.1em;margin:0;max-width:36ch}
body[data-role=admin] .dash-welcome {border:4px solid #b77c2f;border-radius:12px;margin:10px 16px 10px 0;box-shadow:inset 0 0 14px #0008,0 4px 12px #0007;text-align:center}
body[data-role=admin] .dash-welcome p {margin:auto}
.dash-tiles {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin:12px 0 18px}
.dash-tile {
  --tile:#7113a5;--glow:#a33ed0;
  display:flex;align-items:center;justify-content:center;gap:.25em;flex-direction:column;
  min-height:114px;padding:.55em .3em .7em;line-height:1.14;color:white;text-align:center;
  border:2px solid #ffffff80;border-radius:18px;
  background:radial-gradient(ellipse at 50% -50%,#ffffff9c,transparent 65%),linear-gradient(var(--glow),var(--tile) 80%);
  box-shadow:inset 0 -4px 0 #0004,0 4px 6px #22265352;
  transition:transform .18s,filter .18s;
}
.dash-tile span {font-size:2.35em;line-height:1.08;filter:drop-shadow(0 4px 2px #0006)}
.dash-tile strong {overflow-wrap:anywhere}
.dash-tile:nth-child(6n+2) {--tile:#003e85;--glow:#0c7ac6}
.dash-tile:nth-child(6n+3) {--tile:#00634b;--glow:#008964}
.dash-tile:nth-child(6n+4) {--tile:#8c3404;--glow:#ba5304}
.dash-tile:nth-child(6n+5) {--tile:#8e1251;--glow:#c3316f}
.dash-tile:nth-child(6n+6) {--tile:#421b9e;--glow:#7750cc}
.dash-tile:hover {transform:translateY(-3px);filter:brightness(1.08)}
.dash-tile:active {transform:translateY(2px)}
body[data-role=teacher] .dash-tiles {grid-template-columns:repeat(3,minmax(0,1fr))}
body[data-role=student] .dash-tile {min-height:144px;border-radius:28px}
.dash-panels {display:grid;grid-template-columns:1fr 1.3fr;gap:16px;margin-block:16px}
.dash-box {background:white;border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);overflow:hidden;min-width:0}
.dash-box>h2 {
  font-size:1.12em;margin:0;background:linear-gradient(108deg,var(--deep),var(--light));
  color:white;padding:.5em .65em;line-height:1.25;
}
.dash-box>h2 span {font-size:1.25em;margin-right:.18em}
.dash-box-body {padding:.7em .8em}
.dash-box-body p {margin:.32em 0 .5em}
.dash-stats {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,112px),1fr));gap:8px}
.dash-stat {
  text-align:center;display:flex;align-items:center;justify-content:center;flex-direction:column;
  min-height:99px;padding:.48em .3em;line-height:1.14;font-size:.83em;border-radius:13px;
  background:linear-gradient(146deg,#eaf9ff,#bcdffa);box-shadow:inset 0 0 0 1px #b0c9ea;
}
.dash-stat:nth-child(2){background:linear-gradient(146deg,#f2e7ff,#dcc4f6)}
.dash-stat:nth-child(3){background:linear-gradient(146deg,#d6fff0,#b2ebcf)}
.dash-stat:nth-child(4){background:linear-gradient(146deg,#fff8d6,#ffe6a3)}
.dash-stat strong,.dash-stat span:first-child {font-size:1.8em}
.dash-progress {display:flex;gap:.7em;align-items:center;font-size:1.4em}
.dash-progress progress {flex:1;min-width:0;accent-color:#087d38;height:26px;animation:progress-in .55s ease-out both;transform-origin:left}
@keyframes progress-in {from {transform:scaleX(.1)} to {transform:scaleX(1)}}
.dash-recognition {display:flex;align-items:center;gap:.7em}
.dash-recognition>span {font-size:2.85em;filter:drop-shadow(0 3px 2px #99541540)}
.dash-box .live-card {border:0;box-shadow:none;padding:0;background:white;color:var(--ink)}
.dash-box .live-card h2,.dash-box .live-card .eyebrow,.dash-box .live-card p {color:var(--ink)}
.dash-box .live-card .feature-icon {font-size:2em}
body[data-role] .card,body[data-role] .table-wrap,body[data-role] dialog {
  background:linear-gradient(150deg,white 58%,var(--mint));
  border:1px solid var(--border);box-shadow:var(--shadow);
}
body[data-role] .button {
  background:linear-gradient(var(--light),var(--green));color:white;
  box-shadow:inset 0 -3px #0003,0 2px 3px #13274630;min-height:45px;
}
body[data-role] .button.secondary,body[data-role] .button.outline {background:var(--mint);color:var(--ink)}
body[data-role] .button.danger {background:#961c26}
body[data-role] .button:disabled {opacity:.67}
body[data-role] .join-button {background:linear-gradient(#087a47,#03542d);color:white}
body[data-role] th {background:var(--deep);color:white}
body[data-role] tr:nth-child(even) {background:var(--mint)}
body[data-role] .empty {background:var(--mint);color:var(--ink)}
body[data-role] .lesson {border-left:5px solid var(--light)}
body[data-role] .learning-media {max-width:900px}
body[data-role] .high-contrast,body[data-role].high-contrast {
  --paper:white;--ink:black;--muted:#161616;--deep:#080808;--light:#202020;
  --green:#111;--border:#222;--mint:#fff;--accent:#ffdb00;
}
body.high-contrast .dash-tile {--tile:#000;--glow:#222}
body.high-contrast .dash-stat {background:white}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline:3px solid #fff;outline-offset:2px;box-shadow:0 0 0 7px #145bca;
}
@media(max-width:1080px) {
  .top-actions .user-chip {display:none}
  .dash-panels {grid-template-columns:1fr 1fr}
}
@media(max-width:830px) {
  body[data-role] .layout {grid-template-columns:minmax(0,1fr)}
  body[data-role] .topbar {position:static;flex-wrap:wrap}
  .role-banner {order:3}
  body[data-role] .sidebar {padding:6px 12px}
  .sidebar::after {display:none}
  .mobile-nav {display:block}
  .mobile-nav summary {color:white;font-weight:700;min-height:44px}
  body[data-role] .nav-list {display:none}
  body[data-role] .mobile-nav[open]+.nav-list {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}
}
@media(max-width:560px) {
  body[data-role] .main {padding-inline:12px}
  .dash-hero,body[data-role=admin] .dash-hero {margin-inline:-12px;grid-template-columns:1fr}
  .mouse-art {min-height:0;aspect-ratio:2.26}
  .dash-hero .hero-photo {height:155px}
  body[data-role=admin] .dash-welcome {margin:0 8px 10px}
  .dash-panels {grid-template-columns:1fr}
  .dash-tiles,body[data-role=teacher] .dash-tiles {grid-template-columns:repeat(2,minmax(0,1fr))}
  .dash-stats {grid-template-columns:1fr 1fr}
}
.lesson-caption {min-height:3.25em;max-width:900px;padding:.55em .75em;background:var(--deep);border-radius:10px;color:white!important}
