/* ==========================================================================
   Masters · Componentes del área de cliente y del panel de gestión
   Se apoya en styles.css (tokens, botones, contenedores). Geometría recta,
   alto contraste y acento por división (var(--accent...)).
   ========================================================================== */

/* --- Mensajes flash ------------------------------------------------------ */
.flash {
  padding: 12px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-left-width: 4px;
  background: var(--surface-2);
  font-size: 14.5px;
}
.flash-ok    { border-left-color: #1f9d55; background: rgba(31, 157, 85, 0.07); }
.flash-error { border-left-color: #d92b1f; background: rgba(217, 43, 31, 0.06); }
.flash-info  { border-left-color: var(--accent); background: var(--accent-soft); }

/* --- Barra superior: nombre de usuario ----------------------------------- */
.topbar-user {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13.5px;
  padding-right: 4px;
}

/* --- Encabezado de sección ----------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.section-head h1 { margin: 0 0 4px; }
.section-head .muted { margin: 0; }

/* --- Rejilla de proyectos ------------------------------------------------ */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.proj-card {
  display: block;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.proj-card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.proj-card .division {
  font-family: var(--font-head);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-text);
  font-weight: 600;
}
.proj-card h3 { margin: 6px 0 2px; font-size: 19px; }
.proj-card .code { color: var(--muted); font-size: 13px; }

/* --- Tarjeta de plan contratado ------------------------------------------ */
.plan-card { display: flex; flex-direction: column; }
.plan-card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.plan-card-kicker > strong {
  font-family: var(--font-head);
  font-size: 15px;
  white-space: nowrap;
}
.plan-card-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.plan-team {
  --team-color: var(--c-web);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 6px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--team-color);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.plan-team img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.plan-team.team-site   { --team-color: var(--c-site); }
.plan-team.team-design { --team-color: var(--c-design); }
.plan-team.team-wp     { --team-color: var(--c-wp); }
.plan-team.team-host   { --team-color: var(--c-host); }
.plan-card-result {
  margin: 14px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}
.plan-card .progress { margin-top: auto; }

/* --- Barra de progreso --------------------------------------------------- */
.progress {
  position: relative;
  height: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  margin: 16px 0 8px;
  overflow: hidden;
}
.progress > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  width: 0;
  transition: width .4s ease;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.progress-row strong { color: var(--accent-text); }

/* --- Chips de estado ----------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-head);
  letter-spacing: .02em;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.badge.is-nuevo      { border-color: var(--accent-line); color: var(--accent-text); background: var(--accent-soft); }
.badge.is-en_proceso { border-color: #d9a62e; color: #a67715; background: rgba(217,166,46,.12); }
.badge.is-completado { border-color: #1f9d55; color: #157347; background: rgba(31,157,85,.10); }
.badge.is-cancelado  { border-color: var(--line-strong); color: var(--muted); }

/* --- Detalle de proyecto ------------------------------------------------- */
.proj-detail-head {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.proj-detail-head .division {
  font-family: var(--font-head);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-text); font-weight: 600;
}
.proj-detail-head h1 { margin: 6px 0 10px; }
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.meta-row .meta-item .k {
  display: block; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.meta-row .meta-item .v { font-weight: 600; }

/* --- Alcance del plan en el detalle de cliente --------------------------- */
.client-plan {
  margin-bottom: 28px;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.client-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}
.plan-eyebrow,
.client-plan-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.client-plan-head h2 {
  margin: 4px 0 6px;
  font-size: 21px;
}
.client-plan-head p {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.client-plan-total {
  flex: 0 0 auto;
  text-align: right;
}
.client-plan-total span,
.client-plan-total strong,
.client-plan-total small { display: block; }
.client-plan-total span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.client-plan-total strong {
  margin: 2px 0;
  font-family: var(--font-head);
  font-size: 24px;
  letter-spacing: -.03em;
}
.client-plan-total small {
  color: var(--muted);
  font-size: 11px;
}
.client-plan-teams {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
}
.client-plan-teams .plan-card-teams { margin-top: 0; }
.client-plan-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
}
.client-plan-results,
.client-plan-services {
  min-width: 0;
  padding: 22px 26px 24px;
}
.client-plan-results {
  border-right: 1px solid var(--line);
}
.client-plan-results ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.client-plan-results li {
  position: relative;
  padding-left: 22px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.client-plan-results li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #157347;
  font-weight: 700;
}
.client-plan-results p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}
.client-plan-service {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.client-plan-service:last-child { border-bottom: 0; padding-bottom: 0; }
.client-plan-service > div { min-width: 0; }
.client-plan-service strong {
  font-family: var(--font-head);
  font-size: 12.5px;
}
.client-plan-service > strong { white-space: nowrap; }
.client-plan-service span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 760px) {
  .client-plan-head {
    flex-direction: column;
  }
  .client-plan-total { text-align: left; }
  .client-plan-teams {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .client-plan-grid { grid-template-columns: 1fr; }
  .client-plan-results {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .plan-card-kicker { align-items: flex-start; }
  .plan-team { font-size: 10px; }
  .client-plan-head,
  .client-plan-teams,
  .client-plan-results,
  .client-plan-services {
    padding-right: 18px;
    padding-left: 18px;
  }
}

/* --- Rejilla de dos columnas del detalle --------------------------------- */
.detail-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 26px;
  align-items: start;
}
@media (max-width: 860px) { .detail-cols { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}
.card h2 { font-size: 17px; margin: 0 0 16px; }

/* --- Timeline de fases --------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item {
  position: relative;
  padding: 0 0 20px 28px;
  border-left: 2px solid var(--line);
}
.tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -8px; top: 2px;
  width: 14px; height: 14px;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  border-radius: 50%;
}
.tl-item.done::before   { background: var(--accent); border-color: var(--accent); }
.tl-item.doing::before  { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-item .tl-title { font-weight: 600; }
.tl-item .tl-title .badge { margin-left: 8px; transform: translateY(-1px); }
.tl-item .tl-desc { color: var(--text-2); font-size: 14.5px; margin: 3px 0 0; }
.tl-item .tl-date { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* --- Timeline de avances (updates) --------------------------------------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed .when { color: var(--muted); font-size: 12.5px; }
.feed .body { margin-top: 3px; }

/* --- Bloque "sin contenido" y notas -------------------------------------- */
.empty {
  border: 1px dashed var(--line-strong);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
}

/* --- Tarjeta de acceso (login / establecer contraseña) ------------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--bg-soft);
}
.auth-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 34px 32px;
}
.auth-box .brand-mark { height: 30px; margin-bottom: 22px; }
.auth-box h1 { font-size: 22px; margin: 0 0 6px; }
.auth-box p.sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.auth-box label { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; }
.auth-box input[type=email],
.auth-box input[type=password],
.auth-box input[type=text] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font: inherit;
  color: var(--text);
}
.auth-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-box .btn { width: 100%; margin-top: 20px; }
.auth-box .auth-back { margin-top: 10px; }
.auth-err {
  color: #b21f16;
  font-size: 13.5px;
  margin-top: 14px;
  min-height: 1em;
}
.auth-foot { margin-top: 18px; font-size: 13px; text-align: center; color: var(--muted); }
.auth-foot a { color: var(--accent-text); }

/* --- Mensajería ---------------------------------------------------------- */
.thread {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg { display: flex; flex-direction: column; }
.msg.mine   { align-items: flex-end; }
.msg.theirs { align-items: flex-start; }
.msg-bubble {
  max-width: 84%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 14.5px;
  line-height: 1.5;
}
.msg.mine .msg-bubble {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.msg-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

.msg-form { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.msg-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font: inherit;
  color: var(--text);
  resize: vertical;
}
.msg-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* --- Archivos ------------------------------------------------------------ */
.upload-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.upload-form input[type=text] {
  padding: 10px 12px; border: 1px solid var(--line-strong);
  background: var(--surface); font: inherit; color: var(--text);
}
.file-drop {
  display: block;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.file-drop input[type=file] { display: block; margin: 0 auto; }
.file-drop span { display: block; margin-top: 8px; }

.files-h {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 20px 0 8px; font-family: var(--font-head);
}
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-list li:last-child { border-bottom: 0; }
.file-list a { font-weight: 600; color: var(--accent-text); word-break: break-word; }
.file-meta { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* --- Indicador de no leídos --------------------------------------------- */
.unread-dot {
  display: inline-block;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  vertical-align: middle;
  margin-left: 6px;
}

/* --- Chat destacado (área de cliente) ------------------------------------ */
.chat {
  border: 1px solid var(--accent-line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  background: var(--accent);
  color: var(--accent-contrast);
}
.chat-avatar {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 19px;
}
.chat-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.chat-sub { font-size: 12.5px; opacity: .9; }
.presence {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #57e08a;
  box-shadow: 0 0 0 3px rgba(87, 224, 138, .28);
  margin-right: 5px;
  vertical-align: middle;
}
.chat-thread {
  max-height: 380px;
  min-height: 150px;
  padding: 20px 22px;
  margin: 0;
}
.chat-empty { text-align: center; padding: 22px 10px; }
.chat-empty p { margin: 0 0 6px; }
.chat-form {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.chat-form textarea {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font: inherit;
  color: var(--text);
  resize: vertical;
}
.chat-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-form .btn { align-self: stretch; white-space: nowrap; }

/* --- Alertas del panel de gestión ---------------------------------------- */
.alert-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--accent-line);
  border-left-width: 4px;
  background: var(--accent-soft);
  font-size: 14.5px;
}
.alert-bar-icon { font-size: 18px; }

.nav-alert { position: relative; }
.nav-badge-count,
.pill {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1;
}
.nav-badge-count {
  min-width: 18px;
  padding: 3px 5px;
  margin-left: 6px;
  background: #d92b1f;
  color: #fff;
  font-size: 11px;
  text-align: center;
  border-radius: 9px;
  vertical-align: middle;
}
.pill {
  padding: 2px 7px;
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.pill-msg  { border-color: var(--accent-line); color: var(--accent-text); background: var(--accent-soft); }
.pill-file { border-color: #d9a62e; color: #a67715; background: rgba(217,166,46,.12); }
.orders tr.row-alert td { background: var(--accent-soft); }

/* --- Listas resumen del panel (dashboard) -------------------------------- */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.mini-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-main { min-width: 0; }
.mini-main strong { display: block; font-weight: 600; }
.mini-main a { color: var(--text); text-decoration: none; }
.mini-main a:hover { color: var(--accent-text); }
.mini-sub {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.mini-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-align: right;
}
.mini-side .money { font-weight: 600; white-space: nowrap; }

/* --- Ayudas -------------------------------------------------------------- */
.stack-gap > * + * { margin-top: 20px; }
.text-right { text-align: right; }

/* ==========================================================================
   Rediseño 2026 · Shell profesional de administración y cliente
   ========================================================================== */

.app-body {
  --app-sidebar-w: 276px;
  --app-topbar-h: 76px;
  --app-bg: #f4f6f8;
  --app-surface: #ffffff;
  --app-sidebar: #111318;
  --app-sidebar-soft: #1a1d23;
  --app-border: #e2e6eb;
  --app-text-soft: #667085;
  min-height: 100vh;
  padding: 0;
  background: var(--app-bg);
  color: #16181d;
  font-size: 15px;
  line-height: 1.55;
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  display: flex;
  width: var(--app-sidebar-w);
  min-height: 100vh;
  flex-direction: column;
  padding: 24px 18px 18px;
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.07), transparent 30%),
    linear-gradient(180deg, #17191f 0%, var(--app-sidebar) 58%, #0c0e12 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-brand {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-brand img {
  display: block;
  width: 118px;
  max-height: 28px;
  object-fit: contain;
}

.app-brand span {
  padding-left: 12px;
  color: rgba(255, 255, 255, 0.54);
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-nav-label {
  padding: 0 12px;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-nav {
  display: grid;
  gap: 5px;
}

.app-nav-link {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.66);
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.app-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.app-nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 0 #fff;
}

.app-nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
}

.app-nav-icon svg,
.app-logout svg,
.app-menu-toggle svg,
.app-alert-link svg {
  width: 20px;
  height: 20px;
}

.app-nav-count {
  min-width: 22px;
  padding: 3px 6px;
  margin-left: auto;
  color: #fff;
  background: #e0443e;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.app-sidebar-spacer {
  flex: 1;
  min-height: 30px;
}

.app-nav-secondary {
  margin-bottom: 14px;
  border-color: rgba(255, 255, 255, 0.09);
}

.app-sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #373b45, #20232a);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.app-sidebar-user-copy {
  min-width: 0;
}

.app-sidebar-user-copy strong,
.app-sidebar-user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-user-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.app-sidebar-user-copy small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10.5px;
}

.app-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.app-logout:hover {
  color: #fff;
}

.app-workspace {
  min-height: 100vh;
  margin-left: var(--app-sidebar-w);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  height: var(--app-topbar-h);
  align-items: center;
  gap: 18px;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid var(--app-border);
  box-shadow: 0 1px 0 rgba(17, 19, 24, 0.02);
  backdrop-filter: blur(14px);
}

.app-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  cursor: pointer;
}

.app-page-context {
  min-width: 0;
}

.app-page-context span,
.app-page-context strong {
  display: block;
}

.app-page-context span {
  color: var(--app-text-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.app-page-context strong {
  max-width: 440px;
  overflow: hidden;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.app-alert-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-2);
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.app-alert-link:hover {
  background: var(--bg-soft);
  border-color: var(--line-strong);
}

.app-alert-link {
  position: relative;
  width: 40px;
  height: 40px;
}

.app-alert-link span {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  padding: 2px 4px;
  color: #fff;
  background: #d92b1f;
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.app-sidebar-backdrop {
  display: none;
}

.app-body .panel-main {
  min-height: calc(100vh - var(--app-topbar-h));
  padding: 0;
}

.app-content {
  width: 100%;
  max-width: 1520px;
  padding: 34px 38px 80px;
  margin: 0 auto;
}

.app-body h1 {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: -0.035em;
}

.app-body h2 {
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.app-body .section-head {
  max-width: none;
  align-items: center;
  margin-bottom: 26px;
}

.app-body .section-head h1 {
  margin-bottom: 5px;
}

.app-body .section-head .muted {
  max-width: 680px;
  color: var(--app-text-soft);
  font-size: 14px;
}

.content-section-label {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 16px;
}

.content-section-label > div > span {
  display: block;
  margin-bottom: 3px;
  color: var(--app-text-soft);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.content-section-label h2 {
  margin: 0;
  font-size: 18px;
}

.content-section-label > span {
  color: var(--app-text-soft);
  font-size: 11.5px;
}

.app-back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 16px;
  color: var(--app-text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.app-back-link:hover {
  color: var(--text);
}

.app-body .btn {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
}

.app-body .btn-small {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 11.5px;
}

.app-body .btn-accent {
  box-shadow: 0 5px 14px rgba(20, 21, 26, 0.13);
}

.app-body .btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(20, 21, 26, 0.17);
}

.app-body .btn-ghost {
  background: #fff;
  border-color: var(--app-border);
}

.app-body .flash {
  position: relative;
  padding: 14px 18px;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid var(--app-border);
  border-left-width: 4px;
  border-radius: 10px;
  box-shadow: 0 5px 18px rgba(17, 19, 24, 0.04);
}

.app-body .kpi-grid {
  gap: 16px;
  margin-bottom: 28px;
}

.app-body .kpi {
  position: relative;
  min-height: 142px;
  padding: 22px 22px 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  box-shadow: 0 7px 22px rgba(17, 19, 24, 0.035);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.app-body .kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
  opacity: 0.85;
}

.app-body .kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(17, 19, 24, 0.07);
}

.app-body .kpi-label {
  margin-bottom: 16px;
  color: var(--app-text-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.app-body .kpi-value {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  letter-spacing: -0.045em;
}

.app-body .kpi-sub {
  margin-top: 10px;
  color: var(--app-text-soft);
  font-size: 11.5px;
}

.app-body .card,
.app-body .proj-card,
.app-body .proj-detail-head,
.app-body .client-plan,
.app-body .chat,
.app-body .orders-wrap {
  background: #fff;
  border-color: var(--app-border);
  border-radius: 15px;
  box-shadow: 0 8px 28px rgba(17, 19, 24, 0.045);
}

.app-body .card {
  padding: 23px 24px;
}

.app-body .card:hover {
  border-color: var(--app-border);
  box-shadow: 0 8px 28px rgba(17, 19, 24, 0.045);
  transform: none;
}

.app-body .card h2 {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #edf0f3;
  font-size: 15px;
}

.app-body .detail-cols {
  gap: 22px;
}

.app-body .proj-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.app-body .proj-card {
  min-height: 260px;
  padding: 22px;
  border-top: 3px solid var(--accent);
}

.app-body .proj-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(17, 19, 24, 0.09);
  transform: translateY(-3px);
}

.app-body .proj-card h3 {
  margin-top: 10px;
  font-size: 18px;
}

.app-body .plan-card-result {
  min-height: 42px;
  color: #4e5563;
}

.app-body .progress {
  height: 9px;
  background: #eef1f4;
  border: 0;
  border-radius: 999px;
}

.app-body .progress > i {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff));
}

.app-body .badge,
.app-body .pill,
.app-body .paid-tag,
.app-body .status-select {
  border-radius: 999px;
}

.app-body .badge {
  padding: 4px 9px;
  font-size: 10.5px;
}

.app-body .panel-toolbar {
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 13px;
  box-shadow: 0 5px 18px rgba(17, 19, 24, 0.03);
}

.app-body .order-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-body .manual-order-card {
  margin-bottom: 26px;
}

.app-body .manual-order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 18px;
}

.app-body .manual-order-form label {
  display: grid;
  gap: 7px;
  color: #3d4350;
  font-size: 11.5px;
  font-weight: 600;
}

.app-body .manual-order-form input,
.app-body .manual-order-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
}

.app-body .manual-order-form textarea {
  min-height: 92px;
  resize: vertical;
}

.app-body .manual-order-wide {
  grid-column: 1 / -1;
}

.app-body .manual-order-help {
  margin: 14px 0;
  color: var(--app-text-soft);
  font-size: 12px;
}

.app-body .panel-search,
.app-body .status-select,
.app-body input[type="text"],
.app-body input[type="email"],
.app-body input[type="password"],
.app-body input[type="date"],
.app-body input[type="number"],
.app-body select,
.app-body textarea {
  color: var(--text);
  background: #fff;
  border: 1px solid #d9dee5;
  border-radius: 9px;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-body .panel-search {
  width: min(100%, 480px);
  max-width: 480px;
  min-height: 42px;
}

.app-body .status-select {
  min-height: 38px;
  padding: 7px 12px;
}

.app-body .panel-search:focus,
.app-body input:focus,
.app-body select:focus,
.app-body textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.app-body .orders-wrap {
  overflow-x: auto;
}

.app-body table.orders th {
  padding: 13px 16px;
  color: #727987;
  background: #f8f9fb;
  border-bottom-color: var(--app-border);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.app-body table.orders td {
  padding: 17px 16px;
  border-bottom-color: #eceff2;
  font-size: 12.5px;
}

.app-body table.orders tbody tr {
  transition: background 0.14s ease;
}

.app-body table.orders tbody tr:hover {
  background: #fafbfc;
}

.app-body .order-id {
  font-size: 12.5px;
}

.app-body .order-id a {
  color: var(--text);
}

.app-body .order-id a:hover {
  color: var(--accent-text);
}

.app-body .order-date,
.app-body .order-customer span,
.app-body .order-money .iva {
  color: #7a818e;
  font-size: 10.8px;
}

.app-body .order-items-mini {
  color: #4e5563;
  font-size: 11.5px;
}

.app-body .order-notes {
  margin-top: 6px;
  color: #4e5563;
  font-size: 10.8px;
}

.app-body .order-notes summary {
  color: var(--accent-text);
  cursor: pointer;
  font-weight: 600;
}

.app-body .order-notes p {
  max-width: 280px;
  margin: 7px 0 0;
  white-space: pre-wrap;
}

.app-body .order-del {
  padding: 6px 8px;
  color: #9a5450;
  border-radius: 7px;
  text-decoration: none;
}

.app-body .order-del:hover {
  color: #b42318;
  background: #fff1f0;
}

.app-body .paid-tag {
  min-height: 30px;
  padding: 6px 10px;
  background: #fff;
}

.app-body .empty {
  padding: 44px 24px;
  background: #fafbfc;
  border-color: #d8dde4;
  border-radius: 12px;
}

.app-body .alert-bar {
  padding: 14px 18px;
  margin-bottom: 22px;
  background: #fff;
  border: 1px solid var(--accent-line);
  border-left: 4px solid var(--accent);
  border-radius: 11px;
  box-shadow: 0 5px 18px rgba(17, 19, 24, 0.035);
}

.app-body .mini-list li {
  padding: 14px 0;
}

.app-body .mini-sub {
  color: #7a818e;
}

.app-body .proj-detail-head {
  position: relative;
  padding: 28px;
  overflow: hidden;
  border-top: 4px solid var(--accent);
}

.app-body .meta-row {
  gap: 14px;
}

.app-body .meta-item {
  min-width: 130px;
  padding: 11px 14px;
  background: #f8f9fb;
  border: 1px solid #eceff2;
  border-radius: 9px;
}

.app-body .meta-row .meta-item .k {
  color: #7a818e;
  font-size: 9.5px;
}

.app-body .meta-row .meta-item .v {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
}

.app-body .client-plan {
  overflow: hidden;
  border-top-color: var(--accent);
}

.app-body .client-plan-head,
.app-body .client-plan-teams,
.app-body .client-plan-results,
.app-body .client-plan-services {
  padding: 22px 24px;
}

.app-body .client-plan-total {
  padding: 12px 15px;
  background: #f8f9fb;
  border: 1px solid #eceff2;
  border-radius: 10px;
}

.app-body .timeline {
  padding-top: 3px;
}

.app-body .tl-item {
  padding-left: 30px;
}

.app-body .feed li {
  padding: 13px 0;
}

.app-body .file-drop {
  padding: 20px 16px;
  background: #fafbfc;
  border-color: #cfd5dc;
  border-radius: 10px;
}

.app-body .file-drop:hover {
  color: var(--accent-text);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.app-body .chat {
  overflow: hidden;
}

.app-body .chat-head {
  padding: 18px 22px;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 78%, #323640));
}

.app-body .chat-avatar {
  border-radius: 11px;
}

.app-body .chat-thread {
  min-height: 180px;
  background: #fbfcfd;
}

.app-body .msg-bubble {
  border-radius: 11px 11px 11px 3px;
}

.app-body .msg.mine .msg-bubble {
  border-radius: 11px 11px 3px 11px;
}

.app-body .chat-form {
  padding: 14px 16px;
}

.app-body .profile-form label,
.app-body .new-project-form label,
.app-body .grid-form label,
.app-body .ms-add label {
  color: #3d4350;
  font-size: 11.5px;
  font-weight: 600;
}

.app-body .profile-form input,
.app-body .new-project-form input,
.app-body .new-project-form select,
.app-body .grid-form input,
.app-body .grid-form select,
.app-body .ms-edit input,
.app-body .ms-edit select,
.app-body .ms-add input {
  min-height: 40px;
  padding: 9px 11px;
}

.app-body [hidden] {
  display: none !important;
}

/* --- Accesos ------------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  padding: 0;
  background: #f3f5f7;
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(400px, 0.9fr) minmax(480px, 1.1fr);
}

.auth-showcase {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 42px 54px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.12), transparent 28%),
    radial-gradient(circle at 90% 90%, rgba(139, 47, 209, 0.2), transparent 34%),
    linear-gradient(145deg, #17191f 0%, #0d0f13 66%, #191c23 100%);
}

.auth-client .auth-showcase {
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.11), transparent 28%),
    radial-gradient(circle at 90% 88%, rgba(43, 127, 181, 0.3), transparent 35%),
    linear-gradient(145deg, #17191f 0%, #0d1116 62%, #101d27 100%);
}

.auth-showcase::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: 90px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 55px rgba(255, 255, 255, 0.025),
    0 0 0 110px rgba(255, 255, 255, 0.018);
}

.auth-showcase-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
}

.auth-showcase-brand img {
  width: 132px;
}

.auth-showcase-brand span {
  padding: 4px 10px;
  color: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-showcase-copy {
  position: relative;
  z-index: 1;
  max-width: 570px;
  margin: auto 0;
  padding: 70px 0;
}

.auth-eyebrow,
.auth-form-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-eyebrow {
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.52);
}

.auth-showcase-copy h2 {
  max-width: 620px;
  margin-bottom: 20px;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.auth-showcase-copy > p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  line-height: 1.65;
}

.auth-benefits {
  display: grid;
  gap: 12px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.auth-benefits li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12.5px;
}

.auth-benefits span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
}

.auth-site-return {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11.5px;
}

.auth-site-return:hover {
  color: #fff;
}

.auth-form-side {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 46px;
}

.auth-form-side .auth-box {
  max-width: 430px;
}

.auth-box {
  padding: 38px;
  background: #fff;
  border: 1px solid #e1e5ea;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(17, 19, 24, 0.09);
}

.auth-form-side .auth-box {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.auth-box .brand-mark {
  height: 27px;
  margin-bottom: 32px;
}

.auth-form-kicker {
  margin-bottom: 9px;
  color: #8a909c;
}

.auth-box h1 {
  margin-bottom: 8px;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.auth-box p.sub {
  margin-bottom: 28px;
  color: #69717e;
}

.auth-box label {
  margin-top: 16px;
  color: #343a45;
  font-size: 11.5px;
}

.auth-box input[type="email"],
.auth-box input[type="password"],
.auth-box input[type="text"] {
  min-height: 46px;
  padding: 11px 13px;
  border-color: #d8dde4;
  border-radius: 9px;
}

.auth-box .btn {
  min-height: 46px;
  border-radius: 9px;
  font-size: 12.5px;
}

.auth-box .auth-back {
  margin-top: 10px;
}

.auth-err {
  min-height: 20px;
  margin-top: 13px;
}

.auth-foot {
  padding-top: 18px;
  margin-top: 22px;
  border-top: 1px solid #e8ebef;
  line-height: 1.6;
}

.auth-wrap {
  padding: 40px 20px;
  background:
    radial-gradient(circle at 20% 10%, rgba(139, 47, 209, 0.08), transparent 28%),
    #f3f5f7;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1180px) {
  .app-content {
    padding-right: 28px;
    padding-left: 28px;
  }
}

@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: 20px 0 50px rgba(10, 12, 16, 0.25);
    transition: transform 0.22s ease;
  }

  .app-workspace {
    margin-left: 0;
  }

  .app-menu-toggle {
    display: grid;
  }

  .app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    visibility: hidden;
    padding: 0;
    background: rgba(11, 13, 17, 0.52);
    border: 0;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .app-sidebar-open {
    overflow: hidden;
  }

  .app-sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-sidebar-open .app-sidebar-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .auth-layout {
    grid-template-columns: minmax(340px, 0.8fr) minmax(440px, 1.2fr);
  }

  .auth-showcase {
    padding: 36px;
  }
}

@media (max-width: 820px) {
  .auth-layout {
    display: block;
  }

  .auth-showcase {
    min-height: auto;
    padding: 28px 26px 34px;
  }

  .auth-showcase-copy {
    padding: 62px 0 26px;
  }

  .auth-showcase-copy h2 {
    max-width: 650px;
    font-size: 2.15rem;
  }

  .auth-showcase-copy > p {
    margin-bottom: 0;
  }

  .auth-benefits {
    display: none;
  }

  .auth-site-return {
    display: none;
  }

  .auth-form-side {
    min-height: auto;
    padding: 42px 22px 58px;
  }
}

@media (max-width: 720px) {
  .app-topbar {
    height: 68px;
    padding: 0 18px;
  }

  .app-content {
    padding: 26px 18px 64px;
  }

  .app-body .section-head {
    align-items: flex-start;
  }

  .app-body .section-head > div:last-child,
  .app-body .section-head > a,
  .app-body .section-head > button {
    width: 100%;
  }

  .app-body .section-head .btn {
    justify-content: center;
  }

  .app-body .order-head-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-body .manual-order-grid {
    grid-template-columns: 1fr;
  }

  .app-body .manual-order-wide {
    grid-column: auto;
  }

  .app-body .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-body .kpi {
    min-height: 124px;
    padding: 19px;
  }

  .app-body .panel-toolbar {
    align-items: stretch;
  }

  .app-body .panel-toolbar > * {
    width: 100%;
  }

  .app-body .panel-toolbar > div {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    align-items: stretch !important;
  }

  .app-body .panel-search {
    max-width: none;
  }

  .app-body .proj-grid {
    grid-template-columns: 1fr;
  }

  .app-body .card,
  .app-body .proj-detail-head {
    padding: 20px;
  }

  .app-body .chat-form {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .app-page-context span {
    display: none;
  }

  .app-page-context strong {
    max-width: 170px;
  }

  .app-body .kpi-grid {
    grid-template-columns: 1fr;
  }

  .app-body .panel-toolbar > div {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    width: min(88vw, 300px);
  }

  .auth-showcase-copy {
    padding-top: 48px;
  }

  .auth-showcase-copy h2 {
    font-size: 1.72rem;
  }

  .auth-form-side {
    padding-right: 16px;
    padding-left: 16px;
  }

  .auth-form-side .auth-box {
    padding: 12px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .app-sidebar-backdrop,
  .app-nav-link,
  .app-body .kpi,
  .app-body .proj-card {
    transition: none;
  }
}

.app-body :focus-visible,
.auth-page :focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ==========================================================================
   Notificaciones, acciones destructivas y chat flotante
   ========================================================================== */

.app-notifications {
  position: relative;
}

.app-notifications-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 120;
  width: min(400px, calc(100vw - 36px));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(17, 19, 24, 0.18);
}

.app-notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--app-border);
}

.app-notifications-head strong,
.app-notifications-head small {
  display: block;
}

.app-notifications-head strong {
  font-family: var(--font-head);
  font-size: 14px;
}

.app-notifications-head small {
  margin-top: 2px;
  color: var(--app-text-soft);
  font-size: 11px;
}

.app-notifications-close,
.chat-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  place-items: center;
  color: var(--app-text-soft);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.app-notifications-close:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.app-notifications-close svg,
.chat-close svg {
  width: 18px;
  height: 18px;
}

.app-notifications-list {
  max-height: min(490px, calc(100vh - 190px));
  overflow-y: auto;
}

.app-notification-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  color: var(--text);
  border-bottom: 1px solid #edf0f3;
  text-decoration: none;
  transition: background 0.15s ease;
}

.app-notification-item:hover {
  background: #f8f9fb;
}

.app-notification-item.is-unread {
  background: color-mix(in srgb, var(--accent-soft) 45%, #fff);
}

.app-notification-item.is-unread::after {
  position: absolute;
  top: 19px;
  right: 14px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--accent);
  border-radius: 50%;
}

.app-notification-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: #355173;
  background: #edf4fb;
  border-radius: 10px;
}

.app-notification-icon.is-message {
  color: #6b42a1;
  background: #f1eafb;
}

.app-notification-icon.is-file {
  color: #28765b;
  background: #e8f6f0;
}

.app-notification-icon.is-order {
  color: #9a6418;
  background: #fff4df;
}

.app-notification-icon svg {
  width: 18px;
  height: 18px;
}

.app-notification-copy {
  min-width: 0;
  padding-right: 9px;
}

.app-notification-copy strong,
.app-notification-copy span,
.app-notification-copy small {
  display: block;
}

.app-notification-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-notification-copy span {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.app-notification-copy small {
  margin-top: 5px;
  color: var(--app-text-soft);
  font-size: 10.5px;
}

.app-notifications-footer {
  display: block;
  padding: 13px 18px;
  color: var(--accent-text);
  background: #fafbfc;
  border-top: 1px solid var(--app-border);
  font-size: 11.5px;
  font-weight: 650;
  text-align: center;
}

.app-notifications-empty {
  display: grid;
  min-height: 190px;
  padding: 30px;
  place-items: center;
  align-content: center;
  color: var(--app-text-soft);
  text-align: center;
}

.app-notifications-empty svg {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
}

.app-notifications-empty strong,
.app-notifications-empty span {
  display: block;
}

.app-notifications-empty strong {
  color: var(--text);
  font-family: var(--font-head);
  font-size: 13px;
}

.app-notifications-empty span {
  margin-top: 4px;
  font-size: 11.5px;
}

.app-body .btn-danger {
  color: #b42318;
  background: #fff;
  border-color: #f2c8c4;
}

.app-body .btn-danger:hover {
  color: #fff;
  background: #b42318;
  border-color: #b42318;
}

.project-delete-form {
  margin-top: 12px;
}

.detail-cols-single {
  grid-template-columns: 1fr;
}

.floating-chat {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 75;
}

.floating-chat-trigger {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  padding: 0;
  place-items: center;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 75%, #000);
  border-radius: 50%;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 28%, transparent);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.floating-chat-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--accent) 38%, transparent);
}

.floating-chat-trigger svg {
  width: 25px;
  height: 25px;
}

.floating-chat-trigger span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-body .floating-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  display: flex;
  width: min(410px, calc(100vw - 36px));
  height: min(590px, calc(100vh - 130px));
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(17, 19, 24, 0.25);
}

.app-body .floating-chat-panel .chat-head {
  flex: 0 0 auto;
}

.chat-head-text {
  min-width: 0;
  flex: 1;
}

.chat-close {
  color: currentColor;
  background: rgba(255, 255, 255, 0.12);
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.app-body .floating-chat-panel .chat-thread {
  min-height: 0;
  max-height: none;
  flex: 1;
}

.app-body .floating-chat-panel .chat-form {
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .app-notifications-menu {
    position: fixed;
    top: 76px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .floating-chat {
    right: 16px;
    bottom: 16px;
  }

  .floating-chat-trigger {
    width: 54px;
    height: 54px;
  }

  .app-body .floating-chat-panel {
    right: 0;
    width: calc(100vw - 32px);
    height: min(580px, calc(100vh - 100px));
  }

  .app-body .floating-chat-panel .chat-form {
    flex-direction: row;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-chat-trigger,
  .app-notification-item {
    transition: none;
  }
}
