/* =====================================================================
   Agent Console in the Nexa night-aurora style, with its own motion set.
   ===================================================================== */
:root {
  --bg: #04060a; --panel: rgba(12, 16, 22, .62); --panel-2: rgba(255, 255, 255, .045); --border: rgba(255, 255, 255, .085);
  --text: #e9eef3; --muted: #93a1b0; --accent: #3ee6a8; --accent-2: #10b981;
  --green: #3ee6a8; --yellow: #f5b941; --red: #f87171; --gray: #93a1b0;
  --shadow: 0 20px 50px -26px rgba(0, 0, 0, .9);
  --on-accent: #03140d; --spring: cubic-bezier(.34, 1.56, .64, 1); --out: cubic-bezier(.16, 1, .3, 1);
}
:root[data-theme="light"] { --accent: #0e9f72; --accent-2: #0f8f86; --green: #0e9f72; }
body { background: var(--bg); }

/* Icons + aurora */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; width: 18px; height: 18px; display: inline-block; vertical-align: -3px; flex-shrink: 0; transition: transform .35s var(--spring); }
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; }
.aurora .a1 { width: 60vmax; height: 60vmax; left: -18vmax; top: -26vmax; animation: drift1 26s ease-in-out infinite alternate; }
.aurora .a2 { width: 50vmax; height: 50vmax; right: -18vmax; top: -12vmax; animation: drift2 32s ease-in-out infinite alternate; }
.aurora .a3 { width: 46vmax; height: 46vmax; left: 20vw; bottom: -30vmax; animation: drift3 28s ease-in-out infinite alternate; }
.aurora .a4 { width: 34vmax; height: 34vmax; right: 6vw; bottom: -12vmax; animation: drift1 36s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(10vw, 8vh) rotate(25deg) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-12vw, 12vh) rotate(-20deg) scale(.92); } }
@keyframes drift3 { to { transform: translate(-8vw, -10vh) scale(1.12); } }
.app { position: relative; z-index: 1; }

/* Glass surfaces */
.sidebar { background: rgba(6, 9, 13, .72); backdrop-filter: blur(22px) saturate(150%); border-color: var(--border); }
.topbar { background: rgba(4, 6, 10, .55) !important; backdrop-filter: blur(18px); }
.card, .stat, .search { background: var(--panel); backdrop-filter: blur(16px) saturate(140%); border-color: var(--border); }
.drawer { background: rgba(8, 11, 16, .92); backdrop-filter: blur(24px); border-color: var(--border); }
.toast { background: rgba(10, 14, 20, .92); border-color: var(--border); backdrop-filter: blur(18px); }
@media (max-width: 820px), (pointer: coarse) { .card, .stat, .search, .sidebar, .topbar { backdrop-filter: none !important; } .card, .stat { background: rgba(12, 16, 22, .88); } }

/* Brand */
.brand .logo { background: linear-gradient(135deg, #46ebb0, #138a66) !important; color: var(--on-accent) !important; font-size: 0; position: relative; box-shadow: 0 0 18px rgba(62,230,168,.4); }
.brand .logo::after { content: ""; position: absolute; inset: 9px; border-radius: 3px; background: var(--bg); }

/* Navigation: each item has its own icon colour and hover motion */
.nav-item .ico { display: inline-grid; place-items: center; }
.nav-item .ico .i { width: 17px; height: 17px; color: var(--nc, var(--muted)); }
.nav-item[data-view="overview"] { --nc: #3ee6a8; } .nav-item[data-view="agents"] { --nc: #4cc3d4; } .nav-item[data-view="tasks"] { --nc: #f5b941; }
.nav-item[data-view="activity"] { --nc: #a191f2; } .nav-item[data-view="settings"] { --nc: #93b6dc; } .nav-item[href*="agents.html"] { --nc: #3ee6a8; }
.nav-item[data-view="overview"]:hover .i { transform: scale(1.15); }
.nav-item[data-view="agents"]:hover .i { transform: rotate(-12deg); }
.nav-item[data-view="tasks"]:hover .i { transform: translateY(-2px); }
.nav-item[data-view="activity"]:hover .i { transform: scaleX(1.2); }
.nav-item[data-view="settings"]:hover .i { transform: rotate(60deg); }
.nav-item[href="../"]:hover .i { transform: translateX(-3px); }
.nav-item.active { background: rgba(62, 230, 168, .1); box-shadow: inset 3px 0 0 var(--accent); color: var(--text); }
.nav { }
.nav .nav-item { animation: navIn .55s var(--out) both; }
.nav .nav-item:nth-child(2) { animation-delay: .05s; } .nav .nav-item:nth-child(3) { animation-delay: .1s; } .nav .nav-item:nth-child(4) { animation-delay: .15s; }
.nav .nav-item:nth-child(5) { animation-delay: .2s; } .nav .nav-item:nth-child(6) { animation-delay: .25s; } .nav .nav-item:nth-child(7) { animation-delay: .3s; }
@keyframes navIn { from { opacity: 0; transform: translate3d(-16px, 0, 0); } }

/* Buttons */
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 28px -14px rgba(62,230,168,.7); transition: transform .25s var(--spring), box-shadow .25s; display: inline-flex; align-items: center; gap: 7px; }
.btn.primary:hover { filter: none; transform: translateY(-2px); box-shadow: 0 14px 34px -14px rgba(62,230,168,.85); }
.btn.primary .i { width: 15px; height: 15px; }
.icon-btn { background: var(--panel); border-color: var(--border); display: inline-grid; place-items: center; transition: transform .2s; }
#themeBtn:hover .i { transform: rotate(180deg); }
#closeDrawer:hover .i { transform: rotate(90deg); color: var(--red); }
.chip.active { background: rgba(62,230,168,.12); border-color: rgba(62,230,168,.5); color: var(--text); }

/* Overview: statistic cards rise in a wave */
.stats .stat { animation: statRise .7s var(--out) both; }
.stats .stat:nth-child(2) { animation-delay: .08s; } .stats .stat:nth-child(3) { animation-delay: .16s; } .stats .stat:nth-child(4) { animation-delay: .24s; }
@keyframes statRise { from { opacity: 0; transform: translate3d(0, 26px, 0) scale(.96); } }
.stat .value { font-variant-numeric: tabular-nums; }
.stat:hover { border-color: rgba(62,230,168,.35); transform: translateY(-2px); transition: transform .3s var(--out), border-color .3s; }

/* Chart: bars grow like an equaliser, one after another */
.chart .b { background: linear-gradient(180deg, #46ebb0, rgba(19,138,102,.55)); transform-origin: bottom; animation: barGrow .9s var(--spring) both; }
.chart .b.zero { background: var(--border); }
.chart .col:nth-child(1) .b { animation-delay: .02s; } .chart .col:nth-child(2) .b { animation-delay: .05s; } .chart .col:nth-child(3) .b { animation-delay: .08s; }
.chart .col:nth-child(4) .b { animation-delay: .11s; } .chart .col:nth-child(5) .b { animation-delay: .14s; } .chart .col:nth-child(6) .b { animation-delay: .17s; }
.chart .col:nth-child(7) .b { animation-delay: .2s; } .chart .col:nth-child(8) .b { animation-delay: .23s; } .chart .col:nth-child(9) .b { animation-delay: .26s; }
.chart .col:nth-child(10) .b { animation-delay: .29s; } .chart .col:nth-child(11) .b { animation-delay: .32s; } .chart .col:nth-child(12) .b { animation-delay: .35s; }
.chart .col:nth-child(13) .b { animation-delay: .38s; } .chart .col:nth-child(14) .b { animation-delay: .41s; }
@keyframes barGrow { from { transform: scaleY(0); } 65% { transform: scaleY(1.06); } }

/* Usage bars fill from the left */
.usage-bar i { animation: fill 1.1s var(--out) both; transform-origin: 0 50%; }
@keyframes fill { from { transform: scaleX(0); } }
.usage-row { animation: fromRight .5s var(--out) both; }

/* Agent cards flip in */
.agent-grid .agent-card { animation: flipIn .7s var(--out) both; transform-origin: 50% 0; background: var(--panel-2); border-color: var(--border); }
.agent-grid .agent-card:nth-child(2) { animation-delay: .06s; } .agent-grid .agent-card:nth-child(3) { animation-delay: .12s; }
.agent-grid .agent-card:nth-child(4) { animation-delay: .18s; } .agent-grid .agent-card:nth-child(5) { animation-delay: .24s; } .agent-grid .agent-card:nth-child(n+6) { animation-delay: .3s; }
@keyframes flipIn { from { opacity: 0; transform: perspective(800px) rotateX(-40deg) translate3d(0, -10px, 0); } }
.agent-card:hover { border-color: rgba(62,230,168,.45); }

/* Activity slides in from the right */
.feed li { animation: fromRight .5s var(--out) both; }
.feed li:nth-child(2) { animation-delay: .05s; } .feed li:nth-child(3) { animation-delay: .1s; } .feed li:nth-child(4) { animation-delay: .15s; }
.feed li:nth-child(5) { animation-delay: .2s; } .feed li:nth-child(6) { animation-delay: .25s; } .feed li:nth-child(n+7) { animation-delay: .3s; }
@keyframes fromRight { from { opacity: 0; transform: translate3d(22px, 0, 0); } }

/* Table rows fade in one by one */
.table tbody tr { animation: rowIn .45s var(--out) both; }
.table tbody tr:nth-child(2) { animation-delay: .04s; } .table tbody tr:nth-child(3) { animation-delay: .08s; } .table tbody tr:nth-child(4) { animation-delay: .12s; }
.table tbody tr:nth-child(5) { animation-delay: .16s; } .table tbody tr:nth-child(6) { animation-delay: .2s; } .table tbody tr:nth-child(n+7) { animation-delay: .24s; }
@keyframes rowIn { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
.table tbody tr:hover { background: rgba(62,230,168,.06); }

/* Tasks: finishing one draws a line through it */
.task-row { animation: rowIn .4s var(--out) both; }
.task-row .task-text { text-decoration: none !important; background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-position: 0 56%; background-size: 0 1.5px; transition: background-size .45s var(--out), color .3s; }
.task-row.done .task-text { background-size: 100% 1.5px; }
.task-row input { accent-color: var(--accent); }

/* Drawer springs in */
.drawer { transition: transform .5s var(--spring) !important; }
.drawer.open .kv div { animation: rowIn .45s var(--out) both; }
.drawer.open .kv div:nth-child(2) { animation-delay: .04s; } .drawer.open .kv div:nth-child(3) { animation-delay: .08s; }
.drawer.open .kv div:nth-child(4) { animation-delay: .12s; } .drawer.open .kv div:nth-child(5) { animation-delay: .16s; } .drawer.open .kv div:nth-child(6) { animation-delay: .2s; }

/* View switch: content glides in */
.view.active { animation: viewIn .45s var(--out) both !important; }
@keyframes viewIn { from { opacity: 0; transform: translate3d(0, 12px, 0); } }

/* Agent marks */
.av-svg { color: #fff; display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.av-svg .i { width: 58%; height: 58%; stroke-width: 2; }
.feed-av.av-svg .i { width: 15px; height: 15px; }
.badge.running { color: var(--accent); background: rgba(62,230,168,.12); }
.custom-chip { color: var(--accent); border-color: rgba(62,230,168,.45); }

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

/* Icons that replaced the old symbols */
.onboard-ico { color: var(--on-accent) !important; background: linear-gradient(135deg, #46ebb0, #138a66) !important; }
.onboard-ico .i { width: 22px; height: 22px; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: rotate(18deg) scale(1.12); } }
#exportData { display: inline-flex; align-items: center; gap: 7px; }
#exportData .i { width: 15px; height: 15px; transition: transform .3s var(--spring); }
#exportData:hover .i { transform: translateY(2px); }
.task-del { display: inline-grid; place-items: center; }
.task-del .i { width: 14px; height: 14px; transition: transform .3s var(--spring); }
.task-del:hover .i { transform: rotate(90deg); }

/* Bigger tap areas on phones without changing the layout */
@media (pointer: coarse), (max-width: 820px) {
  .link { display: inline-block; padding-block: 12px; margin-block: -12px; }
}

.search .search-ico { display: inline-grid; place-items: center; color: var(--muted); }
.search .search-ico .i { width: 15px; height: 15px; transition: transform .3s var(--spring); }
.search:focus-within .search-ico .i { transform: scale(1.12); color: var(--accent); }

/* Social links at the bottom: round buttons that lift and glow mint on hover */
.social { display: inline-flex; gap: 10px; align-items: center; }
.social a { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; color: #c9d4dc; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); text-decoration: none; transition: transform .3s cubic-bezier(.34,1.56,.64,1), color .2s, border-color .2s, background .2s; }
.social a:hover { transform: translateY(-3px); color: #03140d; background: #3ee6a8; border-color: #3ee6a8; }
.social svg { display: block; }
.side-social { padding: 10px 12px 4px; }
.side-social .social a { width: 34px; height: 34px; }
