:root {
    color-scheme: light;
    --forest: #173b31;
    --forest-deep: #102c25;
    --forest-soft: #e7eee8;
    --gold: #d7ad32;
    --gold-soft: #f6edce;
    --ink: #1d2925;
    --muted: #78827c;
    --line: #e1e6e1;
    --paper: #f3f5f0;
    --white: #fff;
    --danger: #a53e33;
    --danger-bg: #fff2ef;
    --success: #226246;
    --success-bg: #edf7f0;
    font-family: "Aptos", "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--paper); }
body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background-color: var(--paper);
    background-image: linear-gradient(rgba(23, 59, 49, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 59, 49, .025) 1px, transparent 1px);
    background-size: 32px 32px;
    font-size: 14px;
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.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; }

.page-main-auth { display: grid; min-height: 100vh; padding: 44px 24px; place-items: center; }
.auth-shell {
    display: grid;
    width: min(1050px, 100%);
    min-height: 650px;
    grid-template-columns: minmax(0, .94fr) minmax(390px, 1.06fr);
    overflow: hidden;
    border: 1px solid rgba(16, 44, 37, .1);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 30px 80px rgba(28, 48, 39, .13), 0 3px 12px rgba(28, 48, 39, .05);
    animation: arrive .5s ease both;
}
.auth-brand-panel {
    position: relative;
    display: flex;
    min-height: 650px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 42px 44px 34px;
    color: #fff;
    background-color: var(--forest);
    background-image: linear-gradient(135deg, rgba(255,255,255,.025) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.025) 50%, rgba(255,255,255,.025) 75%, transparent 75%, transparent);
    background-size: 38px 38px;
}
.auth-brand-panel::after {
    position: absolute;
    right: -162px;
    bottom: 58px;
    width: 330px;
    height: 330px;
    border: 1px solid rgba(215, 173, 50, .26);
    border-radius: 50%;
    box-shadow: 0 0 0 34px rgba(215, 173, 50, .035), 0 0 0 68px rgba(255, 255, 255, .025);
    content: "";
    pointer-events: none;
}
.auth-brand-top, .auth-brand-message, .auth-brand-foot { position: relative; z-index: 1; }
.auth-brand-top { display: grid; justify-items: start; gap: 20px; }
.auth-logo { display: block; width: 90px; height: 90px; object-fit: cover; border: 3px solid rgba(255,255,255,.8); border-radius: 12px; background: #fff; }
.brand-eyebrow, .eyebrow { margin: 0; font-size: 10px; font-weight: 750; line-height: 1.5; }
.brand-eyebrow { color: rgba(255,255,255,.74); }
.auth-brand-message { max-width: 400px; margin: 54px 0 70px; }
.eyebrow { color: var(--gold); }
.eyebrow-green { color: #477a60; }
.auth-brand-message h1 { margin: 16px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: 42px; font-weight: 400; line-height: 1.16; }
.auth-brand-description { max-width: 345px; margin: 0; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.8; }
.auth-brand-foot { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.68); font-size: 9px; font-weight: 700; }
.status-indicator { width: 7px; height: 7px; border-radius: 50%; background: #d8b63e; box-shadow: 0 0 0 4px rgba(215,173,50,.13); }
.foot-divider { color: rgba(255,255,255,.35); }
.auth-form-panel { display: grid; padding: 64px clamp(36px, 6vw, 78px); align-items: center; }
.auth-form-content { width: 100%; max-width: 365px; margin: 0 auto; }
.auth-form-content h2 { margin: 13px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 32px; font-weight: 400; }
.form-intro { margin: 0 0 34px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.form-stack { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field > span { color: #34423c; font-size: 12px; font-weight: 700; }
.field b { color: #ac5143; font-weight: 700; }
.field small { display: inline; color: var(--muted); font-size: 11px; font-weight: 450; }
.field input, .field textarea, .field select, .search-form input {
    width: 100%;
    min-width: 0;
    border: 1px solid #dce3dd;
    border-radius: 6px;
    outline: none;
    color: var(--ink);
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input, .field select { height: 46px; padding: 0 13px; }
.field textarea { min-height: 88px; padding: 12px 13px; resize: vertical; line-height: 1.55; }
.field input[type="file"] { padding: 9px 10px; color: var(--muted); font-size: 12px; }
.field input::placeholder, .field textarea::placeholder, .search-form input::placeholder { color: #a5ada7; }
.field input:focus, .field textarea:focus, .field select:focus, .search-form input:focus { border-color: #638c76; box-shadow: 0 0 0 3px rgba(23,59,49,.09); }
.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.button:focus-visible, .nav-link:focus-visible, .back-link:focus-visible { outline: 3px solid rgba(215,173,50,.5); outline-offset: 2px; }
.button-primary { color: #fff; background: var(--forest); }
.button-primary:hover { transform: translateY(-1px); background: #205342; }
.button-quiet { color: #637069; background: transparent; }
.button-quiet:hover { color: var(--forest); background: #edf1ed; }
.button-outline { border-color: var(--line); color: var(--forest); background: #fff; }
.button-outline:hover { border-color: #9ab2a2; background: #f7faf7; }
.button-small { min-height: 36px; padding: 0 12px; font-size: 11px; }
.button-submit { width: 100%; min-height: 49px; justify-content: space-between; margin-top: 5px; padding: 0 16px 0 18px; }
.auth-footnote { margin: 27px 0 0; color: #89928c; font-size: 10px; line-height: 1.6; text-align: center; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(20px, 5vw, 72px); border-bottom: 1px solid rgba(27,58,47,.1); background: rgba(255,255,255,.96); }
.brand-lockup { display: inline-flex; min-width: 190px; align-items: center; gap: 11px; text-decoration: none; }
.brand-logo { width: 42px; height: 42px; border: 1px solid #e6e1d3; border-radius: 7px; object-fit: cover; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { color: var(--forest); font-size: 12px; }
.brand-copy small { color: var(--muted); font-size: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions form { margin: 0; }
.nav-link { display: inline-flex; min-height: 36px; align-items: center; padding: 0 12px; border-radius: 5px; color: #66736b; font-size: 11px; font-weight: 650; text-decoration: none; }
.nav-link:hover, .nav-link.is-active { color: var(--forest); background: var(--forest-soft); }
.content-shell { width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 22px; }
.content-shell-narrow { width: min(900px, calc(100% - 48px)); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 30px; }
.page-heading h1 { margin: 7px 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: 35px; font-weight: 400; line-height: 1.15; }
.page-lede { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.heading-meta { display: flex; align-items: center; gap: 9px; color: #56635b; font-size: 11px; font-weight: 650; }
.avatar-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #e7d89e; border-radius: 50%; color: var(--forest); background: var(--gold-soft); font-family: Georgia, serif; font-size: 16px; }
.stat-strip { display: grid; grid-template-columns: 1fr 1fr 1.25fr 2fr; align-items: center; margin-bottom: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.stat-item { display: grid; min-height: 78px; align-content: center; gap: 5px; padding: 0 20px; border-right: 1px solid var(--line); }
.stat-item strong { color: var(--forest); font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 400; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 650; }
.stat-aside { padding: 0 22px; color: #8a938c; font-size: 10px; text-align: right; }
.table-section { border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.section-toolbar { display: flex; min-height: 84px; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.section-toolbar h2 { margin: 0 0 5px; font-size: 14px; font-weight: 750; }
.section-toolbar p { margin: 0; color: var(--muted); font-size: 10px; }
.search-form { display: flex; width: min(370px, 48%); gap: 7px; }
.search-form input { height: 36px; padding: 0 11px; font-size: 11px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { height: 40px; padding: 0 18px; color: #859088; background: #f8faf8; font-size: 9px; font-weight: 750; text-transform: uppercase; }
td { height: 63px; padding: 10px 18px; border-top: 1px solid #edf0ed; color: #526058; font-size: 11px; white-space: nowrap; }
td strong { display: block; max-width: 280px; overflow: hidden; color: #26352d; font-size: 12px; text-overflow: ellipsis; }
td small { display: block; margin-top: 4px; color: #87918a; font-size: 10px; }
.domain-text { color: #416d56; font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; }
.muted { color: #9aa39d; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 20px; font-size: 9px; font-weight: 700; }
.status-pill > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { color: #32724e; background: #edf6ef; }
.status-pending { color: #8a6c1a; background: #fbf5df; }
.empty-state { height: 190px; text-align: center; white-space: normal; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-bottom: 7px; color: var(--ink); font-size: 13px; }
.empty-state span { color: var(--muted); font-size: 11px; }
.empty-state a { display: inline-block; margin-top: 13px; color: #376749; font-size: 11px; font-weight: 700; text-decoration: none; }
.page-footer { margin-top: 27px; color: #8d968f; font-size: 9px; }
.page-footer span { margin: 0 5px; color: #d2ae3b; }
.notice { margin: 0 0 22px; padding: 14px 16px; border: 1px solid; border-radius: 6px; font-size: 11px; line-height: 1.6; }
.notice-error { border-color: #efc9c3; color: var(--danger); background: var(--danger-bg); }
.notice-success { border-color: #c9e2d0; color: var(--success); background: var(--success-bg); }
.credential-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0 0; }
.credential-list div { display: grid; gap: 4px; }
.credential-list dt { color: #5a8067; font-size: 9px; font-weight: 700; }
.credential-list dd { margin: 0; color: #214f38; font-size: 11px; font-weight: 750; overflow-wrap: anywhere; }
.credential-list code { font-family: "Cascadia Code", Consolas, monospace; }
.notice-caption { margin: 10px 0 0; color: #60806a; font-size: 9px; }

.back-link { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 24px; color: #50705c; font-size: 11px; font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--forest-deep); }
.page-heading-compact { align-items: center; margin-bottom: 26px; }
.step-mark { color: #7d8981; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.step-mark i { margin: 0 5px; color: #c1a33f; font-style: normal; }
.tenant-form { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.form-section { padding: 25px 28px 28px; border-bottom: 1px solid #e8ece8; }
.form-section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.section-number { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid #e9d994; border-radius: 50%; color: #806716; background: #fbf6e5; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.form-section-heading h2 { margin: 1px 0 4px; color: #28382f; font-size: 13px; font-weight: 750; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 18px; padding-left: 42px; }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 28px; background: #fafbf9; }

@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 820px) {
    .auth-shell { min-height: 590px; grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr); }
    .auth-brand-panel { min-height: 590px; padding: 32px; }
    .auth-brand-message h1 { font-size: 34px; }
    .auth-form-panel { padding: 48px 34px; }
    .stat-strip { grid-template-columns: repeat(3, 1fr); }
    .stat-aside { display: none; }
}
@media (max-width: 650px) {
    .page-main-auth { padding: 18px; }
    .auth-shell { max-width: 460px; min-height: 0; grid-template-columns: 1fr; }
    .auth-brand-panel { min-height: 0; padding: 24px 26px 25px; }
    .auth-brand-panel::after { right: -200px; bottom: -240px; }
    .auth-brand-top { grid-template-columns: 46px 1fr; align-items: center; gap: 12px; }
    .auth-logo { width: 46px; height: 46px; border-width: 2px; border-radius: 7px; }
    .auth-brand-message { margin: 24px 0 22px; }
    .auth-brand-message h1 { margin: 9px 0 0; font-size: 28px; }
    .auth-brand-description, .auth-brand-foot { display: none; }
    .auth-form-panel { padding: 32px 26px 29px; }
    .auth-form-content h2 { font-size: 28px; }
    .form-intro { margin-bottom: 25px; }
    .topbar { min-height: 64px; padding: 0 16px; }
    .brand-lockup { min-width: 0; }
    .brand-logo { width: 38px; height: 38px; }
    .brand-copy small { display: none; }
    .topbar-actions { gap: 3px; }
    .nav-link { padding: 0 8px; }
    .topbar-actions .button-small { padding: 0 9px; }
    .content-shell, .content-shell-narrow { width: calc(100% - 32px); padding-top: 30px; }
    .page-heading { align-items: flex-start; margin-bottom: 22px; }
    .page-heading h1 { font-size: 30px; }
    .heading-meta { margin-top: 5px; font-size: 0; }
    .avatar-mark { width: 32px; height: 32px; font-size: 14px; }
    .stat-strip { grid-template-columns: repeat(3, 1fr); margin-bottom: 24px; }
    .stat-item { min-height: 68px; padding: 0 11px; }
    .stat-item strong { font-size: 21px; }
    .stat-label { font-size: 9px; }
    .section-toolbar { align-items: stretch; flex-direction: column; padding: 15px; }
    .search-form { width: 100%; }
    th { padding: 0 12px; }
    td { padding: 10px 12px; }
    .form-section { padding: 21px 17px 23px; }
    .form-grid { grid-template-columns: 1fr; gap: 15px; padding-left: 0; }
    .field-wide { grid-column: auto; }
    .form-section-heading { margin-bottom: 17px; }
    .form-actions { padding: 14px 17px; }
}
@media (max-width: 390px) {
    .topbar { padding: 0 11px; }
    .brand-copy strong { font-size: 11px; }
    .topbar-actions .nav-link { display: none; }
    .topbar-actions .button-small { min-height: 33px; font-size: 10px; }
    .stat-item { padding: 0 8px; }
    .stat-label { line-height: 1.3; }
    .credential-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}