/* ============================================================
   DOVA admin — shared styling for the dashboard + agent pages.
   Reuses the marketing site's design tokens (colors, fonts,
   radii) but is a self-contained stylesheet: no GSAP/Lenis/
   custom-cursor coupling to the public site's motion layer.
   ============================================================ */
:root{
  --black:        #030303;
  --bg:           #060606;
  --panel:        #101010;
  --panel-2:      #161616;
  --white:        #f6f5f2;
  --grey-100:     #d6d4cf;
  --grey-300:     #a3a19c;
  --grey-500:     #6b6a66;
  --line:         rgba(246,245,242,0.12);
  --line-strong:  rgba(246,245,242,0.24);

  --radius-soft:  32px;
  --radius-btn:   999px;

  --font-display: 'Clash Display', 'Arial Narrow', sans-serif;
  --font-body:    'General Sans', 'Helvetica Neue', Arial, sans-serif;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ background:var(--bg); }
body{
  margin:0; min-height:100vh; background:var(--bg); color:var(--white);
  font-family:var(--font-body); -webkit-font-smoothing:antialiased;
}
a{ color:inherit; text-decoration:none; }
h1,h2,h3{ font-family:var(--font-display); font-weight:600; margin:0; letter-spacing:-0.02em; }
p{ margin:0; }
button,input{ font-family:var(--font-body); color:inherit; }

/* ---------- header ---------- */
.admin-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:22px clamp(20px,4vw,56px); border-bottom:1px solid var(--line);
}
.admin-header img{ height:20px; display:block; }
.admin-header .back{ font-size:13px; color:var(--grey-300); }
.admin-header .back:hover{ color:var(--white); }
.admin-header-right{ display:flex; align-items:center; gap:20px; }
.admin-user-email{ font-size:12px; color:var(--grey-500); }
.admin-signout{ background:none; border:1px solid var(--line-strong); border-radius:var(--radius-btn); color:var(--grey-300); font-size:12px; padding:7px 14px; cursor:pointer; transition:border-color .2s, color .2s; }
.admin-signout:hover{ border-color:var(--white); color:var(--white); }

/* ---------- login page ---------- */
.login-wrap{
  min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:20px; text-align:center;
}
.login-logo{ height:22px; margin-bottom:36px; }
.login-title{ font-size:clamp(1.6rem,3vw,2.1rem); margin-bottom:10px; }
.login-sub{ color:var(--grey-300); font-size:.92rem; margin-bottom:40px; max-width:340px; line-height:1.6; }
.login-form{ width:100%; max-width:320px; display:flex; flex-direction:column; gap:22px; }
.login-field{ text-align:left; display:flex; flex-direction:column; gap:8px; }
.login-field label{ font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; color:var(--grey-500); }
.login-field input{
  background:transparent; border:1px solid var(--line-strong); border-radius:12px;
  padding:12px 14px; color:var(--white); font-size:1rem; outline:none; transition:border-color .2s;
}
.login-field input:focus{ border-color:var(--white); }
.btn-login{
  background:var(--white); color:var(--black); border:none; border-radius:var(--radius-btn);
  padding:14px; font-family:var(--font-display); font-weight:600; font-size:.95rem; cursor:pointer;
  transition:opacity .2s;
}
.btn-login:hover{ opacity:.85; }
.btn-login:disabled{ opacity:.5; cursor:not-allowed; }
.login-error{ color:#e0776b; font-size:.85rem; text-align:left; }

/* ---------- dashboard ---------- */
.admin-main{ padding:clamp(48px,7vw,84px) clamp(20px,4vw,56px); max-width:1080px; margin:0 auto; }
.admin-title{ font-size:clamp(1.9rem,3.6vw,2.7rem); margin-bottom:14px; }
.admin-sub{ color:var(--grey-300); line-height:1.6; max-width:560px; margin-bottom:52px; }

.agent-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:18px; }
.agent-tile{
  display:flex; flex-direction:column; align-items:flex-start; gap:2px;
  border:1px solid var(--line); border-radius:var(--radius-soft); background:var(--panel);
  padding:28px 24px; transition:border-color .25s, transform .25s;
}
.agent-tile:hover{ border-color:var(--line-strong); transform:translateY(-4px); }
.agent-tile-name{ font-family:var(--font-display); font-weight:700; font-size:1.7rem; }
.agent-tile-role{ font-size:.76rem; text-transform:uppercase; letter-spacing:.08em; color:var(--grey-500); margin:6px 0 10px; }
.agent-tile-stat{ font-size:.85rem; color:var(--grey-100); margin-bottom:14px; min-height:1.2em; }
.agent-tile-stat .n{ font-family:var(--font-display); font-weight:700; color:var(--white); }
.agent-tile-status{ display:inline-flex; align-items:center; gap:7px; font-size:.75rem; color:var(--grey-300); }
.agent-tile-status::before{ content:''; width:7px; height:7px; border-radius:50%; background:var(--grey-500); flex-shrink:0; }
.agent-tile-status.live::before{ background:#4ade80; }

/* ---------- data tables on each agent page ---------- */
.data-section{ max-width:920px; margin:0 auto; padding:0 clamp(20px,4vw,56px) 100px; }
.data-section-head{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:20px; gap:16px; flex-wrap:wrap; }
.data-section-head h2{ font-size:1.3rem; }
.data-section-head .count{ font-size:.8rem; color:var(--grey-500); }
.data-table-wrap{ border:1px solid var(--line); border-radius:var(--radius-soft); overflow:hidden; }
.data-table{ width:100%; border-collapse:collapse; font-size:.88rem; }
.data-table th{
  text-align:left; font-family:var(--font-display); font-weight:600; font-size:.72rem; text-transform:uppercase;
  letter-spacing:.06em; color:var(--grey-500); padding:14px 18px; background:var(--panel-2); border-bottom:1px solid var(--line);
}
.data-table td{ padding:13px 18px; border-bottom:1px solid var(--line); color:var(--grey-100); vertical-align:top; }
.data-table tr:last-child td{ border-bottom:none; }
.data-table tr:hover td{ background:rgba(255,255,255,0.02); }
.data-empty{ padding:32px 18px; text-align:center; color:var(--grey-500); font-size:.88rem; }

.pill{ display:inline-block; font-size:.72rem; padding:4px 10px; border-radius:20px; border:1px solid var(--line-strong); color:var(--grey-300); white-space:nowrap; }
.pill-ok{ color:#4ade80; border-color:rgba(74,222,128,.35); }
.pill-warn{ color:#e0b34d; border-color:rgba(224,179,77,.4); }
.pill-danger{ color:#e0776b; border-color:rgba(224,119,107,.4); }

/* ---------- individual agent page ---------- */
.agent-page-header{ text-align:center; padding:min(14vh,110px) 20px 40px; }
.agent-page-name{ font-size:clamp(2.1rem,5.5vw,3.4rem); }
.agent-page-role{ display:block; color:var(--grey-500); text-transform:uppercase; letter-spacing:.1em; font-size:.8rem; margin-top:12px; }
.agent-page-note{ max-width:480px; margin:22px auto 0; color:var(--grey-300); line-height:1.75; text-align:center; }

/* ---------- corner chat widget ---------- */
.agent-widget{ position:fixed; bottom:24px; right:24px; z-index:5000; font-family:var(--font-body); }
.agent-widget-bubble{
  position:relative; width:56px; height:56px; border-radius:50%; background:var(--white); color:var(--black);
  border:none; font-family:var(--font-display); font-weight:700; font-size:1.15rem;
  cursor:pointer; box-shadow:0 10px 28px rgba(0,0,0,0.45); transition:transform .2s;
}
.agent-widget-bubble:hover{ transform:scale(1.06); }
.agent-widget-bubble-dot{
  position:absolute; top:2px; right:2px; width:11px; height:11px; border-radius:50%;
  background:var(--grey-500); border:2px solid var(--bg);
}
.agent-widget-bubble-dot.live{ background:#4ade80; }

.agent-widget-panel{
  position:absolute; bottom:70px; right:0; width:328px; max-width:calc(100vw - 48px);
  height:440px; max-height:calc(100vh - 120px);
  background:var(--panel); border:1px solid var(--line-strong); border-radius:20px;
  display:flex; flex-direction:column; overflow:hidden; box-shadow:0 20px 50px rgba(0,0,0,.5);
  opacity:0; transform:translateY(16px) scale(.96); pointer-events:none;
  transition:opacity .25s, transform .25s;
}
.agent-widget.open .agent-widget-panel{ opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }

.agent-widget-header{
  display:flex; align-items:center; gap:10px; padding:14px 16px;
  border-bottom:1px solid var(--line); font-family:var(--font-display); font-weight:600; font-size:.95rem;
}
.agent-widget-header-status{ font-family:var(--font-body); font-weight:400; font-size:.7rem; color:var(--grey-500); text-transform:uppercase; letter-spacing:.06em; }
.agent-widget-close{ margin-left:auto; background:none; border:none; color:var(--grey-500); font-size:19px; line-height:1; cursor:pointer; }
.agent-widget-close:hover{ color:var(--white); }

.agent-widget-messages{ flex:1; overflow-y:auto; padding:14px 16px; display:flex; flex-direction:column; gap:10px; }
.agent-widget-msg{ font-size:.87rem; line-height:1.55; padding:9px 13px; border-radius:15px; max-width:86%; word-wrap:break-word; }
.agent-widget-msg.assistant{ background:var(--panel-2); align-self:flex-start; border-bottom-left-radius:4px; }
.agent-widget-msg.user{ background:var(--white); color:var(--black); align-self:flex-end; border-bottom-right-radius:4px; }
.agent-widget-msg.error{ background:transparent; border:1px solid rgba(192,57,43,.5); color:#e0776b; align-self:flex-start; }
.agent-widget-msg.typing{ display:flex; gap:4px; align-items:center; padding:12px 14px; }
.agent-widget-msg.typing span{ width:5px; height:5px; border-radius:50%; background:var(--grey-300); animation:agent-typing 1.1s infinite ease-in-out; }
.agent-widget-msg.typing span:nth-child(2){ animation-delay:.15s; }
.agent-widget-msg.typing span:nth-child(3){ animation-delay:.3s; }
@keyframes agent-typing{ 0%,60%,100%{ opacity:.3; transform:translateY(0); } 30%{ opacity:1; transform:translateY(-2px); } }

.agent-widget-form{ display:flex; gap:8px; padding:12px; border-top:1px solid var(--line); }
.agent-widget-input{
  flex:1; background:transparent; border:1px solid var(--line-strong); border-radius:20px;
  padding:9px 14px; color:var(--white); font-size:.87rem; outline:none; min-width:0;
}
.agent-widget-input:focus{ border-color:var(--white); }
.agent-widget-send{
  width:36px; height:36px; flex-shrink:0; border-radius:50%; background:var(--white); color:var(--black);
  border:none; cursor:pointer; font-size:1rem;
}
.agent-widget-input:disabled, .agent-widget-send:disabled{ opacity:.4; cursor:not-allowed; }

@media (max-width:480px){
  .agent-widget{ right:16px; bottom:16px; }
  .agent-widget-panel{ right:-8px; }
}
