/* Activate GYM · GoFIT Panel — sistema visual (rojo / negro) */
:root {
  --bg: #0b0b0b;
  --bg-2: #101010;
  --card: #151515;
  --card-2: #1c1c1c;
  --input: #1a1a1a;
  --border: #242424;
  --border-2: #2f2f2f;
  --text: #f5f5f5;
  --text-2: #b4b4b4;
  --muted: #7a7a7a;
  --red: #e3171c;
  --red-2: #ff3b3b;
  --red-dark: #8f0c10;
  --violet: #b30f14;
  --blue: #e3171c;
  --cyan: #ff3b3b;
  --grad: linear-gradient(135deg, #f02a2a 0%, #c10f14 100%);
  --red-soft: rgba(227, 23, 28, .12);
  --red-line: rgba(227, 23, 28, .45);
  --ok: #2fd08a;
  --warn: #f5b544;
  --danger: #ff4d5e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 14px 40px -14px rgba(0, 0, 0, .75);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bebas Neue', 'Oswald', 'Arial Narrow', Impact, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--red-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
small, .muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.red { color: var(--red-2); }
.grad-text { color: var(--red); }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; color: var(--text); }
.brand img { width: 38px; height: 38px; }
.brand .wm { font-family: var(--display); font-size: 27px; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
.brand .wm b { color: var(--red); font-weight: 400; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-2); background: var(--card-2); color: var(--text);
  padding: 9px 15px; border-radius: var(--radius-sm); font: inherit; font-weight: 600;
  cursor: pointer; transition: transform .08s, background .15s, border-color .15s, opacity .15s, box-shadow .15s; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { border-color: #444; background: #232323; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -8px rgba(227, 23, 28, .75); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(255, 77, 94, .1); border-color: rgba(255, 77, 94, .4); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--card-2); color: var(--text); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.icon { padding: 7px; }
.btn.block { width: 100%; }

/* ---------- Formularios ---------- */
label.f { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text); }
label.f small { font-weight: 400; }
.input, input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea {
  width: 100%; background: var(--input); border: 1px solid var(--border-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 13px; font: inherit; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227, 23, 28, .2); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b4b4b4' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px !important; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--red); flex: none; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; }

/* ---------- Layout app ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: none; background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px 12px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 0 6px; }
.sidebar .gym-cap { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 8px 14px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active { background: var(--red-soft); color: var(--red-2); border-color: var(--red-line); }
.nav .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.user-card { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--card); margin-top: 10px; }
.user-card .grow { flex: 1; min-width: 0; line-height: 1.2; }
.user-card b { display: block; text-transform: uppercase; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card small { font-size: 12px; }
.credit { text-align: center; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 12px 4px 2px; line-height: 1.7; }
.credit b { color: var(--text-2); font-weight: 700; display: block; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobile-bar { display: none; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(11, 11, 11, .9); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.mobile-bar .brand .wm { font-size: 22px; }
.mobile-bar .brand img { width: 30px; height: 30px; }
.content { width: 100%; max-width: 1000px; margin: 0 auto; padding: 26px 28px 70px; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.ph .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red-2); margin-bottom: 6px; }
.ph h1 { font-size: 40px; }
.ph p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Componentes ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-h h3 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.card-h h3 svg { color: var(--red-2); }
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

.stat { position: relative; overflow: hidden; padding: 18px; }
.stat .lbl { color: var(--text-2); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .lbl svg { color: var(--text-2); }
.stat .val { font-family: var(--display); font-size: 44px; line-height: 1; margin-top: 12px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.stat.hero { background: linear-gradient(160deg, rgba(227, 23, 28, .2), rgba(227, 23, 28, .03) 70%), var(--card); border-color: var(--red-line); }
.stat.hero .lbl svg { color: var(--red-2); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(47, 208, 138, .7); animation: pulse 1.8s infinite; display: inline-block; flex: none; }
.live-dot.red { background: var(--red-2); box-shadow: 0 0 0 0 rgba(255, 59, 59, .7); animation-name: pulseR; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(47, 208, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 208, 138, 0); } }
@keyframes pulseR { 70% { box-shadow: 0 0 0 9px rgba(255, 59, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); } }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 7px; background: var(--card-2); color: var(--text-2); border: 1px solid var(--border-2); white-space: nowrap; }
.badge.ok { background: rgba(47, 208, 138, .1); color: var(--ok); border-color: rgba(47, 208, 138, .3); }
.badge.warn { background: rgba(245, 181, 68, .1); color: var(--warn); border-color: rgba(245, 181, 68, .3); }
.badge.danger, .badge.red { background: var(--red-soft); color: var(--red-2); border-color: var(--red-line); }
.badge.info { background: var(--card-2); color: var(--text); }
.badge.grad { background: var(--red); color: #fff; border-color: transparent; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover { background: var(--card-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--red); color: #fff; flex: none; text-transform: uppercase; }
.avatar.lg { width: 60px; height: 60px; font-size: 22px; }
.avatar.dark { background: var(--card-2); color: var(--text-2); border: 1px solid var(--border-2); }
.person { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.person .avatar { width: 34px; height: 34px; font-size: 12px; }
.person b { display: block; font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 38px !important; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border-2); background: var(--card); color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; font-size: 13px; text-decoration: none !important; display: inline-flex; align-items: center; gap: 7px; }
.chip:hover { color: var(--text); border-color: #444; }
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--text-2); font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--red); }

.empty { text-align: center; padding: 44px 20px; color: var(--text-2); }
.empty .ico-box { width: 50px; height: 50px; border-radius: 12px; background: var(--red-soft); color: var(--red-2); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .ico-box svg { width: 24px; height: 24px; }
.empty h3 { font-size: 22px; margin-bottom: 8px; color: var(--text); }
.empty p { margin: 0 auto 18px; max-width: 360px; }
.empty > svg { width: 34px; height: 34px; color: var(--border-2); margin-bottom: 8px; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 6px; }

/* Gráficos */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 34px; border-radius: 5px 5px 2px 2px; background: #3a3a3a; min-height: 4px; transition: height .4s; }
.bars .b.today i { background: var(--grad); box-shadow: 0 0 18px rgba(227, 23, 28, .45); }
.bars .b span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.bars .b.today span { color: var(--red-2); font-weight: 700; }
.bars .b em { font-style: normal; font-size: 11px; color: var(--text-2); font-weight: 600; }

/* Pantallas */
.screen-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.screen-card h3 { font-size: 24px; }
.status-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.status-line i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.status-line.on { color: var(--ok); }
.status-line.on i { background: var(--ok); }
.icon-row { display: flex; justify-content: flex-end; gap: 2px; }
.icon-row .btn { padding: 6px; color: var(--text-2); }
.icon-row .btn:hover { color: var(--text); }
.mini-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sel-row select { padding: 9px 12px; font-size: 13px; }
.timer-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-align: center; }
.timer-box.run { border-color: var(--red-line); background: linear-gradient(180deg, rgba(227, 23, 28, .1), transparent), var(--bg-2); }
.timer-box .st { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.timer-box.run .st { color: var(--red-2); }
.timer-box .clock { font-family: var(--display); font-size: 56px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.timer-box .now { font-size: 13px; color: var(--text); min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctrl3 { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 8px; }
.ctrl3 .btn { padding: 10px; }
.ctrl3 .play { background: var(--red-dark); border-color: transparent; color: #fff; }
.ctrl3 .play.go { background: var(--grad); }
.ctrl2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ctrl2 .btn { background: transparent; color: var(--text-2); }
.code-box { background: var(--bg-2); border: 1px dashed var(--border-2); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.code-box .code { font-family: var(--display); font-size: 38px; letter-spacing: .25em; color: var(--red-2); }
.info-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.info-box b { color: var(--text); }
.qr-wrap { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: 14px; width: max-content; margin: 0 auto 14px; }

/* Ejercicios */
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.ex-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: border-color .15s; }
.ex-card:hover { border-color: #3a3a3a; }
.ex-card .media { aspect-ratio: 4/3; background: var(--bg-2); position: relative; }
.ex-card .vbadge { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; display: flex; align-items: center; gap: 4px; }
.ex-card .vbadge svg { width: 12px; height: 12px; color: var(--red-2); }
.ex-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ex-card .body b { font-size: 14px; line-height: 1.25; }
.ex-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.media video, .media iframe, .media img { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; background: #000; }
.media-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; font-size: 12px; background: radial-gradient(circle at 30% 20%, rgba(227, 23, 28, .16), transparent 60%), var(--bg-2); }
.media-ph svg { width: 32px; height: 32px; margin: 0 auto 6px; display: block; color: #3a3a3a; }
.media-ph .ini { font-family: var(--display); font-size: 40px; color: #2f2f2f; display: block; }

/* Rutinas */
.rt-card { display: flex; flex-direction: column; gap: 10px; }
.rt-card h3 { font-size: 24px; }
.day-block { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.day-block h4 { padding: 12px 16px; background: var(--card-2); font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.ex-line { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); }
.ex-line .n { width: 26px; height: 26px; border-radius: 8px; background: var(--bg-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-2); }
.ex-line .dose { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ex-line .dose small { display: block; font-weight: 500; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.lib { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 14px; }
.lib-list { overflow-y: auto; flex: 1; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.lib-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: grab; border: 1px solid transparent; }
.lib-item:hover { background: var(--card-2); border-color: var(--border-2); }
.lib-item .grow { flex: 1; min-width: 0; }
.lib-item b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item small { font-size: 11.5px; }
.lib-item .add { color: var(--red-2); }
.ex-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--bg-2); display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px 12px; align-items: start; margin-bottom: 10px; }
.ex-row .n { width: 28px; height: 28px; border-radius: 8px; background: var(--red-soft); color: var(--red-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.ex-row .fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.ex-row .fields label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.ex-row input { padding: 8px 10px !important; font-size: 13px !important; }
.ex-row .acts { display: flex; flex-direction: column; gap: 2px; }
.drop-zone { border: 2px dashed var(--border-2); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; }
.drop-zone.over { border-color: var(--red); background: var(--red-soft); color: var(--text); }
.day-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.day-tab { padding: 8px 14px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--border-2); color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.day-tab.on { background: var(--red); color: #fff; border-color: transparent; }

/* Mensajes */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px 2px 10px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--border); white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: rgba(227, 23, 28, .16); border-color: var(--red-line); border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg small { display: block; margin-top: 4px; font-size: 11px; }
.composer { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--border); padding-top: 14px; }
.composer textarea { min-height: 46px; height: 46px; }
.conv-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; min-height: 520px; }
.conv { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-sm); cursor: pointer; align-items: center; color: inherit; text-decoration: none !important; }
.conv:hover { background: var(--card-2); }
.conv.on { background: var(--card-2); outline: 1px solid var(--border-2); }
.conv .grow { flex: 1; min-width: 0; }
.conv .grow p { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Perfil alumno */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head h2 { font-size: 34px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .75); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { background: var(--card); border: 1px solid var(--border-2); border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .18s; }
.modal.wide { max-width: 860px; }
.modal-h { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-h h3 { font-size: 26px; }
.modal-b { padding: 22px; overflow-y: auto; }
.modal-f { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--card-2); border: 1px solid var(--border-2); border-left: 4px solid var(--ok); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; animation: pop .2s; }
.toast.err { border-left-color: var(--red); }
.loader { display: grid; place-items: center; padding: 60px; }
.spin { width: 28px; height: 28px; border: 3px solid var(--border-2); border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.upload-bar { height: 8px; border-radius: 8px; background: var(--bg-2); overflow: hidden; margin-top: 8px; }
.upload-bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.pick-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.pick-list .check { padding: 6px 8px; border-radius: 8px; }
.pick-list .check:hover { background: var(--card-2); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 52fr 48fr; }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 24px 26px 26px;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 16px),
    radial-gradient(ellipse at 70% 20%, rgba(227, 23, 28, .35), transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(227, 23, 28, .25), transparent 50%),
    #141010; }
.login-art .brand img { width: 54px; height: 54px; }
.login-art .brand .wm { font-size: 32px; }
.login-art h2 { font-size: clamp(56px, 7vw, 96px); line-height: .9; margin-bottom: 22px; }
.login-art h2 em { font-style: normal; color: var(--red); }
.login-art p { color: var(--text-2); font-size: 16px; max-width: 400px; margin: 0; line-height: 1.6; }
.login-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.login-stats div { background: rgba(10, 10, 10, .6); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.login-stats b { font-family: var(--display); color: var(--red); font-size: 26px; font-weight: 400; display: block; line-height: 1; }
.login-stats small { color: var(--text-2); font-size: 13px; }
.login-box { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #0c0c0c; }
.login-box form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.login-box h1 { font-size: 34px; }
.login-box .btn.primary { padding: 13px; font-size: 15px; }
.err-box { background: var(--red-soft); border: 1px solid var(--red-line); color: #ff8b95; padding: 10px 14px; border-radius: 10px; }
.login-links { display: flex; justify-content: center; gap: 18px; font-size: 13px; }
.login-links a { color: var(--text-2); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-21, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .lib { position: static; max-height: 360px; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 50; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .mobile-bar { display: flex; }
  .content { padding: 18px 16px 60px; }
  .ph h1 { font-size: 34px; }
  .conv-layout { grid-template-columns: minmax(0, 1fr); }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 110px 1fr; }
  .ex-row .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .g-4, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .stat .val { font-size: 38px; }
  .search { max-width: none; }
  .ex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
