/* Área de agentes — se carga después de /styles.css */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(900px 480px at 50% -10%, var(--navy-600) 0%, transparent 60%),
    linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  padding: 38px 34px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
  border-top: 3px solid var(--gold-400);
}
.auth-card__logo { width: 190px; margin: 0 auto 22px; }
.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 6px; }
.auth-card__sub { text-align: center; font-size: .92rem; margin-bottom: 26px; }

.auth-card label {
  display: block;
  margin-bottom: 16px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy-800);
}
.auth-card input {
  width: 100%;
  margin-top: 8px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .18);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 20px;
  font-size: .85rem;
}
.auth-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  color: var(--muted);
}
.auth-row input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--gold-500); }
.auth-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: .85rem;
  color: var(--navy-700);
  cursor: pointer;
  text-decoration: underline;
}
.auth-link:hover { color: var(--gold-500); }

.auth-status {
  margin: 16px 0 0;
  font-size: .88rem;
  text-align: center;
  min-height: 20px;
}
.auth-status.is-error { color: #c0392b; }
.auth-status.is-ok { color: #1a7f4b; }

.auth-back { display: block; text-align: center; margin-top: 22px; font-size: .85rem; }

.lang--light {
  width: max-content;
  margin: 20px auto 0;
  border-color: var(--line);
}
.lang--light .lang__btn { color: var(--muted); }
.lang--light .lang__btn.is-active { color: var(--navy-900); }

.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- Workspace ---------- */
.ws-body { background: var(--bg-alt); }

.ws { min-height: 100vh; display: flex; flex-direction: column; }
.ws[hidden] { display: none; }

.ws-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 20px;
  background: var(--navy-800);
  border-bottom: 2px solid var(--gold-500);
}
.ws-top__left { display: flex; align-items: center; gap: 12px; }
.ws-top__logo { height: 36px; width: auto; }
.ws-top__right { display: flex; align-items: center; gap: 10px; }
.ws-top .lang { border-color: rgba(255, 255, 255, .2); }

.ws-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.ws-icon-btn:hover { background: rgba(255, 255, 255, .1); color: var(--gold-400); border-color: rgba(212, 175, 55, .5); }
.ws-burger { display: none; }

.ws-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold-400);
  color: var(--navy-900);
  font-size: .66rem;
  font-weight: 700;
}

.ws-avatar-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
}
.ws-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--navy-900);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.ws-avatar--lg { width: 46px; height: 46px; font-size: .95rem; }
.ws-avatar-btn:hover .ws-avatar { box-shadow: 0 0 0 3px rgba(212, 175, 55, .3); }

.ws-menu { position: relative; }
.ws-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 22px 50px rgba(11, 31, 58, .22);
  padding: 8px;
  z-index: 40;
}
.ws-pop--wide { width: 280px; }
.ws-pop[hidden] { display: none; }
.ws-pop__head {
  padding: 10px 12px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ws-pop__empty { margin: 0; padding: 4px 12px 14px; font-size: .88rem; }

.ws-pop__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 14px;
  border-bottom: 1px solid var(--line);
}
.ws-pop__user strong { display: block; color: var(--navy-800); font-size: .92rem; }
.ws-pop__user span { color: var(--muted); font-size: .78rem; word-break: break-all; }

.ws-pop__meta { margin: 0; padding: 12px; border-bottom: 1px solid var(--line); }
.ws-pop__meta div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ws-pop__meta div:last-child { margin-bottom: 0; }
.ws-pop__meta dt { color: var(--muted); font-size: .78rem; }
.ws-pop__meta dd { margin: 0; color: var(--navy-800); font-size: .78rem; font-weight: 600; text-align: right; }

.ws-pop__action {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: none;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  color: var(--navy-800);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.ws-pop__action:hover:not(:disabled) { background: var(--bg-alt); }
.ws-pop__action:disabled { color: var(--muted); opacity: .6; cursor: not-allowed; }
.ws-pop__action--danger { color: #c0392b; }
.ws-pop__action--danger:hover { background: rgba(192, 57, 43, .08); }

.ws-body-grid { flex: 1; display: grid; grid-template-columns: 250px 1fr 320px; align-items: stretch; }

.ws-side {
  background: var(--navy-900);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.ws-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.ws-nav__label {
  margin: 14px 12px 6px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .34);
}
.ws-nav__label:first-child { margin-top: 0; }
.ws-nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  background: none;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .72);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ws-nav__item svg { flex: none; opacity: .8; }
.ws-nav__item:hover:not(:disabled) { background: rgba(255, 255, 255, .07); color: #fff; }
.ws-nav__item.is-active {
  background: rgba(212, 175, 55, .14);
  color: var(--gold-400);
}
.ws-nav__item.is-active svg { opacity: 1; }
.ws-nav__item:disabled { color: rgba(255, 255, 255, .32); cursor: not-allowed; }

.ws-side__foot {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .3);
  font-size: .72rem;
  text-align: center;
}

.ws-backdrop { display: none; }

.ws-main { padding: 34px 32px 60px; min-width: 0; }

.ws-rail {
  padding: 34px 24px 60px 0;
  min-width: 0;
}
.ws-rail__card {
  position: sticky;
  top: 98px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.ws-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.ws-rail__head h2 { margin: 0; font-size: 1.02rem; }
.ws-rail__refresh {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.ws-rail__refresh:hover:not(:disabled) { color: var(--gold-500); border-color: var(--gold-400); }
.ws-rail__refresh:disabled { opacity: .5; cursor: not-allowed; }
.ws-rail__state { margin: 0; font-size: .86rem; }
.ws-rail__foot {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: .74rem;
  color: var(--muted);
}
.ws-rail__foot[hidden] { display: none; }

.fba-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fba-list[hidden] { display: none; }
.fba-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-alt);
}
.fba-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.fba-item__head strong {
  font-size: .86rem;
  color: var(--navy-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fba-item__meta { font-size: .74rem; color: var(--muted); }

.fba-tag {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.fba-tag--draft { background: rgba(90, 107, 130, .14); color: var(--muted); }
.fba-tag--transit { background: rgba(201, 162, 39, .18); color: #8a6d12; }
.fba-tag--receiving { background: rgba(27, 59, 102, .14); color: var(--navy-700); }
.fba-tag--done { background: rgba(26, 127, 75, .14); color: #1a7f4b; }
.ws-head { margin-bottom: 26px; }
.ws-head h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 4px; }
.ws-head p { margin: 0; }

.ws-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.ws-panel h2 { font-size: 1.2rem; margin-bottom: 4px; }
.ws-panel > p { margin-bottom: 22px; font-size: .92rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tile--link { cursor: pointer; }
.tile--link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(201, 162, 39, .5);
}
.tile--soon { opacity: .64; }
.tile h3 { margin: 0; font-size: 1rem; }
.tile p { margin: 0; font-size: .9rem; }
.tile__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(201, 162, 39, .12);
  color: var(--gold-500);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  margin-bottom: 6px;
}
.tile__badge {
  align-self: flex-start;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .ws-body-grid { grid-template-columns: 250px 1fr; }
  .ws-rail { grid-column: 2; padding: 0 32px 50px; }
  .ws-rail__card { position: static; }
}

@media (max-width: 900px) {
  .ws-burger { display: grid; }
  .ws-body-grid { grid-template-columns: 1fr; }
  .ws-rail { grid-column: 1; padding: 0 20px 44px; }
  .ws-side {
    position: fixed;
    top: 64px;
    left: 0;
    width: 260px;
    z-index: 35;
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  .ws-side.is-open { transform: translateX(0); }
  .ws-backdrop {
    display: block;
    position: fixed;
    inset: 64px 0 0 0;
    background: rgba(7, 21, 40, .5);
    z-index: 34;
  }
  .ws-backdrop[hidden] { display: none; }
  .ws-main { padding: 26px 20px 48px; }
  .ws-top .lang { display: none; }
}

.ws-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--navy-900);
  color: rgba(255, 255, 255, .7);
  font-size: .9rem;
}
.ws-loading[hidden] { display: none; }

@media (max-width: 640px) {
  .auth-card { padding: 28px 22px; }
  .ws-top { padding: 0 14px; }
  .ws-top__right { gap: 8px; }
}
