:root {
  color-scheme: dark;
  --bg: #07142b;
  --bg-deep: #050e20;
  --surface: #0d1e38;
  --surface-2: #102541;
  --surface-3: #142d4d;
  --border: #203b5d;
  --text: #edf4ff;
  --muted: #91a7c2;
  --blue: #3989ed;
  --blue-bright: #57a5ff;
  --green: #35d39a;
  --red: #ff6685;
  --amber: #f5bd59;
  --shadow: 0 18px 50px rgba(0,0,0,.25);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(ellipse at 15% 0%, #102b50 0, var(--bg) 43%, var(--bg-deep) 100%); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 9px; color: #75b4ff; font-size: .69rem; font-weight: 800; letter-spacing: .16em; }
.small { font-size: .78rem; }
.error { min-height: 20px; color: #ff8da4; font-size: .86rem; line-height: 1.5; }
.toast { position: fixed; z-index: 1000; right: 22px; top: 20px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 17px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-12px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; overflow: hidden; position: relative; }
.login-wrap::before, .login-wrap::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.login-wrap::before { background: rgba(36,123,221,.13); top: -150px; left: -130px; }
.login-wrap::after { background: rgba(43,194,169,.08); bottom: -190px; right: -120px; }
.login-card { position: relative; z-index: 1; width: min(100%, 440px); padding: 38px; background: linear-gradient(155deg, rgba(18,43,74,.97), rgba(9,25,47,.98)); border: 1px solid #29496c; border-radius: 23px; box-shadow: 0 28px 90px rgba(0,0,0,.38); animation: rise .55s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 16px; color: white; font-size: 1.55rem; font-weight: 900; background: linear-gradient(145deg, #55adff, #1760bd); box-shadow: 0 9px 28px rgba(37,129,225,.3); }
.login-card h1 { margin: 0 0 9px; font-size: clamp(1.8rem, 6vw, 2.25rem); letter-spacing: -.045em; }
.login-card > .muted { margin: 0 0 28px; line-height: 1.6; }
.login-card form { display: grid; gap: 10px; }
label { display: block; color: #c9d9ed; font-size: .82rem; font-weight: 700; }
input, textarea, select { width: 100%; color: var(--text); background: #081a31; border: 1px solid #294565; border-radius: 10px; outline: none; padding: 13px 14px; transition: border-color .18s, box-shadow .18s, background .18s; }
input::placeholder, textarea::placeholder { color: #68819e; }
input:focus, textarea:focus, select:focus { border-color: var(--blue-bright); box-shadow: 0 0 0 3px rgba(57,137,237,.14); background: #0a203b; }
.login-card input { margin-bottom: 9px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 10px 16px; border-radius: 10px; font-weight: 800; font-size: .86rem; border: 1px solid transparent; transition: .18s ease; }
.primary { color: white; background: linear-gradient(135deg, #398ff2, #2168c4); box-shadow: 0 7px 20px rgba(35,112,205,.2); }
.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.secondary { color: #cfe3fb; background: #132d4c; border-color: #2b4c70; }
.secondary:hover { background: #1a3b60; border-color: #4779aa; }
.full { width: 100%; min-height: 49px; margin-top: 8px; }
.login-card .small { margin: 22px 0 0; }
#apiShort { color: #b6d9ff; }
.app-shell { min-height: 100vh; }
.sidebar { width: 268px; position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 25px 16px 16px; background: rgba(6,18,36,.97); border-right: 1px solid #1b3554; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.small-mark { width: 42px; height: 42px; flex: 0 0 42px; margin: 0; border-radius: 13px; font-size: 1.25rem; }
.brand strong { display: block; font-size: 1.12rem; letter-spacing: -.03em; }
.brand strong span { color: #65adff; }
.brand small, .side-bottom small { display: block; margin-top: 4px; color: #718ba9; font-size: .61rem; font-weight: 800; letter-spacing: .12em; }
.side-label { padding: 0 12px 10px; color: #617c9c; font-size: .65rem; font-weight: 900; letter-spacing: .16em; }
#nav { display: grid; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; color: #9bb0c9; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 10px; font-size: .84rem; font-weight: 650; transition: .18s ease; }
.nav-item span { width: 20px; color: #7e9bbb; text-align: center; font-size: 1rem; }
.nav-item:hover { color: white; background: #102541; }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(48,126,213,.24), rgba(24,61,99,.45)); border-color: #244b75; box-shadow: inset 3px 0 #55a5ff; }
.nav-item.active span { color: #76baff; }
.side-bottom { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 17px 8px 4px; border-top: 1px solid #1c3552; }
.side-bottom strong { font-size: .78rem; }
.side-bottom small { letter-spacing: 0; font-weight: 500; font-size: .7rem; }
.secure-dot, .api-pill i, .live-label i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(53,211,154,.45); }
#logoutBtn { margin-left: auto; width: 34px; height: 34px; color: #a9c3df; background: #102541; border: 1px solid #294665; border-radius: 9px; font-size: 1.1rem; }
.main { min-height: 100vh; margin-left: 268px; display: flex; flex-direction: column; }
.topbar { min-height: 91px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 34px; background: rgba(7,20,40,.88); border-bottom: 1px solid rgba(37,64,94,.75); backdrop-filter: blur(16px); }
.crumb { color: #829ab6; font-size: .73rem; }
.crumb span { margin: 0 7px; color: #4d6888; }
.crumb b { color: #c6d9ef; font-weight: 650; }
.topbar h2 { margin: 5px 0 0; font-size: 1.18rem; letter-spacing: -.025em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.api-pill { display: flex; align-items: center; gap: 9px; padding: 9px 12px; color: #b8cbe0; background: #0d213b; border: 1px solid #25415f; border-radius: 30px; font-size: .73rem; white-space: nowrap; }
.api-pill i { background: var(--amber); }
.icon-btn { width: 39px; height: 39px; display: grid; place-items: center; color: #d5e7fb; background: #102743; border: 1px solid #2a4969; border-radius: 10px; font-size: 1.05rem; }
.icon-btn:hover { background: #19395d; }
.mobile-only { display: none; }
.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 30px 34px 38px; flex: 1; }
.page { animation: fade .25s ease; }
@keyframes fade { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.welcome-row, .page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.welcome-row h1, .page-intro h1 { margin: 0 0 7px; font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.045em; }
.welcome-row .muted, .page-intro .muted { margin: 0; line-height: 1.55; font-size: .88rem; }
.date-chip { padding: 9px 13px; color: #b8d7f7; background: #102945; border: 1px solid #2a4b6d; border-radius: 9px; font-size: .77rem; white-space: nowrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 19px; }
.stat-card, .panel, .feature-card { background: linear-gradient(145deg, rgba(17,40,68,.96), rgba(11,29,52,.96)); border: 1px solid #203e60; border-radius: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.11); }
.stat-card { min-height: 132px; padding: 18px; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #9eb4ce; font-size: .78rem; }
.stat-icon { width: 30px; height: 30px; display: grid; place-items: center; color: #75baff; background: #17385d; border-radius: 9px; }
.stat-card > strong { display: block; margin: 13px 0 4px; font-size: 1.65rem; letter-spacing: -.04em; }
.stat-card > small { color: #7892ae; font-size: .7rem; }
.grid-two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 17px; margin-bottom: 18px; }
.panel { padding: 21px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.panel h3, .feature-card h3 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
.panel-head p { margin: 5px 0 0; font-size: .75rem; }
.live-label { display: inline-flex; align-items: center; gap: 7px; color: #77dfb8; font-size: .64rem; font-weight: 900; letter-spacing: .12em; }
.live-label i { width: 6px; height: 6px; }
.connection-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid #1e3856; }
.connection-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: #8bc4ff; background: #173656; border-radius: 10px; font-size: .75rem; font-weight: 900; }
.connection-copy { min-width: 0; flex: 1; }
.connection-copy b, .connection-copy small { display: block; }
.connection-copy b { font-size: .8rem; }
.connection-copy small { margin-top: 4px; color: #7893af; font-size: .68rem; overflow-wrap: anywhere; }
.status { display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 30px; font-size: .65rem; font-weight: 800; white-space: nowrap; }
.status.good { color: #70e0b6; background: rgba(29,151,111,.14); border: 1px solid rgba(53,211,154,.25); }
.status.bad { color: #ff91a7; background: rgba(194,57,88,.14); border: 1px solid rgba(255,102,133,.25); }
.status.pending { color: #f5c875; background: rgba(205,148,48,.12); border: 1px solid rgba(245,189,89,.22); }
.status.neutral { color: #a9c1dc; background: #18324f; border: 1px solid #2b4968; }
.quick-action { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 0; color: var(--text); text-align: left; background: transparent; border: 0; border-top: 1px solid #1e3856; }
.quick-action > span:nth-child(2) { min-width: 0; flex: 1; }
.quick-action b, .quick-action small { display: block; }
.quick-action b { font-size: .8rem; }
.quick-action small { margin-top: 4px; color: #8199b4; font-size: .69rem; line-height: 1.4; }
.quick-action > span:last-child { color: #75baff; }
.quick-icon { width: 35px; height: 35px; display: grid; place-items: center; color: #85c2ff; background: #173656; border-radius: 9px; }
.quick-action:hover b { color: #80bdff; }
.note-panel { display: flex; align-items: flex-start; gap: 13px; background: rgba(20,51,82,.55); }
.note-symbol { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; color: #83c3ff; background: #1b426b; border-radius: 50%; font-weight: 900; }
.note-panel b { font-size: .83rem; }
.note-panel p { margin: 5px 0 0; color: #91a9c4; font-size: .77rem; line-height: 1.6; }
.page-intro { align-items: center; }
#sectionBody { display: grid; gap: 17px; }
.callout { padding: 15px 17px; color: #b9d2ec; background: rgba(27,69,108,.34); border: 1px solid #285078; border-left: 3px solid #55a5ff; border-radius: 11px; font-size: .8rem; line-height: 1.65; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.feature-card { padding: 19px; }
.feature-top { display: flex; align-items: flex-start; gap: 12px; }
.feature-symbol { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; color: #8dc6ff; background: #17395f; border: 1px solid #28527b; border-radius: 11px; font-size: 1.05rem; }
.feature-top h3 { margin: 1px 0 7px; }
.feature-card p { min-height: 42px; margin: 15px 0; color: #91a8c2; font-size: .78rem; line-height: 1.6; }
.feature-card .secondary { min-height: 36px; padding: 8px 12px; font-size: .74rem; }
.field { display: grid; gap: 8px; min-width: 0; }
.field textarea { min-height: 270px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; line-height: 1.55; }
.settings-json { width: 100%; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 15px 0; }
.empty-state { padding: 25px 18px; color: #91a9c4; text-align: center; background: rgba(5,18,34,.45); border: 1px dashed #2b4968; border-radius: 11px; font-size: .8rem; line-height: 1.65; }
.empty-state strong { display: block; margin-bottom: 5px; color: #d7e7f8; font-size: .88rem; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .77rem; }
.data-table th { padding: 12px; color: #8fa8c4; background: #0a1d34; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; }
.data-table td { padding: 13px 12px; color: #c4d5e8; border-bottom: 1px solid #203a57; vertical-align: top; }
.data-table tr:hover td { background: rgba(37,83,128,.13); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 15px; }
footer { display: flex; justify-content: center; gap: 9px; padding: 18px 25px 24px; color: #607b99; font-size: .68rem; }
@media (min-width: 1500px) { .content { padding-left: 45px; padding-right: 45px; } }
@media (max-width: 1100px) { .sidebar { width: 238px; } .main { margin-left: 238px; } .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .content { padding-left: 24px; padding-right: 24px; } .topbar { padding-left: 24px; padding-right: 24px; } }
@media (max-width: 760px) {
  .sidebar { width: min(290px, 86vw); transform: translateX(-105%); transition: transform .24s ease; box-shadow: 15px 0 45px rgba(0,0,0,.35); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-only { display: grid; }
  .topbar { min-height: 76px; gap: 10px; padding: 12px 15px; }
  .topbar h2 { font-size: 1rem; }
  .topbar > div:nth-child(2) { flex: 1; }
  .api-pill { padding: 8px 9px; font-size: .65rem; }
  .top-actions { gap: 7px; }
  .content { padding: 22px 15px 30px; }
  .welcome-row, .page-intro { align-items: flex-start; }
  .welcome-row h1, .page-intro h1 { font-size: 1.55rem; }
  .grid-two { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .panel { padding: 17px; }
}
@media (max-width: 480px) {
  .login-card { padding: 27px 21px; border-radius: 18px; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 118px; padding: 13px; }
  .stat-card > strong { font-size: 1.35rem; }
  .stat-head { font-size: .7rem; }
  .stat-card > small { font-size: .64rem; }
  .date-chip { font-size: .68rem; padding: 8px 9px; }
  .api-pill { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
  .connection-row { gap: 8px; }
  .connection-copy b { font-size: .73rem; }
  .connection-copy small { font-size: .62rem; }
  .connection-row .status { font-size: .58rem; padding: 5px 7px; }
  .form-actions { flex-direction: column; }
  .form-actions button { width: 100%; }
  footer { flex-wrap: wrap; font-size: .62rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
