/* =========================================================
   Lukademy Studio — estilos
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --bg-softer: #fbfbfc;
  --bg-hover: #f1f1f3;
  --border: #ececef;
  --border-strong: #dcdce1;
  --text: #1d1d22;
  --text-2: #5b5b66;
  --text-3: #6b6b76;  /* 5.3:1 sobre blanco (antes 3.2:1) */
  --text-placeholder: #868691;
  --accent: #6844f8;  /* 5.6:1 sobre blanco, 4.9:1 sobre morado suave */
  --accent-hover: #5a36ea;
  --accent-soft: #f1edff;
  --accent-softer: #f8f6ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #15803d;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 40, .05);
  --shadow: 0 1px 3px rgba(20, 20, 40, .06), 0 4px 12px rgba(20, 20, 40, .04);
  --shadow-lg: 0 12px 40px rgba(20, 20, 40, .14), 0 2px 8px rgba(20, 20, 40, .06);
  --sidebar-w: 236px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
code, kbd {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(109, 74, 255, .3); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: var(--bg); border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: #e7e0ff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; flex: none;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-2); font-size: 16px;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn-sm { width: 26px; height: 26px; font-size: 14px; }
.icon-btn.placeholder { visibility: hidden; }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 500; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Formularios ---------- */

.input, .select, .textarea {
  width: 100%;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  transition: border-color .15s, box-shadow .15s;
}
.input, .select { height: 36px; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-placeholder); }
.select {
  appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238e8e99' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select-sm, .input-sm { height: 32px; font-size: 13px; padding-top: 4px; padding-bottom: 4px; }
.textarea { resize: vertical; line-height: 1.55; min-height: 60px; }

.form { display: grid; gap: 14px; }
.form-field { display: grid; gap: 5px; }
.form-field > span { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 30px; height: 18px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .2s; }
.switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(12px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.segmented { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; }
.segmented button { border: 0; background: transparent; padding: 4px 12px; border-radius: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.segmented button.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Badges y piezas ---------- */

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status-badge { color: var(--c); background: var(--soft); background: color-mix(in srgb, var(--c) 12%, white); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--text-3)); flex: none; }
.status-badge .dot { width: 7px; height: 7px; }

.plat {
  display: inline-grid; place-items: center; flex: none;
  min-width: 22px; height: 18px; padding: 0 4px; border-radius: 4px;
  background: var(--c); color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .02em;
}
.plat-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--bg-soft); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.tag-rec { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: var(--s, 22px); height: var(--s, 22px); border-radius: 50%;
  background: var(--c); color: #fff;
  font-size: calc(var(--s, 22px) * .42); font-weight: 600; letter-spacing: .02em;
}
.avatar-empty { --s: 26px; --c: var(--border-strong); color: var(--text-2); }
.owner { display: inline-flex; align-items: center; gap: 7px; }

.logo-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #8b6bff, #6d4aff); color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 2px 6px rgba(109, 74, 255, .35);
}

/* ---------- Arranque / login ---------- */

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .logo-mark { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .7; } }
.loading { padding: 48px; text-align: center; color: var(--text-3); }

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(circle at 15% 10%, #efeaff 0, transparent 40%),
    radial-gradient(circle at 90% 90%, #f4f0ff 0, transparent 45%),
    var(--bg-soft);
}
.login-card {
  width: 100%; max-width: 380px; display: grid; gap: 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px 28px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-brand .logo-mark { width: 42px; height: 42px; font-size: 21px; border-radius: 11px; }
.login-brand h1 { font-size: 19px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: -4px; }
.login-foot { text-align: center; }
.login .btn-block { height: 40px; }

/* ---------- Shell ---------- */

.shell { display: flex; height: 100vh; height: 100dvh; }

.sidebar {
  width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; gap: 14px;
  padding: 14px 10px; background: var(--bg-soft); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-weight: 700; font-size: 15px; }
.sidebar-new { margin: 4px 0; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--bg-hover); color: var(--text); }
.nav a.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
.nav a.active .nav-ico { filter: none; }
.nav-ico { width: 20px; text-align: center; font-size: 15px; }
.sidebar-foot { margin-top: auto; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 6px 6px 8px; border-radius: var(--radius-sm); }
.user-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 32px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-ico { font-size: 22px; }
.topbar h1 { font-size: 20px; }
.topbar-sub:empty { display: none; }
.topbar-new { display: none; }
.view { padding: 8px 32px 48px; max-width: 1480px; }
.bottom-nav { display: none; }

/* ---------- Bloques comunes ---------- */

.view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.view-intro { font-size: 13.5px; }
.section { margin-bottom: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 15px; }
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.empty { text-align: center; padding: 56px 16px; color: var(--text-2); }
.empty-ico { font-size: 34px; margin-bottom: 8px; }
.empty h3 { font-size: 16px; color: var(--text); margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }
.empty-inline { padding: 8px 0; }

.alert {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin-bottom: 20px; border-radius: var(--radius);
  background: var(--warn-soft); border: 1px solid #fde68a; color: #78350f; font-size: 13.5px;
}

/* ---------- Filtros ---------- */

.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search .input { padding-left: 32px; height: 34px; background: var(--bg-soft); border-color: var(--border); }
.search .input:focus { background: var(--bg); }
.search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-52%); color: var(--text-3); font-size: 16px; pointer-events: none; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .select { width: auto; max-width: 180px; }
.date-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.date-filter .input { width: 140px; }
.filter-toggle { display: none; }
.filter-count { color: var(--accent); font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; font-size: 12px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-rec { color: var(--text-3); }

/* ---------- Tarjetas y chips ---------- */

.card {
  position: relative; display: grid; gap: 6px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 11px 10px 13px; box-shadow: var(--shadow-sm);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.card::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card[data-kind="record"] { background: #fffaf5; border-style: dashed; }
.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 0; }
.card-top:empty { display: none; }
.card-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.card-hook { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.meta-date.overdue { color: var(--danger); font-weight: 500; }
.overdue { color: var(--danger); }

.chip {
  display: flex; align-items: center; gap: 5px; min-width: 0;
  height: 22px; padding: 0 6px 0 5px; border-radius: 5px;
  background: var(--bg); background: color-mix(in srgb, var(--c) 9%, white); border-left: 3px solid var(--c);
  font-size: 12px; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.chip:hover { background: color-mix(in srgb, var(--c) 16%, white); }
.chip .plat { min-width: 18px; height: 15px; font-size: 8.5px; padding: 0 3px; }
.chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chip-record { background: #fff; border-left-style: dashed; box-shadow: 0 0 0 1px var(--border) inset; color: var(--text-2); }
.chip-ico { font-size: 11px; }

.dragging { opacity: .35; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none;
  box-shadow: var(--shadow-lg); opacity: .95;
}
.drop-over { background: var(--accent-softer) !important; box-shadow: inset 0 0 0 2px var(--accent) !important; }

/* ---------- Dashboard ---------- */

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 24px; }
.hero h1 { font-size: 26px; letter-spacing: -.02em; }
.hero-date { margin-bottom: 2px; }
.hero-actions { display: flex; gap: 8px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: grid; gap: 2px; text-align: left; padding: 14px 16px;
  background: var(--soft, var(--bg)); border: 1px solid var(--border); border-radius: var(--radius-lg);
  position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tile::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--c); opacity: .8; }
.tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile-emoji { font-size: 14px; }
.tile-num { font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--text); line-height: 1.2; }
.tile-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.strip-day {
  display: grid; justify-items: center; gap: 2px; padding: 8px 4px;
  border: 1px solid var(--border); background: var(--bg-softer); border-radius: var(--radius);
}
.strip-day:hover { background: var(--bg-hover); }
.strip-day.today { border-color: var(--accent); background: var(--accent-softer); }
.strip-day.today .strip-num { color: var(--accent); }
.strip-name { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.strip-num { font-size: 16px; font-weight: 600; }
.strip-dots { display: flex; gap: 3px; align-items: center; min-height: 14px; }
.strip-dots .dot { width: 6px; height: 6px; }
.strip-rec { font-size: 10px; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 -10px;
  border-radius: var(--radius-sm); cursor: pointer; position: relative;
}
.list-row:hover { background: var(--bg-soft); }
.list-date { width: 84px; flex: none; display: grid; line-height: 1.3; }
.list-day { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.list-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.list-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { display: flex; align-items: center; gap: 6px; }
.list-sub:empty { display: none; }

.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mini-stat {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-softer); color: var(--text-2); font-size: 13px;
}
.mini-stat:hover { background: var(--bg-hover); }
.mini-stat strong { color: var(--text); font-size: 15px; }

/* ---------- Calendario ---------- */

.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav .icon-btn { font-size: 22px; line-height: 1; }
.cal-title { font-size: 18px; margin-left: 8px; min-width: 0; }
.cal-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.cal-month { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.cal-weekdays div { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day {
  min-height: 124px; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s; min-width: 0;
}
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: var(--bg-softer); }
.day.other { background: #fcfcfd; }
.day.other .day-num { color: var(--text-3); opacity: .6; }
.day-head { display: flex; align-items: center; gap: 4px; height: 24px; }
.day-num { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 500; color: var(--text-2); }
.day.today .day-num { background: var(--accent); color: #fff; font-weight: 600; }
.day-count { display: none; }
.day-add {
  margin-left: auto; width: 22px; height: 22px; border: 0; border-radius: 5px; background: transparent;
  color: var(--text-3); font-size: 16px; line-height: 1; opacity: 0; transition: opacity .12s;
}
.day:hover .day-add { opacity: 1; }
.day-add:hover { background: var(--accent-soft); color: var(--accent); }
.day-items { display: grid; gap: 3px; min-width: 0; }
.day-dots { display: none; }
.more { border: 0; background: none; text-align: left; font-size: 11.5px; color: var(--text-3); padding: 1px 4px; border-radius: 4px; font-weight: 500; }
.more:hover { background: var(--bg-hover); color: var(--text); }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-col {
  display: flex; flex-direction: column; gap: 8px; min-height: 420px; min-width: 0;
  padding: 8px; background: var(--bg-soft); border-radius: var(--radius-lg); border: 1px solid transparent; cursor: pointer;
}
.week-col.today { background: var(--accent-softer); border-color: #e0d8ff; }
.week-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 4px; }
.week-day { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.week-num { font-size: 18px; font-weight: 600; }
.week-col.today .week-num { color: var(--accent); }
.week-items { display: grid; gap: 8px; align-content: start; }
.week-items .card { cursor: grab; }
.week-add {
  margin-top: auto; border: 1px dashed var(--border-strong); background: transparent; border-radius: var(--radius-sm);
  height: 30px; font-size: 12.5px; color: var(--text-3);
}
.week-add:hover { color: var(--accent); border-color: var(--accent); background: var(--bg); }

.cal-agenda { display: none; }
.agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.agenda-head h3 { font-size: 15px; }
.agenda-list { display: grid; gap: 8px; }
.agenda-empty { padding: 12px 0; }

.unscheduled { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 14px; background: var(--bg-softer); }
.unscheduled summary { cursor: pointer; font-weight: 500; color: var(--text-2); font-size: 13.5px; }
.unscheduled-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.unscheduled-list .chip { max-width: 240px; cursor: grab; }

/* ---------- Tablero Kanban ---------- */

.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(236px, 1fr); gap: 12px;
  overflow-x: auto; padding-bottom: 12px; align-items: start;
  scroll-snap-type: x proximity;
}
.column {
  display: flex; flex-direction: column; gap: 10px; min-height: 200px; padding: 10px;
  background: var(--bg-soft); border-radius: var(--radius-lg); scroll-snap-align: start;
  transition: background .15s, box-shadow .15s;
}
.column-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 0 4px; }
.column-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.column-head h3 { font-size: 13.5px; }
.column-count { font-size: 12px; color: var(--text-3); font-weight: 500; }
.column-head .icon-btn { margin-left: auto; }
.column-items { display: grid; gap: 8px; }
.column-items .card { cursor: grab; }
.column-empty {
  padding: 18px 8px; text-align: center; font-size: 12.5px; color: var(--text-3);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
}

/* ---------- Tabla ---------- */

.result-count { margin-left: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 12px; background: var(--bg-soft); border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; cursor: pointer; user-select: none;
}
.table th:hover, .table th.sorted { color: var(--text); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--bg-softer); }
.td-title { font-weight: 500; white-space: normal !important; min-width: 220px; }
.table .plat-label { margin-left: 6px; }

/* ---------- Ideas ---------- */

.filters-always .select { max-width: 200px; }
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ideas-grid > .empty { grid-column: 1 / -1; }
.idea-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.idea-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.idea-card.scheduled { background: var(--bg-softer); }
.idea-card h4 { font-size: 15px; line-height: 1.35; }
.idea-desc { color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.idea-ref { font-size: 12.5px; color: var(--text-2); }
.idea-link { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea-link:hover { text-decoration: underline; }
.idea-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.idea-foot .btn .status-badge { height: 18px; padding: 0 6px; font-size: 11px; }

/* ---------- Resumen ---------- */

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { display: grid; gap: 2px; align-content: start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.kpi-num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi-warn { background: var(--warn-soft); border-color: #fde68a; }
.kpi-warn .kpi-num { color: var(--warn); }
.progress { display: block; height: 6px; border-radius: 99px; background: var(--bg-hover); overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.pipeline { display: flex; gap: 3px; height: 14px; border-radius: 99px; overflow: hidden; background: var(--bg-soft); }
.pipe-seg { background: var(--c); min-width: 6px; }
.pipe-empty { flex: 1; }
.pipeline-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.pipeline-legend strong { color: var(--text); }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 76px; align-items: center; gap: 10px; font-size: 13px; }
.bar-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--c); border-radius: 99px; min-width: 4px; transition: width .4s ease; }
.bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-value .muted { font-weight: 400; font-size: 12px; }

.owner-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.owner-list li { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr 44px; align-items: center; gap: 12px; font-size: 13px; }
.owner-list .progress { margin: 0; }
.owner-list .small { text-align: right; }

/* ---------- Configuración ---------- */

.settings { max-width: 760px; }
.account { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.team-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 14px; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; }
.team-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.catalog { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; font-size: 13px; color: var(--text-2); }
.catalog h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 6px; }
.catalog p { padding: 2px 0; }
.shortcuts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-size: 13px; color: var(--text-2); }

/* ---------- Modales ---------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 24px; overflow-y: auto;
  background: rgba(24, 22, 40, .45); opacity: 0; transition: opacity .18s;
}
.modal-overlay.show { opacity: 1; }
.modal {
  width: 100%; background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(.99); transition: transform .18s; margin-bottom: auto;
}
.modal-overlay.show .modal { transform: none; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 820px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 4px; }
.modal-header h2 { font-size: 17px; }
.modal-body { padding: 14px 20px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.confirm-msg { color: var(--text-2); }
.modal-body > .list { margin-top: 10px; }

/* Editor de contenido */
.modal-editor .modal-body { padding: 0; }
.editor { display: flex; flex-direction: column; }
.editor-head { position: relative; padding: 28px 36px 6px; }
.editor-status-bar { position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--c); border-radius: var(--radius-lg) var(--radius-lg) 0 0; transition: background .2s; }
.editor-close { position: absolute; top: 14px; right: 14px; }
.editor-head .editor-title { padding-right: 24px; }
.editor-title {
  width: 100%; border: 0; resize: none; overflow: hidden; padding: 0; background: transparent;
  font: inherit; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; color: var(--text);
}
.editor-title:focus { outline: none; }
.editor-title::placeholder { color: #c8c8d0; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.props { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 24px; padding: 12px 36px 16px; border-bottom: 1px solid var(--border); }
.prop { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 8px; min-height: 40px; }
.prop-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.prop-label span { width: 16px; text-align: center; font-size: 13px; }
.prop-value { min-width: 0; }
.prop-value .input, .prop-value .select { border-color: transparent; background-color: transparent; height: 34px; }
.prop-value .input:hover, .prop-value .select:hover { background-color: var(--bg-soft); }
.prop-value .input:focus, .prop-value .select:focus { background-color: var(--bg); border-color: var(--accent); }
.inline { display: flex; gap: 6px; }
.input-time { width: 104px; flex: none; }

.editor-sections { display: grid; gap: 18px; padding: 20px 36px 8px; }
.ed-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.ed-section .textarea { background: var(--bg-softer); border-color: var(--border); }
.ed-section .textarea:focus { background: var(--bg); }
.textarea-script { min-height: 180px; font-size: 14.5px; }
.links { display: grid; gap: 6px; margin-bottom: 8px; }
.link-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) 32px 32px; gap: 6px; align-items: center; }
.link-row .input { height: 34px; }
.link-row a.icon-btn { text-decoration: none; }

.editor-foot {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 36px; margin-top: 16px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px);
  border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.hint { font-size: 12px; color: var(--text-3); }

/* ---------- Toasts ---------- */

#toast-root { position: fixed; z-index: 300; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  padding: 10px 16px; border-radius: var(--radius); background: #1d1d22; color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-success { background: #14532d; }
.toast-error { background: #991b1b; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 72px; }
  .sidebar { align-items: center; padding: 14px 8px; }
  .brand span, .nav a span:not(.nav-ico), .user-name, .sidebar-new { display: none; }
  .brand { padding: 4px 0; }
  .nav a { justify-content: center; padding: 0; width: 44px; height: 40px; }
  .nav-ico { font-size: 18px; }
  .user-chip { flex-direction: column; padding: 0; }
  .topbar-new { display: inline-flex; }
  .view, .topbar { padding-left: 24px; padding-right: 24px; }
  .week-grid { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(170px, 1fr); overflow-x: auto; padding-bottom: 8px; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .shell { flex-direction: column; }
  .sidebar { display: none; }
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 18px; }
  .topbar-new span { display: none; }
  .topbar-new { width: 38px; padding: 0; font-size: 20px; border-radius: 50%; }
  .view { padding: 4px 16px 32px; }

  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-template-columns: repeat(6, 1fr);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  }
  .bottom-nav a { display: grid; justify-items: center; gap: 1px; padding: 6px 0; color: var(--text-3); font-size: 10.5px; font-weight: 500; border-radius: 8px; }
  .bottom-nav a .nav-ico { font-size: 19px; width: auto; filter: grayscale(.6); opacity: .8; }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav a.active .nav-ico { filter: none; opacity: 1; }

  .hero h1 { font-size: 21px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 12px 14px; }
  .tile-num { font-size: 24px; }
  .week-strip { gap: 4px; }
  .strip-day { padding: 6px 2px; }
  .mini-stats { grid-template-columns: 1fr; }
  .list-date { width: 64px; }
  .list-row .status-badge { display: none; }

  /* Filtros plegables */
  .filterbar { gap: 8px; }
  .search { max-width: none; flex: 1 1 0; }
  .filter-toggle { display: inline-flex; }
  .filters:not(.filters-always) { display: none; width: 100%; }
  .filterbar.open .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters .select { max-width: none; width: 100%; }
  .filters-always { width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .filters-always .select { max-width: none; }
  .date-filter { display: grid; gap: 2px; }
  .date-filter .input { width: 100%; }

  /* Calendario compacto: puntos + agenda del día seleccionado */
  .cal-toolbar { gap: 10px; }
  .cal-title { font-size: 16px; }
  .cal-actions { width: 100%; justify-content: space-between; }
  .legend { display: none; }
  .day { min-height: 54px; padding: 4px 2px; align-items: center; gap: 2px; }
  .day-head { justify-content: center; height: 26px; }
  .day-num { width: 26px; height: 26px; }
  .day.selected:not(.today) .day-num { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .day-add, .day-items { display: none; }
  .day-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
  .day-dots .dot { width: 5px; height: 5px; }
  .day-dots .dot-rec { background: transparent; box-shadow: inset 0 0 0 1.2px var(--c); }
  .cal-weekdays div { padding: 6px 0; text-align: center; font-size: 11px; }
  .cal-agenda { display: block; margin-top: 16px; }

  .week-grid { display: grid; grid-auto-flow: row; grid-template-columns: 1fr; overflow: visible; }
  .week-col { min-height: 0; }
  .week-col.past:not(.today) { opacity: .85; }

  .board { grid-auto-columns: 82vw; margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 16px; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:last-child { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: 80px 1fr 64px; }
  .catalog, .shortcuts { grid-template-columns: 1fr; }
  .team-form { grid-template-columns: 1fr; }

  /* Modal a pantalla completa en móvil */
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal { max-width: none !important; border-radius: 0; min-height: 100%; }
  .modal-sm { min-height: 0; margin: auto 12px; border-radius: var(--radius-lg); align-self: center; }
  .editor-head { padding: 24px 16px 4px; }
  .editor-status-bar { border-radius: 0; }
  .editor-title { font-size: 22px; }
  .props { grid-template-columns: 1fr; padding: 8px 16px 12px; }
  .prop { grid-template-columns: 112px 1fr; }
  .editor-sections { padding: 16px 16px 8px; }
  .editor-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .hint, .editor-cancel { display: none; }
  .editor-close { top: 10px; right: 8px; }
  .link-row { grid-template-columns: 1fr 32px 32px; }
  .link-row .input:first-child { grid-column: 1 / -1; }
  .form-row { grid-template-columns: 1fr; }
  #toast-root { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (hover: none) {
  .day-add { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Ficha: plataformas, cuenta y preparación ---------- */

.plats { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.plats .plat-label { margin-left: 2px; }
.card-account { font-size: 12px; color: var(--accent); font-weight: 500; margin-top: -2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.prop-wide { grid-column: 1 / -1; }
.platform-checks { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.check-pill {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px 0 9px; border: 1px solid var(--border-strong); border-radius: 99px;
  font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.check-pill:hover { background: var(--bg-soft); }
.check-pill input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--border-strong); background: var(--bg); transition: background .15s, border-color .15s;
}
.check-pill input:checked + .check-box { background: var(--c); border-color: var(--c); }
.check-pill input:checked + .check-box::after {
  content: ''; width: 4px; height: 8px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check-pill:has(input:checked) { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 7%, white); }
.check-pill:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.prep {
  display: grid; gap: 12px; padding: 16px 18px; margin-bottom: 2px;
  border: 1px solid #e4dcff; border-radius: var(--radius-lg); background: var(--accent-softer);
}
.prep-title { font-size: 14px; color: var(--text); }
.prep-field { display: grid; gap: 5px; min-width: 0; }
.prep-field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.prep-row { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 12px; }
.prep-row-2 { grid-template-columns: 1fr 1fr; }
.prep .input, .prep .textarea { background: var(--bg); border-color: #e4dcff; }

@media (max-width: 760px) {
  .prep { padding: 14px; }
  .prep-row, .prep-row-2 { grid-template-columns: 1fr; }
  .prop-wide { grid-template-columns: 1fr; gap: 2px; padding: 4px 0; }
}

/* ---------- Desplegable de cuentas con casillas ---------- */

.multi { position: relative; }
.multi-trigger {
  width: 100%; min-height: 36px; display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; text-align: left; background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-sm);
}
.multi-trigger:hover { background: var(--bg-soft); }
.multi.open .multi-trigger, .multi-trigger:focus-visible { background: var(--bg); border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.multi-value { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.multi-placeholder { color: var(--text-3); }
.multi-chev { color: var(--text-3); font-size: 15px; line-height: 1; margin-top: -4px; transition: transform .15s; }
.multi.open .multi-chev { transform: rotate(180deg); margin-top: 4px; }
.account-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 500;
}
.multi-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: min(320px, 100%);
  display: grid; gap: 1px; padding: 6px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.multi-option {
  position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm); font-size: 13.5px; cursor: pointer; user-select: none;
}
.multi-option:hover { background: var(--bg-soft); }
.multi-option input { position: absolute; opacity: 0; pointer-events: none; }
.multi-option input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.multi-option input:checked + .check-box::after {
  content: ''; width: 4px; height: 8px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.multi-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- Horas de grabación ---------- */

.chip-time { flex: none; font-size: 11px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tag-time { background: var(--accent-soft); border-color: #e0d8ff; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.slot { display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: start; }
.slot-time {
  display: grid; justify-items: center; gap: 2px; padding: 8px 4px; margin-top: 2px;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--accent);
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2;
}
.slot-time.none { background: var(--bg-soft); color: var(--text-3); font-size: 12px; font-weight: 500; }
.slot-n { font-size: 10.5px; font-weight: 600; opacity: .7; text-transform: uppercase; letter-spacing: .04em; }
.slot-n::before { content: '#'; }

/* Selector de hora 12 h */
.time12 { display: flex; align-items: center; gap: 4px; }
.time12 .select { width: auto; flex: 1; min-width: 0; padding-left: 8px; padding-right: 22px; background-position: right 7px center; }
.time12-sep { font-weight: 600; color: var(--text-3); }
.prep-row { grid-template-columns: 1fr 210px 1fr; }
.prep-row.prep-row-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .prep-row, .prep-row.prep-row-2 { grid-template-columns: 1fr; } }

/* ---------- Plantillas y login ---------- */

.template-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.template-bar .select { width: auto; min-width: 220px; max-width: 100%; background-color: var(--accent-softer); border-color: #e0d8ff; }
.template-hint { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.team-list li > div { min-width: 0; }

.remember { position: relative; display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.remember input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.remember input:checked + .check-box::after {
  content: ''; width: 4px; height: 8px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.remember:has(input:focus-visible) .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =========================================================
   Revisión de usabilidad y accesibilidad
   ========================================================= */

/* Saltar al contenido (teclado / lectores de pantalla) */
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 400;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 600; transition: top .15s;
}
.skip-link:focus { top: 12px; }
#view:focus { outline: none; }

/* Respuesta táctil inmediata y sin retraso de 300 ms */
button, a, .chip, .card, .idea-card, .tile, .check-pill, .multi-option, select { touch-action: manipulation; }
.btn:active:not(:disabled), .icon-btn:active, .tile:active, .mini-stat:active { transform: scale(.97); }
.btn, .icon-btn { transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; }
.btn:disabled { cursor: not-allowed; }

/* Encabezados de tabla ordenables, accesibles con teclado */
.th-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: pointer;
}
.table th { cursor: default; }

/* Mostrar / ocultar contraseña */
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 84px; }
.password-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  height: 30px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent;
  color: var(--accent); font-size: 12.5px; font-weight: 600;
}
.password-toggle:hover { background: var(--accent-soft); }

/* Pantallas táctiles: zonas de toque de al menos 44 px */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn-sm { width: 40px; height: 40px; }
  .input, .select { min-height: 44px; }
  .segmented button { min-height: 38px; padding: 6px 14px; }
  .check-pill { height: 40px; }
  .multi-option { height: 44px; }
  .day-add { width: 32px; height: 32px; }
  .password-toggle { height: 38px; }
  .remember { min-height: 40px; }
  .topbar-new { width: 44px; height: 44px; }
}

/* Móvil: texto de formularios a 16 px para que iOS no haga zoom al escribir */
@media (max-width: 760px) {
  .input, .select, .textarea { font-size: 16px; }
  .muted.small, .small { font-size: 13px; }
}
