/* Bitácora — estilos
   Para cambiar los colores de la marca, edita solo el bloque "MARCA". */

:root {
  /* ===== MARCA — tomada del logo (cian #00AFD7) ===== */
  --cyan: #00AFD7;           /* color del logo */
  --cyan-hover: #0BA0C4;
  --brand: #0B2535;          /* barra lateral: azul marino */
  --brand-2: #14364A;        /* hover en la barra */
  --brand-ink: #E8F5F9;      /* texto sobre la barra */
  --brand-muted: #8FB0BE;    /* texto secundario en la barra */
  --accent: #007C9C;         /* enlaces y detalles (cian oscuro, legible) */
  --accent-strong: #006A86;
  --accent-ink: #ffffff;
  --accent-soft: #E0F4F9;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;

  /* ===== Base ===== */
  --canvas: #F3F6F7;
  --surface: #ffffff;
  --ink: #11232D;
  --muted: #5E6E75;
  --line: #DCE2E5;
  --line-soft: #EBEFF1;

  --pending: #9A6A12; --pending-bg: #FBF1DC;
  --done: #2F7D4F;    --done-bg: #E1F1E6;
  --danger: #B4382A;  --danger-bg: #FBE7E4;

  --prio-alta: #D63A2B; --prio-media: #EDB21B; --prio-baja: #ffffff; --prio-ring: #B4BEC2;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(21, 35, 42, .06), 0 4px 14px rgba(21, 35, 42, .05);
  --side-w: 268px;

  /* compatibilidad con nombres anteriores */
  --paper: var(--canvas);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #071A26; --brand-2: #102D3E; --brand-ink: #E3F1F6; --brand-muted: #7FA0AE;
    --accent: #3CC6E6; --accent-strong: #6AD5EE; --accent-ink: #062126; --accent-soft: #10303C;
    --canvas: #0F171A; --surface: #162126; --ink: #E4ECEE; --muted: #8FA2A8; --line: #263840; --line-soft: #1D2C32;
    --pending: #E2B35A; --pending-bg: #33280F; --done: #6FCB8F; --done-bg: #16301F; --danger: #EE8A7B; --danger-bg: #3A1E19;
    --prio-alta: #F05A49; --prio-media: #F2C33E; --prio-baja: #F2F4F5; --prio-ring: #5D7178;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --brand: #071A26; --brand-2: #102D3E; --brand-ink: #E3F1F6; --brand-muted: #7FA0AE;
  --accent: #3CC6E6; --accent-strong: #6AD5EE; --accent-ink: #062126; --accent-soft: #10303C;
  --canvas: #0F171A; --surface: #162126; --ink: #E4ECEE; --muted: #8FA2A8; --line: #263840; --line-soft: #1D2C32;
  --pending: #E2B35A; --pending-bg: #33280F; --done: #6FCB8F; --done-bg: #16301F; --danger: #EE8A7B; --danger-bg: #3A1E19;
  --prio-alta: #F05A49; --prio-media: #F2C33E; --prio-baja: #F2F4F5; --prio-ring: #5D7178;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas); color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.5; font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.page-title, .auth-brand-title, .auth-card h1, .side-brand-name, .modal h2, .general-card .project-name, .empty h2 {
  font-family: var(--serif); font-weight: 700; letter-spacing: -0.005em;
}
a { color: var(--accent); }
button { font-family: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
#app { min-height: 100vh; }

/* ---------- Marca ---------- */
.brand-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; }
.brand-mark img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.brand-sm { width: 34px; height: 34px; }
.brand-lg { width: 96px; height: 96px; }
.brand-fallback { background: var(--accent); color: var(--accent-ink); border-radius: 9px; font-weight: 800; }
.brand-sm.brand-fallback { font-size: 18px; }
.brand-lg.brand-fallback { font-size: 50px; border-radius: 22px; }

/* ---------- Acceso (login, registro, primer arranque) ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; }
.auth-brand {
  background: var(--brand); color: var(--brand-ink);
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: 56px clamp(32px, 6vw, 88px);
}
.auth-brand-title { font-size: clamp(44px, 5vw, 68px); line-height: 1; }
.auth-brand .brand-lg { width: 120px; height: 120px; margin-bottom: 8px; }
.auth-brand-text { margin: 0; max-width: 30ch; font-size: 17px; color: var(--brand-muted); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 32px; margin-bottom: 6px; }
.auth-eyebrow { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 14.5px; margin: 0 0 26px; }
.auth-switch { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ---------- Formularios ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea, .select, .link-input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px;
}
.field input:focus, .select:focus, .link-input:focus, .comment-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 13px; color: var(--danger); background: var(--danger-bg); padding: 8px 10px; border-radius: 7px; margin: -4px 0 14px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 86px; }
.pass-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--accent);
  font-size: 13px; font-weight: 700; padding: 6px 9px; border-radius: 6px;
}
.pass-toggle:hover { background: var(--accent-soft); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin: 0 0 14px; cursor: pointer; }
.check-row input { margin-top: 3px; accent-color: var(--accent); }
.check-row strong { color: var(--ink); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 10px 16px;
  font-size: 14.5px; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--cyan); color: var(--brand); width: 100%; }
.btn-primary:hover:not(:disabled) { background: var(--cyan-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--surface); border-color: var(--line); color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-bg); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-text { background: none; border: none; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; padding: 2px 0; }
.newbtn { width: auto; white-space: nowrap; }

/* ---------- Estructura con barra lateral ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--brand); color: var(--brand-ink);
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; }
.side-brand-name { font-size: 23px; }
.side-brand .brand-sm { width: 38px; height: 38px; }
.side-scroll { flex: 1 1 auto; overflow-y: auto; padding: 4px 12px 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  color: var(--brand-ink); font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 9px 10px; text-align: left;
}
.nav-item:hover { background: var(--brand-2); }
.nav-item { position: relative; }
.nav-item.active { background: var(--brand-2); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--cyan);
}
.nav-item.active .nav-icon { color: var(--cyan); opacity: 1; }
.nav-item.active .nav-count { background: var(--cyan); color: var(--brand); }
.nav-icon { width: 20px; text-align: center; opacity: .75; flex: 0 0 auto; font-size: 14px; }
.nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  flex: 0 0 auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center;
  background: var(--brand-2); color: var(--brand-ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.nav-alert { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--prio-alta); box-shadow: 0 0 0 2px var(--brand); }
.nav-general { margin-top: 2px; }
.nav-section {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 10px 6px; font-size: 12.5px; font-weight: 700; color: var(--brand-muted);
}
.nav-add {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--brand-2);
  background: none; color: var(--brand-ink); font-size: 17px; line-height: 1; cursor: pointer;
}
.nav-add:hover { background: var(--brand-2); }
.nav-empty { margin: 4px 10px; font-size: 13px; color: var(--brand-muted); }
.side-foot { border-top: 1px solid var(--brand-2); padding: 12px 12px 16px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 10px 6px; }
.me-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-2); color: var(--brand-ink); font-size: 13px; font-weight: 800;
}
.me-text { min-width: 0; }
.me-name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 12px; color: var(--brand-muted); }
.me-actions { display: flex; gap: 14px; padding: 2px 10px 0 54px; }
.side-link { background: none; border: none; padding: 0; cursor: pointer; color: var(--brand-muted); font: inherit; font-size: 12.5px; font-weight: 600; }
.side-link:hover, .side-link.active { color: var(--brand-ink); text-decoration: underline; }

.main { min-width: 0; }
.container { max-width: 900px; padding: 36px clamp(20px, 4vw, 48px) 64px; }
.mobile-bar { display: none; }
.scrim { display: none; }

/* ---------- Encabezados de página ---------- */
.page-title { font-size: 36px; line-height: 1.1; }
.page-sub { font-size: 14.5px; color: var(--muted); margin-top: 6px; max-width: 64ch; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.toolbar-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.menu-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted);
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip .mono { opacity: .7; margin-left: 2px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 22px 0 20px; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 700; color: var(--muted); padding: 8px 0; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--cyan); }

/* ---------- Inicio: tarjetas de proyectos ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 26px; }
.project-card {
  text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
}
.project-card:hover { border-color: var(--accent); }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.project-name { font-size: 16.5px; font-weight: 800; line-height: 1.3; }
.project-stats { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat-pend { color: var(--ink); font-weight: 700; }
.stat-alta { color: var(--prio-alta); font-weight: 700; }
.project-meta { font-size: 12.5px; color: var(--muted); }
.general-card {
  grid-column: 1 / -1; background: var(--brand); color: var(--brand-ink); border-color: var(--brand);
  padding: 20px 22px;
}
.general-card:hover { border-color: var(--accent); background: var(--brand-2); }
.general-card .project-name { font-size: 24px; }
.general-card { background-image: radial-gradient(circle at 100% 0, rgba(0,175,215,.22), transparent 55%); }
.general-card .project-stats, .general-card .project-meta { color: var(--brand-muted); }
.general-card .stat-pend { color: var(--brand-ink); }
.tag-role {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.tag-role.role-gerente { background: var(--pending-bg); color: var(--pending); }
.tag-role.role-director { background: var(--line-soft); color: var(--muted); }
.general-card .tag-role { background: var(--brand-2); color: var(--brand-ink); }

/* ---------- Lista de pendientes ---------- */
.ledger { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--line-soft); }
.row:first-child { border-top: none; }
.row-check { flex: 0 0 auto; padding-top: 1px; }
.palomita {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--prio-ring);
  background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 13px; font-weight: 800; padding: 0;
}
.palomita:hover { border-color: var(--done); }
.palomita.done { background: var(--done); border-color: var(--done); color: #fff; }
.palomita:disabled { cursor: default; }
.status-pill { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status-pill.pending { background: var(--pending-bg); color: var(--pending); }
.status-pill.done { background: var(--done-bg); color: var(--done); }
.row-body { flex: 1 1 auto; min-width: 0; }
.row-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 3px; }
.row-title { flex: 1 1 auto; min-width: 0; font-size: 15.5px; font-weight: 700; overflow-wrap: anywhere; }
.row-title.is-done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); font-weight: 600; }
.row-meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.row-actions { margin-top: 8px; }
.comments-toggle { background: none; border: none; padding: 0; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--accent); }
.comments-toggle:hover { text-decoration: underline; }

/* Importancia */
.prio-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--prio-ring); flex: 0 0 auto; padding: 0; }
.prio-dot.prio-alta { background: var(--prio-alta); border-color: var(--prio-alta); }
.prio-dot.prio-media { background: var(--prio-media); border-color: var(--prio-media); }
.prio-dot.prio-baja { background: var(--prio-baja); }
.prio-lg { width: 20px; height: 20px; margin-top: 1px; }
.prio-btn { cursor: pointer; }
.prio-btn:hover { box-shadow: 0 0 0 4px var(--accent-soft); }
.prio-btn:disabled { opacity: .5; cursor: default; }
.prio-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.prio-option {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 8px 15px; font: inherit; font-size: 14px; font-weight: 700;
}
.prio-option.selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.prio-menu {
  position: fixed; z-index: 60; min-width: 176px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(21, 35, 42, .16);
}
.prio-menu-title { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 6px 10px 4px; }
.prio-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; border-radius: 7px;
  cursor: pointer; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink); padding: 9px 10px; text-align: left;
}
.prio-menu-item:hover, .prio-menu-item:focus-visible { background: var(--line-soft); outline: none; }
.prio-menu-item.selected { font-weight: 800; }
.prio-check { margin-left: auto; color: var(--accent); }

/* Comentarios */
.comments { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.comment { font-size: 14px; }
.comment-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 2px; }
.comment-author { font-weight: 700; font-size: 13.5px; }
.comment-time { font-size: 12px; color: var(--muted); }
.comment-text { overflow-wrap: anywhere; }
.comment-attachment, .comment-link {
  display: inline-block; max-width: 100%; margin-top: 6px; padding: 7px 11px;
  background: var(--canvas); border: 1px solid var(--line); border-radius: 8px;
  font-size: 13.5px; font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; line-height: 1.45;
}
.comment-link { color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comment-attachment:hover, .comment-link:hover { border-color: var(--accent); }
.comment-attachment .size { font-weight: 500; color: var(--muted); white-space: nowrap; }
.attach-links { display: inline-flex; gap: 12px; margin-left: 8px; font-size: 13px; }
.mini-del { background: none; border: none; cursor: pointer; color: var(--muted); font: inherit; font-size: 12.5px; padding: 0 0 0 4px; }
.mini-del:hover { color: var(--danger); }
.comment-form-row { display: flex; flex-direction: column; gap: 8px; }
.comment-form { display: flex; gap: 8px; }
.comment-form input {
  flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
}
.comment-form button {
  padding: 9px 15px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--cyan); color: var(--brand); font: inherit; font-weight: 700; font-size: 13.5px;
}
.comment-form button:disabled { opacity: .5; }
.attach-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attach-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: none; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 11px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
}
.attach-btn:hover { border-color: var(--accent); color: var(--accent); }
.attach-pending {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow-wrap: anywhere;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; padding: 5px 8px 5px 11px; border-radius: 999px;
}
.attach-pending button { background: none; border: none; color: inherit; cursor: pointer; font-size: 14px; padding: 0 2px; }
.link-input { font-size: 14px; padding: 9px 11px; }
.progress { font-size: 12.5px; color: var(--muted); }
.progress-bar { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.progress-bar > div { height: 100%; width: 0; background: var(--accent); transition: width .15s ease; }

/* Vacío */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h2 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: 14.5px; margin: 0; }

/* ---------- Tarjetas y panel ---------- */
.panel { display: flex; flex-direction: column; gap: 18px; margin-top: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card.narrow { max-width: 460px; margin-top: 20px; }
.card h2 { font-size: 17px; margin-bottom: 4px; }
.card .sub, .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.invite { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.invite-code {
  font-size: 22px; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums;
  background: var(--brand); color: var(--cyan); padding: 6px 14px; border-radius: 8px;
}
.meter { height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; background: var(--accent); }
.meter.warn > div { background: var(--prio-media); }
.meter.full > div { background: var(--prio-alta); }
.meter-label { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.user-row:first-child { border-top: none; }
.user-name { font-weight: 700; font-size: 14.5px; }
.user-sub { font-size: 12.5px; color: var(--muted); }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.add-member { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.add-member .select { width: auto; flex: 0 1 auto; }
.add-member .select:first-child { flex: 1 1 220px; }
.add-member .btn { width: auto; }
.temp-pass { font-size: 20px; font-weight: 800; letter-spacing: .06em; background: var(--accent-soft); color: var(--accent); padding: 8px 12px; border-radius: 8px; display: inline-block; margin: 8px 0; }
.notice { background: var(--pending-bg); color: var(--pending); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }

/* ---------- Ventanas ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 22, 27, .5);
  display: flex; align-items: flex-start; justify-content: center; padding: 11vh 16px 16px;
}
.modal { width: 100%; max-width: 460px; background: var(--surface); border-radius: 14px; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal h2 { font-size: 19px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

/* ---------- Celular ---------- */
@media (max-width: 899px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 36px 24px 30px; gap: 12px; }
  .auth-brand .brand-lg { width: 56px; height: 56px; }
  .auth-brand .brand-lg.brand-fallback { font-size: 30px; border-radius: 14px; }
  .auth-brand-title { font-size: 34px; }
  .auth-brand-text { font-size: 15px; }
  .auth-main { align-items: flex-start; padding: 28px 20px 40px; }

  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(86vw, 300px);
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(10, 22, 27, .5); }
  .mobile-bar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; background: var(--brand); color: var(--brand-ink);
  }
  .mobile-bar .brand-sm { width: 28px; height: 28px; }
  .mobile-title { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-toggle {
    width: 38px; height: 38px; flex: 0 0 auto; border: none; border-radius: 8px; background: var(--brand-2);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  }
  .menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--brand-ink); }
  .container { padding: 22px 16px 56px; }
  .page-title { font-size: 28px; }
  .row { padding: 14px; gap: 12px; }
  .newbtn { width: 100%; }
  .toolbar-row { align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* Conteo en tarjetas de proyecto */
.project-count { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; font-weight: 600; }
.count-big { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1; }
.project-count .stat-alta { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--danger-bg); font-size: 12.5px; }
.project-card .project-meta { margin-top: 2px; }
