:root {
  --ink: #172235;
  --muted: #718096;
  --line: #e6eaf0;
  --surface: #ffffff;
  --background: #f4f6f9;
  --sidebar: #101927;
  --primary: #635bff;
  --primary-dark: #4c46d7;
  --mint: #37c99b;
  --danger: #d94b61;
  --warning: #b87816;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--background); font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 25px; letter-spacing: -.6px; }
h2 { letter-spacing: -.6px; }
h3 { margin-bottom: 0; font-size: 18px; letter-spacing: -.25px; }
h4 { margin-bottom: 0; }
.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 20px 24px; color: #d8e0eb; background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; flex: 0 0 auto; border-radius: 12px; color: white; background: linear-gradient(145deg, #756fff, #5048db); box-shadow: 0 8px 25px #635bff40; font-size: 21px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { color: white; font-size: 19px; line-height: 1.15; letter-spacing: -.4px; }
.brand small { margin-top: 3px; color: #8e9bb0; font-size: 11px; letter-spacing: .4px; }
.main-nav { display: grid; gap: 7px; margin-top: 56px; }
.main-nav a { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 9px; color: #8e9bb0; font-weight: 600; transition: .2s ease; }
.main-nav a span { color: #59677c; font-size: 10px; letter-spacing: 1px; }
.main-nav a:hover, .main-nav a.active { color: white; background: #ffffff0d; }
.main-nav a.active { box-shadow: inset 3px 0 var(--primary); }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 14px 10px 0; border-top: 1px solid #ffffff0e; color: #8e9bb0; font-size: 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px #37c99b18; }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 94px; padding: 20px 38px; border-bottom: 1px solid var(--line); background: #ffffffb8; backdrop-filter: blur(14px); }
.eyebrow { margin-bottom: 5px; color: #8b96a8; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
.account-area { display: flex; align-items: center; gap: 11px; }
.account-area strong, .account-area small { display: block; }
.account-area strong { font-size: 12px; }
.account-area small { color: var(--muted); font-size: 10px; }
.account-avatar { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 50%; color: #5149d9; background: #eeecff; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 9px 16px; border: 0; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 12px; transition: transform .15s, background .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary { color: white; background: var(--primary); box-shadow: 0 5px 14px #635bff30; }
.button-primary:hover { background: var(--primary-dark); }
.button-ghost { color: #566176; border: 1px solid var(--line); background: white; }
.button-ghost:hover { background: #f7f8fb; }
.button-light { color: #5149d9; background: white; box-shadow: 0 8px 24px #2e285025; }
.button-danger { color: white; background: var(--danger); }
.account-area .button { margin-left: 12px; }
.dashboard-main { width: min(1450px, 100%); margin: auto; padding: 28px 38px 50px; }
.hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; min-height: 220px; padding: 36px 40px; overflow: hidden; border-radius: 16px; color: white; background: radial-gradient(circle at 78% 20%, #817aff70, transparent 34%), radial-gradient(circle at 90% 90%, #37c99b35, transparent 32%), linear-gradient(125deg, #252042, #343064 65%, #273c58); box-shadow: 0 15px 35px #25204220; }
.hero::after { position: absolute; right: 12%; top: -70px; width: 230px; height: 230px; border: 1px solid #ffffff10; border-radius: 50%; content: ""; box-shadow: 0 0 0 40px #ffffff05, 0 0 0 80px #ffffff03; }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #b3acdd; }
.hero h2 { margin-bottom: 12px; font-size: clamp(26px, 3vw, 38px); line-height: 1.15; }
.hero p:last-child { max-width: 580px; margin-bottom: 0; color: #b9c0d1; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.stat-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 12px #17223505; }
.stat-label { display: block; color: #8a95a6; font-size: 9px; font-weight: 800; letter-spacing: 1.2px; }
.stat-card strong { display: block; margin: 7px 0 1px; font-size: 30px; line-height: 1.2; letter-spacing: -1px; }
.stat-card small { color: var(--muted); font-size: 11px; }
.panel { margin-bottom: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 3px 14px #17223505; scroll-margin-top: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-heading p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); font-size: 11px; }
.client-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.field { display: block; min-width: 0; }
.field > span { display: block; margin-bottom: 6px; color: #566176; font-size: 11px; font-weight: 700; }
.field small { display: block; margin-top: 5px; color: #919bac; font-size: 10px; }
input, select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #dce1e9; outline: none; border-radius: 8px; color: var(--ink); background: #fbfcfd; transition: border .15s, box-shadow .15s; }
input:focus, select:focus { border-color: #918cff; box-shadow: 0 0 0 3px #635bff13; background: white; }
input::placeholder { color: #b0b8c5; }
select:disabled { color: #8a95a6; background: #f1f3f6; }
.client-picker { width: min(480px, 100%); }
.badge-group { display: flex; gap: 7px; padding-bottom: 5px; }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 20px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge-success { color: #087c5b; background: #e3f8f0; }
.badge-warning { color: #93600d; background: #fff4d9; }
.badge-danger { color: #ad344a; background: #ffeaee; }
.badge-neutral { color: #657186; background: #eef1f5; }
.badge-info { color: #5149d9; background: #eeecff; }
.client-status { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.count-pill { display: grid; min-width: 26px; height: 26px; place-items: center; border-radius: 8px; color: #5b54d9; background: #eeecff; font-size: 11px; font-weight: 800; }
.content-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 18px; }
.table-wrap { width: 100%; overflow-x: auto; }
.empty-state { display: grid; min-height: 110px; place-items: center; border: 1px dashed #dce1e9; border-radius: 9px; color: #9aa4b3; background: #fafbfc; font-size: 11px; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 9px 10px; color: #8a95a6; background: #f8f9fb; font-size: 9px; letter-spacing: .5px; text-align: left; white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbff; }
.numeric { font-variant-numeric: tabular-nums; }
.uuid-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: ui-monospace, monospace; font-size: 10px; }
.row-action { padding: 5px 9px; border: 1px solid #ffd1d9; border-radius: 6px; color: #c13d54; background: #fff7f8; cursor: pointer; font-size: 10px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 15px; }
.order-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.confirmation { display: flex; align-items: flex-start; gap: 9px; max-width: 590px; color: #667388; font-size: 11px; cursor: pointer; }
.confirmation input { width: 15px; height: 15px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--primary); }
.confirmation.compact { align-items: center; white-space: nowrap; }
.cancel-panel { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(500px, 1.3fr); align-items: center; gap: 30px; }
.cancel-panel h3 { margin-bottom: 6px; }
.cancel-form { display: grid; grid-template-columns: minmax(250px, 1fr) auto auto; align-items: end; gap: 14px; }
.command-status { text-transform: capitalize; }
.credentials-panel { border-color: #dcd9ff; background: linear-gradient(150deg, white, #faf9ff); }
.credential-list { display: grid; gap: 10px; }
.credential-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 16px; border: 1px solid #e7e5f6; border-radius: 9px; background: #ffffffc9; }
.credential-row > div { min-width: 0; }
.credential-label { display: block; margin-bottom: 5px; color: #7e8798; font-size: 10px; font-weight: 700; }
code { display: block; overflow: hidden; color: #3d375f; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.copy-button { min-width: 57px; padding: 6px 10px; border: 1px solid #dfdcf5; border-radius: 6px; color: #5b54d9; background: #f5f3ff; cursor: pointer; font-size: 10px; font-weight: 800; }
.copy-button:hover { background: #eae7ff; }
.client-token-heading { display: flex; align-items: center; justify-content: space-between; margin: 25px 0 12px; }
.client-token-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.client-token-card { padding: 15px; border: 1px solid #e7e5f6; border-radius: 9px; background: white; }
.client-token-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.client-id { padding: 3px 8px; border-radius: 5px; color: #5149d9; background: #eeecff; font: 700 11px ui-monospace, monospace; }
.tokens-hidden code { color: transparent !important; border-radius: 4px; background: #dcd9eb; text-shadow: 0 0 8px #59536b; user-select: none; }
.toast { position: fixed; right: 26px; bottom: 26px; z-index: 20; max-width: 420px; padding: 13px 18px; border-radius: 9px; color: white; background: #263449; box-shadow: 0 12px 35px #17223535; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s; font-size: 12px; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #b53a50; }
.toast.success { background: #147e62; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 30px; background: radial-gradient(circle at 15% 15%, #35315d, transparent 38%), radial-gradient(circle at 90% 85%, #1f4b52, transparent 30%), #101927; }
.login-shell { display: grid; grid-template-columns: 1.1fr .9fr; width: min(980px, 100%); min-height: 590px; overflow: hidden; border: 1px solid #ffffff15; border-radius: 20px; background: #171f31; box-shadow: 0 35px 80px #0005; }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 45px; color: white; background: radial-gradient(circle at 80% 35%, #635bff35, transparent 35%), linear-gradient(155deg, #282343, #172d3b); }
.brand-login { padding: 0; }
.login-intro .eyebrow { color: #a49de5; }
.login-intro h1 { margin: 12px 0 18px; font-size: 43px; line-height: 1.13; }
.login-intro p { max-width: 400px; color: #aeb8ca; }
.login-features { display: flex; flex-wrap: wrap; gap: 8px; }
.login-features span { padding: 6px 10px; border: 1px solid #ffffff12; border-radius: 20px; color: #9eabc0; background: #ffffff06; font-size: 9px; }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 50px; background: white; }
.login-form-heading { margin-bottom: 30px; }
.login-form-heading h2 { margin-bottom: 8px; font-size: 32px; }
.login-form-heading p:last-child { color: var(--muted); font-size: 12px; }
.login-form-panel .field { margin-bottom: 18px; }
.login-form-panel input { height: 46px; }
.login-button { width: 100%; min-height: 46px; margin-top: 6px; }
.form-message { min-height: 24px; margin: 12px 0; font-size: 11px; }
.error { color: #bd3d53; }
.security-note { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); color: #8a95a6; font-size: 9px; }
@media (max-width: 1150px) {
  .form-grid { grid-template-columns: repeat(3, 1fr); }
  .cancel-panel { grid-template-columns: 1fr; gap: 15px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 850px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding: 25px 12px; }
  .sidebar .brand { padding: 0; justify-content: center; }
  .sidebar .brand > span:last-child, .main-nav a:not(.active) { font-size: 0; }
  .main-nav a { justify-content: center; padding: 12px 5px; font-size: 0; }
  .main-nav a span { font-size: 10px; }
  .sidebar-footer { justify-content: center; font-size: 0; }
  .topbar, .dashboard-main { padding-left: 22px; padding-right: 22px; }
  .content-grid, .login-shell { grid-template-columns: 1fr; }
  .login-intro { display: none; }
  .login-shell { max-width: 500px; min-height: auto; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .cancel-form { grid-template-columns: 1fr; align-items: stretch; }
  .client-token-list { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 80px; padding: 15px; }
  .topbar .eyebrow, .account-area > span:not(.account-avatar), .account-avatar { display: none; }
  .topbar h1 { font-size: 20px; }
  .dashboard-main { padding: 15px; }
  .hero { align-items: flex-start; flex-direction: column; padding: 26px; }
  .hero h2 { font-size: 28px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-card strong { font-size: 25px; }
  .panel { padding: 18px; }
  .client-toolbar, .order-footer, .panel-heading { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .order-footer .button { width: 100%; }
  .credential-row { align-items: flex-start; }
  .credential-row code { max-width: 65vw; }
  .login-page { padding: 15px; }
  .login-form-panel { padding: 32px 25px; }
}

[hidden] { display: none !important; }
.client-token-actions { display: flex; align-items: center; gap: 7px; }
.download-link { display: inline-flex; align-items: center; min-height: 28px; padding: 6px 10px; border-radius: 6px; color: white; background: var(--primary); font-size: 10px; font-weight: 800; white-space: nowrap; }
.download-link:hover { background: var(--primary-dark); }
@media (max-width: 580px) { .client-token-card-header { align-items: flex-start; gap: 10px; } .client-token-actions { align-items: flex-end; flex-direction: column; } }
