:root {
  color-scheme: dark;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #f4f3ed;
  background: #0d100f;
  --canvas: #0d100f;
  --sidebar: #111413;
  --panel: #161a18;
  --panel-soft: #1a1e1c;
  --raised: #202522;
  --line: #2b302d;
  --line-soft: #222724;
  --text: #f4f3ed;
  --muted: #929a95;
  --muted-2: #69716c;
  --accent: #ff6735;
  --accent-hover: #ff774a;
  --accent-soft: #3b2118;
  --good: #63c98f;
  --good-soft: #183025;
  --warning: #e2ad58;
  --warning-soft: #352b18;
  --bad: #e3766d;
  --bad-soft: #39211f;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 24px 70px rgb(0 0 0 / .22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgb(255 255 255 / .017) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .017) 1px, transparent 1px),
    var(--canvas);
  background-size: 34px 34px;
}
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.shell { min-height: 100vh; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.eyebrow { margin: 0; color: var(--accent); font: 600 10px/1.3 var(--mono); letter-spacing: .13em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 6px 0 0; font-size: clamp(25px, 2.2vw, 36px); line-height: 1.08; letter-spacing: -.04em; }
h2 { margin: 5px 0 8px; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
h3 { margin: 22px 0 7px; font-size: 15px; }
.quiet { color: var(--muted); font-size: 13px; line-height: 1.55; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 5px rgb(99 201 143 / .08); }

/* Login */
.login-view {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 8vh 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr);
  align-items: center;
  gap: clamp(45px, 9vw, 130px);
}
.login-story { min-height: 550px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0; }
.brand-lockup, .sidebar-brand { display: flex; align-items: center; gap: 12px; }
.brand-lockup strong, .sidebar-brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand-symbol { display: grid; place-items: center; width: 43px; height: 43px; background: var(--accent); color: #fff; border-radius: 10px; font: 700 17px/1 var(--mono); box-shadow: 0 10px 30px rgb(255 103 53 / .18); }
.brand-symbol.small { width: 38px; height: 38px; border-radius: 9px; font-size: 14px; }
.login-story h1 { max-width: 700px; margin: 20px 0; font-size: clamp(46px, 6.2vw, 82px); letter-spacing: -.065em; }
.login-story h1 span { color: #777e79; }
.login-story > div > p:last-child { max-width: 580px; color: #a5aca7; font-size: 17px; line-height: 1.65; }
.login-facts { display: flex; gap: 28px; color: var(--muted); font: 500 11px var(--mono); }
.login-facts span::before { content: "✓"; margin-right: 8px; color: var(--good); }
.login-card { padding: 34px; box-shadow: var(--shadow); }
.login-card h2 { margin-top: 8px; font-size: 27px; }
.login-card > .quiet { margin: 0 0 28px; }
.login-card form { display: grid; gap: 17px; }
.login-card .button { width: 100%; justify-content: space-between; margin-top: 4px; }

/* Main application shell */
.admin-view { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px 20px;
  background: rgb(17 20 19 / .96);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar-brand { padding: 0 8px 31px; }
.sidebar-brand > div:last-child { display: grid; gap: 4px; }
.sidebar-brand span { color: var(--muted-2); font: 600 8px var(--mono); letter-spacing: .13em; }
.tabs { display: grid; gap: 5px; }
.nav-label { margin: 18px 10px 7px; color: var(--muted-2); font: 600 9px var(--mono); letter-spacing: .13em; }
.tab {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.tab:hover { color: var(--text); background: var(--panel-soft); }
.tab.active { color: var(--text); background: #24201d; border-color: #4b332a; }
.tab.active::after { content: ""; width: 3px; height: 18px; margin-left: auto; border-radius: 3px; background: var(--accent); }
.tab-icon { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; }
.tab.active .tab-icon { color: var(--accent); border-color: #5b392d; background: var(--accent-soft); }
.sidebar-status { margin-top: auto; padding: 16px 13px; display: grid; gap: 7px; background: #151a17; border: 1px solid var(--line-soft); border-radius: 8px; }
.sidebar-status span { color: #cbd2cd; font-size: 11px; font-weight: 600; }
.sidebar-status i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--good); }
.sidebar-status small { color: var(--muted-2); font: 9px var(--mono); }
.sidebar-footer { padding: 17px 9px 0; display: flex; justify-content: space-between; color: var(--muted-2); font: 9px var(--mono); }
.app-main { min-width: 0; width: min(100%, 1620px); padding: 34px clamp(24px, 3.4vw, 58px) 70px; }
.toolbar { min-height: 70px; margin-bottom: 27px; display: flex; justify-content: space-between; align-items: flex-start; gap: 25px; }
.identity h1 { font-size: 31px; }
.toolbar-actions, .section-header, footer { display: flex; align-items: center; gap: 10px; }
.toolbar-actions { justify-content: flex-end; }

/* Controls */
label { display: grid; gap: 7px; color: #dadeda; font-size: 12px; font-weight: 500; }
input, textarea, select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--text);
  background: #101311;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}
textarea { min-height: 90px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #626964; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(255 103 53 / .09); }
.button, .icon-button {
  min-height: 39px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #e2e5e2;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s, color .15s;
}
.button:hover, .icon-button:hover { background: var(--raised); border-color: #414844; }
.button:active, .icon-button:active { transform: translateY(1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { color: #151210; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.go { color: var(--accent); border-color: #60402f; background: #241a16; }
.icon-button { width: 39px; padding: 0; font-size: 17px; }
.error-message { min-height: 20px; color: var(--bad); font-size: 12px; }

/* Overview */
.metrics { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metrics article { min-height: 134px; padding: 19px 20px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
.metrics article.metric-primary { background: var(--accent); border-color: var(--accent); color: #151210; }
.metrics span { color: var(--muted); font: 600 10px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.metrics .metric-primary span, .metrics .metric-primary small { color: rgb(22 17 14 / .63); }
.metrics strong { margin: 11px 0 auto; color: var(--text); font: 600 36px/1 var(--mono); letter-spacing: -.05em; }
.metrics .metric-primary strong { color: #151210; }
.metrics strong em { font-style: normal; }
.metrics strong b { color: var(--muted-2); font-weight: 400; }
.metrics small { margin-top: 12px; color: var(--muted-2); font-size: 10px; }
.metric-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; }
.metric-dot.good { background: var(--good); }
.metric-dot.warning { background: var(--warning); }

/* Workspaces and tables */
.workspace, .audit-panel { padding: 25px 26px 29px; box-shadow: var(--shadow); }
.section-header { justify-content: space-between; gap: 25px; }
.section-header > div { min-width: 0; }
.section-header p.quiet { max-width: 720px; margin: 0; }
.license-tools { margin: 25px 0 13px; padding: 12px; display: grid; grid-template-columns: minmax(260px, 1fr) 220px; gap: 10px; background: #111412; border: 1px solid var(--line-soft); border-radius: 8px; }
.search-label { position: relative; display: block; }
.search-label > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; pointer-events: none; }
.search-label input { padding-left: 39px; }
.filter-label { position: relative; display: block; }
.filter-label > span { position: absolute; z-index: 1; left: 12px; top: 7px; color: var(--muted-2); font: 600 8px var(--mono); text-transform: uppercase; }
.filter-label select { padding: 15px 31px 3px 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th, td { padding: 15px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: 12px; vertical-align: middle; }
th { padding-top: 10px; color: var(--muted-2); font: 600 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgb(255 255 255 / .018); }
.customer-cell { min-width: 170px; }
.customer-wrap { display: flex; align-items: center; gap: 11px; }
.customer-avatar { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid #533326; border-radius: 8px; font: 600 12px var(--mono); }
.note { display: block; max-width: 260px; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.license-key { display: block; margin-bottom: 7px; color: var(--accent); font: 500 10px var(--mono); white-space: nowrap; }
.license-key.unavailable { color: var(--muted); }
.key-copy { min-height: 25px; padding: 4px 7px; font-size: 9px; }
.profile-usage { min-width: 105px; }
.profile-usage strong { font: 600 14px var(--mono); }
.usage-track { width: 90px; height: 3px; margin-top: 8px; overflow: hidden; background: #282d2a; border-radius: 4px; }
.usage-track span { display: block; height: 100%; max-width: 100%; background: var(--accent); border-radius: inherit; }
.usage-0 { width: 0; } .usage-10 { width: 10%; } .usage-20 { width: 20%; } .usage-30 { width: 30%; }
.usage-40 { width: 40%; } .usage-50 { width: 50%; } .usage-60 { width: 60%; } .usage-70 { width: 70%; }
.usage-80 { width: 80%; } .usage-90 { width: 90%; } .usage-100 { width: 100%; }
.status { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; font: 600 9px var(--mono); white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.status.active { color: var(--good); background: var(--good-soft); }
.status.available { color: var(--warning); background: var(--warning-soft); }
.status.suspended, .status.expired { color: var(--bad); background: var(--bad-soft); }
.status.web-off { color: var(--muted); background: #262a28; }
.action-group { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.action-group > .button { min-height: 30px; padding: 6px 9px; font-size: 10px; white-space: nowrap; }
.row-actions { justify-content: flex-end; flex-wrap: nowrap; }
.more-actions { position: relative; }
.more-actions summary { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; list-style: none; font: 600 15px var(--mono); }
.more-actions summary::-webkit-details-marker { display: none; }
.more-actions[open] summary { color: var(--accent); border-color: #5f3a2c; background: var(--accent-soft); }
.more-menu { position: absolute; z-index: 20; right: 0; top: 38px; width: 210px; padding: 6px; display: grid; gap: 2px; background: #1d211f; border: 1px solid #3a403c; border-radius: 8px; box-shadow: 0 18px 45px rgb(0 0 0 / .45); }
.more-menu .button { width: 100%; min-height: 33px; justify-content: flex-start; padding: 7px 9px; border: 0; font-size: 10px; }
.more-menu .button:last-child { color: var(--bad); }
.empty-message { margin: 25px 0 2px; text-align: center; }

/* Releases */
.release-current { margin: 21px 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.release-current article { min-height: 112px; padding: 17px; display: grid; align-content: start; gap: 8px; background: #101311; border: 1px solid var(--line); border-radius: 8px; }
.release-current span { color: var(--muted-2); font: 600 9px var(--mono); letter-spacing: .06em; }
.release-current strong { font: 600 14px var(--mono); }
.release-current small { color: var(--muted); font-size: 10px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.release-current code { color: var(--accent); font: 9px/1.45 var(--mono); overflow-wrap: anywhere; }
.release-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, .72fr); gap: 13px; align-items: start; }
.release-form { padding: 19px; display: grid; gap: 15px; background: #101311; border: 1px solid var(--line); border-radius: 8px; }
.release-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.release-submit { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.release-drop { min-height: 165px; padding: 24px; place-items: center; align-content: center; border: 1px dashed #49504b; border-radius: 7px; background: #151917; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.release-drop:hover, .release-drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.release-drop.selected { border-style: solid; border-color: var(--good); }
.release-drop input { position: absolute; width: 1px; height: 1px; min-height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.release-drop-icon { width: 48px; height: 34px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--accent); border-radius: 5px; font: 10px var(--mono); }
.release-drop span { color: var(--muted); font-size: 11px; }
.release-drop output { color: var(--good); font: 10px var(--mono); overflow-wrap: anywhere; }
.release-checks { padding: 19px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 8px; }
.release-checks h3 { margin-top: 5px; }
.release-checks ol { margin: 18px 0; padding: 0; display: grid; gap: 12px; list-style: none; }
.release-checks li { position: relative; padding-left: 25px; color: var(--muted); font-size: 11px; }
.release-checks li::before { content: "○"; position: absolute; left: 0; color: #626863; font: 13px var(--mono); }
.release-checks li[data-state="ok"] { color: var(--good); }
.release-checks li[data-state="ok"]::before { content: "✓"; color: var(--good); }
.release-progress { position: relative; height: 34px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.release-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .15s; }
.release-progress strong { position: absolute; inset: 0; display: grid; place-items: center; font: 10px var(--mono); }
.release-history { margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); }
.release-history-table { min-width: 720px; }
.release-history-table td:first-child { color: #fff; font-family: var(--mono); font-weight: 600; }
.release-confirm-summary { margin: 20px 0; display: grid; grid-template-columns: 110px 1fr; gap: 9px 16px; font-size: 12px; }
.release-confirm-summary dt { color: var(--muted); }
.release-confirm-summary dd { margin: 0; font-family: var(--mono); overflow-wrap: anywhere; }

/* Audit, dialogs and feedback */
.audit-list { margin: 15px 0 0; padding: 0; list-style: none; }
.audit-list li { padding: 13px 2px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.audit-list time { color: var(--muted); white-space: nowrap; font: 9px var(--mono); }
dialog { width: min(520px, calc(100vw - 28px)); padding: 26px; color: var(--text); background: #1b1f1d; border: 1px solid #3a403c; border-radius: 10px; box-shadow: 0 30px 100px #000; }
dialog::backdrop { background: rgb(0 0 0 / .76); backdrop-filter: blur(3px); }
dialog form { display: grid; gap: 15px; }
dialog footer { margin-top: 10px; justify-content: flex-end; }
.checkbox { display: flex; align-items: center; }
.checkbox input { width: 17px; min-height: 17px; margin: 0 8px 0 0; }
.issued-key { display: block; margin: 16px 0; padding: 15px 13px; color: var(--accent); background: #111412; border: 1px solid var(--line); border-radius: 7px; font: 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 20px; max-width: 430px; padding: 13px 16px; color: var(--text); background: #242925; border: 1px solid #404641; border-radius: 8px; box-shadow: 0 20px 60px #0008; font-size: 12px; }
.toast[data-kind="error"] { color: var(--bad); border-color: #6b3733; }
.wide-dialog { width: min(980px, calc(100vw - 28px)); }
.profile-admin-list { margin: 18px 0 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.profile-admin-card { padding: 17px; background: #131614; border: 1px solid var(--line); border-radius: 8px; }
.profile-admin-head { margin-bottom: 14px; display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.profile-admin-grid { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 11px; }
.profile-admin-grid span:nth-child(even) { font-family: var(--mono); }
.presence { white-space: nowrap; font: 9px var(--mono); }
.presence.online { color: var(--good); }
.presence.offline { color: var(--muted); }
.presence.pending, .pending-note { color: var(--warning); }
.presence.revoked { color: var(--bad); }
.profile-detail { margin: 12px 0 0; }
.profile-admin-card .action-group { margin-top: 15px; }
.web-panel-note { color: var(--muted); font-size: 10px; }

@media (max-width: 1180px) {
  .admin-view { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-layout { grid-template-columns: 1fr; }
  .profile-admin-list { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .login-view { grid-template-columns: 1fr; padding: 42px 0; }
  .login-story { min-height: auto; gap: 55px; }
  .login-facts { display: none; }
  .admin-view { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 15px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { padding: 0 3px 13px; }
  .tabs { display: flex; gap: 5px; overflow-x: auto; }
  .nav-label, .sidebar-status, .sidebar-footer { display: none; }
  .tab { min-width: max-content; width: auto; padding: 8px 11px; }
  .tab.active::after { display: none; }
  .app-main { padding: 24px 18px 55px; }
  .toolbar { min-height: auto; }
  .license-tools { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .login-view { width: min(100% - 24px, 520px); }
  .login-story h1 { font-size: 44px; }
  .login-card { padding: 25px 20px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metrics article { min-height: 116px; padding: 15px; }
  .metrics strong { font-size: 29px; }
  .workspace, .audit-panel { padding: 20px 16px; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .section-header .button.primary { width: 100%; }
  .release-current, .release-grid { grid-template-columns: 1fr; }
  .release-submit { align-items: stretch; flex-direction: column; }
  .audit-list li { flex-direction: column; gap: 5px; }
  dialog { padding: 21px 17px; }
}
