:root {
    --ink: #2f3f52;
    --muted: #687789;
    --canvas: #f7f7f7;
    --surface: #ffffff;
    --line: #d8dee8;
    --line-soft: #edf2f7;
    --brand: #336699;
    --brand-dark: #2f5d8c;
    --brand-soft: #f5f9fd;
    --base: #331a30;
    --base-light: #452e42;
    --action: #ef3a23;
    --action-hover: #da3520;
    --green: #1f6d3f;
    --green-soft: #e8f7ef;
    --amber: #7a5d00;
    --amber-soft: #fff7db;
    --red: #8c2f3b;
    --red-soft: #fdecef;
    --radius: 5px;
    font-family: "Open Sans", Arial, sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; background: var(--canvas); }
body { font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(239, 58, 35, .22);
    outline-offset: 2px;
}
[hidden] { display: none !important; }
svg { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; color: #333333; font-size: 31px; font-weight: 400; line-height: 1.15; }
h2 { margin-bottom: 0; color: #333333; font-size: 19px; font-weight: 500; }

.login-view { display: grid; min-height: 100dvh; place-items: center; padding: 28px 18px; background: linear-gradient(145deg, #f8f9fb 0%, #f1f3f6 60%, #f7f7f7 100%); }
.login-view::before { position: fixed; top: 0; right: 0; left: 0; height: 7px; background: linear-gradient(90deg, var(--base) 0 58%, var(--brand) 58% 86%, var(--action) 86%); content: ""; }
.login-card { width: min(100%, 430px); padding: 34px 36px 28px; border: 1px solid var(--line); border-top: 5px solid var(--base); border-radius: var(--radius); background: #fff; box-shadow: 0 16px 45px rgba(47, 63, 82, .11); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; color: #222; font-size: 26px; font-weight: 600; letter-spacing: -.035em; }
.login-brand img { width: 178px; height: auto; object-fit: contain; }
.login-copy { margin: 13px 0 25px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-card label, .field > span { display: block; margin-bottom: 7px; color: var(--ink); font-size: 12px; font-weight: 650; }
.stacked-label { display: block; margin-top: 14px; }
.stacked-label > span { display: block; margin-bottom: 7px; }
.secret-input { position: relative; }
.secret-input input { padding-right: 46px; }
input, select, textarea { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #ccd4df; border-radius: var(--radius); color: var(--ink); background: #fff; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #8b96a4; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--action); outline: 0; box-shadow: 0 0 0 2px rgba(239, 58, 35, .1); }
.icon-button { display: grid; width: 42px; height: 42px; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); }
.icon-button svg { width: 19px; height: 19px; }
.icon-button--light { position: absolute; top: 1px; right: 1px; color: var(--muted); }
.primary-button, .secondary-button, .danger-button { display: inline-flex; min-height: 41px; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius); font-weight: 650; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.primary-button { border: 1px solid var(--action); color: #fff; background: var(--action); }
.primary-button:hover { border-color: var(--action-hover); background: var(--action-hover); }
.primary-button svg, .secondary-button svg { width: 18px; height: 18px; }
.primary-button--wide { width: 100%; justify-content: space-between; margin-top: 17px; padding-right: 12px; padding-left: 16px; }
.secondary-button { border: 1px solid #cbd3dd; color: #3f4c5c; background: #f3f4f5; }
.secondary-button:hover { border-color: #b6c0cd; background: #e8eaed; }
.danger-button { border: 1px solid #d8a7ae; color: var(--red); background: #fff7f8; }
.danger-button:hover, .danger-button--solid { border-color: var(--red); color: #fff; background: var(--red); }
.danger-button--solid:hover { background: #762532; }
.form-message { margin: 12px 0 0; padding: 9px 11px; border: 1px solid #b9e6ca; border-radius: var(--radius); color: var(--green); background: var(--green-soft); font-size: 12px; }
.form-message--error { border-color: #f5c2cb; color: var(--red); background: var(--red-soft); }
.login-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 27px; padding-top: 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.language-switch { min-width: 32px; padding: 4px 7px; border: 1px solid #cbd3dd; border-radius: 3px; color: var(--ink); background: #fff; font-size: 10px; font-weight: 700; }

.app-shell { min-height: 100dvh; }
.app-header { position: fixed; z-index: 20; top: 0; right: 0; left: 0; display: grid; height: 58px; grid-template-columns: 230px minmax(0, 1fr) auto; align-items: center; color: #fff; background: #050505; border-bottom: 4px solid var(--base); }
.header-brand { display: flex; height: 54px; align-items: center; gap: 8px; padding: 0 22px; color: #fff; text-decoration: none; }
.header-brand img { width: 31px; height: 31px; object-fit: contain; filter: brightness(0) invert(1); }
.header-brand span { font-size: 22px; font-weight: 600; letter-spacing: -.04em; }
.header-context { display: flex; align-items: center; gap: 10px; color: #c8c8c8; font-size: 12px; }
.environment-badge { padding: 3px 7px; border: 1px solid #4e4e4e; border-radius: 99px; color: #e8e8e8; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.header-actions { display: flex; align-self: stretch; }
.current-user { display: flex; align-items: center; padding: 0 16px; color: #d7d7d7; font-size: 11px; }
.header-button { min-width: 52px; padding: 0 16px; border: 0; border-left: 1px solid #333; color: #fff; background: transparent; font-size: 11px; }
.header-button:hover { background: var(--base); }
.sidebar { position: fixed; z-index: 10; top: 58px; bottom: 0; left: 0; display: flex; width: 230px; flex-direction: column; justify-content: space-between; padding: 22px 12px 15px; color: #fff; background: var(--base); }
.nav-item { display: flex; width: 100%; min-height: 45px; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: var(--radius); color: #d8cfd7; background: transparent; text-align: left; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav-item.is-active { color: #222; background: #fff; font-weight: 650; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-top: 1px solid rgba(255, 255, 255, .14); color: #cabfc8; font-size: 10px; }
.service-dot { width: 8px; height: 8px; border-radius: 50%; background: #64c88c; box-shadow: 0 0 0 3px rgba(100, 200, 140, .13); }
.workspace { min-height: 100dvh; margin-left: 230px; padding: 94px 34px 50px; }
.page-heading { display: flex; max-width: 1440px; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 auto 24px; }
.page-intro { max-width: 760px; margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.metric-grid { display: grid; max-width: 1440px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 auto 18px; }
.metric-card { display: flex; min-height: 111px; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.metric-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 50%; }
.metric-icon svg { width: 21px; height: 21px; }
.metric-icon--blue { color: var(--brand); background: #edf5fc; }
.metric-icon--purple { color: #6b386d; background: #f3edf4; }
.metric-icon--green { color: var(--green); background: var(--green-soft); }
.metric-icon--amber { color: var(--amber); background: var(--amber-soft); }
.metric-card > div:last-child { min-width: 0; }
.metric-label { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-card strong { display: block; margin: 4px 0 1px; color: #222; font-size: 25px; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric-card small { display: block; overflow: hidden; color: #8391a3; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-card { max-width: 1440px; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.catalog-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 18px 14px; border-bottom: 1px solid var(--line); background: var(--brand-soft); }
.catalog-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.catalog-header .secondary-button { min-height: 35px; padding: 7px 11px; font-size: 11px; }
.toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 190px 190px; gap: 9px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.search-control { position: relative; }
.search-control svg { position: absolute; top: 11px; left: 11px; width: 17px; height: 17px; color: #788697; pointer-events: none; }
.search-control input { min-height: 39px; padding-left: 37px; }
.filter-control select { min-height: 39px; padding-right: 34px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #687789 50%), linear-gradient(135deg, #687789 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-repeat: no-repeat; background-size: 5px 5px, 5px 5px; }
.catalog-message { padding: 34px 18px; color: var(--muted); text-align: center; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0; }
thead th { padding: 11px 13px; color: #fff; background: var(--brand); border-bottom: 1px solid var(--brand-dark); font-size: 9px; font-weight: 700; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap; }
thead th:first-child { padding-left: 18px; }
thead th:last-child { width: 1%; }
tbody tr:nth-child(even) { background: var(--brand-soft); }
tbody tr:hover { background: #ecf4fb; }
tbody td { padding: 12px 13px; border-bottom: 1px solid var(--line-soft); color: var(--ink); font-size: 12px; vertical-align: middle; }
tbody td:last-child .row-action + .row-action { margin-left: 6px; }
.row-action:disabled { color: #9aa5b2; cursor: not-allowed; text-decoration: none; }
tbody td:first-child { padding-left: 18px; }
tbody td > strong, tbody td > small { display: block; }
tbody td > strong { font-size: 12px; font-weight: 650; }
tbody td > small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.domain-value, .key-prefix { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.edition-pill, .status-pill { display: inline-flex; min-height: 23px; align-items: center; padding: 2px 8px; border: 1px solid #c7d9eb; border-radius: 99px; color: var(--brand-dark); background: #edf5fc; font-size: 9px; font-weight: 700; }
.edition-pill[data-edition="Enterprise"] { border-color: #d7c7da; color: #6b386d; background: #f3edf4; }
.edition-pill[data-edition="Free"] { border-color: #d4dbe5; color: #516172; background: #eef2f7; }
.status-pill[data-status="Revoked"], .status-pill[data-status="Suspended"] { border-color: #f5c2cb; color: var(--red); background: var(--red-soft); }
.activation-state { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; }
.activation-state::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.activation-state[data-active="false"] { color: #8391a3; }
.row-action { display: inline-flex; min-height: 31px; align-items: center; gap: 5px; padding: 5px 8px; border: 0; color: var(--action); background: transparent; font-size: 10px; font-weight: 700; }
.row-action:hover { color: var(--action-hover); text-decoration: underline; }
.row-action svg { width: 14px; height: 14px; }

.app-dialog { width: min(calc(100% - 28px), 680px); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 7px; color: var(--ink); background: transparent; box-shadow: 0 22px 60px rgba(21, 27, 36, .28); }
.app-dialog::backdrop { background: rgba(23, 29, 37, .53); backdrop-filter: blur(2px); }
.app-dialog--small { width: min(calc(100% - 28px), 520px); }
.dialog-frame { display: flex; max-height: calc(100dvh - 32px); flex-direction: column; border: 1px solid var(--line); border-top: 5px solid var(--base); border-radius: 7px; background: #fff; }
.dialog-frame--wide { width: 100%; }
.dialog-header { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 20px 15px; border-bottom: 1px solid var(--line); background: var(--brand-soft); }
.dialog-close { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.dialog-close:hover { color: #222; background: #e5ebf1; }
.dialog-close svg { width: 18px; height: 18px; }
.dialog-body { overflow-y: auto; padding: 20px; }
.dialog-copy { margin-bottom: 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dialog-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: #fafafa; }
.dialog-footer--split { justify-content: space-between; }
.dialog-footer--split > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 16px; }
.field--wide { grid-column: 1 / -1; }
.trial-toggle { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 12px; font-weight: 650; }
.trial-toggle input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--action); }
.trial-help { margin: -9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.field input, .field select { min-height: 41px; }
.field input:disabled { color: #7b8795; background: #f3f4f5; }
.detail-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 13px; margin-bottom: 18px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); background: var(--brand-soft); color: var(--muted); font-size: 10px; }
.form-grid--detail { padding-top: 3px; }
.readonly-value { display: flex; min-height: 41px; align-items: center; padding: 9px 11px; border: 1px solid var(--line-soft); border-radius: var(--radius); color: #566678; background: #f8f9fa; font-size: 10px; font-weight: 500; overflow-wrap: anywhere; }
.success-mark { display: grid; width: 50px; height: 50px; place-items: center; margin: 0 auto 14px; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.success-mark svg { width: 29px; height: 29px; }
.app-dialog--key .dialog-copy { text-align: center; }
.key-box { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #f5f6f8; }
.key-box code { min-width: 0; flex: 1; overflow-wrap: anywhere; color: #26384a; font-size: 11px; }
.key-box .secondary-button { flex: 0 0 auto; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
    .app-header { grid-template-columns: 1fr auto; }
    .header-brand { padding-left: 15px; }
    .header-context { display: none; }
    .sidebar { top: auto; right: 0; bottom: 0; width: auto; height: 58px; padding: 6px 10px; border-top: 4px solid var(--base); background: #050505; }
    .sidebar nav { height: 100%; }
    .nav-item { width: auto; height: 100%; min-height: 0; padding: 5px 14px; color: #fff; }
    .nav-item.is-active { color: #222; }
    .sidebar-footer { display: none; }
    .workspace { margin-left: 0; padding: 86px 16px 84px; }
    .page-heading { align-items: flex-start; }
    .toolbar { grid-template-columns: 1fr 1fr; }
    .search-control { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .login-card { padding: 28px 22px 22px; }
    .header-actions .header-button { padding: 0 11px; }
    .page-heading { display: grid; }
    .page-heading .primary-button { justify-self: start; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 92px; }
    .toolbar { grid-template-columns: 1fr; }
    .search-control { grid-column: auto; }
    .catalog-header { align-items: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
    .field--wide { grid-column: auto; }
    .dialog-footer, .dialog-footer--split { align-items: stretch; flex-direction: column-reverse; }
    .dialog-footer > button, .dialog-footer--split > button, .dialog-footer--split > div, .dialog-footer--split > div > button { width: 100%; }
    .key-box { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
