:root {
      --primary:#4f46e5; --primary-2:#6366f1; --ok:#10b981; --warn:#f59e0b; --bad:#ef4444;
      --bg:#eef2ff; --panel:rgba(255,255,255,.82); --panel-2:rgba(255,255,255,.58); --border:rgba(99,102,241,.16);
      --text:#111827; --muted:#6b7280; --soft:#f8fafc; --shadow:0 14px 40px -28px rgba(31,41,55,.55);
      --radius:16px; --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    }
    * { box-sizing:border-box; }
    body { margin:0; min-height:100vh; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color:var(--text); background:radial-gradient(circle at top left,#dbeafe 0,#eef2ff 34%,#f8fafc 100%); }
    .hidden{display:none!important}.container{width:min(1440px,calc(100vw - 32px));margin:0 auto;padding:28px 0 42px}.auth-shell{width:min(460px,calc(100vw - 32px));margin:12vh auto}.glass{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
    .login-card{padding:26px}.login-title{margin:0 0 8px;color:#1e1b4b}.login-copy{margin:0 0 22px;color:var(--muted);line-height:1.6}.auth-form{display:flex;flex-direction:column;gap:14px}.label{display:block;font-size:13px;font-weight:700;color:#374151;margin-bottom:7px}.input,.textarea,.select{width:100%;border:1px solid #d1d5db;border-radius:10px;background:rgba(255,255,255,.92);padding:11px 12px;font-size:14px}.textarea{min-height:110px;resize:vertical;font-family:var(--mono);font-size:12px}.input:focus,.textarea:focus,.select:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 4px rgba(79,70,229,.10)}
    .topbar{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px}.brand h1{margin:0;color:#1e1b4b;font-size:30px;letter-spacing:-.03em}.brand p{margin:6px 0 0;color:var(--muted)}.top-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.badge{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);background:rgba(255,255,255,.76);color:#3730a3;border-radius:999px;padding:7px 11px;font-size:12px;font-weight:800}.badge.warn{color:#92400e;border-color:rgba(245,158,11,.28)}.badge.ok{color:#047857;border-color:rgba(16,185,129,.28)}.badge.bad{color:#991b1b;border-color:rgba(239,68,68,.28)}
    .btn{border:none;border-radius:10px;background:var(--primary);color:#fff;padding:10px 14px;font-weight:800;font-size:13px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;transition:.15s}.btn:hover{background:#4338ca;transform:translateY(-1px)}.btn.secondary{background:#fff;color:#374151;border:1px solid #d1d5db}.btn.secondary:hover{background:#f9fafb}.btn.danger{background:#fff;color:var(--bad);border:1px solid #fecaca}.btn.danger:hover{background:#fef2f2}.btn.small{padding:7px 10px;font-size:12px}.btn:disabled{opacity:.6;cursor:not-allowed;transform:none}
    .hero{padding:20px;margin-bottom:18px;display:grid;grid-template-columns:1.1fr 1.9fr;gap:20px;align-items:center}.status-line{display:flex;align-items:center;gap:14px}.dot{width:15px;height:15px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 7px rgba(16,185,129,.14)}.dot.warn{background:var(--warn);box-shadow:0 0 0 7px rgba(245,158,11,.16)}.dot.bad{background:var(--bad);box-shadow:0 0 0 7px rgba(239,68,68,.14)}.status-title{font-size:18px;font-weight:900}.status-sub{font-size:13px;color:var(--muted);margin-top:4px}.quick-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.auto{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:13px;font-weight:700}.auto input{accent-color:var(--primary)}
    .metric-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:18px}.metric{padding:15px;background:var(--panel);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow)}.metric-label{font-size:12px;color:var(--muted);font-weight:800}.metric-value{margin-top:7px;font-size:23px;font-weight:950;color:#1e1b4b}.metric-hint{margin-top:4px;font-size:12px;color:var(--muted)}.metric.ok .metric-value{color:#047857}.metric.warn .metric-value{color:#92400e}.metric.bad .metric-value{color:#b91c1c}
    .grid{display:grid;grid-template-columns:1.05fr .95fr;gap:18px;margin-bottom:18px}.panel{padding:18px}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}.panel-title{margin:0;font-size:17px;color:#1f2937}.panel-sub{font-size:12px;color:var(--muted);margin-top:3px}.list{display:flex;flex-direction:column;gap:10px}.item{background:var(--panel-2);border:1px solid rgba(99,102,241,.12);border-radius:12px;padding:12px}.item-title{display:flex;justify-content:space-between;align-items:center;gap:10px;font-weight:900}.muted{color:var(--muted)}.mini{font-size:12px;color:var(--muted);margin-top:6px}.mono{font-family:var(--mono)}.pill{border-radius:999px;padding:3px 8px;font-size:11px;font-weight:900}.pill.ok{background:#d1fae5;color:#065f46}.pill.warn{background:#fef3c7;color:#92400e}.pill.bad{background:#fee2e2;color:#991b1b}.pill.neutral{background:#e5e7eb;color:#374151}
    .table-wrap{overflow:auto;border:1px solid rgba(99,102,241,.12);border-radius:12px;background:rgba(255,255,255,.48)}table{width:100%;border-collapse:collapse}th,td{padding:12px 13px;border-bottom:1px solid rgba(99,102,241,.10);font-size:13px;text-align:left;vertical-align:top}th{background:rgba(238,242,255,.7);color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em}tr:last-child td{border-bottom:none}.empty{padding:26px;text-align:center;color:var(--muted);font-size:13px}.code{font-family:var(--mono);font-size:12px;word-break:break-all}.error-detail{white-space:pre-wrap;word-break:break-word;max-height:96px;overflow:auto}.mapping-form{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;margin-bottom:12px}.catalog{display:flex;gap:7px;flex-wrap:wrap}.model-chip{border:1px solid #d1d5db;background:#fff;border-radius:999px;padding:6px 9px;font-family:var(--mono);font-size:12px;cursor:pointer}.model-chip:hover{border-color:var(--primary);color:var(--primary)}
    .modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,.34);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:.2s;z-index:50;padding:16px}.modal-overlay.active{opacity:1;visibility:visible}.modal{width:min(520px,100%);background:#fff;border-radius:18px;padding:22px;box-shadow:0 24px 60px -30px #000}.modal-title{margin:0 0 16px}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.hint{font-size:12px;color:var(--muted);line-height:1.5;margin-top:7px}.toast{position:fixed;right:18px;bottom:18px;background:#fff;border-left:4px solid var(--primary);border-radius:12px;box-shadow:var(--shadow);padding:12px 16px;font-weight:800;font-size:13px;transform:translateX(130%);transition:.25s;z-index:60}.toast.show{transform:translateX(0)}.toast.error{border-left-color:var(--bad);color:#b91c1c}.toast.success{border-left-color:var(--ok);color:#047857}
    .app-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:18px;align-items:start}.sidebar{position:sticky;top:18px;padding:12px}.nav-title{font-size:12px;color:var(--muted);font-weight:900;text-transform:uppercase;letter-spacing:.08em;padding:8px 10px}.nav-btn{width:100%;border:none;background:transparent;color:#374151;border-radius:11px;padding:11px 12px;text-align:left;font-weight:850;cursor:pointer;display:flex;justify-content:space-between;align-items:center}.nav-btn:hover{background:rgba(99,102,241,.09)}.nav-btn.active{background:var(--primary);color:#fff;box-shadow:0 10px 22px -16px var(--primary)}.nav-count{font-size:11px;border-radius:999px;background:rgba(255,255,255,.22);padding:2px 7px}.content{min-width:0}.view{display:none}.view.active{display:block}.view-head{margin-bottom:16px}.view-head h2{margin:0;font-size:22px;color:#1f2937}.view-head p{margin:6px 0 0;color:var(--muted);font-size:13px}.single{margin-bottom:18px}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}.notice{padding:14px;border-radius:12px;background:#fffbeb;border:1px solid #fde68a;color:#92400e;font-size:13px;line-height:1.5}.api-test-grid{display:grid;grid-template-columns:220px 1fr;gap:12px;align-items:start}.config-row{display:grid;grid-template-columns:220px 1fr 90px;gap:10px;align-items:center}.config-row .mini{margin:0}.pre{background:#0f172a;color:#e5e7eb;border-radius:12px;padding:12px;overflow:auto;min-height:160px;font-family:var(--mono);font-size:12px;white-space:pre-wrap}.mobile-tabs{display:none;gap:8px;overflow:auto;margin-bottom:14px;padding-bottom:2px}.mobile-tabs .nav-btn{width:auto;white-space:nowrap;background:rgba(255,255,255,.7)}.mobile-tabs .nav-btn.active{background:var(--primary)}.account-user{white-space:nowrap;line-height:1.35}.account-name{line-height:1.35;max-width:220px}.account-token{white-space:nowrap;line-height:1.35}.code{line-height:1.35}
    @media(max-width:1100px){.metric-grid{grid-template-columns:repeat(3,1fr)}.grid,.hero,.two-col{grid-template-columns:1fr}.quick-tools{justify-content:flex-start}.app-layout{grid-template-columns:1fr}.sidebar{display:none}.mobile-tabs{display:flex}.api-test-grid{grid-template-columns:1fr}}@media(max-width:720px){.container{width:min(100vw - 20px,1440px);padding:18px 0 28px}.topbar{flex-direction:column}.metric-grid{grid-template-columns:repeat(2,1fr)}.mapping-form{grid-template-columns:1fr}.config-row{grid-template-columns:1fr}.panel{padding:14px}th,td{padding:10px}.brand h1{font-size:25px}}

.log-box{margin-top:14px;max-height:360px;overflow:auto;background:#0f172a;color:#dbeafe;border-radius:12px;padding:12px;font:12px/1.5 var(--mono);white-space:pre-wrap;border:1px solid rgba(15,23,42,.18)}

/* UI polish */
.brand-meta{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}.brand-meta span{font-size:11px;font-weight:900;color:#3730a3;background:rgba(99,102,241,.1);border:1px solid rgba(99,102,241,.16);border-radius:999px;padding:4px 8px}.summary-strip{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:18px}.summary-strip>div{display:flex;gap:10px;align-items:center;justify-content:space-between;background:rgba(255,255,255,.66);border:1px solid var(--border);border-radius:14px;padding:12px 14px;box-shadow:var(--shadow)}.summary-strip b{color:#1e1b4b;font-size:13px;white-space:nowrap}.summary-strip span{color:var(--muted);font-size:12px;line-height:1.45}.nav-btn{position:relative}.nav-btn.active::before{content:"";position:absolute;left:6px;top:50%;width:4px;height:18px;border-radius:999px;background:rgba(255,255,255,.86);transform:translateY(-50%)}.panel,.metric,.hero{transition:box-shadow .18s ease,transform .18s ease,border-color .18s ease}.panel:hover,.metric:hover,.hero:hover{transform:translateY(-1px);border-color:rgba(99,102,241,.26);box-shadow:0 18px 48px -30px rgba(31,41,55,.65)}tbody tr:hover{background:rgba(238,242,255,.42)}.view-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}.footer-note{padding:10px 4px 0}.quick-tools .btn{white-space:nowrap}.item-title{line-height:1.35}.input::placeholder,.textarea::placeholder{color:#9ca3af}.pre,.log-box{box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}
@media(max-width:900px){.summary-strip{grid-template-columns:1fr}.view-head{display:block}}
@media(max-width:520px){.metric-grid{grid-template-columns:1fr}.top-actions{width:100%;justify-content:flex-start}.summary-strip>div{align-items:flex-start;flex-direction:column}.btn{width:auto}.quick-tools{width:100%}.quick-tools .btn{flex:1;justify-content:center}.brand-meta{margin-top:8px}}
/* targeted layout fixes 20260518-0752 */
.topbar{align-items:center}.top-actions{display:grid;grid-template-columns:auto auto auto auto auto;align-items:center}.top-actions #logoutBtn{grid-column:auto;white-space:nowrap}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric{display:grid;grid-template-columns:1fr auto;grid-template-areas:"label value" "hint value";align-items:center;min-height:58px;padding:11px 13px}.metric-label{grid-area:label}.metric-value{grid-area:value;margin:0 0 0 12px;font-size:20px;text-align:right}.metric-hint{grid-area:hint;margin-top:2px;font-size:11px}.account-actions{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;white-space:nowrap}.account-actions .btn{padding:7px 9px;line-height:1}.table-wrap table{width:100%}.table-wrap td:last-child{white-space:nowrap}@media(max-width:1100px){.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:720px){.top-actions{display:flex;width:100%;justify-content:flex-start}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.metric-grid{grid-template-columns:1fr}.account-actions{flex-wrap:wrap}.quick-tools .btn{flex:0 1 auto}}

/* hard override layout fixes 20260518-0800 */
body #appShell .topbar{align-items:center!important;display:flex!important}body #appShell .top-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:nowrap!important;gap:8px!important}body #appShell .top-actions>*{flex:0 0 auto!important}body #appShell #logoutBtn{display:inline-flex!important;white-space:nowrap!important}
body #appShell #view-overview .metric-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;margin-bottom:14px!important}body #appShell #view-overview .metric{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"label value" "hint value"!important;align-items:center!important;min-height:54px!important;padding:10px 12px!important}body #appShell #view-overview .metric-label{grid-area:label!important}body #appShell #view-overview .metric-value{grid-area:value!important;margin:0 0 0 12px!important;font-size:19px!important;text-align:right!important}body #appShell #view-overview .metric-hint{grid-area:hint!important;margin-top:2px!important;font-size:11px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
body #appShell .account-actions{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:nowrap!important;white-space:nowrap!important}body #appShell .account-actions .btn{display:inline-flex!important;width:auto!important;min-width:auto!important;padding:6px 8px!important;line-height:1!important}body #appShell #usersPanel td:last-child{white-space:nowrap!important;min-width:150px!important}
@media(max-width:860px){body #appShell .top-actions{flex-wrap:wrap!important;justify-content:flex-start!important}body #appShell #view-overview .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}@media(max-width:520px){body #appShell #view-overview .metric-grid{grid-template-columns:1fr!important}body #appShell .account-actions{flex-wrap:wrap!important}}

/* final forced layout fixes 20260518-0810 */
body #appShell.container{position:relative!important;padding-top:34px!important}
body #appShell .topbar{display:block!important;position:relative!important;padding-right:88px!important;margin-bottom:14px!important}
body #appShell .brand{max-width:calc(100% - 10px)!important}
body #appShell .brand h1{padding-right:0!important}
body #appShell .top-actions{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;padding:8px 0 2px!important;scrollbar-width:thin!important}
body #appShell .top-actions>*{flex:0 0 auto!important;white-space:nowrap!important}
body #appShell #logoutBtn{position:absolute!important;right:0!important;top:0!important;display:inline-flex!important;width:auto!important;z-index:5!important}
body #appShell #view-overview .hero{grid-template-columns:minmax(220px,.8fr) minmax(0,1.2fr)!important;gap:12px!important;padding:14px!important}
body #appShell #view-overview .hero .quick-tools{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;justify-content:flex-end!important;gap:8px!important;overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important;padding-bottom:2px!important}
body #appShell #view-overview .hero .quick-tools .btn{flex:0 0 auto!important;width:auto!important;white-space:nowrap!important;padding:9px 12px!important}
body #appShell #view-overview .metric-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-flow:row!important;gap:10px!important;width:100%!important}
body #appShell #view-overview .metric{min-width:0!important;width:100%!important;min-height:52px!important}
body #appShell #usersPanel table{min-width:920px!important;table-layout:auto!important}
body #appShell #usersPanel th:last-child,body #appShell #usersPanel td:last-child{width:190px!important;min-width:190px!important;max-width:190px!important;white-space:nowrap!important}
body #appShell #usersPanel .account-actions{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;gap:6px!important;align-items:center!important;justify-content:flex-start!important;white-space:nowrap!important;width:100%!important}
body #appShell #usersPanel .account-actions .btn{flex:0 0 auto!important;width:auto!important;padding:6px 8px!important;white-space:nowrap!important}
body #appShell #routesPanel table{min-width:1040px!important;table-layout:auto!important}
body #appShell #routesPanel th:first-child,body #appShell #routesPanel td:first-child{width:300px!important;min-width:300px!important;max-width:380px!important;white-space:nowrap!important}
body #appShell #routesPanel td:first-child .code,body #appShell #routesPanel td:first-child{word-break:normal!important;overflow-wrap:normal!important;line-height:1.25!important}
@media(max-width:900px){body #appShell .topbar{padding-right:82px!important}body #appShell #view-overview .hero{grid-template-columns:1fr!important}body #appShell #view-overview .hero .quick-tools{justify-content:flex-start!important}body #appShell #view-overview .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:420px){body #appShell #view-overview .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}body #appShell #view-overview .metric{padding:9px 10px!important}body #appShell #view-overview .metric-value{font-size:17px!important}}
