:root {
  color-scheme: dark;
  --ar-orange: #ff5a2a;
  --ar-orange-2: #ff8134;
  --ar-red: #d8301b;
  --ar-bg: #040506;
  --ar-panel: rgba(8, 9, 11, .94);
  --ar-panel-2: rgba(13, 14, 17, .94);
  --ar-line: rgba(255, 91, 39, .25);
  --ar-soft-line: rgba(255, 255, 255, .075);
  --ar-text: #f5f5f6;
  --ar-muted: #858993;
  --ar-dim: #535760;
  --ar-green: #35df79;
  --ar-yellow: #ffbd3b;
  --ar-red-text: #ff6371;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ar-bg); }
body { min-height: 100vh; margin: 0; color: var(--ar-text); background: var(--ar-bg); font: 14px Inter, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.ar-background { position: fixed; z-index: 0; inset: 0; overflow: hidden; background: radial-gradient(circle at 88% 5%,rgba(255,76,23,.16),transparent 31%),radial-gradient(circle at 12% 92%,rgba(255,116,33,.07),transparent 30%),linear-gradient(120deg,#030405,#0a0605 52%,#030405); }
.ar-background::before { position: absolute; inset: 0; content: ""; background-image: linear-gradient(rgba(255,255,255,.016) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.016) 1px,transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom,rgba(0,0,0,.65),transparent 86%); }
.ar-background::after { position: absolute; right: -140px; top: 6%; width: 470px; height: 470px; border: 1px solid rgba(255,82,25,.08); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,82,25,.018),0 0 0 110px rgba(255,82,25,.012); content: ""; }

#app { position: relative; z-index: 1; display: grid; grid-template-columns: 268px minmax(0,1fr); gap: 24px; width: min(1920px,100%); min-height: 100vh; margin: 0 auto; padding: 20px; }
.ar-sidebar { position: sticky; top: 20px; display: flex; flex-direction: column; height: calc(100vh - 40px); min-height: 650px; padding: 18px 14px 14px; overflow: hidden auto; border: 1px solid rgba(255,255,255,.105); border-radius: 20px; background: linear-gradient(155deg,rgba(15,16,20,.97),rgba(5,6,8,.98)); box-shadow: 0 28px 90px rgba(0,0,0,.48),inset 0 1px rgba(255,255,255,.04); }
.ar-brand { display: flex; align-items: center; gap: 13px; min-height: 72px; padding: 3px 5px 17px; border-bottom: 1px solid var(--ar-soft-line); color: #fff; text-decoration: none; }
.ar-brand > b { display: grid; place-items: center; flex: 0 0 50px; width: 50px; height: 50px; border: 1px solid rgba(255,128,78,.65); border-radius: 14px; background: linear-gradient(145deg,#ff673b,#bc2317 72%,#6b140f); box-shadow: 0 11px 30px rgba(233,51,25,.26),inset 0 1px rgba(255,255,255,.2); font-size: 25px; }
.ar-brand span { font-size: 17px; font-weight: 800; }
.ar-brand small { display: block; margin-top: 5px; color: #71757e; font-size: 10px; font-weight: 500; }
#nav { display: grid; gap: 2px; margin-top: 14px; }
.ar-nav-group { margin: 14px 11px 7px; color: #62666f; font-size: 9px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
#nav button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 9px 34px 9px 12px; overflow: hidden; border: 0; border-radius: 10px; color: #969aa3; background: transparent; cursor: pointer; text-align: left; font-weight: 650; transition: .18s ease; }
#nav button::after { position: absolute; right: 13px; top: 50%; color: #60646c; content: "›"; translate: 0 -52%; font-size: 22px; }
#nav button:hover { color: #fff; background: rgba(255,255,255,.035); transform: translateX(2px); }
#nav button.active { color: #fff; background: linear-gradient(90deg,rgba(255,76,33,.28),rgba(103,22,13,.12)); box-shadow: inset 3px 0 var(--ar-orange),inset 0 0 0 1px rgba(255,90,42,.08); }
.ar-nav-icon { display: grid; place-items: center; flex: 0 0 22px; width: 22px; color: currentColor; font-size: 17px; }
.ar-sidebar-status { display: grid; gap: 6px; margin-top: auto; padding: 13px; border: 1px solid var(--ar-soft-line); border-radius: 10px; background: rgba(255,255,255,.018); }
.ar-sidebar-status strong { color: var(--ar-green); font-size: 10px; }
.ar-sidebar-status strong i,.ar-header-live i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ar-green); box-shadow: 0 0 12px var(--ar-green); }
.ar-sidebar-status span { color: var(--ar-muted); font-size: 9px; line-height: 1.5; }
.ar-back { display: flex; align-items: center; min-height: 42px; margin-top: 10px; padding: 0 12px; border: 1px solid var(--ar-soft-line); border-radius: 9px; color: #8f939b; text-decoration: none; font-size: 11px; }
.ar-back:hover { color: #fff; border-color: var(--ar-line); }

.ar-main { min-width: 0; padding: 0 6px 28px 0; }
.ar-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 82px; }
.ar-header p,.eyebrow { margin: 0; color: var(--ar-orange); font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.ar-header h1 { margin: 6px 0 0; color: #fff; font-size: clamp(25px,2.2vw,34px); line-height: 1.1; }
.ar-header-live { display: flex; align-items: center; gap: 3px; min-height: 38px; padding: 0 14px; border: 1px solid rgba(49,223,119,.2); border-radius: 24px; color: var(--ar-green); background: rgba(19,94,48,.08); font-size: 10px; font-weight: 750; }
.ar-header-live.warn { border-color: rgba(255,174,45,.28); background: rgba(255,174,45,.08); color: #ffc35c; }
.ar-header-live.offline { border-color: rgba(255,74,60,.3); background: rgba(255,74,60,.08); color: #ff746b; }
.ar-header-live.warn i { background: #ffad2e; box-shadow: 0 0 11px #ffad2e; }
.ar-header-live.offline i,.ar-sidebar-status.offline i { background: #ff4a3c; box-shadow: 0 0 11px #ff4a3c; }
#notice { position: fixed; z-index: 80; top: 22px; right: 28px; }
.toast { max-width: 420px; padding: 13px 17px; border: 1px solid rgba(48,223,121,.34); border-radius: 10px; color: #75efa1; background: rgba(9,35,20,.97); box-shadow: 0 16px 45px rgba(0,0,0,.42); }
.toast.error { color: #ff8490; border-color: rgba(255,64,84,.42); background: rgba(44,9,14,.97); }
.ar-content { display: grid; gap: 14px; }
.ar-content.is-loading { min-height: 380px; place-items: center; border: 1px solid var(--ar-line); border-radius: 16px; color: var(--ar-muted); background: var(--ar-panel); }

.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.stat { min-height: 104px; padding: 17px 18px; border: 1px solid var(--ar-soft-line); border-radius: 12px; background: radial-gradient(circle at 100% 0,rgba(255,77,22,.075),transparent 48%),var(--ar-panel); box-shadow: inset 0 1px rgba(255,255,255,.018); }
.stat b { display: block; color: #fff; font-size: 28px; line-height: 1; }
.stat span { display: block; margin-top: 9px; color: var(--ar-muted); font-size: 10px; }
.stat em { display: block; margin-top: 9px; color: var(--ar-green); font-size: 9px; font-style: normal; }
.panel { overflow: hidden; border: 1px solid var(--ar-soft-line); border-radius: 13px; background: var(--ar-panel); box-shadow: 0 18px 60px rgba(0,0,0,.22); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 0 18px; border-bottom: 1px solid var(--ar-soft-line); }
.panel-head h2,.panel-head h3 { margin: 0; font-size: 14px; }
.panel-head span { color: var(--ar-muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.48fr) minmax(260px,.62fr); gap: 14px; }
.dashboard-bottom { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 14px; }
.system-health { display: grid; gap: 10px; padding: 14px; }
.health-item { padding: 13px; border: 1px solid var(--ar-soft-line); border-radius: 10px; background: rgba(255,255,255,.018); }
.health-item header { display: flex; justify-content: space-between; color: #e9e9eb; font-size: 11px; font-weight: 750; }
.health-item p { margin: 6px 0 0; color: var(--ar-muted); font-size: 9px; }
.health-track { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.075); }
.health-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--ar-orange),var(--ar-orange-2)); }

.table { display: grid; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(200px,1.3fr) minmax(120px,.72fr) minmax(110px,.62fr) minmax(90px,.55fr) auto; gap: 14px; align-items: center; min-height: 60px; padding: 11px 16px; border-bottom: 1px solid rgba(255,255,255,.055); }
.row:last-child { border-bottom: 0; }
.row.head { min-height: 43px; color: var(--ar-dim); background: rgba(255,255,255,.012); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.row b { overflow: hidden; color: #f4f4f5; text-overflow: ellipsis; white-space: nowrap; }
.row small { display: block; overflow: hidden; margin-top: 4px; color: var(--ar-muted); text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--ar-muted); font-size: 11px; }
.tag { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 9px; border-radius: 18px; color: var(--ar-green); background: rgba(31,154,74,.1); font-size: 9px; font-weight: 800; }
.tag::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.tag.bad { color: var(--ar-red-text); background: rgba(174,27,45,.11); }
.tag.warn { color: var(--ar-yellow); background: rgba(174,115,19,.11); }
.actions { display: flex; gap: 7px; align-items: center; }
button.primary,button.danger,button.ghost,.panel-action { min-height: 38px; padding: 0 14px; border: 1px solid var(--ar-orange); border-radius: 8px; color: #fff; background: linear-gradient(135deg,var(--ar-orange),#de3519); cursor: pointer; font-weight: 750; }
button.ghost,.panel-action { border-color: var(--ar-line); color: #e2e2e4; background: rgba(255,76,25,.055); }
button.danger { border-color: rgba(255,66,82,.38); color: var(--ar-red-text); background: rgba(92,10,18,.18); }
button:hover:not(:disabled) { filter: brightness(1.12); }
button:disabled { opacity: .42; cursor: default; }
.panel-action { min-height: 32px; font-size: 9px; }
.toolbar,.form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; padding: 17px; border: 1px solid var(--ar-line); border-radius: 12px; background: radial-gradient(circle at 100% 0,rgba(255,72,18,.08),transparent 34%),var(--ar-panel); }
.form + .form { margin-top: 10px; }
.form label { display: grid; flex: 1; gap: 7px; min-width: 160px; color: #a6a8ae; font-size: 9px; font-weight: 700; }
input,select,textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; outline: 0; color: #fff; background: #050607; }
textarea { min-height: 90px; resize: vertical; }
input:focus,select:focus,textarea:focus { border-color: var(--ar-orange); box-shadow: 0 0 0 3px rgba(255,80,28,.08); }
.cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 12px; }
.card { min-width: 0; padding: 18px; border: 1px solid var(--ar-soft-line); border-radius: 12px; background: var(--ar-panel); }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.card p { line-height: 1.55; }
.settings-grid .card { display: grid; gap: 9px; }
.settings-grid label.card { cursor: pointer; }
.settings-grid input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--ar-orange); }
.empty { padding: 55px 20px; border: 1px dashed rgba(255,255,255,.12); border-radius: 11px; color: var(--ar-muted); text-align: center; }

.event-list,.queue-list { display: grid; }
.event-row { display: grid; grid-template-columns: 72px 88px minmax(0,1fr); gap: 11px; align-items: center; min-height: 48px; padding: 9px 16px; border-bottom: 1px solid rgba(255,255,255,.05); font-family: "Cascadia Mono",Consolas,monospace; font-size: 10px; }
.event-row:last-child { border-bottom: 0; }
.event-row time { color: #6f737c; }
.event-row strong { color: var(--ar-green); font-weight: 700; }
.event-row strong.warn { color: var(--ar-yellow); }
.event-row strong.bad { color: var(--ar-red-text); }
.event-row span { overflow: hidden; color: #b6b8be; text-overflow: ellipsis; white-space: nowrap; }
.queue-list { gap: 8px; padding: 12px; }
.queue-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; padding: 12px; border-left: 2px solid var(--ar-orange); background: rgba(255,255,255,.022); }
.queue-item b { font-size: 11px; }
.queue-item small { display: block; margin-top: 5px; color: var(--ar-muted); font-size: 9px; }
.queue-item time { color: var(--ar-yellow); font-size: 9px; }

.ar-dialog { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 18px; }
.ar-dialog-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(9px); }
.ar-dialog-card { position: relative; width: min(480px,100%); overflow: hidden; padding: 28px; border: 1px solid rgba(255,88,38,.42); border-radius: 17px; background: radial-gradient(circle at 100% 0,rgba(255,69,19,.13),transparent 36%),#090a0c; box-shadow: 0 35px 110px rgba(0,0,0,.72); animation: ar-dialog-in .18s ease-out; }
.ar-dialog-card > small { color: var(--ar-orange); font-size: 9px; font-weight: 850; letter-spacing: .13em; }
.ar-dialog-card h2 { margin: 9px 0 7px; font-size: 23px; }
.ar-dialog-card p { margin: 0 0 19px; color: var(--ar-muted); font-size: 11px; line-height: 1.6; }
.ar-dialog-entity { margin-bottom: 16px; padding: 12px; border: 1px solid var(--ar-soft-line); border-radius: 9px; background: rgba(0,0,0,.25); }
.ar-dialog-entity b { display: block; }
.ar-dialog-entity span { display: block; margin-top: 5px; color: var(--ar-muted); font-size: 9px; }
.ar-dialog-card label { display: grid; gap: 7px; margin-bottom: 16px; color: #aaa; font-size: 10px; }
.ar-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ar-dialog-actions button { min-height: 43px; }
@keyframes ar-dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

@media (max-width: 1180px) {
  #app { grid-template-columns: 224px minmax(0,1fr); gap: 16px; padding: 14px; }
  .dashboard-grid,.dashboard-bottom { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(180px,1.2fr) repeat(3,minmax(90px,.7fr)) auto; gap: 9px; }
}
@media (max-width: 820px) {
  #app { display: block; padding: 9px; }
  .ar-sidebar { position: static; width: 100%; height: auto; min-height: 0; margin-bottom: 12px; }
  #nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ar-nav-group,.ar-sidebar-status { display: none; }
  #nav button { justify-content: center; padding: 8px; }
  #nav button::after { display: none; }
  .ar-back { margin-top: 12px; }
  .ar-main { padding: 0 3px 22px; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .row.head { display: none; }
  .actions { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .ar-brand { min-height: 60px; padding-bottom: 12px; }
  .ar-brand > b { flex-basis: 42px; width: 42px; height: 42px; border-radius: 11px; font-size: 20px; }
  #nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #nav button { min-width: 0; font-size: 11px; }
  .ar-header { min-height: 75px; }
  .ar-header-live { display: none; }
  .stats { gap: 8px; }
  .stat { min-height: 92px; padding: 14px; }
  .stat b { font-size: 23px; }
  .row { grid-template-columns: 1fr; }
  .form { display: grid; }
  .form label { min-width: 0; }
  .cards { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 60px 70px minmax(0,1fr); gap: 7px; padding: 9px 11px; font-size: 8px; }
  .ar-dialog-card { padding: 23px 18px 18px; }
  .ar-dialog-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
.ar-demo-banner { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:18px; padding:16px 18px; border:1px solid rgba(255,82,45,.48); border-radius:14px; background:linear-gradient(100deg,rgba(255,64,28,.16),rgba(255,64,28,.035)); box-shadow:0 0 32px rgba(255,58,27,.08); }
.ar-demo-banner div { display:flex; flex-direction:column; gap:4px; }
.ar-demo-banner b { color:#ff623f; font-size:12px; letter-spacing:.12em; }
.ar-demo-banner span { color:#a9abb4; font-size:13px; }
.ar-demo-banner a { flex:none; padding:10px 14px; border:1px solid rgba(255,82,45,.45); border-radius:10px; color:#f4f4f6; text-decoration:none; font-size:12px; font-weight:700; }
.ar-demo-banner a:hover { background:rgba(255,82,45,.12); }
@media (max-width:720px) { .ar-demo-banner { align-items:flex-start; flex-direction:column; } .ar-demo-banner a { width:100%; text-align:center; } }
