:root {
    --ink: #172033;
    --muted: #667085;
    --line: #e5e9f2;
    --panel: #ffffff;
    --canvas: #f5f7fb;
    --navy: #111b33;
    --violet: #6454d7;
    --violet-dark: #5143bd;
    --green: #167c52;
    --green-soft: #e9f8f0;
    --red: #c7384a;
    --red-soft: #fff0f2;
    --amber: #9a6700;
    --amber-soft: #fff7df;
    --blue: #1769aa;
    --blue-soft: #eaf4ff;
    --shadow: 0 10px 30px rgba(22, 32, 58, .07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; background: linear-gradient(180deg, #111b33 0%, #172443 100%); color: white; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 40px; }
.brand-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, #8b7df0, #5143bd); color: white; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 8px 22px rgba(100,84,215,.35); flex: 0 0 auto; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .01em; }
.brand small { margin-top: 1px; color: #aeb8cf; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
nav { display: grid; gap: 8px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: #b8c2d8; border-radius: 10px; font-weight: 600; font-size: 14px; transition: .18s ease; }
.nav-link:hover { background: rgba(255,255,255,.07); color: white; }
.nav-link.active { color: white; background: rgba(139,125,240,.18); box-shadow: inset 3px 0 #8b7df0; }
.nav-icon { width: 22px; text-align: center; font-size: 18px; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 20px 8px 0; }
.signed-in { display: flex; gap: 10px; align-items: center; }
.signed-in small, .signed-in strong { display: block; }
.signed-in small { color: #96a3bc; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.signed-in strong { margin-top: 2px; font-size: 13px; max-width: 125px; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #293858; color: #dcd9ff; font-weight: 700; }
.text-button { border: 0; background: none; color: #96a3bc; padding: 12px 0 0 44px; cursor: pointer; font-size: 12px; }
.text-button:hover { color: white; }

.main-content { padding: 42px clamp(24px, 4vw, 64px) 64px; min-width: 0; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-header h1 { margin: 4px 0 8px; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.035em; line-height: 1.08; }
.eyebrow { margin: 0; color: var(--violet); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }
p.muted { margin: 0; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--muted); font-size: 13px; font-weight: 650; }
.back-link:hover { color: var(--violet); }
.heading-with-badge { display: flex; align-items: center; gap: 14px; }
.heading-with-badge h1 { margin-bottom: 4px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; white-space: nowrap; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .65; cursor: wait; }
.btn-primary { color: white; background: var(--violet); box-shadow: 0 6px 16px rgba(100,84,215,.18); }
.btn-primary:hover:not(:disabled) { background: var(--violet-dark); }
.btn-secondary { color: #344054; background: white; border-color: #d8deea; }
.btn-secondary:hover:not(:disabled) { border-color: #b9c1d1; box-shadow: 0 5px 15px rgba(22,32,58,.06); }
.btn-success { color: white; background: var(--green); }
.btn-danger { color: white; background: var(--red); }
.btn-danger-soft { color: var(--red); background: var(--red-soft); border-color: #ffd7dc; }
.btn-small { min-height: 33px; padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn.disabled { opacity: .45; pointer-events: none; }
.button-working { display: none; }
.is-working .button-label { display: none; }
.is-working .button-working { display: inline; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 20px; display: flex; align-items: center; gap: 15px; box-shadow: 0 4px 18px rgba(22,32,58,.035); }
.stat-card small, .stat-card strong { display: block; }
.stat-card small { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.stat-card strong { font-size: 27px; letter-spacing: -.03em; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; }
.stat-icon.violet { color: var(--violet); background: #f0edff; }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.slate { color: #5f6b7c; background: #eef1f5; }
.stat-icon.red { color: var(--red); background: var(--red-soft); }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel + .panel { margin-top: 22px; }
.panel-toolbar, .panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; }
.panel-toolbar { border-bottom: 1px solid var(--line); }
.panel-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.panel h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.015em; }
.panel p { font-size: 13px; }
.filter-form { display: flex; align-items: center; gap: 8px; }
input, select, textarea { width: 100%; border: 1px solid #d8deea; border-radius: 9px; background: white; color: var(--ink); padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: #8b7df0; box-shadow: 0 0 0 3px rgba(100,84,215,.11); }
select { min-width: 150px; }
.search-field { position: relative; }
.search-field span { position: absolute; top: 9px; left: 11px; color: var(--muted); }
.search-field input { width: 230px; padding-left: 32px; }
label > span { display: block; margin-bottom: 7px; color: #344054; font-size: 12px; font-weight: 700; }
label em { color: var(--muted); font-style: normal; font-weight: 500; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 18px; color: #7a8496; background: #fafbfc; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 16px 18px; border-bottom: 1px solid #edf0f5; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfe; }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.resource-name { font-weight: 750; color: #28334a; }
.resource-name:hover { color: var(--violet); }
.align-right { text-align: right; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .92em; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.status-running { color: var(--green); background: var(--green-soft); }
.status-stopped { color: #5f6b7c; background: #eef1f5; }
.status-error { color: var(--red); background: var(--red-soft); }
.status-pending { color: var(--amber); background: var(--amber-soft); }
.status-rescue { color: var(--blue); background: var(--blue-soft); }
.status-unknown { color: #6b5f8b; background: #f0edff; }
.pagination { display: flex; align-items: center; gap: 10px; }

.detail-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 22px; margin-bottom: 22px; }
.detail-card { padding: 22px; }
.panel-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.section-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--violet); background: #f0edff; flex: 0 0 auto; }
.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; margin: 0; }
.definition-grid dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.definition-grid dd { margin: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.display-name-detail { position: relative; }
.inline-edit-button { margin-top: 7px; padding: 0; border: 0; background: transparent; color: var(--violet); font-size: 11px; font-weight: 750; cursor: pointer; }
.inline-edit-button:hover { color: var(--violet-dark); text-decoration: underline; }
.primary-ip { padding: 16px; border: 1px solid #dfe3ec; border-radius: 12px; background: #fafbfe; }
.primary-ip small, .primary-ip strong { display: block; }
.primary-ip small { color: var(--muted); margin-bottom: 6px; }
.primary-ip strong { font-size: 17px; }
.config-preview { max-height: 180px; overflow: auto; margin: 14px 0 0; padding: 14px; border-radius: 10px; background: #111b2e; color: #b9c6df; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.client-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-bottom: 22px; }
.client-detail-card { min-height: 150px; padding: 24px; display: flex; align-items: center; gap: 18px; }
.client-detail-card .section-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
.client-detail-card small, .client-detail-card strong { display: block; }
.client-detail-card small { margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.client-detail-card strong { font-size: clamp(18px, 2.2vw, 25px); overflow-wrap: anywhere; }
.action-panel { padding: 22px; margin-bottom: 22px; }
.action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.action-tile { min-height: 96px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; color: var(--ink); text-align: left; cursor: pointer; transition: .15s ease; }
.action-tile:hover { border-color: #bfb6ff; background: #f8f6ff; transform: translateY(-1px); }
.action-tile strong, .action-tile span { display: block; }
.action-tile strong { margin-bottom: 7px; font-size: 13px; }
.action-tile span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.action-tile.danger:hover { border-color: #ffb8c1; background: #fff7f8; }

.alert { margin-bottom: 20px; padding: 13px 15px; border-radius: 10px; font-size: 13px; font-weight: 650; }
.alert-error { color: #9f2636; background: var(--red-soft); border: 1px solid #ffd0d6; }
.alert-success { color: #116741; background: var(--green-soft); border: 1px solid #c8ecd9; }
.alert-warning { color: #805500; background: var(--amber-soft); border: 1px solid #f0d998; }
.empty-state { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty-state > span { width: 42px; height: 42px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; color: var(--violet); background: #f0edff; font-size: 20px; }
.empty-state h2, .empty-state h3 { margin: 0 0 7px; color: var(--ink); }
.empty-state p { margin: 0 0 18px; }
.empty-state.compact { padding: 28px 20px; }

.modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 17px; background: transparent; overflow: visible; }
.modal::backdrop { background: rgba(11,18,34,.62); backdrop-filter: blur(3px); }
.modal-card { position: relative; padding: 27px; border-radius: 17px; background: white; box-shadow: 0 24px 70px rgba(9,17,33,.3); display: grid; gap: 17px; overflow-y: auto; max-height: calc(100vh - 40px); }
.modal-card h2, .modal-card p { margin: 0; }
.modal-card p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal-close { position: absolute; top: 14px; right: 15px; border: 0; background: #f1f3f7; color: #667085; width: 29px; height: 29px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 3px; }
.danger-text { color: var(--red); }

.login-page { display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 20% 15%, #293858 0, #111b33 38%, #0c1427 100%); }
.login-shell { width: min(1000px, 100%); min-height: 610px; display: grid; grid-template-columns: 1.12fr .88fr; border: 1px solid rgba(255,255,255,.09); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.32); }
.login-brand { padding: clamp(40px, 7vw, 80px); color: white; background: linear-gradient(145deg, rgba(100,84,215,.18), rgba(17,27,51,.15)); display: flex; flex-direction: column; justify-content: center; }
.login-brand .brand-mark { margin-bottom: 38px; }
.login-brand h1 { max-width: 540px; margin: 10px 0 18px; font-size: clamp(35px, 5vw, 55px); line-height: 1.04; letter-spacing: -.05em; }
.login-intro { color: #aeb8cf; max-width: 500px; line-height: 1.7; }
.trust-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 34px; color: #c3cbe0; font-size: 11px; }
.trust-row span::before { content: "✓"; margin-right: 6px; color: #8b7df0; }
.login-card { padding: clamp(35px, 5vw, 60px); background: white; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { margin: 8px 0 8px; font-size: 30px; letter-spacing: -.035em; }
.stack-form { display: grid; gap: 18px; margin-top: 28px; }
.fine-print { margin: 20px 0 0; color: #98a2b3; font-size: 10px; text-align: center; line-height: 1.5; }
.password-shell { width: min(500px, 100%); }
.password-card { border-radius: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.32); }
.password-card .brand-mark { margin-bottom: 28px; }
.password-card .alert { margin: 22px 0 0; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.field-error { display: block; margin-top: 6px; color: var(--red); font-size: 11px; }
.secondary-logout { text-align: center; }
.secondary-logout .text-button { padding: 18px 0 0; color: var(--muted); }

.credential-card { margin-bottom: 22px; padding: 22px; border: 1px solid #cfc8ff; border-radius: 16px; background: #f8f6ff; box-shadow: var(--shadow); }
.credential-card h2 { margin: 5px 0 5px; }
.credential-card p { margin: 0; color: var(--muted); font-size: 13px; }
.credential-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 14px; }
.credential-grid input { background: white; font-family: "SFMono-Regular", Consolas, monospace; }
.user-list { display: grid; }
.user-card { padding: 22px; border-bottom: 1px solid var(--line); }
.user-card:last-child { border-bottom: 0; }
.user-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.user-summary h3 { margin: 0 0 4px; font-size: 15px; }
.user-summary p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.avatar-light { color: var(--violet); background: #f0edff; }
.role-badge { padding: 5px 9px; border-radius: 999px; color: #5547bd; background: #f0edff; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.assignment-form { margin: 18px 0 0 46px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.assignment-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 12px; }
.assignment-heading small { color: var(--muted); }
.instance-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 260px; overflow-y: auto; }
.check-card { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.check-card:has(input:checked) { border-color: #bcb3ff; background: #f7f5ff; }
.check-card input, .inline-check input { width: auto; flex: 0 0 auto; accent-color: var(--violet); }
.check-card span { margin: 0; min-width: 0; }
.check-card strong, .check-card small { display: block; }
.check-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.check-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.assignment-form .align-right { margin-top: 12px; }
.admin-access-note { margin: 14px 0 0 46px; color: var(--muted); font-size: 12px; }
.instance-fieldset { margin: 0; padding: 0; border: 0; }
.instance-fieldset legend { margin-bottom: 9px; color: #344054; font-size: 12px; font-weight: 700; }
.inline-check { display: flex; align-items: center; gap: 9px; }
.inline-check span { margin: 0; }

.domain-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 22px; }
.domain-card { padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 15px rgba(22,32,58,.035); }
.domain-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.domain-card-heading a { color: #28334a; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.domain-card-heading a:hover { color: var(--violet); }
.domain-card-heading small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.domain-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 18px 0; }
.domain-meta dt { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.domain-meta dd { margin: 0; font-size: 12px; font-weight: 700; }
.mini-badge { display: inline-flex; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.mini-success { color: var(--green); background: var(--green-soft); }
.mini-muted { color: #5f6b7c; background: #eef1f5; }
.domain-empty { grid-column: 1 / -1; }
.domain-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.nameserver-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.nameserver-list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfe; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.dns-type-badge { display: inline-flex; min-width: 46px; justify-content: center; padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 850; }
.dns-a, .dns-aaaa { color: #1769aa; background: #eaf4ff; }
.dns-cname { color: #5a45bd; background: #f0edff; }
.dns-mx { color: var(--amber); background: var(--amber-soft); }
.dns-txt, .dns-ns, .dns-frame { color: #5f6b7c; background: #eef1f5; }
.dns-url, .dns-url301 { color: var(--green); background: var(--green-soft); }
.dns-address { max-width: 420px; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error-card { width: min(520px, 100%); padding: 44px; border-radius: 20px; background: white; text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.error-card .brand-mark { margin: 0 auto 24px; }
.error-card h1 { margin: 8px 0 12px; }
.error-card .btn { margin-top: 24px; }
.two-column { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; }
.panel-body { padding: 22px; }
.money { font-variant-numeric: tabular-nums; font-weight: 750; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.action-row form { margin: 0; }
.billing-form { display: grid; gap: 14px; }
.billing-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.checkout-shell { width: min(760px, 100%); margin: 0 auto; }
.checkout-summary { padding: 22px; border-radius: 14px; background: #f8f7ff; border: 1px solid #ded9ff; }
.checkout-summary div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; }
.checkout-summary div + div { border-top: 1px solid #e5e1ff; }
.payment-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.payment-method { min-height: 88px; display: grid; grid-template-columns: auto 72px minmax(0, 1fr); align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: white; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.payment-method:hover { border-color: #c8c0f4; }
.payment-method:has(input:checked) { border-color: #8f80ed; background: #f8f6ff; box-shadow: 0 0 0 3px rgba(100,84,215,.08); }
.payment-method input { width: auto; }
.payment-method img { width: 72px; height: 38px; object-fit: contain; }
.payment-method-copy { min-width: 0; }
.payment-method-copy strong, .payment-method-copy small { display: block; }
.payment-method-copy strong { margin-bottom: 4px; color: var(--ink); font-size: 13px; }
.payment-method-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.payment-fields { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.payment-fields-title { margin: 0 0 14px; font-size: 13px; }
.service-list { display: grid; gap: 9px; }
.service-option { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.service-option input { width: auto; }
.status-paid, .status-successful, .status-clear, .status-active { color: var(--green); background: var(--green-soft); }
.status-unpaid, .status-outstanding, .status-payment_due { color: var(--amber); background: var(--amber-soft); }
.status-overdue, .status-failed, .status-suspended { color: var(--red); background: var(--red-soft); }
.status-partially_paid, .status-pending_approval { color: var(--blue); background: var(--blue-soft); }

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .action-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .filter-form { flex-wrap: wrap; justify-content: flex-end; }
    .domain-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .domain-summary-grid { grid-template-columns: 1fr; }
    .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: static; width: 100%; height: auto; padding: 16px; flex-direction: row; align-items: center; gap: 12px; }
    .brand { margin: 0 auto 0 0; }
    .brand small, .sidebar-footer { display: none; }
    nav { display: flex; }
    .nav-link { padding: 10px; font-size: 0; }
    .nav-icon { font-size: 18px; }
    .main-content { padding: 28px 16px 48px; }
    .page-header { flex-direction: column; }
    .header-actions { justify-content: flex-start; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .panel-toolbar { align-items: flex-start; flex-direction: column; }
    .filter-form, .filter-form > * { width: 100%; }
    .search-field input { width: 100%; }
    .action-grid, .definition-grid, .client-detail-grid { grid-template-columns: 1fr; }
    .login-page { padding: 0; }
    .login-shell { min-height: 100vh; display: block; border-radius: 0; }
    .login-brand { display: none; }
    .login-card { min-height: 100vh; }
    .password-card { min-height: auto; border-radius: 0; }
    .credential-grid, .instance-check-grid { grid-template-columns: 1fr; }
    .assignment-form, .admin-access-note { margin-left: 0; }
    .domain-card-grid { grid-template-columns: 1fr; padding: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .billing-form-grid, .payment-methods { grid-template-columns: 1fr; }
}
