@font-face {
    font-family: "Manrope";
    src: url("fonts/manrope.woff2") format("woff2");
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: #30353b;
    background: #f5f9fc;
    font-synthesis: none;
    --brand: #ce4508;
    --brand-dark: #a93705;
    --ink: #30353b;
    --muted: #71808d;
    --line: #dce5eb;
    --canvas: #f5f9fc;
    --surface: #ffffff;
    --blue-wash: #eaf5ff;
    --focus: #0a72c2;
    --success: #18794e;
    --success-wash: #e9f8f0;
    --danger: #b42318;
    --danger-wash: #fff0ee;
    --shadow: 0 18px 50px rgba(42, 58, 70, .11);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: linear-gradient(180deg, #fff 0, var(--blue-wash) 44rem, var(--canvas) 100%); color: var(--ink); line-height: 1.55; }
a { color: var(--brand); text-underline-offset: .2em; }
a:hover { color: var(--brand-dark); }
button, input { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .65rem; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.08; letter-spacing: -.045em; font-weight: 800; }
h2 { margin-bottom: .55rem; font-size: clamp(1.35rem, 2vw, 1.8rem); line-height: 1.2; letter-spacing: -.025em; }
h3 { margin-bottom: .45rem; font-size: 1rem; }
p { color: var(--muted); }

.site-header { position: relative; z-index: 10; background: rgba(255,255,255,.96); border-bottom: 1px solid rgba(220,229,235,.8); box-shadow: 0 4px 20px rgba(44,58,68,.04); }
.site-header__inner { width: min(100% - 2.5rem, 80rem); min-height: 5.5rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: 1rem; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.brand:hover { color: var(--ink); }
.brand img { width: 11.25rem; height: auto; display: block; }
.brand__product { display: grid; padding-left: 1rem; border-left: 1px solid var(--line); line-height: 1.05; }
.brand__product strong { font-size: .95rem; letter-spacing: .11em; }
.brand__product span { margin-top: .25rem; color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; justify-content: flex-end; gap: .3rem; flex-wrap: wrap; }
.site-nav a { padding: .7rem .8rem; color: #65727d; border-radius: .4rem; font-size: .83rem; font-weight: 700; letter-spacing: .025em; text-decoration: none; }
.site-nav a:hover { color: var(--ink); background: #f3f6f8; }
.site-nav .site-nav__action { margin-left: .35rem; padding-inline: 1.1rem; background: var(--brand); color: white; }
.site-nav .site-nav__action:hover { background: var(--brand-dark); color: white; }

.page-shell { width: min(100% - 2.5rem, 76rem); min-height: calc(100vh - 10rem); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5.5rem) 0; }
.site-footer { width: min(100% - 2.5rem, 80rem); margin: 0 auto; padding: 1.25rem 0 2rem; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .8rem; }
.eyebrow { display: block; margin-bottom: .65rem; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.page-header { max-width: 52rem; margin-bottom: 2rem; }
.page-header p { max-width: 45rem; margin-bottom: 0; font-size: 1.04rem; }

.auth-page { min-height: 33rem; display: grid; place-items: center; }
.auth-card, .content-card, .client-card { background: rgba(255,255,255,.98); border: 1px solid rgba(220,229,235,.95); border-radius: 1rem; box-shadow: var(--shadow); }
.auth-card { width: min(100%, 31rem); padding: clamp(1.6rem, 4vw, 2.75rem); }
.auth-card--compact { width: min(100%, 28rem); }
.auth-card--wide { width: min(100%, 38rem); }
.auth-card__header { margin-bottom: 1.75rem; }
.auth-card__header h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.auth-card__header p { margin-bottom: 0; }
.auth-card__footer { margin: 1.4rem 0 0; text-align: center; font-size: .82rem; }
.auth-card__footer strong { color: var(--brand); }
.auth-form { display: grid; gap: 1.1rem; }
.form-field { display: grid; gap: .4rem; }
.form-field > label { color: #3f4850; font-size: .83rem; font-weight: 700; }
.form-control { width: 100%; min-height: 3rem; padding: .72rem .9rem; color: var(--ink); background: white; border: 1px solid #bdcad3; border-radius: .5rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.form-control:hover { border-color: #8f9da8; }
.form-control:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(10,114,194,.16); }
.form-control--code { max-width: 14rem; letter-spacing: .2em; font-size: 1.15rem; font-weight: 700; }
.form-control.invalid { border-color: var(--danger); background: #fffafa; }
.form-control.valid:not(:placeholder-shown) { border-color: #77aa92; }
.validation-message { color: var(--danger); font-size: .78rem; font-weight: 650; }
.validation-summary { padding: .8rem 1rem; color: var(--danger); background: var(--danger-wash); border: 1px solid #f1c1bb; border-radius: .5rem; font-size: .82rem; }
.validation-summary:empty { display: none; }
.validation-summary ul { margin: 0; padding-left: 1.15rem; }
.form-options { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .82rem; }
.check-control { display: inline-flex; align-items: center; gap: .55rem; color: #4c5963; cursor: pointer; }
.check-control input { width: 1rem; height: 1rem; accent-color: var(--brand); }

.button { min-height: 2.8rem; width: max-content; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .7rem 1.15rem; border: 1px solid transparent; border-radius: .4rem; font-weight: 750; font-size: .88rem; line-height: 1; text-decoration: none; cursor: pointer; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .site-nav a:focus-visible, .brand:focus-visible, a:focus-visible { outline: 3px solid rgba(10,114,194,.25); outline-offset: 3px; }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button--primary { color: white; background: var(--brand); box-shadow: 0 8px 20px rgba(206,69,8,.2); }
.button--primary:hover { color: white; background: var(--brand-dark); }
.button--secondary { color: var(--ink); background: white; border-color: #b9c5cd; }
.button--secondary:hover { color: var(--ink); background: #f5f7f8; border-color: #8f9da8; }
.button--ghost { color: #56636d; background: #f2f5f7; border-color: #e0e6ea; }
.button--ghost:hover { color: var(--ink); background: #e8edf0; }
.button--danger { color: var(--danger); background: var(--danger-wash); border-color: #efc3bd; }
.button--danger:hover { color: #8f1c13; background: #ffe4e0; }
.button--success { color: var(--success); background: var(--success-wash); border-color: #b8deca; }
.button--success:hover { color: #11643f; background: #dff3e8; }
.button--full { width: 100%; }
.button--small { min-height: 2.15rem; padding: .5rem .7rem; font-size: .72rem; }
.button-row, .action-group { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.button-row form { margin: 0; }

.alert { margin-bottom: 1.2rem; padding: .85rem 1rem; border: 1px solid; border-radius: .55rem; font-size: .85rem; font-weight: 600; }
.alert--error { color: var(--danger); background: var(--danger-wash); border-color: #efc3bd; }
.alert--success { color: var(--success); background: var(--success-wash); border-color: #b8deca; }
.loading-state { padding: 1rem; color: var(--muted); background: #f4f7f9; border-radius: .5rem; }
.content-card { margin-bottom: 1.5rem; padding: clamp(1.3rem, 3vw, 2rem); }
.content-card--narrow { width: min(100%, 44rem); margin-inline: auto; }
.content-card--flush { padding: 0; overflow: hidden; }
.section-heading { margin-bottom: 1rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.section-heading h2, .section-heading .eyebrow { margin-bottom: 0; }

.hero-panel { min-height: 34rem; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(17rem, .7fr); align-items: center; gap: clamp(2rem, 6vw, 5rem); padding: clamp(2rem, 5vw, 4rem); background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(224,242,255,.94)); border: 1px solid #dbeaf5; border-radius: 1.25rem; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero-panel::after { content: ""; position: absolute; right: -8rem; bottom: -12rem; width: 30rem; height: 30rem; background: var(--brand); border-radius: 50%; opacity: .09; }
.hero-panel__content { position: relative; z-index: 1; }
.hero-panel__content p { max-width: 38rem; margin-bottom: 1.7rem; font-size: clamp(1rem, 2vw, 1.18rem); }
.service-status { position: relative; z-index: 1; display: flex; align-items: center; gap: .9rem; padding: 1.2rem; background: rgba(255,255,255,.83); border: 1px solid rgba(255,255,255,.9); border-radius: .8rem; box-shadow: 0 12px 35px rgba(43,65,80,.1); }
.service-status__dot { width: .75rem; height: .75rem; flex: 0 0 auto; background: #24a66a; border-radius: 50%; box-shadow: 0 0 0 .35rem rgba(36,166,106,.13); }
.service-status span:last-child { display: grid; }
.service-status small { margin-top: .15rem; color: var(--muted); }

.admin-nav { display: flex; gap: .35rem; margin: 0 0 1.6rem; padding: .35rem; overflow-x: auto; background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: .65rem; scrollbar-width: thin; }
.admin-nav a { flex: 0 0 auto; padding: .6rem .8rem; color: #5d6973; border-radius: .4rem; font-size: .78rem; font-weight: 750; text-decoration: none; }
.admin-nav a:hover { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(48,53,59,.08); }
.admin-nav a.active { color: white; background: var(--ink); box-shadow: 0 4px 12px rgba(48,53,59,.16); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stats article { min-height: 8rem; display: flex; flex-direction: column; justify-content: space-between; padding: 1.2rem; background: white; border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 8px 25px rgba(40,56,68,.06); }
.stats span { color: var(--muted); font-size: .77rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.stats strong { color: var(--ink); font-size: 2.25rem; line-height: 1; }
.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; font-size: .84rem; }
th, td { padding: .9rem 1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid #e4eaee; }
th { color: #687681; background: #f7f9fa; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfd; }
.table-nowrap { white-space: nowrap; }
.status-badge { width: max-content; display: inline-flex; align-items: center; padding: .25rem .5rem; border: 1px solid; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.status-badge--success { color: var(--success); background: var(--success-wash); border-color: #b8deca; }
.status-badge--danger { color: var(--danger); background: var(--danger-wash); border-color: #efc3bd; }
.status-badge--muted { color: #66737d; background: #f0f3f5; border-color: #d9e0e4; }
.status-badge--info { color: #11699e; background: #eaf6fd; border-color: #b8daed; }
.client-list { margin: 0; padding: 0; list-style: none; }
.client-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid #e7ecef; }
.client-list li:last-child { border-bottom: 0; }
.card-grid { display: grid; gap: 1.25rem; }
.client-card { padding: clamp(1.2rem, 3vw, 1.75rem); }
.client-card__header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.client-card__header h2, .client-card__header .eyebrow { margin-bottom: 0; }
.client-meta { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.client-detail { padding: .9rem 0; border-top: 1px solid #e6ecef; }
.client-detail:last-child { padding-bottom: 0; }
.code-list { margin: .45rem 0 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.code-list code { display: block; overflow-wrap: anywhere; }
code, .recovery-code { padding: .18rem .35rem; color: #46525b; background: #eef2f4; border-radius: .25rem; font-family: Consolas, "Courier New", monospace; font-size: .82em; }
.tag-list { display: flex; gap: .45rem; flex-wrap: wrap; }
.tag-list span { padding: .3rem .55rem; color: #52606a; background: #f0f4f6; border-radius: .35rem; font-size: .75rem; font-weight: 650; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.page-header--actions { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; }
.toolbar { margin-bottom: 1.25rem; padding: 1rem; display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 7px 22px rgba(40,56,68,.05); }
.toolbar--panel { align-items: end; }
.toolbar__search { width: min(100%, 25rem); }
.toolbar__count { margin-left: auto; padding-bottom: .75rem; color: var(--muted); font-size: .8rem; font-weight: 700; }
.directory-toolbar { margin-bottom: .75rem; padding: 1rem; display: grid; grid-template-columns: minmax(15rem, 2fr) repeat(3, minmax(9rem, 1fr)) minmax(12rem, 1.25fr); align-items: end; gap: .75rem; background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 7px 22px rgba(40,56,68,.05); }
.directory-toolbar .form-control { min-height: 2.65rem; padding-block: .58rem; font-size: .8rem; }
.search-control { position: relative; }
.search-control .form-control { padding-right: 2.6rem; }
.search-control__clear { position: absolute; top: 50%; right: .45rem; width: 1.85rem; height: 1.85rem; padding: 0; translate: 0 -50%; color: #66737d; background: transparent; border: 0; border-radius: 50%; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.search-control__clear:hover { color: var(--ink); background: #eef2f4; }
.active-filters { margin: 0 0 .75rem; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; color: var(--muted); font-size: .75rem; font-weight: 700; }
.active-filters > span { margin-right: .15rem; }
.active-filters button { min-height: 1.9rem; padding: .32rem .58rem; color: #43515b; background: white; border: 1px solid #ccd6dc; border-radius: 999px; font: inherit; cursor: pointer; }
.active-filters button:hover { color: var(--ink); border-color: #92a1ab; }
.active-filters .active-filters__clear { color: var(--brand-dark); background: transparent; border-color: transparent; }
.directory-summary { min-height: 2.7rem; display: flex; align-items: center; justify-content: flex-end; gap: .65rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
.directory-summary > span { margin-right: auto; }
.directory-summary label { color: #4f5c66; }
.form-control--compact { width: auto; min-height: 2.2rem; padding: .38rem 1.8rem .38rem .55rem; font-size: .76rem; }
.primary-cell { display: grid; gap: .15rem; min-width: 12rem; }
.primary-cell span, .section-note, .field-help { color: var(--muted); font-size: .76rem; }
.role-summary { margin-top: .35rem; display: grid; gap: .22rem; min-width: 13rem; color: #53616b; font-size: .76rem; }
.action-group--end { justify-content: flex-end; }
.empty-state { padding: 2rem; text-align: center; }
.empty-state h2 { margin-bottom: .25rem; }
.empty-state p { margin-bottom: 0; }
.pagination { margin: 1.25rem 0 2rem; display: flex; align-items: center; justify-content: center; gap: 1rem; color: var(--muted); font-size: .8rem; font-weight: 700; }
.pagination--numbered { flex-wrap: wrap; }
.pagination__pages { display: flex; align-items: center; gap: .3rem; }
.pagination__page { min-width: 2.15rem; min-height: 2.15rem; padding: .35rem; color: #53616b; background: white; border: 1px solid #c9d3d9; border-radius: .4rem; font-size: .75rem; font-weight: 750; cursor: pointer; }
.pagination__page:hover { color: var(--ink); border-color: #8f9da8; }
.pagination__page.is-current { color: white; background: var(--ink); border-color: var(--ink); }
.pagination__page:disabled { cursor: wait; }
.pagination__ellipsis { min-width: 1.25rem; text-align: center; }
.directory-results { position: relative; }
.directory-results__loading { position: absolute; z-index: 2; top: .55rem; right: .55rem; padding: .35rem .55rem; color: #43515b; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: .4rem; box-shadow: 0 4px 12px rgba(42,58,70,.08); font-size: .72rem; font-weight: 700; }
.table-sort-group { display: flex; align-items: center; gap: .45rem; }
.table-sort { margin: -.35rem -.4rem; padding: .35rem .4rem; display: inline-flex; align-items: center; gap: .25rem; color: inherit; background: transparent; border: 0; border-radius: .3rem; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.table-sort:hover { color: var(--ink); background: #edf2f5; }
.table-sort:disabled { cursor: wait; opacity: .65; }
.table-sort--secondary { color: #7b8790; font-size: .62rem; }
.table-sort__indicator { min-width: .7rem; color: var(--brand-dark); text-align: center; }
.user-table td:last-child { width: 1%; }
.confirm-panel { position: sticky; z-index: 8; bottom: 1rem; margin: 1.25rem auto 0; padding: 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; background: #fff; border: 1px solid #edb7b0; border-radius: .8rem; box-shadow: 0 20px 55px rgba(64,35,30,.2); }
.confirm-panel h2, .confirm-panel p, .confirm-panel .eyebrow { margin-bottom: .2rem; }
.form-dialog { border-color: #b8d4e4; }
.alert--info { color: #11699e; background: #eaf6fd; border-color: #b8daed; }
.admin-form { display: grid; gap: 1.25rem; }
.admin-form--narrow { width: min(100%, 42rem); }
.form-section { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.form-field--wide { grid-column: 1 / -1; }
.form-control--textarea { min-height: 8rem; resize: vertical; font-family: Consolas, "Courier New", monospace; font-size: .8rem; }
.form-control--colour { min-height: 3rem; padding: .3rem; }
.form-actions { display: flex; gap: .75rem; align-items: center; margin-bottom: 2rem; }
.toggle-row { margin-top: 1.25rem; display: flex; gap: .7rem 1.4rem; flex-wrap: wrap; }
.switch-control { display: inline-flex; align-items: center; gap: .6rem; color: #46535d; font-size: .84rem; font-weight: 700; cursor: pointer; }
.switch-control input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }
.accordion-list { display: grid; gap: .7rem; }
.accordion-card { overflow: hidden; border: 1px solid var(--line); border-radius: .65rem; background: #fbfcfd; }
.accordion-card summary { padding: .85rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.accordion-card summary::-webkit-details-marker { display: none; }
.accordion-card summary > span:first-child { display: grid; }
.accordion-card summary small { color: var(--muted); font-size: .7rem; }
.accordion-card__body { padding: 1rem; background: white; border-top: 1px solid var(--line); }
.choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; margin-top: .75rem; }
.choice-card { min-height: 3.1rem; padding: .7rem .8rem; display: flex; align-items: center; gap: .65rem; border: 1px solid #dbe3e8; border-radius: .5rem; cursor: pointer; }
.choice-card:has(input:checked) { background: var(--blue-wash); border-color: #95c7e5; }
.choice-card input { accent-color: var(--brand); }
.choice-card span { display: grid; }
.choice-card small { color: var(--muted); font-size: .68rem; }
.button-row--compact { gap: .4rem; }
.management-split { display: grid; grid-template-columns: minmax(15rem,.38fr) minmax(0,1fr); gap: 1rem; align-items: start; }
.management-list, .management-detail { margin-bottom: 1rem; }
.selection-list { display: grid; gap: .35rem; }
.selection-list__item { width: 100%; padding: .75rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; color: var(--ink); background: #f7f9fa; border: 1px solid transparent; border-radius: .5rem; text-align: left; cursor: pointer; }
.selection-list__item:hover, .selection-list__item.is-selected { background: var(--blue-wash); border-color: #acd4eb; }
.selection-list__item > span:first-child { display: grid; }
.selection-list__item small { color: var(--muted); font-size: .68rem; }
.permission-legend { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.permission-state { min-height: 2rem; padding: .4rem .65rem; display: inline-flex; align-items: center; border: 1px solid; border-radius: 999px; font: inherit; font-size: .7rem; font-weight: 800; white-space: nowrap; }
button.permission-state { cursor: pointer; }
.permission-state--granted { color: var(--success); background: var(--success-wash); border-color: #a9d8bf; }
.permission-state--neutral { color: #64727c; background: #f1f4f6; border-color: #d6dfe4; }
.permission-state--prohibited { color: var(--danger); background: var(--danger-wash); border-color: #efc3bd; }
.permission-bulk { margin-bottom: 1rem; align-items: center; color: var(--muted); font-size: .76rem; }
.permission-list { margin-bottom: 1rem; display: grid; border-top: 1px solid var(--line); }
.permission-row { padding: .9rem 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.permission-row p { margin: .15rem 0; font-size: .75rem; }
.client-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.client-facts { margin: 1rem 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .5rem; }
.client-facts div { padding: .65rem; display: grid; background: #f5f8fa; border-radius: .45rem; }
.client-facts span { color: var(--muted); font-size: .64rem; font-weight: 750; text-transform: uppercase; }
.client-facts strong { font-size: 1.1rem; }
.secret-field { margin-top: 1rem; width: min(100%,32rem); }
.branding-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(18rem,.7fr); gap: 1.5rem; align-items: start; }
.brand-preview { min-height: 23rem; padding: 1rem; display: grid; grid-template-columns: .8fr 1.2fr; background: var(--preview-bg); border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; }
.brand-preview--dark { color: white; background-color: #1d252b; }
.brand-preview__logo { padding: 1rem; display: grid; place-items: start center; }
.brand-preview__logo img { max-width: 100%; max-height: 5rem; object-fit: contain; }
.brand-preview__card { align-self: center; padding: 1.2rem; display: grid; gap: .65rem; color: var(--ink); background: rgba(255,255,255,.94); border-radius: .65rem; box-shadow: 0 12px 30px rgba(31,46,57,.15); }
.brand-preview__card span { color: var(--brand); font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.brand-preview__card i { height: 2rem; display: block; border: 1px solid #cbd6dd; border-radius: .35rem; }
.brand-preview__card button { min-height: 2rem; color: white; background: var(--brand); border: 0; border-radius: .35rem; }
.qr-setup { margin-bottom: 1.5rem; padding: 1.25rem; display: grid; grid-template-columns: 12rem minmax(0,1fr); align-items: center; gap: 1.5rem; background: #f4f8fa; border: 1px solid #dce7ed; border-radius: .75rem; }
.qr-setup__image { padding: .65rem; background: white; border: 1px solid var(--line); border-radius: .65rem; box-shadow: 0 8px 24px rgba(42,58,70,.09); }
.qr-setup__image img { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.qr-setup__instructions h2 { font-size: 1.25rem; }
.qr-setup__instructions ol { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--muted); font-size: .85rem; }
.qr-setup__instructions li + li { margin-top: .3rem; }
.manual-key { font-size: .82rem; }
.manual-key summary { width: max-content; color: var(--brand); font-weight: 700; cursor: pointer; }
.manual-key p { margin: .75rem 0 .4rem; }
.manual-key code { display: block; padding: .6rem; overflow-wrap: anywhere; }
.scope-panel, .recovery-panel { margin-bottom: 1.25rem; padding: 1rem; background: #f4f8fa; border: 1px solid #dce7ed; border-radius: .65rem; }
.scope-panel h2 { font-size: 1rem; }
.scope-panel ul { margin: 0; padding: 0; display: grid; gap: .55rem; list-style: none; }
.scope-panel li { display: flex; align-items: center; gap: .55rem; }
.scope-check { color: var(--success); font-weight: 800; }
.recovery-panel { margin-top: 1.5rem; margin-bottom: 0; }
.recovery-codes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; padding: 0; list-style: none; }
.recovery-codes code { display: block; padding: .55rem; text-align: center; }

.admin-app { min-height: 100vh; background: #f4f7f9; }
.admin-header { position: sticky; z-index: 20; top: 0; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); box-shadow: 0 3px 16px rgba(42,58,70,.05); }
.admin-header__inner { min-height: 4.25rem; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand--admin img { width: 8.25rem; }
.brand--admin .brand__product { padding-left: .85rem; }
.admin-header__actions { display: flex; align-items: center; gap: .35rem; }
.admin-header__actions a { padding: .6rem .75rem; color: #5b6872; border-radius: .4rem; font-size: .8rem; font-weight: 700; text-decoration: none; }
.admin-header__actions a:hover { color: var(--ink); background: #f1f4f6; }
.admin-header__actions .site-nav__action { padding-inline: 1rem; color: white; background: var(--brand); }
.admin-header__actions .site-nav__action:hover { color: white; background: var(--brand-dark); }
.admin-frame { width: min(100%, 104rem); min-height: calc(100vh - 4.25rem); margin: 0 auto; display: grid; grid-template-columns: 14.5rem minmax(0,1fr); }
.admin-sidebar { min-height: calc(100vh - 4.25rem); padding: 2rem 1.1rem; background: #fff; border-right: 1px solid var(--line); }
.admin-sidebar__heading { padding: 0 .75rem 1.25rem; display: grid; }
.admin-sidebar__heading .eyebrow { margin-bottom: .25rem; }
.admin-sidebar__heading strong { font-size: 1.05rem; }
.admin-sidebar .admin-nav, .admin-mobile-menu .admin-nav { margin: 0; padding: 0; display: grid; gap: .25rem; overflow: visible; background: transparent; border: 0; border-radius: 0; }
.admin-sidebar .admin-nav a, .admin-mobile-menu .admin-nav a { width: 100%; padding: .72rem .8rem; color: #58656f; border-radius: .45rem; font-size: .8rem; }
.admin-sidebar .admin-nav a:hover, .admin-mobile-menu .admin-nav a:hover { background: #f2f5f7; box-shadow: none; }
.admin-sidebar .admin-nav a.active, .admin-mobile-menu .admin-nav a.active { color: #8f3107; background: #fff0e9; box-shadow: inset 3px 0 0 var(--brand); }
.admin-workspace { min-width: 0; display: flex; flex-direction: column; }
.admin-main { width: 100%; max-width: 88rem; margin: 0 auto; padding: clamp(1.75rem,3vw,3rem); flex: 1 0 auto; }
.admin-main .page-header { max-width: 64rem; margin-bottom: 1.4rem; }
.admin-main .page-header--actions { max-width: none; }
.admin-main .page-header h1 { margin-bottom: .35rem; font-size: clamp(1.85rem,3vw,2.55rem); }
.admin-main .page-header p { font-size: .94rem; }
.admin-main .content-card, .admin-main .client-card { box-shadow: 0 8px 28px rgba(42,58,70,.07); }
.admin-footer { margin: 0 clamp(1.75rem,3vw,3rem); padding: 1rem 0 1.5rem; display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); font-size: .72rem; }
.admin-mobile-menu { display: none; }

.row-actions { display: flex; align-items: flex-start; justify-content: flex-end; gap: .4rem; }
.action-menu { min-width: 4.3rem; }
.action-menu > summary { width: 100%; list-style: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu[open] > summary { color: var(--ink); background: #e8edf0; }
.action-menu__panel { min-width: 10.5rem; margin-top: .35rem; display: grid; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: .45rem; box-shadow: 0 10px 28px rgba(42,58,70,.12); }
.action-menu__panel a, .action-menu__panel button { width: 100%; min-height: 2.2rem; padding: .55rem .7rem; color: #4f5c66; background: white; border: 0; border-bottom: 1px solid #edf1f3; border-radius: 0; font: inherit; font-size: .72rem; font-weight: 650; text-align: left; text-decoration: none; cursor: pointer; }
.action-menu__panel > :last-child { border-bottom: 0; }
.action-menu__panel a:hover, .action-menu__panel button:hover { color: var(--ink); background: #f4f7f9; }
.action-menu__panel button:disabled { color: #9aa4ab; cursor: not-allowed; }
.action-menu__panel .action-menu__danger { color: var(--danger); }
.badge-stack { display: flex; align-items: flex-start; gap: .4rem; flex-wrap: wrap; }
.fact-line { display: flex; gap: .45rem .9rem; flex-wrap: wrap; color: var(--muted); font-size: .72rem; }
.fact-line strong { color: var(--ink); }
.client-table .primary-cell { max-width: 27rem; }
.client-table .primary-cell code { width: max-content; max-width: 100%; overflow-wrap: anywhere; }
.client-table td:last-child { width: 1%; }

@media (max-width: 850px) {
    .site-header__inner { padding: .9rem 0; align-items: flex-start; }
    .brand img { width: 9rem; }
    .brand__product { display: none; }
    .site-nav { max-width: 60%; }
    .site-nav a { padding: .5rem .6rem; font-size: .74rem; }
    .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .hero-panel { grid-template-columns: 1fr; min-height: auto; }
    .service-status { max-width: 26rem; }
    .client-grid, .management-split, .branding-layout { grid-template-columns: 1fr; }
    .admin-frame { display: block; }
    .admin-sidebar { display: none; }
    .admin-mobile-menu { margin: 1rem 1rem 0; display: block; background: white; border: 1px solid var(--line); border-radius: .55rem; }
    .admin-mobile-menu > summary { padding: .75rem 1rem; color: var(--ink); font-size: .82rem; font-weight: 750; cursor: pointer; }
    .admin-mobile-menu .admin-nav { padding: 0 .5rem .5rem; }
    .directory-toolbar { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .directory-toolbar__search { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
    .site-header__inner, .page-shell, .site-footer { width: min(100% - 1.5rem, 80rem); }
    .site-header__inner { display: grid; gap: .7rem; }
    .site-nav { max-width: 100%; justify-content: flex-start; }
    .site-nav .site-nav__action { margin-left: 0; }
    .page-shell { min-height: calc(100vh - 13rem); padding: 2rem 0 3rem; }
    .auth-page { min-height: 0; place-items: start center; }
    .auth-card { padding: 1.35rem; border-radius: .8rem; }
    .form-options, .section-heading, .client-card__header, .client-list li { align-items: flex-start; flex-direction: column; }
    .button-row { align-items: stretch; }
    .button-row form, .button-row .button { width: 100%; }
    .stats { grid-template-columns: 1fr 1fr; gap: .7rem; }
    .stats article { min-height: 6.8rem; }
    .hero-panel { padding: 1.5rem; border-radius: .9rem; }
    .site-footer { flex-direction: column; }
    th, td { padding: .75rem; }
    .recovery-codes { grid-template-columns: 1fr; }
    .qr-setup { grid-template-columns: 1fr; }
    .qr-setup__image { width: min(100%, 13rem); margin-inline: auto; }
    .page-header--actions, .confirm-panel, .permission-row { align-items: stretch; flex-direction: column; }
    .form-grid, .choice-grid { grid-template-columns: 1fr; }
    .toolbar__search { width: 100%; }
    .toolbar__count { width: 100%; margin-left: 0; padding-bottom: 0; }
    .directory-toolbar { grid-template-columns: 1fr; }
    .directory-toolbar__search { grid-column: auto; }
    .directory-summary { align-items: flex-start; flex-wrap: wrap; }
    .directory-summary > span { width: 100%; }
    .active-filters > span { width: 100%; }
    .form-actions { align-items: stretch; flex-direction: column; }
    .form-actions .button { width: 100%; }
    .client-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .admin-header__inner { min-height: 3.8rem; padding: .55rem .75rem; }
    .brand--admin img { width: 7rem; }
    .admin-header__actions a:first-child { display: none; }
    .admin-main { padding: 1.25rem .75rem 2rem; }
    .admin-footer { margin-inline: .75rem; }
    .admin-main .page-header--actions { gap: .8rem; }
    .admin-main .page-header--actions .button { width: 100%; }
    .responsive-table thead { display: none; }
    .responsive-table { width: 100%; display: block; }
    .responsive-table tbody { width: 100%; display: grid; }
    .responsive-table tr { width: 100%; padding: .9rem; display: grid; border-bottom: 1px solid var(--line); }
    .responsive-table tr:last-child { border-bottom: 0; }
    .responsive-table td { padding: .45rem 0; display: grid; grid-template-columns: 6.5rem minmax(0,1fr); gap: .75rem; border: 0; }
    .responsive-table td::before { content: attr(data-label); color: #687681; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
    .responsive-table .row-actions { justify-content: flex-start; }
    .user-table .table-sort-group { align-items: flex-start; flex-direction: column; }
    .pagination--numbered { gap: .55rem; }
    .pagination__pages { max-width: 100%; order: 3; overflow-x: auto; }
    .action-menu__panel { min-width: 9.5rem; }
}

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