:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --sidebar: #101828;
    --sidebar-hover: #1d2939;
    --text: #101828;
    --muted: #667085;
    --line: #e4e7ec;
    --line-dark: #d0d5dd;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --success: #067647;
    --success-soft: #ecfdf3;
    --warning: #b54708;
    --warning-soft: #fffaeb;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --violet: #6941c6;
    --violet-soft: #f4f3ff;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .03);
    --radius: 10px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
code, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: 244px; display: flex; flex-direction: column; padding: 22px 16px 16px; background: var(--sidebar); color: #fff; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 23px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: #2563eb; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark.large { width: 48px; height: 48px; border-radius: 12px; font-size: 15px; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 14px; font-weight: 700; }
.brand-copy small { margin-top: 1px; color: #98a2b3; font-size: 11px; }
.nav { display: grid; gap: 4px; padding-top: 20px; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 0 12px; border-radius: 8px; color: #98a2b3; font-size: 13px; font-weight: 600; transition: background .18s, color .18s; }
.nav-link svg { width: 19px; height: 19px; }
.nav-link:hover { background: var(--sidebar-hover); color: #f9fafb; }
.nav-link.active { background: #1d2939; color: #fff; }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.09); }
.account-link { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 8px; color: #d0d5dd; }
.account-link:hover, .account-link.active { background: var(--sidebar-hover); }
.account-link > span:nth-child(2) { min-width: 0; flex: 1; }
.account-link strong, .account-link small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-link strong { font-size: 12px; }
.account-link small { color: #98a2b3; font-size: 10px; }
.account-link > svg { width: 16px; height: 16px; color: #667085; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: #344054; color: #fff; font-size: 12px; font-weight: 700; }
.logout-button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #98a2b3; font-size: 12px; font-weight: 600; }
.logout-button:hover { background: var(--sidebar-hover); color: #fff; }
.logout-button svg { width: 17px; height: 17px; }

.main-area { width: calc(100% - 244px); min-width: 0; margin-left: 244px; }
.topbar { position: sticky; top: 0; z-index: 30; height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.025em; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.mobile-menu { display: none; width: 38px; height: 38px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.topbar-action { padding: 9px 13px; }
.content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 26px 30px 48px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; line-height: 1; transition: background .18s, border-color .18s, color .18s, box-shadow .18s; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.18); }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { border-color: var(--line-dark); background: #fff; color: #344054; }
.button-secondary:hover, .button-ghost:hover { background: var(--surface-soft); border-color: #b8c0cc; }
.button-ghost { border-color: var(--line); background: transparent; color: #475467; }
.button-danger { border-color: #fecdca; background: #fff; color: var(--danger); }
.button-danger:hover { background: var(--danger-soft); }
.button-sm { min-height: 33px; padding: 7px 11px; font-size: 11px; }
.button-block { width: 100%; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid; border-radius: 8px; font-size: 12px; }
.alert svg { width: 18px; height: 18px; flex: 0 0 auto; }
.alert-success { border-color: #abefc6; background: var(--success-soft); color: var(--success); }
.alert-danger { border-color: #fecdca; background: var(--danger-soft); color: var(--danger); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 13px; min-height: 94px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-icon.violet { background: var(--violet-soft); color: var(--violet); }
.stat-card span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-card strong { display: block; margin-top: 2px; font-size: 24px; line-height: 1.2; letter-spacing: -.035em; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.card-header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.card-header.compact { min-height: 65px; }
.card-header h2 { margin: 0; font-size: 15px; line-height: 1.35; letter-spacing: -.015em; }
.card-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 21px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 780px; border-collapse: collapse; }
th { height: 42px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #f9fafb; color: #667085; font-size: 9px; font-weight: 700; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid #eef0f3; color: #475467; font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }
.primary-text { color: var(--text); font-weight: 700; }
.primary-text:hover { color: var(--primary); }
.cell-sub { display: block; margin-top: 3px; color: #98a2b3; font-size: 9px; }
.domain-text { display: inline-block; max-width: 230px; overflow: hidden; color: #344054; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.table-action-cell { width: 52px; text-align: right; }
.status { display: inline-flex; align-items: center; justify-content: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; text-transform: capitalize; }
.status-active { background: var(--success-soft); color: var(--success); }
.status-suspended { background: var(--warning-soft); color: var(--warning); }
.status-revoked { background: var(--danger-soft); color: var(--danger); }
.icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #667085; }
.icon-button:hover { border-color: #b9c2cf; background: var(--surface-soft); color: var(--text); }
.icon-button svg { width: 16px; height: 16px; }
.icon-button.primary { border-color: #bfd4ff; background: var(--primary-soft); color: var(--primary); }

.empty-state { padding: 55px 24px; text-align: center; }
.empty-state.compact-empty { padding: 38px 20px; }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 10px; background: var(--surface-soft); color: #98a2b3; }
.empty-state h3 { margin: 0; font-size: 14px; }
.empty-state p { margin: 5px 0 15px; color: var(--muted); font-size: 11px; }

.toolbar { display: flex; align-items: center; gap: 9px; padding: 15px; border-bottom: 1px solid var(--line); }
.toolbar select { width: 190px; }
.search-control { position: relative; flex: 1; }
.search-control svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; color: #98a2b3; transform: translateY(-50%); }
.search-control input { padding-left: 36px; }

.field-grid { display: grid; gap: 16px; margin-bottom: 17px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.field { display: grid; gap: 6px; margin-bottom: 17px; }
.field:last-child { margin-bottom: 0; }
.field label { color: #344054; font-size: 11px; font-weight: 700; }
.field label span { color: #98a2b3; font-weight: 500; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select { width: 100%; border: 1px solid var(--line-dark); border-radius: 8px; outline: none; background: #fff; color: var(--text); font-size: 12px; transition: border-color .18s, box-shadow .18s; }
.field input, .field select, .toolbar input, .toolbar select { height: 41px; padding: 0 12px; }
.field textarea { min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar input:focus, .toolbar select:focus { border-color: #84adff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field small { color: #98a2b3; font-size: 9px; }
.field-error { color: var(--danger); font-size: 9px; font-weight: 600; }
.field-error.block { display: block; margin-top: 7px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); cursor: pointer; }
.checkbox-row input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--primary); }
.checkbox-row strong, .checkbox-row small { display: block; }
.checkbox-row strong { font-size: 11px; }
.checkbox-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }

.form-page { width: 100%; max-width: 980px; margin: 0 auto; }
.narrow-form { max-width: 820px; }
.form-card { margin-bottom: 16px; }
.sticky-form-actions { position: sticky; bottom: 12px; z-index: 10; display: flex; justify-content: flex-end; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.95); box-shadow: 0 8px 25px rgba(16,24,40,.09); backdrop-filter: blur(12px); }
.sticky-form-actions.single { justify-content: flex-end; }
.source-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.source-tab { cursor: pointer; }
.source-tab input { position: absolute; opacity: 0; pointer-events: none; }
.source-tab > span { min-height: 88px; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 15px; border: 1px solid var(--line-dark); border-radius: 9px; background: #fff; transition: border-color .18s, background .18s, box-shadow .18s; }
.source-tab svg { grid-row: 1 / 3; width: 23px; height: 23px; color: #667085; }
.source-tab b { align-self: end; font-size: 12px; }
.source-tab small { align-self: start; color: var(--muted); font-size: 9px; }
.source-tab input:checked + span { border-color: #84adff; background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.source-tab input:checked + span svg { color: var(--primary); }
.source-panel { display: none; }
.source-panel.active { display: block; }
.upload-box { position: relative; padding: 25px; border: 1px dashed #b8c2d0; border-radius: 9px; background: var(--surface-soft); text-align: center; }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-box label { display: grid; justify-items: center; cursor: pointer; }
.upload-box label svg { width: 25px; height: 25px; margin-bottom: 8px; color: var(--primary); }
.upload-box label strong { font-size: 12px; }
.upload-box label small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.upload-box > span { display: block; margin-top: 11px; color: #475467; font-size: 10px; font-weight: 600; }

.page-actions, .content-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.content-actions > div { color: var(--muted); font-size: 11px; }
.action-group { display: flex; align-items: center; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: #475467; font-size: 11px; font-weight: 600; }
.back-link:hover { color: var(--primary); }
.back-link svg { width: 16px; height: 16px; }
.license-heading { margin-bottom: 16px; }
.heading-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.heading-line h2 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
.license-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.detail-main { display: grid; gap: 16px; min-width: 0; }
.detail-sidebar { display: grid; gap: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.info-grid > div { min-height: 76px; padding: 16px 19px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.info-grid > div:nth-child(2n) { border-right: 0; }
.info-grid > div.full { grid-column: 1 / -1; border-right: 0; }
.info-grid > div:last-child { border-bottom: 0; }
.info-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.info-grid strong { display: block; color: #344054; font-size: 11px; }
.wrap-text { overflow-wrap: anywhere; }
.copy-field { display: flex; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 8px; background: var(--surface-soft); }
.copy-field code { flex: 1; min-width: 0; padding: 10px 11px; overflow: auto; color: #344054; font-size: 10px; white-space: nowrap; }
.copy-field button { min-width: 58px; border: 0; border-left: 1px solid var(--line); background: #fff; color: var(--primary); font-size: 10px; font-weight: 700; }
.control-card .card-body { padding-top: 17px; }
.delete-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; border-color: #fecdca; box-shadow: none; }
.delete-card strong { display: block; color: var(--danger); font-size: 11px; }
.delete-card p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }

.product-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.product-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.product-card-header { display: flex; align-items: center; justify-content: space-between; }
.product-logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 800; }
.product-logo.large { width: 52px; height: 52px; border-radius: 11px; font-size: 13px; }
.product-card h2 { margin: 15px 0 2px; font-size: 15px; }
.product-card > code { color: var(--muted); font-size: 9px; }
.product-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 17px 0; }
.product-stats > div { padding: 9px; border-radius: 7px; background: var(--surface-soft); }
.product-stats span, .product-stats strong { display: block; }
.product-stats span { color: var(--muted); font-size: 8px; }
.product-stats strong { margin-top: 2px; font-size: 12px; }
.product-actions { display: flex; gap: 7px; }
.product-actions .button { flex: 1; }
.product-detail-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 15px; margin-bottom: 16px; padding: 18px; }
.product-detail-head h2 { margin: 0; font-size: 18px; }
.product-detail-head code { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.product-detail-stats { display: flex; gap: 8px; }
.product-detail-stats > div { min-width: 76px; padding: 9px 11px; border-radius: 8px; background: var(--surface-soft); }
.product-detail-stats span, .product-detail-stats strong { display: block; }
.product-detail-stats span { color: var(--muted); font-size: 8px; }
.product-detail-stats strong { margin-top: 2px; font-size: 12px; }
.count-pill { min-width: 26px; height: 26px; display: inline-grid; place-items: center; padding: 0 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 700; }
.file-list { display: grid; }
.file-list > div { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.file-list > div:last-child { border-bottom: 0; }
.file-list span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-soft); color: #98a2b3; font-size: 8px; font-weight: 700; }
.file-list code { color: #344054; font-size: 10px; overflow-wrap: anywhere; }

.auth-page { min-height: 100vh; background: #f4f6f9; }
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; }
.login-brand { display: grid; justify-items: center; margin-bottom: 22px; }
.login-brand strong { margin-top: 10px; font-size: 14px; }
.login-brand small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.login-card { width: min(100%, 390px); padding: 29px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 18px 55px rgba(16,24,40,.09); }
.login-heading { margin-bottom: 22px; text-align: center; }
.login-heading h1 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.login-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.form-stack { display: grid; gap: 15px; }
.form-stack .field { margin: 0; }
.login-button { min-height: 42px; margin-top: 2px; }
.login-footer { margin: 18px 0 0; color: #98a2b3; font-size: 9px; }
.sidebar-backdrop { display: none; }

@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(16,24,40,.48); }
    .sidebar-backdrop.show { display: block; }
    .main-area { width: 100%; margin-left: 0; }
    .mobile-menu { display: grid; }
    .topbar { height: 68px; padding: 0 18px; }
    .content { padding: 20px 18px 40px; }
    .product-detail-head { grid-template-columns: auto 1fr; }
    .product-detail-stats { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .topbar p { display: none; }
    .topbar h1 { font-size: 17px; }
    .topbar-action span { display: none; }
    .content { padding: 15px 12px 32px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { min-height: 82px; padding: 13px; gap: 10px; }
    .stat-icon { width: 36px; height: 36px; }
    .stat-card strong { font-size: 20px; }
    .toolbar { align-items: stretch; flex-wrap: wrap; }
    .search-control { flex-basis: 100%; }
    .toolbar select { flex: 1; width: auto; }
    .field-grid.two, .source-tabs, .info-grid { grid-template-columns: 1fr; }
    .info-grid > div, .info-grid > div:nth-child(2n) { border-right: 0; }
    .info-grid > div.full { grid-column: auto; }
    .page-actions, .content-actions { align-items: flex-start; flex-direction: column; }
    .action-group { width: 100%; }
    .action-group .button { flex: 1; }
    .detail-sidebar { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr; }
    .product-detail-stats { width: 100%; display: grid; grid-template-columns: repeat(3,1fr); }
    .product-detail-stats > div { min-width: 0; }
    .sticky-form-actions { bottom: 7px; }
    .login-card { padding: 24px 19px; }
}

/* Refined license management UI */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    --bg: #f3f6fa;
    --surface-soft: #f7f9fc;
    --line: #e2e8f0;
    --line-dark: #cbd5e1;
    --text: #0f172a;
    --muted: #64748b;
    --sidebar: #0f172a;
    --sidebar-hover: #1e293b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .045);
    --radius: 12px;
}

body { background: var(--bg); }
.sidebar { width: 252px; padding: 24px 18px 18px; }
.main-area { width: calc(100% - 252px); margin-left: 252px; }
.brand { padding: 0 8px 24px; }
.brand-mark { border-radius: 10px; box-shadow: 0 8px 20px rgba(37, 99, 235, .22); }
.nav-link { min-height: 44px; padding: 0 13px; font-size: 13px; }
.nav-link.active { background: #243247; box-shadow: inset 3px 0 0 #60a5fa; }
.topbar { height: 78px; padding: 0 34px; }
.topbar h1 { font-size: 21px; }
.topbar p { font-size: 12px; }
.content { max-width: 1280px; padding: 30px 34px 52px; }
.card { border-color: #dde4ee; box-shadow: var(--shadow); }
.button { min-height: 40px; padding: 9px 15px; font-size: 12.5px; }
.button-sm { min-height: 34px; padding: 7px 11px; font-size: 11.5px; }
.field label { font-size: 12.5px; }
.field input, .field select, .field textarea { font-size: 13px; }
.field input, .field select { height: 44px; }
.field small { color: #718096; font-size: 10.5px; line-height: 1.55; }
.field small code, .automatic-url-note code { padding: 1px 4px; border-radius: 4px; background: #eef2f7; color: #334155; font-size: .95em; }
th { height: 46px; padding: 0 18px; font-size: 10px; }
td { padding: 15px 18px; font-size: 12.5px; }
.cell-sub { font-size: 10px; }
.status { min-height: 25px; padding: 4px 9px; font-size: 10px; }

.license-list-card { overflow: hidden; }
.license-list-header {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--line);
}
.license-list-header h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.license-list-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.license-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 210px 170px auto;
    align-items: end;
    gap: 12px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}
.license-toolbar .search-control { min-width: 0; }
.license-toolbar .search-control input,
.license-toolbar .filter-control select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line-dark);
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: var(--text);
    font-size: 12.5px;
    transition: border-color .18s, box-shadow .18s;
}
.license-toolbar .search-control input { padding: 0 13px 0 40px; }
.license-toolbar .search-control input:focus,
.license-toolbar .filter-control select:focus {
    border-color: #7aa7ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.license-toolbar .search-control svg { left: 14px; width: 17px; height: 17px; }
.filter-control { display: grid; gap: 6px; }
.filter-control label { color: #475569; font-size: 10px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.filter-control select { padding: 0 34px 0 12px; }
.filter-submit { min-width: 94px; height: 44px; }
.license-empty-state { min-height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 42px 24px; }
.license-empty-state .empty-icon { width: 52px; height: 52px; margin-bottom: 14px; border: 1px solid #e7ecf3; background: #f8fafc; }
.license-empty-state h3 { margin: 0; font-size: 15px; }
.license-empty-state p { max-width: 360px; margin: 7px 0 18px; color: var(--muted); font-size: 11.5px; }
.license-table { min-width: 940px; }

.license-create-page { max-width: 1000px; }
.section-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.license-main-fields { align-items: start; }
.domain-input-wrap {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--line-dark);
    border-radius: 8px;
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
}
.domain-input-wrap:focus-within {
    border-color: #84adff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.domain-input-wrap > span {
    width: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-right: 1px solid var(--line);
    background: #f8fafc;
    color: #64748b;
}
.domain-input-wrap > span svg { width: 17px; height: 17px; }
.domain-input-wrap input {
    min-width: 0;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.automatic-url-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 4px 0 18px;
    padding: 13px 14px;
    border: 1px solid #cfe0ff;
    border-radius: 9px;
    background: #f5f9ff;
    color: #31507e;
}
.automatic-url-note > svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; color: var(--primary); }
.automatic-url-note strong { display: block; color: #1e3a5f; font-size: 11.5px; }
.automatic-url-note p { margin: 3px 0 0; font-size: 10.5px; line-height: 1.55; }
.advanced-options {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
}
.advanced-options summary {
    display: grid;
    grid-template-columns: 115px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 14px;
    cursor: pointer;
    list-style: none;
}
.advanced-options summary::-webkit-details-marker { display: none; }
.advanced-options summary > span { color: var(--muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.advanced-options summary > strong { color: #334155; font-size: 11.5px; }
.advanced-options summary svg { width: 16px; height: 16px; color: #64748b; transition: transform .18s; }
.advanced-options[open] summary svg { transform: rotate(180deg); }
.advanced-options-body { padding: 15px; border-top: 1px solid var(--line); background: #fbfcfe; }
.advanced-options-body .field { margin: 0; }
.source-tab > span { min-height: 94px; }

@media (max-width: 1100px) {
    .license-toolbar { grid-template-columns: minmax(260px, 1fr) 180px 150px auto; }
}

@media (max-width: 900px) {
    .license-toolbar { grid-template-columns: 1fr 1fr; }
    .license-toolbar .search-control { grid-column: 1 / -1; }
    .filter-submit { width: 100%; }
}

@media (max-width: 820px) {
    .sidebar { width: 252px; }
    .main-area { width: 100%; margin-left: 0; }
    .topbar { padding: 0 20px; }
    .content { padding: 22px 18px 42px; }
}

@media (max-width: 620px) {
    .license-list-header { min-height: 66px; padding: 14px 15px; }
    .license-toolbar { grid-template-columns: 1fr; padding: 14px 15px; }
    .license-toolbar .search-control { grid-column: auto; }
    .license-empty-state { min-height: 240px; padding: 34px 20px; }
    .advanced-options summary { grid-template-columns: 1fr auto; }
    .advanced-options summary > span { display: none; }
    .domain-input-wrap > span { width: 40px; }
}
.status-blocked { background: var(--danger-soft); color: var(--danger); }
