:root {
  --bg: #070b18;
  --panel: rgba(16, 24, 48, 0.82);
  --panel-strong: rgba(21, 32, 62, 0.96);
  --card: rgba(255, 255, 255, 0.075);
  --card-2: rgba(255, 255, 255, 0.115);
  --text: #eef4ff;
  --muted: #96a4bf;
  --line: rgba(141, 165, 211, 0.28);
  --blue: #56b7ff;
  --cyan: #38f0ff;
  --green: #5df5a8;
  --yellow: #ffd166;
  --red: #ff6b7a;
  --purple: #a78bfa;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(56, 240, 255, 0.20), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(167, 139, 250, 0.20), transparent 25%),
    radial-gradient(circle at 50% 90%, rgba(93, 245, 168, 0.09), transparent 26%),
    var(--bg);
  overflow-x: hidden;
}

button, input { font: inherit; }
.shell { width: min(1580px, calc(100vw - 32px)); margin: 0 auto; padding: 28px 0 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan); font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 48px); letter-spacing: -0.055em; }
h2 { margin-bottom: 8px; letter-spacing: -0.03em; }
h3 { margin-bottom: 8px; }
.muted { color: var(--muted); line-height: 1.6; }
.top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.btn, .icon-btn {
  border: 0;
  color: var(--text);
  cursor: pointer;
  border-radius: 14px;
  font-weight: 800;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn { padding: 12px 16px; border: 1px solid rgba(255,255,255,.14); }
.btn:hover, .icon-btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--blue), var(--purple)); box-shadow: 0 12px 30px rgba(86, 183, 255, 0.26); }
.btn.secondary { background: rgba(255, 255, 255, 0.10); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { padding: 9px 12px; font-size: 13px; border-radius: 11px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.icon-btn { width: 38px; height: 38px; background: rgba(255,255,255,.08); color: var(--muted); font-size: 26px; line-height: 1; }

.badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; background: rgba(86, 183, 255, 0.13); color: #bce7ff; border: 1px solid rgba(86, 183, 255, 0.22); font-weight: 800; font-size: 12px; }
.badge-warn { color: #ffe29c; background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.22); }
.badge-success { color: #c6ffdf; background: rgba(93, 245, 168, 0.13); border-color: rgba(93, 245, 168, 0.26); }

.hero-card, .kanban-area, .side-panel, .modal {
  background: linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.045));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-card { border-radius: 28px; padding: 24px; display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.hero-card p { max-width: 780px; color: var(--muted); line-height: 1.65; margin: 0; }
.hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; min-width: 330px; }
.hero-metrics div { background: rgba(255,255,255,.08); border-radius: 20px; padding: 16px; text-align: center; border: 1px solid rgba(255,255,255,.1); }
.hero-metrics span { display: block; font-size: 30px; font-weight: 900; }
.hero-metrics small { color: var(--muted); font-weight: 700; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 20px; align-items: start; }
.kanban-area { min-height: 640px; border-radius: 28px; padding: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-head p { margin: 0; color: var(--muted); }
.section-head.compact { margin: 0 0 10px; }
.section-head.compact h3 { margin: 0; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.column { background: rgba(3, 7, 18, 0.38); border: 1px solid rgba(255,255,255,.10); border-radius: 22px; padding: 12px; min-height: 560px; }
.column-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: #dbe9ff; font-weight: 900; }
.column-head span:last-child { color: var(--muted); font-size: 12px; background: rgba(255,255,255,.08); border-radius: 999px; padding: 4px 8px; }
.ticket-card { background: linear-gradient(160deg, rgba(255,255,255,.13), rgba(255,255,255,.055)); border: 1px solid rgba(255,255,255,.13); border-radius: 18px; padding: 14px; margin-bottom: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.ticket-top, .ticket-meta, .ticket-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket-key { color: var(--cyan); font-size: 12px; font-weight: 900; letter-spacing: .06em; }
.priority { font-size: 11px; color: #ffe7a9; background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.2); border-radius: 999px; padding: 4px 8px; font-weight: 800; }
.ticket-card h3 { font-size: 15px; line-height: 1.35; margin-top: 10px; }
.ticket-desc { color: var(--muted); font-size: 12px; line-height: 1.55; min-height: 38px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 11px 0; }
.chip { font-size: 11px; color: #cbe4ff; background: rgba(86,183,255,.10); border: 1px solid rgba(86,183,255,.16); border-radius: 999px; padding: 4px 7px; }
.ticket-meta { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.criteria { color: #d5e4fb; font-size: 12px; background: rgba(3,7,18,.32); padding: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.criteria ul { margin: 6px 0 0 16px; padding: 0; }
.criteria li { margin: 4px 0; }

.side-panel { position: sticky; top: 16px; height: calc(100vh - 32px); border-radius: 28px; padding: 18px; overflow: hidden; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 20px; }
.current-agent-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 18px; background: rgba(56,240,255,.09); border: 1px solid rgba(56,240,255,.18); margin-bottom: 14px; }
.current-agent-card small { color: var(--muted); display: block; margin-bottom: 4px; }
.current-agent-card p { color: var(--muted); font-size: 12px; margin: 5px 0 0; line-height: 1.5; }
.pulse-dot { width: 12px; height: 12px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 rgba(93,245,168,.7); margin-top: 7px; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(93,245,168,.6); } 70% { box-shadow: 0 0 0 12px rgba(93,245,168,0); } 100% { box-shadow: 0 0 0 0 rgba(93,245,168,0); } }
.agent-graph { position: relative; height: 430px; background: radial-gradient(circle at center, rgba(86,183,255,.08), rgba(3,7,18,.26)); border-radius: 22px; border: 1px solid rgba(255,255,255,.1); overflow: hidden; margin-bottom: 14px; }
.agent-node { position: absolute; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 999px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 9px; font-size: 11px; font-weight: 900; color: #ddecff; background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.24), rgba(86,183,255,.10) 38%, rgba(19,30,57,.96) 75%); border: 1px solid rgba(141,165,211,.42); box-shadow: 0 8px 30px rgba(0,0,0,.3); z-index: 2; }
.agent-node .status { font-size: 10px; color: var(--muted); margin-top: 5px; }
.agent-node.active { border-color: var(--cyan); color: white; box-shadow: 0 0 35px rgba(56,240,255,.56), inset 0 0 26px rgba(56,240,255,.16); animation: nodeGlow 1.25s infinite alternate; }
.agent-node.completed { border-color: var(--green); box-shadow: 0 0 24px rgba(93,245,168,.30); }
.agent-node.completed .status { color: var(--green); }
@keyframes nodeGlow { from { transform: scale(1); } to { transform: scale(1.045); } }
.agent-line { position: absolute; height: 3px; transform-origin: left center; border-top: 3px dotted rgba(141,165,211,.34); z-index: 1; transition: border .25s ease, box-shadow .25s ease; }
.agent-line.active { border-top: 3px solid var(--cyan); box-shadow: 0 0 18px rgba(56,240,255,.95); }
.agent-line.completed { border-top: 3px solid rgba(93,245,168,.7); box-shadow: 0 0 12px rgba(93,245,168,.45); }
.event-log-wrap { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.event-log { flex: 1; overflow: auto; padding-right: 4px; }
.event-item { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.event-item time { color: var(--muted); font-weight: 700; }
.event-item strong { color: #ddecff; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(9px); display: grid; place-items: center; z-index: 20; padding: 20px; }
.modal { width: min(720px, 100%); border-radius: 28px; padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 12px; }
.tabs { display: flex; gap: 8px; background: rgba(255,255,255,.06); border-radius: 16px; padding: 6px; margin: 18px 0; }
.tab { flex: 1; border: 0; border-radius: 12px; padding: 10px; cursor: pointer; color: var(--muted); background: transparent; font-weight: 900; }
.tab.active { color: white; background: rgba(86,183,255,.18); }
label { display: block; color: #dce8ff; font-weight: 800; margin-bottom: 12px; }
input { width: 100%; margin-top: 7px; padding: 12px 13px; border-radius: 13px; background: rgba(3,7,18,.38); border: 1px solid rgba(255,255,255,.14); color: var(--text); outline: none; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,240,255,.12); }
.info-box, .error { padding: 14px; border-radius: 16px; line-height: 1.55; }
.info-box { color: #cbe4ff; background: rgba(86,183,255,.10); border: 1px solid rgba(86,183,255,.2); }
.error { color: #ffd2d8; background: rgba(255,107,122,.12); border: 1px solid rgba(255,107,122,.22); margin: 12px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions.centered { justify-content: center; }
.pr-modal { text-align: center; }
.success-orb { width: 80px; height: 80px; border-radius: 999px; display: grid; place-items: center; margin: 0 auto 16px; background: linear-gradient(135deg, var(--green), var(--cyan)); color: #061421; font-weight: 1000; font-size: 42px; box-shadow: 0 0 42px rgba(93,245,168,.38); }
.pr-summary { margin: 18px 0; text-align: left; background: rgba(3,7,18,.34); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 16px; }
.pr-summary div { margin: 8px 0; color: #d7e8ff; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.check { background: rgba(93,245,168,.10); color: #c6ffdf; border: 1px solid rgba(93,245,168,.18); border-radius: 14px; padding: 11px; font-weight: 900; font-size: 13px; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .side-panel { position: fixed; inset: 12px; height: auto; z-index: 10; }
  .kanban { grid-template-columns: repeat(5, minmax(250px, 1fr)); }
}
@media (max-width: 760px) {
  .shell { width: min(100vw - 20px, 1580px); padding-top: 16px; }
  .topbar, .hero-card { align-items: flex-start; flex-direction: column; }
  .hero-metrics { width: 100%; min-width: 0; }
  .check-grid { grid-template-columns: 1fr; }
}
