/* OfiSim · estilos propios. Identidad "Atlántico": azul petróleo, coral y papel cálido. */

/* Fuente Figtree incluida en el proyecto (licencia SIL OFL, ver fonts/OFL-Figtree.txt): funciona sin conexión. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/figtree-latin.woff2") format("woff2") }

:root {
  --bg: #f6f4ef; --panel: #ffffff; --panel2: #faf8f4; --line: #e6e1d8; --text: #1c2b33; --muted: #5b6970;
  --accent: #0e7c86; --accent2: #0a626a; --accentsoft: #e2f2f3; --coral: #f2694b; --coralsoft: #fde9e4;
  --ok: #2a7f51; --oksoft: #e4f3ea; --bad: #c0392f; --badsoft: #fbe7e5; --warn: #8f5d10; --warnsoft: #fbf1dc; --coraltext: #c2432a;
  --gold: #e9a23b; --navy: #12303d;
  --radius: 8px; --shadow: 0 1px 0 rgba(28,43,51,.04), 0 2px 8px rgba(28,43,51,.05);
  --paper: #fffdf8; --ink: #22262b;
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
[data-theme="dark"] { color-scheme: dark;
  --bg: #0f1a1f; --panel: #16242b; --panel2: #1b2c34; --line: #27404b; --text: #e7eef0; --muted: #93a7ae;
  --accent: #3fb7c1; --accent2: #63c9d1; --accentsoft: #133a40; --coral: #ff8a70; --coralsoft: #3d2520;
  --ok: #4cbf7f; --bad: #ef6b60; --warn: #e3a54a; --coraltext: #ff8a70; --oksoft: #143224; --badsoft: #3a1a18; --warnsoft: #352a12; --navy: #0a1418;
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 4px 14px rgba(0,0,0,.25);
}

* { box-sizing: border-box }
html, body { margin: 0; height: 100% }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5 }
button { font: inherit; cursor: pointer }
input, select, textarea { font: inherit; color: var(--text) }
a { color: var(--accent) }
h1, h2, h3 { letter-spacing: -.01em }
.hidden { display: none !important }
.muted { color: var(--muted) }

/* ---------- marca ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px }
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--muted) }
.mk { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; position: relative; overflow: hidden }
.mk::after { content: ""; position: absolute; right: -6px; bottom: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--coral) }

/* ---------- acceso ---------- */
#login { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr 1.1fr; background: var(--bg) }
#login .box { display: flex; align-items: center; justify-content: center; padding: 40px; order: 1 }
#login .hero { order: 2; margin: 16px; border-radius: 16px; padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' viewBox='0 0 160 40'%3E%3Cpath d='M0 20 Q20 5 40 20 T80 20 T120 20 T160 20' fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='2'/%3E%3C/svg%3E") 0 100%/160px 40px repeat,
    linear-gradient(160deg, #0e7c86 0%, #12303d 70%) }
#login .hero .logo small { color: #a9d6da }
#login .hero .mk { background: #fff; color: var(--accent) }
#login .hero h1 { font-size: 40px; line-height: 1.12; margin: 0 0 14px; font-weight: 800 }
#login .hero p { color: #cfe6e8; font-size: 16px; max-width: 500px }
#login .card { width: 100%; max-width: 380px; background: transparent; border: none; box-shadow: none }
#login h2 { margin: 0 0 4px; font-size: 26px; font-weight: 800 }
.feat { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px }
.feat span { background: rgba(255,255,255,.1); border-radius: 6px; padding: 6px 11px; font-size: 13px; color: #e8f4f5 }

/* ---------- controles ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px }
.field label { font-size: 12.5px; font-weight: 700; color: var(--muted) }
.inp { border: 1.5px solid var(--line); background: var(--panel); border-radius: 6px; padding: 9px 11px; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accentsoft) }
.inp[readonly] { background: var(--panel2); color: var(--muted) }
textarea.inp { resize: vertical }
.btn { border: 1.5px solid var(--line); background: var(--panel); color: var(--text); padding: 8px 15px; border-radius: 6px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; transition: background .15s, border-color .15s }
.btn:hover { border-color: var(--accent) }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff }
.btn.pri:hover { background: var(--accent2); border-color: var(--accent2) }
.btn.big { width: 100%; justify-content: center; padding: 11px 18px; font-size: 15px }
.btn.sm { padding: 4px 10px; font-size: 12.5px }
.btn:disabled { opacity: .45; cursor: not-allowed }
.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px }
.sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0 }
.sep::before, .sep::after { content: ""; flex: 1; border-top: 1px dashed var(--line) }
.hint { display: flex; gap: 10px; background: var(--accentsoft); border-left: 3px solid var(--accent); border-radius: 4px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; white-space: nowrap }
.coins { color: var(--warn); font-weight: 800 }
.iconbtn { width: 36px; height: 36px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--panel); display: grid; place-items: center; color: var(--text); text-decoration: none; flex-shrink: 0 }
.iconbtn:hover { border-color: var(--accent) }
.avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--coral); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0 }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 800; white-space: nowrap }
.t-blue { background: var(--accentsoft); color: var(--accent) }
.t-warn { background: var(--warnsoft); color: var(--warn) }
.t-coral { background: var(--coralsoft); color: var(--coral) }
.t-gray { background: var(--panel2); color: var(--muted); border: 1px solid var(--line) }

/* ---------- estructura ---------- */
#app { display: grid; grid-template-columns: 236px 1fr; height: 100vh }
aside { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: auto }
aside .logo { padding: 18px 18px 10px }
.nav { flex: 1; padding: 4px 10px }
.nav h6 { margin: 18px 10px 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em }
.nav button { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: none; color: var(--text); padding: 8px 10px; border-radius: 6px; text-align: left; font-weight: 600 }
.nav button:hover { background: var(--panel2) }
.nav button.on { background: var(--accentsoft); color: var(--accent) }
.nav .ic { width: 20px; text-align: center }
.nav .cnt { margin-left: auto; background: var(--coraltext); color: #fff; border-radius: 4px; font-size: 11px; padding: 0 6px; font-weight: 800 }
.side-foot { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted) }
main { display: flex; flex-direction: column; overflow: hidden }
header.top { height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line); flex-shrink: 0 }
#view { flex: 1; overflow: auto; padding: 26px 28px 60px }

.xpbox { display: flex; align-items: center; gap: 10px; min-width: 0 }
.lvl { width: 38px; height: 38px; border-radius: 8px; background: var(--navy); color: #fff; display: grid; place-items: center; flex-shrink: 0; position: relative }
.lvl b { font-size: 15px }
.lvl::after { content: "NIV"; position: absolute; top: 2px; font-size: 7px; letter-spacing: .1em; opacity: .7 }
.xpbox .t { font-size: 12px; line-height: 1.3; color: var(--muted) }
.xpbox .t b { display: block; color: var(--text); font-size: 13px; white-space: nowrap }
.xpbar { height: 5px; width: 160px; background: var(--line); border-radius: 3px; margin-top: 4px; overflow: hidden }
.xpbar i { display: block; height: 100%; background: var(--coral); transition: width .5s }

/* ---------- páginas ---------- */
.ph { margin-bottom: 20px }
.ph h1 { margin: 0; font-size: 26px; font-weight: 800 }
.ph p { margin: 4px 0 0; color: var(--muted) }
.crumb { font-size: 12px; color: var(--accent); font-weight: 700; margin-bottom: 2px }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow) }
.card h3 { margin: 0 0 12px; font-size: 15px }
.card .hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line) }
.card .hd h3 { margin: 0 }
.pad { padding: 18px 20px }
.grid { display: grid; gap: 14px }
.g4 { grid-template-columns: repeat(4, 1fr) }
.g2 { grid-template-columns: repeat(2, 1fr) }
.empty { padding: 36px; text-align: center; color: var(--muted) }

.welcome { background: var(--navy); color: #fff; border: none; position: relative; overflow: hidden }
.welcome::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: var(--accent); opacity: .35 }
.welcome .muted { color: #b9d3d8 }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--coral) calc(var(--p) * 1%), rgba(255,255,255,.15) 0); display: grid; place-items: center; flex-shrink: 0; position: relative; z-index: 1 }
.ring b { width: 66px; height: 66px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 18px }
.welcome > div { position: relative; z-index: 1 }

.kpi { padding: 14px 16px; display: flex; gap: 12px; align-items: center }
.kpi .ki { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; font-size: 19px }
.kpi .v { font-size: 22px; font-weight: 800 }
.kpi .l { font-size: 12.5px; color: var(--muted) }

.bars { display: flex; align-items: flex-end; gap: 20px; height: 180px; padding: 6px 4px 0 }
.bars .b { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px }
.bars .b i { display: block; width: 100%; max-width: 54px; background: var(--accent); border-radius: 4px 4px 0 0 }
.bars .b em { font-style: normal; font-weight: 800; font-size: 12px }
.bars .b span { font-size: 12px; color: var(--muted) }

/* ---------- tareas ---------- */
.jtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px }
.jtab { border: 1.5px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 10px 14px; text-align: left; min-width: 170px }
.jtab b { display: block }
.jtab small { color: var(--muted); font-size: 12px }
.jtab.on { border-color: var(--accent); background: var(--accentsoft) }
.jtab.lock { opacity: .55 }
.tasklist { display: flex; flex-direction: column }
.trow { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer }
.trow:last-child { border-bottom: none }
.trow:hover { background: var(--panel2) }
.trow .ti { width: 40px; height: 40px; border-radius: 8px; background: var(--accentsoft); display: grid; place-items: center; font-size: 18px; flex-shrink: 0 }
.trow.done .ti { background: var(--oksoft) }
.trow .tt { flex: 1; min-width: 0 }
.trow .tt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.trow .tt span { font-size: 12.5px; color: var(--muted) }
.trow.lock { cursor: not-allowed; opacity: .5 }
.xp { font-weight: 800; font-size: 12.5px; color: var(--warn); white-space: nowrap }
.score { font-weight: 800; min-width: 48px; text-align: right }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 15px; white-space: nowrap }
.stars .off { color: var(--line) }

/* ---------- tablas ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line) }
.toolbar .inp { max-width: 340px }
.tbl-wrap { overflow: auto }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px }
.tbl th { text-align: left; padding: 9px 14px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0 }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line) }
.tbl tr:hover td { background: var(--panel2) }
.norms table { width: 100%; border-collapse: collapse; font-size: 13px }
.norms th, .norms td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top }
.norms th { font-size: 11.5px; color: var(--muted); text-transform: uppercase }
.fich td, .fich th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12.5px }
.fich tr { cursor: pointer }
.fich tbody tr:hover td { background: var(--panel2) }

/* ---------- insignias y tienda ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px }
.badge { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 12px; text-align: center }
.badge .bi { width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 12px; display: grid; place-items: center; font-size: 28px; background: var(--coralsoft); transform: rotate(-4deg) }
.badge b { display: block; font-size: 13px }
.badge span { font-size: 12px; color: var(--muted) }
.badge.off { opacity: .45; filter: grayscale(1) }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px }
.item { background: var(--panel); border: 1.5px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px }
.item .big { font-size: 32px; line-height: 1 }
.item.owned { border-color: var(--ok) }
.item.eq { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accentsoft) }
.swatch { width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--line) }

/* ---------- cajón lateral ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 94vw; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(18,48,61,.18); z-index: 60; display: flex; flex-direction: column; animation: entra .2s }
.drawer .dh { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line) }
.drawer .db { padding: 16px 20px; overflow: auto }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13px }
.kv span:nth-child(odd) { color: var(--muted) }

/* ---------- espacio de trabajo ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(18,48,61,.5); display: flex; align-items: center; justify-content: center; animation: aparece .15s }
.ws { width: min(1360px, 96vw); height: min(880px, 94vh); background: var(--panel); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.3) }
.ws .wh { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line) }
.ws .wh h2 { flex: 1; margin: 0; font-size: 17px }
.ws .wb { flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden }
.ws .desk { overflow: auto; padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; background: #dfe7e6 linear-gradient(0deg, rgba(14,124,134,.06) 1px, transparent 1px) 0 0/100% 22px }
[data-theme="dark"] .ws .desk { background: #13232a linear-gradient(0deg, rgba(63,183,193,.07) 1px, transparent 1px) 0 0/100% 22px }
.ws.desk-madera .desk { background: repeating-linear-gradient(90deg, #b07b4f, #b07b4f 40px, #a8714a 40px, #a8714a 80px) }
.ws.desk-corcho .desk { background: radial-gradient(#c79b62 1px, transparent 1.5px) 0 0/6px 6px, #b8864f }
.ws.desk-marmol .desk { background: linear-gradient(135deg, #f3f3f3, #e2e2e6 40%, #f7f7f7 60%, #dedee4) }
.ws.desk-pizarra .desk { background: #2f3b36 }
.ws.desk-cuaderno .desk { background: repeating-linear-gradient(0deg, #fbfbf6, #fbfbf6 26px, #cfe0f5 27px), #fbfbf6 }
.ws .form { overflow: auto; padding: 22px 26px; border-left: 1px solid var(--line) }
.ws .wf { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel2) }
.deskdecor { margin-top: auto; align-self: flex-end; position: sticky; bottom: 0; font-size: 32px }

.frm { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px 14px }
.frm .field { grid-column: span 6; margin: 0 }
.frm .w2 { grid-column: span 2 } .frm .w3 { grid-column: span 3 } .frm .w4 { grid-column: span 4 }
.frm .sec { grid-column: span 6; font-size: 12px; font-weight: 800; color: var(--coraltext); text-transform: uppercase; letter-spacing: .08em; padding-bottom: 4px; border-bottom: 2px solid var(--coralsoft) }
.question { font-size: 16px; font-weight: 700; margin: 0 0 14px }
.qopts { display: flex; flex-direction: column; gap: 8px }
.qopts label { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 8px; padding: 11px 14px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text) }
.qopts label:hover { border-color: var(--accent) }
.qopts label:has(input:checked) { border-color: var(--accent); background: var(--accentsoft) }
.qopts input { accent-color: var(--accent); margin-top: 3px }

/* ---------- documentos sobre la mesa ---------- */
.paper { position: relative; width: 100%; max-width: 620px; background: var(--paper); color: var(--ink); padding: 36px 40px; font-family: Georgia, "Times New Roman", serif; font-size: 13px; line-height: 1.55; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 10px 26px rgba(0,0,0,.16) }
.paper h4 { margin: 0; font-family: var(--font); letter-spacing: .1em }
.paper .lh { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 3px double var(--c, #333) }
.paper .brand { font-family: var(--font); font-size: 19px; font-weight: 800; color: var(--c, #333) }
.paper .brand small { display: block; font-size: 10.5px; font-weight: 400; color: #666 }
.paper .box { border: 1px solid #d6d1c6; padding: 8px 10px; font-size: 12.5px }
.paper table { width: 100%; border-collapse: collapse; margin: 12px 0; font-family: var(--font); font-size: 12.5px }
.paper th { text-align: left; padding: 5px 7px; color: var(--c, #333); border-bottom: 2px solid var(--c, #333); font-size: 11.5px; text-transform: uppercase }
.paper td { padding: 5px 7px; border-bottom: 1px solid #ebe6dc }
.paper .r { text-align: right }
.paper .tot td { border: none; padding: 3px 7px }
.paper .tot .big td { font-size: 15px; font-weight: 800; border-top: 2px solid #333 }
.paper .foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #e2ddd2; font-size: 10.5px; color: #777 }
.stamp { position: absolute; padding: 5px 12px; border: 3px solid #b5332b; border-radius: 4px; color: #b5332b; font-family: "Courier New", monospace; font-weight: 800; font-size: 13px; line-height: 1.2; text-align: center; transform: rotate(-9deg); opacity: .78 }
.stamp.blue { border-color: #1f5aa6; color: #1f5aa6 }
.hand { font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive; color: #1b3a8a; font-size: 15px }
.postit { width: 340px; max-width: 100%; padding: 20px 22px; background: #ffe98a; color: #3a3320; font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 14.5px; line-height: 1.55; box-shadow: 0 8px 20px rgba(0,0,0,.18); transform: rotate(1.5deg) }
.mail { width: 100%; max-width: 640px; background: #fff; color: #1c2b33; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 26px rgba(0,0,0,.16); font-size: 13.5px }
.mail .mh { padding: 14px 20px; background: #f1f6f6; border-bottom: 1px solid #dde6e6 }
.mail .mh > b { display: block; font-size: 16px; margin-bottom: 6px }
.mail .mh div { font-size: 12.5px; color: #5b6b72 }
.mail .mb { padding: 16px 20px; line-height: 1.6 }
.mail .mhilo { padding: 10px 20px; background: #faf8f3; border-bottom: 1px solid #e7e1d5 }
.mail-prev { border-left: 3px solid #d7dede; padding: 2px 0 2px 10px; margin: 6px 0; color: #5b6b72; font-size: 12px }
.mail-prev .mp-h { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 2px }
.mail-prev p { margin: 0; line-height: 1.45 }
.mail .madj { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 16px }
.adjunto { display: inline-flex; align-items: center; gap: 4px; background: #eef4f4; border: 1px solid #d7e2e2; border-radius: 5px; padding: 5px 8px; font-size: 12px; font-weight: 600; color: #30464d; cursor: pointer; font-family: inherit }
.adjunto:hover { border-color: #0e7c86; color: #0e7c86 }
.adjunto small { color: #6b7f85; font-weight: 500 }
.phone { width: 100%; max-width: 380px; background: #12303d; color: #e7f2f3; border-radius: 22px; padding: 22px 18px; box-shadow: 0 12px 30px rgba(0,0,0,.25); border: 6px solid #0b1e26 }
.phone-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 11.5px; color: #8fb9bf }
.phone-head .btn { background: #1d4a59; border-color: #2a6b62; color: #e7f2f3; padding: 4px 8px; font-size: 11.5px }
.phone .who { font-size: 12px; color: #8fb9bf; margin-top: 4px }
.phone .bub { background: #1d4a59; border-radius: 14px 14px 14px 4px; padding: 11px 14px; margin: 6px 0 10px; line-height: 1.5 }
.folder { position: relative; margin: 8px 0; padding: 13px 16px 13px 54px; background: #e9c97c; color: #4a3a10; font-weight: 700; font-size: 15px; border-radius: 3px 8px 6px 6px; box-shadow: 0 3px 8px rgba(0,0,0,.14) }
.folder .tab { position: absolute; left: 12px; top: 10px; width: 30px; height: 24px; border-radius: 4px; background: var(--navy); color: #e9c97c; display: grid; place-items: center; font-size: 13px }
.meca-src { white-space: pre-wrap; user-select: none; background: var(--panel2); border: 1.5px dashed var(--line); border-radius: 6px; padding: 12px; font-family: Consolas, "Courier New", monospace; font-size: 15px; line-height: 1.6 }
.meca-in { min-height: 130px; font-family: Consolas, "Courier New", monospace; font-size: 15px }

/* ---------- resultado ---------- */
.res { width: min(640px, 94vw); max-height: 90vh; overflow: auto; background: var(--panel); border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,.3) }
.res .top { padding: 26px 26px 16px; text-align: center; border-bottom: 1px solid var(--line) }
.res .top .big { font-size: 48px; font-weight: 800; line-height: 1.1 }
.res .gain { display: inline-block; margin-top: 8px; padding: 5px 14px; border-radius: 6px; background: var(--coral); color: #fff; font-weight: 800 }
.res .items { padding: 6px 22px }
.ri { display: flex; gap: 12px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13px }
.ri .ic { width: 22px; height: 22px; border-radius: 4px; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0 }
.ri .ic.info { background: var(--muted) }
.ri .l { width: 170px; flex-shrink: 0; font-weight: 700 }
.ri .v { flex: 1 }
.ri .v s { color: var(--bad) }
.rubrica { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin: 12px 22px 0 }
.rub { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-size: 12px; background: var(--panel2) }
.rub b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted) }
.rub span { font-weight: 800 }
.rub.ok span { color: var(--ok) }
.rub.bad span { color: var(--bad) }
.rub small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.4 }
.exp { margin: 12px 22px; padding: 11px 14px; background: var(--panel2); border-left: 3px solid var(--accent); border-radius: 4px; font-size: 13px }
.res .ft { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px }

/* ---------- avisos ---------- */
#toasts { position: fixed; left: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px }
.toast { display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 380px; padding: 11px 15px; background: var(--navy); color: #fff; border-left: 4px solid var(--coral); border-radius: 6px; box-shadow: 0 10px 28px rgba(0,0,0,.25); animation: entra .25s }
.toast small { display: block; color: #a9c6cb }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100 }

@keyframes aparece { from { opacity: 0 } to { opacity: 1 } }
@keyframes entra { from { transform: translateY(12px); opacity: 0 } to { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important } }

/* ---------- pantallas estrechas ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr) }
  .g2 { grid-template-columns: 1fr }
  #login { grid-template-columns: 1fr }
  #login .hero { display: none }
  .ws .wb { grid-template-columns: 1fr; overflow: auto }
  .ws .desk { max-height: 45vh }
  .xpbar { width: 110px }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr }
  aside { flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line) }
  aside .logo small, .side-foot, .nav h6 { display: none }
  .nav { display: flex; gap: 4px; padding: 6px }
  .nav button { width: auto; white-space: nowrap }
  header.top { padding: 0 16px; overflow-x: auto }
  #view { padding: 20px 16px 48px }
  .g4 { grid-template-columns: 1fr 1fr }
  .ri .l { width: 110px }
  .frm .w2, .frm .w3, .frm .w4 { grid-column: span 6 }
}

/* ---------- foco visible con teclado ---------- */
.trow:focus-visible, .tbl tr:focus-visible, .btn:focus-visible, .iconbtn:focus-visible, .nav button:focus-visible, .jtab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px }
.hint.pista { background: var(--warnsoft); border-left-color: var(--gold); animation: entra .2s }

/* ---------- piezas de la fase 2 ---------- */
.lbl-doc { text-transform: none; letter-spacing: 0; color: var(--text) !important; font-size: 13.5px !important; font-weight: 500 !important }
.phone .who.me { text-align: right }
.phone .bub.me { background: #2a6b62; border-radius: 14px 14px 4px 14px; margin-left: 36px }
.agendas { width: 100%; max-width: 620px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px }
table.agenda { width: 100%; border-collapse: collapse; background: var(--paper); color: var(--ink); font-size: 11.5px; box-shadow: 0 4px 12px rgba(0,0,0,.12) }
table.agenda caption { caption-side: top; text-align: left; font-weight: 800; padding: 6px 8px; background: var(--navy); color: #fff; font-size: 12px }
table.agenda th { padding: 3px 4px; font-weight: 700; color: #555; text-transform: capitalize; border-bottom: 1px solid #e2ddd2 }
table.agenda td { padding: 3px 4px; text-align: center; border: 1px solid #ece7dd; height: 22px }
table.agenda td.ocu { background: repeating-linear-gradient(45deg, #f3d8d3, #f3d8d3 4px, #fbe7e3 4px, #fbe7e3 8px); color: #9a3a2c; font-weight: 700; font-size: 10px }
table.agenda td.cer { background: #e5e5e5; color: #999 }
@media (max-width: 760px) { .agendas { grid-template-columns: 1fr } }

/* ---------- móvil: la tarea ocupa toda la pantalla y se desplaza entera ---------- */
@media (max-width: 760px) {
  .overlay { align-items: stretch }
  .ws { width: 100vw; height: 100dvh; border-radius: 0 }
  .ws .wh { flex-wrap: wrap; padding: 10px 12px }
  .ws .wh h2 { flex-basis: calc(100% - 90px); font-size: 15.5px }
  .ws .wb { display: block; overflow: auto }
  .ws .desk { max-height: none; padding: 16px 12px }
  .ws .form { overflow: visible; border-left: none; border-top: 1px solid var(--line); padding: 16px 14px 24px }
  .ws .wf { flex-wrap: wrap; padding: 10px 12px; gap: 8px }
  .ws .wf #wsInfo { flex-basis: 100% !important; font-size: 12px }
  .ws .wf .btn { flex: 1; justify-content: center }
  .paper { padding: 22px 18px }
  .res { width: 100vw; max-height: 100dvh; border-radius: 0 }
  .ri { flex-wrap: wrap }
  .ri .v { flex-basis: 100%; padding-left: 34px }
}

/* ---------- panel del profesor ---------- */
body.panel { height: auto; min-height: 100% }
.ptop { display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10 }
.ptop .mk { background: var(--navy) }
.pmain { max-width: 1200px; margin: 0 auto; padding: 26px 24px 40px }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px; border: 2px dashed var(--line); border-radius: 10px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accentsoft) }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--text); text-transform: none; letter-spacing: 0; margin: 4px 0 }
.chk input { accent-color: var(--accent); width: 16px; height: 16px }
.tbl th.sort { cursor: pointer; user-select: none }
.tbl th.sort:hover { color: var(--accent) }
.tbl th.sort.asc::after { content: " ▲"; font-size: 9px }
.tbl th.sort.desc::after { content: " ▼"; font-size: 9px }
.minibar { height: 4px; width: 80px; background: var(--line); border-radius: 2px; margin-top: 4px; overflow: hidden }
.minibar i { display: block; height: 100%; background: var(--accent) }
.hbar { display: grid; grid-template-columns: minmax(120px, 1.3fr) 2fr 48px auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--line) }
.ofi-detalle { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--panel2) }
.ofi-detalle summary { cursor: pointer; font-size: 12.5px }
.ofi-detalle summary:hover { color: var(--accent) }
.hbar:last-child { border-bottom: none }
.hbar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.hbar .b { height: 10px; background: var(--panel2); border-radius: 5px; overflow: hidden; border: 1px solid var(--line) }
.hbar .b i { display: block; height: 100% }
.hbar > b { text-align: right }
.drawer.wide { width: 640px }
@media (max-width: 760px) { .ptop { padding: 10px 14px } .pmain { padding: 18px 14px 32px } .hbar { grid-template-columns: 1fr 1fr 44px } .hbar > span.muted { display: none } }
@media print {
  .ptop, .drop, #cardConfig, .no-print, #avisosCarga, #toasts { display: none !important }
  body { background: #fff } .card { box-shadow: none; break-inside: avoid } .pmain { padding: 0 }
}

/* ---------- tutorial ---------- */
.tuto .top { padding: 30px 30px 18px }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 18px }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line) }
.dots i.on { background: var(--accent); width: 22px; border-radius: 4px }

/* ---------- informe de prácticas ---------- */
.informe-wrap { display: flex; justify-content: center }
.informe { width: 100%; max-width: 820px; background: var(--paper); color: var(--ink); padding: 36px 42px; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 10px 26px rgba(0,0,0,.12); font-size: 13.5px; line-height: 1.5 }
.informe h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #0e7c86; margin: 22px 0 8px; border-bottom: 2px solid #e2f2f3; padding-bottom: 4px }
.informe p { margin: 0 }
.ihead { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 3px double #0e7c86; padding-bottom: 14px }
.ihead h2 { margin: 2px 0; font-size: 26px; font-weight: 800 }
.ikicker { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #f2694b }
.imuted { color: #5b6b72 }
.inota { text-align: center; background: #12303d; color: #fff; border-radius: 10px; padding: 10px 18px; min-width: 110px }
.inota b { font-size: 34px; line-height: 1 } .inota span { opacity: .7; margin-left: 2px } .inota small { display: block; font-size: 11.5px; color: #a9d6da; margin-top: 2px }
.ialerta { margin-top: 12px; padding: 8px 12px; background: #fbe7e5; color: #8a2b24; border-radius: 4px; font-size: 12.5px }
.ikpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px }
.ikpis div { background: #f3f1ec; border-radius: 6px; padding: 10px 12px } .ikpis b { display: block; font-size: 16px } .ikpis span { font-size: 11.5px; color: #5b6b72 }
.itbl { width: 100%; border-collapse: collapse } .itbl td, .itbl th { padding: 5px 6px; border-bottom: 1px solid #ebe6dc; text-align: left } .itbl th { font-size: 11px; color: #5b6b72; text-transform: uppercase }
.itbl .r { text-align: right } .itbl .iw { width: 45% } .ismall { font-size: 12px }
.ibar { display: block; height: 10px; background: #ece8df; border-radius: 5px; overflow: hidden } .ibar i { display: block; height: 100% }
.ifoot { margin-top: 20px; padding-top: 8px; border-top: 1px solid #e2ddd2; font-size: 11px; color: #777 }
@media (max-width: 760px) { .informe { padding: 22px 16px } .ikpis { grid-template-columns: 1fr 1fr } .ihead { flex-direction: column } }

/* ---------- certificado (solo se imprime) ---------- */
.cert { width: 297mm; height: 210mm; padding: 10mm; background: #fffdf8; color: #1c2b33; font-family: var(--font); page: cert }
.cmarco { height: 100%; border: 3px double #0e7c86; outline: 1px solid #f2694b; outline-offset: -9px; padding: 12mm 18mm 8mm; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative }
.clogo { display: flex; align-items: center; gap: 10px; text-align: left } .clogo b { display: block; font-size: 16px } .clogo small { color: #6b7a82 }
.ctit { margin-top: 10mm; font-family: Georgia, serif; font-size: 34px; letter-spacing: .12em; text-transform: uppercase; color: #12303d }
.ctxt { font-size: 15px; max-width: 220mm; line-height: 1.6; margin: 4mm 0 0 }
.cnom { font-family: Georgia, serif; font-style: italic; font-size: 38px; color: #0e7c86; margin: 3mm 0 0; border-bottom: 1px solid #c9d6d8; padding: 0 12mm 2mm }
.ccomp { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 6mm; font-size: 12.5px; color: #3c4b52 }
.cpie { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10mm; font-size: 12.5px; text-align: left }
.cfirma { font-family: "Segoe Script", "Bradley Hand", cursive; font-size: 22px; color: #1b3a8a }
.clinea { border-top: 1px solid #9aa8ad; padding-top: 2mm; margin-top: 1mm; color: #5b6b72; font-size: 11.5px }
.csello { width: 30mm; height: 30mm; border: 3px solid #b5332b; border-radius: 50%; color: #b5332b; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 11px; line-height: 1.15; transform: rotate(-10deg); opacity: .8; font-family: "Courier New", monospace }
.caviso { margin-top: 5mm; font-size: 10px; color: #8a979c }

/* ---------- impresión de informe y certificado ---------- */
#impresion { display: none }
@page { size: A4; margin: 12mm }
@page cert { size: A4 landscape; margin: 0 }
@media print {
  body.imprimiendo { background: #fff; height: auto }
  body.imprimiendo > *:not(#impresion) { display: none !important }
  body.imprimiendo #impresion { display: block !important }
  #impresion .informe { box-shadow: none; max-width: none; padding: 0; background: #fff }
  #impresion .isalto { break-before: page }
  #impresion * { -webkit-print-color-adjust: exact; print-color-adjust: exact }
}

/* ---------- accesibilidad ---------- */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 6px; font-weight: 700; text-decoration: none }
.skip:focus { top: 12px }
#view:focus { outline: none }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.inp:focus-visible { outline: none }
.qopts label:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accentsoft); border-color: var(--accent) }
.tbl th.sort:focus-visible { outline-offset: -2px }
/* Contraste del texto sobre colores claros en el tema oscuro */
[data-theme="dark"] .btn.pri, [data-theme="dark"] .btn.pri:hover { color: #0b1a1f }
[data-theme="dark"] .nav .cnt, [data-theme="dark"] .res .gain { color: #2a0f08 }
.res .gain { background: var(--coraltext) }
