/* ============================================================
   Techleet Portal — shared stylesheet (client + admin)
   Brand: indigo gradient DNA, signal orange, pulse-trace motif.
   Chart palette validated (dataviz six checks, dark surface #12112c):
   #5b58c7 #0e94b0 #d97706 #059669 #dc4848
   ============================================================ */

:root {
  --ink: #0a0a18;
  --indigo-950: #12112c;
  --indigo-900: #1b1a3e;
  --indigo-700: #34327a;
  --indigo-500: #5b58c7;
  --indigo-300: #8f8ce0;
  --paper: #f3f2fa;
  --signal: #ffa33c;
  --signal-deep: #e8871a;
  --muted: #a9a7c9;
  --line: rgba(91, 88, 199, 0.28);

  --st-new: #5b58c7;
  --st-review: #0e94b0;
  --st-progress: #d97706;
  --st-done: #059669;
  --st-rejected: #dc4848;

  --font-sans: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

body {
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--paper);
  background:
    radial-gradient(1000px 500px at 90% -10%, rgba(91, 88, 199, 0.25), transparent 60%),
    radial-gradient(800px 600px at -10% 40%, rgba(52, 50, 122, 0.3), transparent 55%),
    linear-gradient(170deg, #16153a 0%, var(--ink) 55%);
  background-attachment: fixed;
  min-height: 100vh;
}

::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 2px; }

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3 { line-height: 1.2; }
.display {
  font-weight: 800;
  font-stretch: 115%;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: default; transform: none !important; }
.btn-signal { background: var(--signal); color: var(--ink); }
.btn-signal:hover:not(:disabled) { background: var(--signal-deep); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 163, 60, 0.25); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--paper); }
.btn-ghost:hover:not(:disabled) { border-color: var(--indigo-300); }
.btn-danger { background: transparent; border: 1px solid rgba(220, 72, 72, 0.5); color: #f0a0a0; }
.btn-danger:hover:not(:disabled) { border-color: #dc4848; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

/* ---------- login screen ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-trace {
  position: absolute;
  left: 0; right: 0; top: 58%;
  opacity: 0.5;
  pointer-events: none;
}
.login-trace path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: trace-draw 2s cubic-bezier(0.6, 0, 0.3, 1) 0.2s forwards;
}
@keyframes trace-draw { to { stroke-dashoffset: 0; } }

.login-card {
  position: relative;
  width: min(400px, 100%);
  background: linear-gradient(160deg, rgba(52, 50, 122, 0.4), rgba(18, 17, 44, 0.85));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2.6rem 2.2rem;
  backdrop-filter: blur(10px);
  animation: card-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes card-in { from { opacity: 0; transform: translateY(16px); } }
.login-card .logo { height: 34px; width: auto; margin-bottom: 1.8rem; }
.login-card h1 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.login-card .sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.8rem; }

/* ---------- forms ---------- */
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--paper);
  background: rgba(10, 10, 24, 0.55);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--signal);
  outline-offset: 0;
  border-color: transparent;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.check-field {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 1.1rem 0;
}
.check-field input { margin-top: 0.25rem; accent-color: var(--signal); width: 16px; height: 16px; flex-shrink: 0; }

.form-error {
  display: none;
  background: rgba(220, 72, 72, 0.12);
  border: 1px solid rgba(220, 72, 72, 0.45);
  color: #f0a0a0;
  font-size: 0.85rem;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
}
.form-error.show { display: block; animation: card-in 0.25s; }

/* ---------- app shell ---------- */
.app { display: none; min-height: 100vh; }
.app.show { display: block; }
.app-admin.show { display: grid; grid-template-columns: 220px 1fr; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(16px, 4vw, 40px);
  background: rgba(10, 10, 24, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .logo { height: 26px; width: auto; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-right .who { font-size: 0.85rem; color: var(--muted); }

.main { padding: clamp(20px, 4vw, 40px); max-width: 1060px; margin-inline: auto; }

/* ---------- sidebar (admin) ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(10, 10, 24, 0.7);
  border-right: 1px solid var(--line);
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.sidebar .logo { height: 26px; width: auto; margin: 0.4rem 0.6rem 1.6rem; }
.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.side-link:hover { color: var(--paper); background: rgba(91, 88, 199, 0.12); }
.side-link.active { color: var(--paper); background: rgba(91, 88, 199, 0.2); }
.side-link .dot { width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); opacity: 0.7; }
.sidebar .spacer { flex: 1; }

/* ---------- stat tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.tile {
  background: linear-gradient(160deg, rgba(52, 50, 122, 0.32), rgba(18, 17, 44, 0.7));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  animation: card-in 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
.tile:nth-child(2) { animation-delay: 0.06s; }
.tile:nth-child(3) { animation-delay: 0.12s; }
.tile:nth-child(4) { animation-delay: 0.18s; }
.tile .num {
  font-size: 2rem;
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tile .lbl { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 0.25rem; }
.tile .bar { height: 3px; border-radius: 2px; margin-top: 0.8rem; background: var(--indigo-700); position: relative; overflow: hidden; }
.tile .bar i { position: absolute; inset: 0; transform-origin: left; background: var(--signal); border-radius: 2px; }

/* ---------- panels & cards ---------- */
.panel {
  background: linear-gradient(160deg, rgba(52, 50, 122, 0.25), rgba(18, 17, 44, 0.65));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1.4rem;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-head h2 { font-size: 1.02rem; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.2rem; }
.section-title h1 { font-size: 1.35rem; }
.section-title .sub { color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem; }

/* ---------- request list ---------- */
.req-list { display: grid; gap: 0.7rem; }
.req-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  background: rgba(18, 17, 44, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  animation: card-in 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
.req-card:hover { transform: translateY(-2px); border-color: rgba(91, 88, 199, 0.55); background: rgba(27, 26, 62, 0.6); }
.req-card .title { font-weight: 700; font-size: 0.97rem; }
.req-card .meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.req-card .right { text-align: right; font-size: 0.78rem; color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  border: 1px solid;
  white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-new      { color: #b9b7f0; border-color: var(--st-new);      background: rgba(91, 88, 199, 0.16); }
.chip-review   { color: #9fdcec; border-color: var(--st-review);   background: rgba(14, 148, 176, 0.14); }
.chip-quoted   { color: #9fdcec; border-color: var(--st-review);   background: rgba(14, 148, 176, 0.14); }
.chip-approved { color: #f5c68a; border-color: var(--st-progress); background: rgba(217, 119, 6, 0.14); }
.chip-progress { color: #f5c68a; border-color: var(--st-progress); background: rgba(217, 119, 6, 0.14); }
.chip-resolved { color: #c8c6f5; border-color: var(--indigo-300);  background: rgba(143, 140, 224, 0.16); }
.chip-done     { color: #86e7c2; border-color: var(--st-done);     background: rgba(5, 150, 105, 0.14); }
.chip-rejected { color: #f0a0a0; border-color: var(--st-rejected); background: rgba(220, 72, 72, 0.14); }

.prio { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; }
.prio-urgent { color: #f0a0a0; }
.prio-normal { color: var(--muted); }
.prio-low { color: var(--muted); opacity: 0.7; }

/* ---------- empty & skeleton ---------- */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty strong { color: var(--paper); display: block; margin-bottom: 0.3rem; }
.skeleton { display: grid; gap: 0.7rem; }
.skeleton .sk {
  height: 64px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(52, 50, 122, 0.2) 40%, rgba(91, 88, 199, 0.28) 50%, rgba(52, 50, 122, 0.2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- slide-over drawer ---------- */
.drawer-veil {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 14, 0.6);
  backdrop-filter: blur(2px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-veil.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background: linear-gradient(170deg, #1c1b45, #100f28);
  border-left: 1px solid var(--line);
  z-index: 50;
  transform: translateX(102%);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.drawer.show { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 1.02rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.4rem; }
.drawer-close { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.drawer-close:hover { color: var(--paper); border-color: var(--indigo-300); }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 0.4rem 1rem; font-size: 0.88rem; margin-bottom: 1.2rem; }
.kv dt { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-top: 0.15rem; }
.kv dd { color: var(--paper); }
.kv .desc { white-space: pre-wrap; }

/* ---------- comments ---------- */
.thread { display: grid; gap: 0.7rem; margin-top: 0.5rem; }
.msg {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  font-size: 0.9rem;
  background: rgba(18, 17, 44, 0.5);
  animation: card-in 0.3s;
}
.msg .who { display: flex; gap: 0.6rem; align-items: baseline; margin-bottom: 0.25rem; }
.msg .who b { font-size: 0.82rem; }
.msg .who time { font-size: 0.7rem; color: var(--muted); }
.msg.mine { border-color: rgba(255, 163, 60, 0.35); background: rgba(255, 163, 60, 0.07); }
.msg.internal { border-style: dashed; border-color: rgba(220, 72, 72, 0.45); background: rgba(220, 72, 72, 0.06); }
.msg.internal .who::after { content: "INTERNAL"; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; color: #f0a0a0; }
.composer { display: grid; gap: 0.6rem; margin-top: 1rem; }
.composer textarea { min-height: 70px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: var(--indigo-900);
  border: 1px solid var(--indigo-500);
  color: var(--paper);
  padding: 0.75rem 1.3rem;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 90;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- charts ---------- */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.chart-panel .mono-title { margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--font-mono); font-size: 10.5px; fill: var(--muted); }
.chart-svg .val { fill: var(--paper); font-weight: 500; }
.chart-svg .grid { stroke: rgba(91, 88, 199, 0.15); stroke-width: 1; }
.chart-tip {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  background: #1c1b45;
  border: 1px solid var(--indigo-500);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--paper);
  display: none;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.data-toggle { background: none; border: 0; color: var(--muted); font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; cursor: pointer; text-transform: uppercase; }
.data-toggle:hover { color: var(--paper); }
.chart-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-top: 0.5rem; }
.chart-table th, .chart-table td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid rgba(91, 88, 199, 0.15); }
.chart-table th { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* ---------- filters & table (admin) ---------- */
.filter-row { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.filter-row select, .filter-row input {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--paper);
  background: rgba(10, 10, 24, 0.55);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.filter-row input { flex: 1; min-width: 160px; }

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.client-card {
  background: rgba(18, 17, 44, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.client-card h3 { font-size: 0.98rem; margin-bottom: 0.2rem; }
.client-card .em { font-size: 0.8rem; color: var(--muted); word-break: break-all; }
.client-card .pr { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; color: var(--indigo-300); margin-top: 0.6rem; text-transform: uppercase; }

/* ---------- modal ---------- */
.modal-veil { position: fixed; inset: 0; background: rgba(5, 5, 14, 0.65); z-index: 60; display: none; place-items: center; padding: 20px; }
.modal-veil.show { display: grid; }
.modal {
  width: min(460px, 100%);
  background: linear-gradient(170deg, #1c1b45, #100f28);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.8rem;
  animation: card-in 0.3s;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { font-size: 1.1rem; margin-bottom: 1.2rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .charts { grid-template-columns: 1fr; }
  .app-admin.show { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .logo { margin: 0 0.8rem 0 0.2rem; }
  .sidebar .spacer { display: none; }
  .kv { grid-template-columns: 100px 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .req-card { grid-template-columns: 1fr; gap: 0.5rem; }
  .req-card .right { text-align: left; }
}

/* ---------- screenshot attachments ---------- */
.img-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.img-thumb {
  position: relative; width: 74px; height: 74px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: rgba(10, 10, 24, 0.55);
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-x {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  border: 0; border-radius: 50%; background: rgba(10, 10, 24, 0.8);
  color: var(--paper); font-size: 0.85rem; line-height: 1; cursor: pointer;
}
.img-x:hover { background: var(--st-rejected); }
.img-add {
  width: 74px; height: 74px; cursor: pointer;
  border: 1px dashed var(--line); border-radius: 8px;
  background: transparent; color: var(--muted);
  font-family: var(--font-mono); font-size: 0.62rem;
}
.img-add:hover:not(:disabled) { border-color: var(--signal); color: var(--signal); }
.img-strip { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.2rem; }
.img-strip img {
  width: 110px; height: 82px; object-fit: cover; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: 8px;
}
.img-strip img:hover { border-color: var(--signal); }
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; cursor: zoom-out;
  background: rgba(10, 10, 24, 0.88); padding: 3vmin;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 94vw; max-height: 94vh; object-fit: contain; border-radius: 8px; }

/* ---------- request type chips ---------- */
.typechip {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid; white-space: nowrap;
}
.typechip-bug { color: #ff8a8a; border-color: rgba(220, 72, 72, 0.55); background: rgba(220, 72, 72, 0.12); }
.typechip-design { color: #6fd4e8; border-color: rgba(14, 148, 176, 0.55); background: rgba(14, 148, 176, 0.12); }
.typechip-content { color: #7ce0b3; border-color: rgba(5, 150, 105, 0.55); background: rgba(5, 150, 105, 0.12); }
.typechip-feature { color: #a9a7f0; border-color: rgba(91, 88, 199, 0.6); background: rgba(91, 88, 199, 0.14); }
.typechip-other { color: var(--muted); border-color: var(--line); background: rgba(169, 167, 201, 0.1); }

/* ---------- danger actions ---------- */
.btn-danger {
  background: transparent; color: #ff8a8a;
  border: 1px solid rgba(220, 72, 72, 0.55);
}
.btn-danger:hover { background: rgba(220, 72, 72, 0.14); }
.client-actions { display: flex; gap: 0.6rem; margin-top: 0.9rem; }
.modal .warn {
  border: 1px solid rgba(220, 72, 72, 0.45); border-radius: 8px;
  background: rgba(220, 72, 72, 0.1); color: var(--paper);
  padding: 0.7rem 0.9rem; font-size: 0.88rem; margin-bottom: 1.1rem;
}
.radio-field {
  display: flex; align-items: flex-start; gap: 0.55rem;
  padding: 0.55rem 0; cursor: pointer; font-size: 0.9rem;
}
.radio-field input { margin-top: 0.25rem; accent-color: var(--signal); }
.radio-field .hint { color: var(--muted); font-size: 0.8rem; display: block; }

/* ---------- resolved / confirm-close banner (client) ---------- */
.confirm-banner {
  border: 1px solid rgba(143, 140, 224, 0.55); border-radius: 10px;
  background: linear-gradient(160deg, rgba(91, 88, 199, 0.22), rgba(18, 17, 44, 0.5));
  padding: 1rem 1.1rem; margin-bottom: 1.2rem;
  animation: fadeUp 0.4s ease both;
}
.confirm-banner p { font-size: 0.92rem; margin-bottom: 0.8rem; }
.confirm-banner .row { display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* ---------- TEAM TAB ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 163, 60, 0.55); }
  55% { box-shadow: 0 0 0 7px rgba(255, 163, 60, 0); }
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to { background-position: 200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideOut {
  to { opacity: 0; transform: translateX(28px); max-height: 0;
    margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
}

.hq-connect {
  max-width: 420px; margin: 3rem auto; text-align: center;
  border: 1px solid var(--line); border-radius: 14px; padding: 2.2rem 1.8rem;
  background: linear-gradient(160deg, rgba(52, 50, 122, 0.32), rgba(18, 17, 44, 0.7));
  animation: fadeUp 0.4s ease both;
}
.hq-connect h2 { margin-bottom: 0.5rem; }
.hq-connect p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.3rem; }
.hq-connect .field { text-align: left; }

.team-kpis { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.kpi-chip {
  display: flex; align-items: baseline; gap: 0.5rem;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.45rem 1rem; animation: fadeUp 0.4s ease both;
  background: rgba(18, 17, 44, 0.55);
}
.kpi-chip b { font-size: 1.15rem; font-stretch: 112%; }
.kpi-chip span { font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.kpi-chip.hot { border-color: var(--signal); }
.kpi-chip.hot b { color: var(--signal); }

.roster { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem; margin-bottom: 1.8rem; }
.agent-card {
  position: relative; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.2rem 1.3rem; cursor: pointer;
  background: linear-gradient(160deg, rgba(52, 50, 122, 0.3), rgba(18, 17, 44, 0.68));
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  animation: fadeUp 0.45s ease both;
}
.agent-card:hover { transform: translateY(-4px); border-color: var(--indigo-300);
  box-shadow: 0 10px 28px rgba(10, 10, 24, 0.5); }
.agent-card .ava {
  width: 46px; height: 46px; border-radius: 12px; display: grid;
  place-items: center; font-weight: 800; font-size: 1.25rem;
  font-stretch: 112%; margin-bottom: 0.8rem; color: var(--ink);
}
.agent-card h3 { font-size: 1.05rem; text-transform: capitalize; }
.agent-card .seat { font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 0.55rem; }
.agent-card .last { font-size: 0.8rem; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; }
.agent-card .when { font-family: var(--font-mono); font-size: 0.62rem;
  color: var(--indigo-300); margin-top: 0.6rem; }
.agent-dot {
  position: absolute; top: 1.1rem; right: 1.1rem; width: 10px; height: 10px;
  border-radius: 50%;
}
.agent-dot.running { background: var(--signal); animation: pulseDot 1.6s ease infinite; }
.agent-dot.ok { background: var(--st-done); }
.agent-dot.failed, .agent-dot.crashed { background: var(--st-rejected); }
.agent-dot.idle { background: var(--indigo-700); }

.team-section { margin-bottom: 1.8rem; }
.team-section > .mono-title { display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.8rem; }
.team-section .countb { color: var(--signal); }

.appr-card {
  border: 1px solid rgba(255, 163, 60, 0.4); border-radius: 12px;
  padding: 1rem 1.2rem; margin-bottom: 0.9rem; overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 163, 60, 0.06), rgba(18, 17, 44, 0.6));
  animation: fadeUp 0.4s ease both;
}
.appr-card.leaving { animation: slideOut 0.35s ease forwards; }
.appr-card .who { font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal);
  margin-bottom: 0.35rem; }
.appr-card h4 { font-size: 0.98rem; margin-bottom: 0.4rem; }
.appr-card .body { font-size: 0.87rem; color: #d5d3ea; white-space: pre-wrap;
  max-height: 150px; overflow-y: auto; margin-bottom: 0.8rem; }
.appr-card .row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn-ok { background: rgba(5, 150, 105, 0.16); color: #86e7c2;
  border: 1px solid rgba(5, 150, 105, 0.5); }
.btn-ok:hover { background: rgba(5, 150, 105, 0.3); }

.runlog { display: grid; gap: 0.5rem; }
.run-row {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: rgba(18, 17, 44, 0.5); animation: fadeUp 0.4s ease both;
}
.run-row summary {
  list-style: none; cursor: pointer; display: grid;
  grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: center;
  padding: 0.7rem 1rem;
}
.run-row summary::-webkit-details-marker { display: none; }
.run-row summary:hover { background: rgba(91, 88, 199, 0.08); }
.run-agent { font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 0.15rem 0.55rem;
  border-radius: 999px; border: 1px solid; }
.run-sum { font-size: 0.85rem; color: #d5d3ea; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.run-row[open] .run-sum { white-space: normal; }
.run-meta { font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted);
  white-space: nowrap; }
.run-detail { padding: 0 1rem 0.9rem; font-size: 0.82rem; color: var(--muted); }
.run-detail .act { padding: 0.25rem 0 0.25rem 1rem; border-left: 2px solid var(--indigo-700); margin-bottom: 0.2rem; }
.run-detail .lesson { color: #f5c68a; }

.qtabs { display: flex; gap: 0.4rem; margin-bottom: 0.9rem; }
.qtab {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 0.45rem 0.95rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--muted); transition: all 0.2s ease;
}
.qtab.active { border-color: var(--signal); color: var(--signal);
  background: rgba(255, 163, 60, 0.08); }
.q-item { display: grid; grid-template-columns: 1fr auto; gap: 0.8rem;
  align-items: center; border: 1px solid var(--line); border-radius: 10px;
  padding: 0.7rem 1rem; margin-bottom: 0.55rem;
  background: rgba(18, 17, 44, 0.5); animation: fadeUp 0.4s ease both; }
.q-item .t { font-size: 0.88rem; }
.q-item .m { font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted); margin-top: 0.15rem; }

.sk-shimmer {
  height: 74px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(52, 50, 122, 0.18) 40%,
    rgba(143, 140, 224, 0.16) 50%, rgba(52, 50, 122, 0.18) 60%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
  margin-bottom: 0.7rem;
}
.refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }
.hq-bar { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.hq-bar .status { font-family: var(--font-mono); font-size: 0.62rem;
  color: var(--muted); letter-spacing: 0.1em; }

/* ---------- password show/hide ---------- */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 2.6rem; }
.pw-eye {
  position: absolute; right: 0.45rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 0.35rem; display: grid; place-items: center; border-radius: 6px;
}
.pw-eye:hover { color: var(--paper); }
.pw-eye.on { color: var(--signal); }
