:root {
    color-scheme: light;
    --app-bg: #f4f7fb;
    --panel: #ffffff;
    --text: #182230;
    --muted: #667085;
    --line: #d9e2ec;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: #e6f4f1;
    --danger: #b42318;
    --warning: #b54708;
    --success: #067647;
    --info: #175cd3;
    --sidebar: #111827;
    --sidebar-line: rgba(255, 255, 255, 0.08);
    --sidebar-text: #d1d7e0;
    --shadow: 0 14px 40px rgba(16, 24, 40, 0.08);
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--app-bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
h2 { font-size: 18px; font-weight: 800; }
.muted { color: var(--muted); margin: 6px 0 0; }

code {
    padding: 3px 7px;
    border-radius: 7px;
    background: #eef2f7;
    color: #24324a;
    font-size: 13px;
    word-break: break-word;
}
pre {
    overflow-x: auto;
    padding: 16px;
    border: 1px solid #1f2a44;
    border-radius: 10px;
    background: #0f172a;
    color: #e5eefc;
    line-height: 1.55;
}
pre code { padding: 0; background: transparent; color: inherit; }

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

/* Admin navigation */
.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px;
    background: var(--sidebar);
    color: #fff;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}
.admin-main { min-width: 0; }
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    color: #fff;
    font-size: 18px;
    font-weight: 850;
}
.brand:hover { color: #fff; }
.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
}
.sidebar-nav {
    display: grid;
    gap: 8px;
}
.nav-search {
    position: relative;
}
.nav-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: #8e9aab;
    pointer-events: none;
}
.nav-search input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px 9px 38px;
    border: 1px solid var(--sidebar-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    outline: none;
}
.nav-search input::placeholder {
    color: #98a2b3;
}
.nav-search input:focus {
    border-color: rgba(20, 184, 166, 0.62);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
.nav-recent {
    display: grid;
    gap: 6px;
    padding-top: 2px;
}
.nav-mini-title {
    padding: 0 4px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.nav-recent-list {
    display: grid;
    gap: 4px;
}
.nav-recent-list a {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--sidebar-text);
    font-weight: 700;
}
.nav-recent-list a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.nav-section {
    border: 1px solid transparent;
    border-radius: 12px;
}
.nav-section.is-filter-hidden,
.nav-submenu a.is-filter-hidden {
    display: none;
}
.nav-section[open] {
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--sidebar-line);
}
.nav-section summary {
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 12px;
    color: #f8fafc;
    cursor: pointer;
    list-style: none;
    font-weight: 800;
}
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.nav-section summary i:first-child {
    width: 20px;
    text-align: center;
    color: #a7b1c2;
}
.nav-section summary:hover,
.nav-section summary.active {
    background: rgba(255, 255, 255, 0.08);
}
.nav-chevron {
    color: #8e9aab;
    font-size: 13px;
    transition: transform 0.16s ease;
}
.nav-section[open] .nav-chevron {
    transform: rotate(180deg);
}
.nav-submenu {
    display: grid;
    gap: 3px;
    padding: 3px 8px 9px 14px;
}
.sidebar-nav a, .logout {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--sidebar-text);
    font-weight: 650;
}
.sidebar-nav a i, .logout i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}
.sidebar-nav a:hover, .sidebar-nav a.active, .logout:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.sidebar-nav a.active {
    background: rgba(15, 118, 110, 0.22);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--primary);
}
.logout {
    margin-top: auto;
    border-top: 1px solid var(--sidebar-line);
}
.mobile-menu { background: var(--sidebar); color: #fff; }
.mobile-menu .btn-close { filter: invert(1); }
.mobile-menu .offcanvas-body { display: flex; flex-direction: column; gap: 18px; }

.topbar {
    min-height: 72px;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 28px;
    background: rgba(244, 247, 251, 0.86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(217, 226, 236, 0.8);
}
.topbar-title {
    display: grid;
    min-width: 0;
    font-weight: 800;
}
.topbar-title small {
    color: var(--muted);
    font-weight: 600;
}
.topbar-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.topbar-search {
    position: relative;
    width: min(520px, 38vw);
    margin-left: auto;
}
.topbar-search i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.topbar-search input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px 9px 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.04);
}
.icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #344054;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.04);
}
.icon-button:hover { background: var(--primary-soft); color: var(--primary); }

.content {
    width: min(1560px, 100%);
    margin: 0 auto;
    padding: 28px;
}

/* Panels, stats and forms */
.content > * + * { margin-top: 20px; }
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}
.head-actions, .inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.inline-form input { min-width: min(320px, 100%); }

.panel, .stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.panel {
    padding: 20px;
    overflow: hidden;
}
.panel + .panel { margin-top: 20px; }
.panel.narrow, .license-panel, .license-admin-panel { max-width: none; }
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.stats-grid, .report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}
.stat {
    position: relative;
    padding: 20px;
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute;
    inset: auto -28px -34px auto;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: var(--primary-soft);
}
.stat span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
    font-weight: 750;
}
.stat strong {
    position: relative;
    z-index: 1;
    font-size: 34px;
    line-height: 1;
}

.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.16s ease;
}
.button:hover, button:hover {
    transform: translateY(-1px);
    background: var(--primary-dark);
    color: #fff;
}
.button.secondary, button.secondary {
    background: #eef2f7;
    color: #24324a;
}
.button.secondary:hover, button.secondary:hover {
    background: #e2e8f0;
    color: #172033;
}
.button.danger, button.danger {
    background: var(--danger);
    color: #fff;
}
.button.danger:hover, button.danger:hover {
    background: #912018;
    color: #fff;
}
.button.compact, button.compact {
    min-height: 34px;
    padding: 0 11px;
    font-size: 13px;
}
.masked-secret {
    color: #526071;
}

form { margin: 0; }
.form-stack, .form-grid { display: grid; gap: 16px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full, .form-actions { grid-column: 1 / -1; }
label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-weight: 750;
    font-size: 14px;
}
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    color: var(--text);
    background: #fff;
    font: inherit;
    font-weight: 550;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: 4px solid rgba(15, 118, 110, 0.14);
}
textarea { resize: vertical; }
input[type="file"] { padding: 9px; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
}
.license-form { display: grid; gap: 22px; }
.form-section {
    display: grid;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.form-section > .full { grid-column: 1 / -1; }
.form-section:last-of-type { border-bottom: 0; }
.form-section h2 { font-size: 15px; color: #24324a; }
.license-key-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}
.license-key-row input {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
.check-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.check-row input { width: auto; }
.smtp-test-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.email-template-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.smtp-test-result.ok, .email-template-result.ok { color: #047857; font-weight: 750; }
.smtp-test-result.error, .email-template-result.error { color: #b42318; font-weight: 750; }
.email-preview-wrap {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    background: #f8fafc;
}
.email-preview-frame {
    width: 100%;
    height: 520px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.certificate-body { background: #eef2f7; padding: 28px; }
.license-certificate { max-width: 900px; margin: 0 auto; }
.certificate-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.certificate-sheet {
    background: #fff;
    border: 1px solid #dbe3ef;
    padding: 48px;
    min-height: 900px;
    box-shadow: var(--shadow);
}
.certificate-sheet h1 { font-size: 42px; margin-bottom: 8px; }
.certificate-sheet h2 { font-size: 26px; color: #0f766e; margin-bottom: 28px; }
.certificate-sheet dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.certificate-sheet dt { color: #667085; font-weight: 700; }
.certificate-sheet dd { margin: 0; font-size: 18px; font-weight: 750; }
.certificate-footer { margin-top: 48px; color: #667085; }
@media print {
    .certificate-actions { display: none; }
    .certificate-body { background: #fff; padding: 0; }
    .certificate-sheet { box-shadow: none; border: 0; }
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin-top: 10px;
}
.permission-group {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin: 0;
}
.permission-group legend {
    float: none;
    width: auto;
    padding: 0 8px;
    margin: 0;
    color: #24324a;
    font-size: 14px;
    font-weight: 850;
}

.table-responsive {
    border-radius: 12px;
    border: 1px solid var(--line);
}

/* Tables and badges */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
th, td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    background: #f8fafc;
}
tbody tr:hover td { background: #f8fbfd; }
tr:last-child td { border-bottom: 0; }
.actions {
    text-align: right;
    white-space: normal;
    min-width: 170px;
}
.action-links {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.inline-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.inline-actions input {
    width: min(260px, 100%);
    min-height: 34px;
    padding: 6px 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #eef2f7;
    color: #344054;
}
.badge.active, .badge.success { background: #dcfae6; color: var(--success); }
.badge.open { background: #e0eaff; color: var(--info); }
.badge.waiting_admin { background: #fee4e2; color: var(--danger); }
.badge.waiting_client { background: #fef0c7; color: var(--warning); }
.badge.closed { background: #eef2f7; color: #344054; }
.badge.blocked, .badge.suspended, .badge.expired, .badge.license_blocked, .badge.client_blocked, .badge.danger { background: #fee4e2; color: var(--danger); }
.badge.expiring, .badge.warning { background: #fef0c7; color: var(--warning); }
.badge.activation_limit, .badge.info { background: #e0eaff; color: var(--info); }

.alert {
    border: 0;
    border-radius: 12px;
    padding: 13px 16px;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
}
.alert.success { background: #dcfae6; color: var(--success); }
.alert.error { background: #fee4e2; color: var(--danger); }

.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.pagination a, .pagination span {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 0 10px;
}
.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.qr-box {
    width: 220px;
    height: 220px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    margin: 16px 0;
}
.qr-box img { width: 190px; height: 190px; }
.secret-details { margin: 10px 0 18px; }
.secret-details summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 800;
}

.client-portal-body {
    background: #eef4f7;
}

/* Client portal */
.client-portal {
    max-width: 1280px;
}
.portal-head {
    align-items: stretch;
}
.portal-token {
    min-width: min(320px, 100%);
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}
.portal-token span,
.portal-token small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}
.portal-token strong {
    color: var(--text);
}
.portal-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.portal-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #344054;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(16, 24, 40, 0.04);
}
.portal-nav a.active,
.portal-nav a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.portal-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.portal-action {
    min-height: 116px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow);
}
.portal-action:hover {
    border-color: rgba(15, 118, 110, 0.4);
    background: var(--primary-soft);
}
.portal-action i {
    color: var(--primary);
    font-size: 22px;
}
.portal-action span {
    font-size: 17px;
    font-weight: 850;
}
.portal-action small {
    color: var(--muted);
    font-weight: 650;
}
.license-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
    gap: 20px;
}
.license-card {
    display: grid;
    gap: 18px;
}
.license-card-head,
.subsection-head,
.license-key-copy {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.license-key-copy {
    align-items: center;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: #f8fafc;
}
.license-key-copy code {
    font-size: 14px;
}
.portal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin: 0;
}
.portal-details div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
}
.portal-details dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}
.portal-details dd {
    margin: 5px 0 0;
    font-weight: 800;
}
.portal-subsection {
    display: grid;
    gap: 10px;
}
.portal-subsection h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 850;
}
.portal-collapsible {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
}
.portal-collapsible summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    cursor: pointer;
    font-weight: 850;
    list-style: none;
}
.portal-collapsible summary::-webkit-details-marker {
    display: none;
}
.portal-collapsible summary::after {
    content: "+";
    margin-left: auto;
    color: var(--muted);
    font-weight: 900;
}
.portal-collapsible[open] summary::after {
    content: "-";
}
.portal-collapsible > :not(summary) {
    margin: 0 14px 14px;
}
.entitlement-list,
.response-code-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.entitlement-list span,
.response-code-grid span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #344054;
    font-weight: 700;
}
.support-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 20px;
    align-items: start;
}

/* Support */
.support-main,
.support-side,
.support-thread,
.support-ticket-list {
    display: grid;
    gap: 12px;
}
.support-message {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
}
.support-message.private {
    background: #fff9ed;
    border-color: #f9dbaf;
}
.support-message-head {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.support-message-head span,
.support-private-note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.support-message-head small {
    margin-left: auto;
    color: var(--muted);
    font-weight: 650;
}
.support-message-body {
    line-height: 1.55;
}
.support-private-note {
    display: inline-flex;
    margin-top: 10px;
}
.support-ticket-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
}
.support-ticket-row > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.portal-support-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.portal-support-sidebar,
.portal-support-main,
.portal-ticket-list {
    display: grid;
    gap: 12px;
}
.portal-ticket-card {
    display: grid;
    gap: 7px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
    color: var(--text);
}
.portal-ticket-card.active,
.portal-ticket-card:hover {
    border-color: rgba(15, 118, 110, 0.45);
    background: var(--primary-soft);
}
.portal-ticket-card strong {
    line-height: 1.35;
}
.portal-ticket-card small {
    color: var(--muted);
    font-weight: 650;
}
.portal-reply-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.empty-state {
    padding: 22px 0;
}
.modal-content {
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.modal-header,
.modal-footer {
    gap: 12px;
    padding: 16px 20px;
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    justify-content: flex-end;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at 20% 20%, #d9f0ec 0, transparent 32%), var(--app-bg);
}
.auth-card {
    width: min(460px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
}
.auth-card-wide { width: min(920px, 100%); }
.auth-card-wide .installer-form .form-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.auth-card-wide .installer-form .form-section > h2,
.auth-card-wide .installer-form .form-section > p,
.auth-card-wide .installer-form .form-section > .check-row {
    grid-column: 1 / -1;
}
.auth-card .brand { color: var(--text); }
.auth-card .brand:hover { color: var(--text); }

.feature-editor {
    display: grid;
    gap: 10px;
}
.feature-rows {
    display: grid;
    gap: 8px;
}
.feature-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.4fr) auto;
    gap: 8px;
    align-items: center;
}

@media (max-width: 991px) {
    .admin-shell { display: block; }
    .topbar { padding: 12px 16px; }
    .topbar-search { display: none; }
    .content { padding: 18px 14px 28px; }
    .page-head { flex-direction: column; }
    .support-layout { grid-template-columns: 1fr; }
    .portal-support-layout { grid-template-columns: 1fr; }
    .search-results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .form-grid { grid-template-columns: 1fr; }
    .auth-card-wide .installer-form .form-section { grid-template-columns: 1fr; }
    .split-grid { grid-template-columns: 1fr; }
    .license-key-row { grid-template-columns: 1fr; }
    .feature-row { grid-template-columns: 1fr; }
    .checkbox-grid { grid-template-columns: 1fr; }
    .head-actions, .form-actions, .action-links, .inline-actions {
        justify-content: stretch;
    }
    .head-actions > *, .form-actions > *, .action-links > *, .inline-actions > * {
        flex: 1 1 auto;
    }
    .button, button { width: auto; }
    .topbar-title small { display: none; }
}
