/* Vaayun staff console. Shares the site's tokens (styles.css). */
.ad-body { background: var(--paper); min-height: 100svh; }
.ad-body[hidden], .ad-bar[hidden], .ad-banner[hidden] { display: none; }

/* ---------- top bar ---------- */
.ad-bar { position: sticky; top: 0; z-index: 60; background: var(--ink); color: var(--paper); border-bottom: 3px solid var(--orange); }
.ad-bar-in { width: min(var(--max), 100% - var(--pad) * 2); margin-inline: auto; height: 66px; display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); }
.ad-logo { display: inline-flex; align-items: center; gap: 12px; flex: none; color: var(--paper); }
.ad-logo img { height: 40px; width: auto; filter: invert(1) brightness(1.6); }
.ad-logo span { display: flex; flex-direction: column; line-height: 1.1; }
.ad-logo b { font-size: 16px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; }
.ad-logo small { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--orange); margin-top: 3px; }
.ad-nav { display: flex; gap: clamp(14px, 2.4vw, 34px); margin-inline: auto; }
.ad-nav a { position: relative; font-size: 14px; font-weight: 500; padding: 8px 0; color: rgba(238, 233, 222, 0.62); transition: color 0.25s; white-space: nowrap; }
.ad-nav a:hover, .ad-nav a.on { color: var(--paper); }
.ad-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.ad-nav a.on::after { transform: scaleX(1); }
.ad-user { display: flex; align-items: center; gap: 12px; flex: none; }
.ad-ico { width: 36px; height: 36px; border: 1px solid rgba(238, 233, 222, 0.35); border-radius: 50%; display: grid; place-items: center; color: var(--paper); transition: background 0.3s, color 0.3s, transform 0.5s var(--ease); }
.ad-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ad-ico:hover { background: var(--paper); color: var(--ink); }
.ad-ico.spin svg { animation: spin 0.8s linear infinite; }
.ad-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: var(--ink); font-size: 13px; font-weight: 600; }
.ad-who { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ad-who b { font-size: 13.5px; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-who i { font-style: normal; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange); }
.ad-out { padding: 8px 15px; border: 1.5px solid rgba(238, 233, 222, 0.5); border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--paper); transition: background 0.3s, color 0.3s; }
.ad-out:hover { background: var(--paper); color: var(--ink); }

.ad-banner { background: var(--orange); color: var(--ink); font-size: 13px; }
.ad-banner > div { width: min(var(--max), 100% - var(--pad) * 2); margin-inline: auto; padding: 9px 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.ad-banner b { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.ad-banner code { font-family: var(--f-mono); font-size: 12px; background: rgba(15, 15, 13, 0.12); padding: 1px 6px; }

/* ---------- layout ---------- */
.ad-main { width: min(var(--max), 100% - var(--pad) * 2); margin-inline: auto; padding: clamp(26px, 3.4vw, 48px) 0 clamp(60px, 7vw, 100px); min-height: 70svh; }
.ad-loading { padding: 80px 0; text-align: center; color: var(--mute); font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.ad-view { animation: ad-in 0.5s var(--ease) both; }
@keyframes ad-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ad-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 28px; margin-bottom: clamp(20px, 2.6vw, 34px); }
.ad-head .label { margin-bottom: 10px; }
.ad-title { font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-weight: 500; line-height: 1.04; letter-spacing: -0.045em; }
.ad-title em { color: var(--orange); }
.ad-sub { margin-top: 8px; color: var(--mute); font-size: 0.98rem; }
.ad-h2 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 500; letter-spacing: -0.03em; margin-bottom: 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ad-h2 small { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }

/* ---------- KPI strip ---------- */
.ad-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--ink); background: var(--paper); margin-bottom: clamp(26px, 3.4vw, 44px); }
.ad-kpi { padding: 18px 20px 16px; border-left: 1px solid rgba(15, 15, 13, 0.3); display: flex; flex-direction: column; gap: 3px; text-align: left; position: relative; transition: background 0.3s; }
.ad-kpi:first-child { border-left: 0; }
a.ad-kpi:hover { background: rgba(15, 15, 13, 0.04); }
.ad-kpi b { font-size: clamp(2rem, 3.2vw, 2.8rem); font-weight: 500; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.ad-kpi span { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.ad-kpi.hot { background: var(--ink); color: var(--paper); }
.ad-kpi.hot span { color: var(--orange); }
.ad-kpi.hot b { color: var(--paper); }
.ad-kpi.hot::after { content: ""; position: absolute; right: 16px; top: 18px; width: 8px; height: 8px; background: var(--orange); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.ad-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 3.2vw, 48px); align-items: start; }

/* ---------- status badge ---------- */
.ad-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border: 1px solid var(--ink); border-radius: 999px; font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; background: var(--paper); }
.ad-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.ad-badge.requested::before { background: transparent; border: 1.5px solid var(--ink); }
.ad-badge.scheduled { border-color: var(--orange); }
.ad-badge.scheduled::before { background: transparent; border: 1.5px solid var(--orange); }
.ad-badge.in_progress { background: var(--orange); border-color: var(--orange); }
.ad-badge.in_progress::before { background: var(--ink); animation: blink 1s steps(2) infinite; }
.ad-badge.completed { background: var(--ink); color: var(--paper); }
.ad-badge.completed::before { background: #5CE08E; }
.ad-badge.cancelled { color: var(--mute); border-color: rgba(15, 15, 13, 0.35); }
.ad-badge.cancelled::before { background: var(--mute); }
.ad-flag { display: inline-block; padding: 2px 7px; background: var(--orange); color: var(--ink); font-family: var(--f-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- queue + feed rows ---------- */
.ad-rows { border-top: 1px solid var(--ink); }
.ad-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 15px 4px 15px 0; border-bottom: 1px solid rgba(15, 15, 13, 0.35); cursor: pointer; transition: padding 0.4s var(--ease), background 0.3s; }
.ad-row:hover { padding-left: 10px; background: rgba(15, 15, 13, 0.03); }
.ad-row-main { min-width: 0; }
.ad-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 4px; }
.ad-ref { font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; color: var(--mute); }
.ad-row h3 { font-size: 1.08rem; font-weight: 500; letter-spacing: -0.025em; line-height: 1.2; }
.ad-meta { font-size: 13px; color: var(--mute); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-row-act { display: flex; align-items: center; gap: 10px; flex: none; }
.ad-age { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--mute); text-transform: uppercase; white-space: nowrap; }
.ad-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; transition: background 0.3s, color 0.3s, border-color 0.3s; }
.ad-btn:hover { background: var(--ink); color: var(--paper); }
.ad-btn.solid { background: var(--ink); color: var(--paper); }
.ad-btn.solid:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.ad-btn.small { padding: 6px 12px; font-size: 12px; }
.ad-btn:disabled { opacity: 0.5; cursor: progress; }
.ad-empty { padding: 36px 20px; border: 1px dashed rgba(15, 15, 13, 0.4); color: var(--mute); text-align: center; font-size: 14px; }
.ad-feed { list-style: none; border-top: 1px solid var(--ink); }
.ad-feed li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid rgba(15, 15, 13, 0.3); cursor: pointer; font-size: 13.5px; }
.ad-feed li::before { content: ""; width: 7px; height: 7px; margin-top: 7px; background: var(--orange); }
.ad-feed b { font-weight: 500; }
.ad-feed small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.ad-feed time { font-family: var(--f-mono); font-size: 10.5px; color: var(--mute); text-transform: uppercase; white-space: nowrap; margin-top: 3px; }

/* ---------- board ---------- */
.ad-board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: start; }
.ad-col { background: rgba(15, 15, 13, 0.035); border: 1px solid rgba(15, 15, 13, 0.4); min-height: 320px; display: flex; flex-direction: column; transition: background 0.25s, border-color 0.25s; }
.ad-col.over { background: rgba(255, 74, 28, 0.08); border-color: var(--orange); }
.ad-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--ink); background: var(--paper); font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.ad-col-head span { display: inline-flex; align-items: center; gap: 8px; }
.ad-col-head i { font-style: normal; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; background: var(--ink); color: var(--paper); border-radius: 11px; font-size: 11px; }
.ad-col-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; max-height: min(74vh, 780px); overflow-y: auto; }
.ad-card { display: block; padding: 13px 14px 12px; border: 1px solid var(--ink); background: var(--paper); cursor: grab; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); text-align: left; width: 100%; }
.ad-card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--orange); }
.ad-card.drag { opacity: 0.4; cursor: grabbing; }
.ad-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ad-card h3 { font-size: 0.98rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.ad-card p { font-size: 12.5px; color: var(--mute); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-card-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed rgba(15, 15, 13, 0.35); font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mute); }
.ad-col-empty { color: rgba(15, 15, 13, 0.4); font-size: 12.5px; text-align: center; padding: 22px 6px; }
.ad-hint { font-size: 12.5px; color: var(--mute); margin-bottom: 12px; font-family: var(--f-mono); letter-spacing: 0.02em; }
.ad-more { margin-top: 18px; }
.ad-more summary { cursor: pointer; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); padding: 8px 0; }

/* ---------- toolbar + tables ---------- */
.ad-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.ad-search, .ad-sel { height: 42px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 14px; color: var(--ink); }
.ad-search { flex: 1 1 240px; min-width: 200px; }
.ad-search:focus, .ad-sel:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 74, 28, 0.18); }
.ad-sel { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%230F0F0D' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 10px; }
.ad-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 13px; background: var(--ink); color: var(--paper); border-radius: 999px; font-size: 12.5px; }
.ad-chip button { width: 22px; height: 22px; border-radius: 50%; background: rgba(238, 233, 222, 0.2); color: var(--paper); font-size: 14px; line-height: 1; }
.ad-table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--ink); font-size: 14px; }
.ad-table th { text-align: left; padding: 12px 14px 12px 0; font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); border-bottom: 1px solid var(--ink); white-space: nowrap; }
.ad-table td { padding: 14px 14px 14px 0; border-bottom: 1px solid rgba(15, 15, 13, 0.3); vertical-align: middle; }
.ad-table tr.row { cursor: pointer; transition: background 0.25s; }
.ad-table tr.row:hover { background: rgba(15, 15, 13, 0.04); }
.ad-table td b { font-weight: 500; display: block; }
.ad-table td small { display: block; color: var(--mute); font-size: 12.5px; margin-top: 2px; }
.ad-table .ref { font-family: var(--f-mono); font-size: 12px; color: var(--mute); }
.ad-scroll { overflow-x: auto; }

/* ---------- drawer ---------- */
.ad-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(15, 15, 13, 0.5); opacity: 0; transition: opacity 0.4s; }
.ad-scrim.show { opacity: 1; }
.ad-drawer { position: fixed; z-index: 100; top: 0; right: 0; height: 100%; width: min(540px, 100%); background: var(--paper); border-left: 2px solid var(--ink); transform: translateX(102%); transition: transform 0.55s var(--ease); display: flex; flex-direction: column; box-shadow: -18px 0 40px rgba(15, 15, 13, 0.18); }
.ad-drawer.open { transform: none; }
.ad-dr-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; background: var(--ink); color: var(--paper); }
.ad-dr-head .ad-ref { color: var(--orange); }
.ad-dr-head h2 { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; margin-top: 6px; }
.ad-dr-head .ad-badge { color: var(--ink); }
.ad-dr-head .ad-badge.completed { background: var(--paper); color: var(--ink); }
.ad-dr-head .ad-badge.cancelled { color: var(--mute); }
.ad-dr-close { width: 36px; height: 36px; flex: none; border: 1px solid rgba(238, 233, 222, 0.45); border-radius: 50%; color: var(--paper); font-size: 20px; line-height: 1; transition: background 0.3s, color 0.3s; }
.ad-dr-close:hover { background: var(--paper); color: var(--ink); }
.ad-dr-body { flex: 1; overflow-y: auto; padding: 22px 24px 30px; display: flex; flex-direction: column; gap: 26px; }
.ad-sec h4 { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.ad-sec h4::after { content: ""; flex: 1; height: 1px; background: rgba(15, 15, 13, 0.3); }
.ad-dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 9px 14px; font-size: 14px; }
.ad-dl dt { color: var(--mute); font-size: 13px; }
.ad-dl dd { word-break: break-word; }
.ad-dl a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(15, 15, 13, 0.4); }
.ad-dl a:hover { color: var(--orange); }
.ad-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 4px 0 10px; }
.ad-step { padding: 10px 4px 9px; border: 1.5px solid var(--ink); border-radius: 4px; font-family: var(--f-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase; text-align: center; line-height: 1.25; transition: background 0.25s, color 0.25s, border-color 0.25s; }
.ad-step:hover { background: rgba(15, 15, 13, 0.08); }
.ad-step.on { background: var(--ink); color: var(--paper); }
.ad-step.cur { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.ad-textarea { width: 100%; min-height: 78px; padding: 12px 14px; border: 1.5px solid var(--ink); background: var(--paper); font: inherit; font-size: 14px; resize: vertical; border-radius: 4px; }
.ad-textarea:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 74, 28, 0.18); }
.ad-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.ad-act .grow { flex: 1; }
.ad-help { font-size: 12.5px; color: var(--mute); margin-top: 6px; }
.ad-tl { list-style: none; position: relative; padding-left: 22px; }
.ad-tl::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; border-left: 1.5px dashed rgba(15, 15, 13, 0.5); }
.ad-tl li { position: relative; padding: 0 0 16px; font-size: 13.5px; }
.ad-tl li::before { content: ""; position: absolute; left: -22px; top: 4px; width: 11px; height: 11px; background: var(--paper); border: 1.5px solid var(--ink); }
.ad-tl li:first-child::before { background: var(--orange); border-color: var(--orange); }
.ad-tl b { font-weight: 500; }
.ad-tl small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.ad-tl p { margin-top: 3px; color: #3A3935; }

/* ---------- misc ---------- */
.ad-toast { position: fixed; z-index: 140; left: 50%; bottom: 26px; translate: -50% 20px; max-width: min(92vw, 520px); padding: 12px 18px; background: var(--ink); color: var(--paper); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.35s, translate 0.45s var(--ease); display: flex; gap: 14px; align-items: center; box-shadow: 6px 6px 0 var(--orange); }
.ad-toast.show { opacity: 1; translate: -50% 0; pointer-events: auto; }
.ad-toast.err { background: #C4300E; box-shadow: 6px 6px 0 var(--ink); }
.ad-toast button { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: underline; color: var(--orange); }
.ad-gate { max-width: 560px; margin: clamp(30px, 8vw, 90px) auto; padding: clamp(26px, 4vw, 44px); border: 1px solid var(--ink); background: var(--paper); box-shadow: 8px 8px 0 var(--ink); }
.ad-gate h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; margin: 10px 0 14px; }
.ad-gate p { color: #3A3935; line-height: 1.5; margin-bottom: 12px; }
.ad-gate pre { margin: 14px 0 18px; padding: 14px 16px; background: var(--ink); color: var(--paper); font-family: var(--f-mono); font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; }
.ad-gate .ad-act { margin-top: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .ad-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ad-kpi:nth-child(4) { border-left: 0; }
  .ad-kpi:nth-child(n+4) { border-top: 1px solid rgba(15, 15, 13, 0.3); }
  .ad-cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .ad-bar-in { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px 16px; }
  .ad-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 4px; }
  .ad-who { display: none; }
  .ad-user { margin-left: auto; }
  .ad-row-act .ad-age { display: none; }
  .ad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-kpi:nth-child(odd) { border-left: 0; }
  .ad-kpi:nth-child(n+3) { border-top: 1px solid rgba(15, 15, 13, 0.3); }
  .ad-kpi:nth-child(4) { border-left: 1px solid rgba(15, 15, 13, 0.3); }
  .ad-dl { grid-template-columns: 96px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ad-view, .ad-drawer, .ad-scrim { animation: none; transition: none; }
}
