:root {
  --bg: #f3f1ee;
  --bg-soft: #ecebe7;
  --surface: #fff;
  --surface-2: #faf9f7;
  --surface-3: #f1efeb;
  --border: #e3e0db;
  --border-soft: #eceae5;
  --border-strong: #cfcbc3;
  --text: #17373d;
  --text-muted: #5e7077;
  --text-soft: #8c9aa0;
  --brand: #17373d;
  --brand-2: #3a565c;
  --brand-red: #aa2b2b;
  --success: #3d6e4a;
  --warning: #b5832a;
  --danger: #aa2b2b;
  --tint: #e3eaeb;
  --tint-red: #f4e1e1;
  --tint-green: #e3ece5;
  --tint-yellow: #f1e6cf;
  --shadow-sm: 0 1px 1px rgba(23,55,61,.04);
  --shadow: 0 1px 2px rgba(23,55,61,.05), 0 2px 8px rgba(23,55,61,.04);
  --shadow-pop: 0 8px 28px rgba(23,55,61,.10), 0 2px 4px rgba(23,55,61,.06);
  --shadow-modal: 0 28px 80px rgba(23,55,61,.20), 0 4px 12px rgba(23,55,61,.10);
  --r-2: 6px;
  --r-3: 8px;
  --r-4: 10px;
  --r-5: 12px;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss02";
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; overflow-x: hidden; }
body { min-height: 100vh; background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
svg { display: block; }

/* Login mirrors ClaudeApp's quiet Post-24 entry screen. */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--bg); }
.login-card { width: min(100%, 390px); padding: 34px 36px 30px; border: 1px solid var(--border); border-radius: var(--r-5); background: var(--surface); box-shadow: var(--shadow); }
.login-brand { width: 146px; height: 40px; overflow: hidden; }
.login-brand img { display: block; width: auto; height: 40px; }
.eyebrow { margin: 24px 0 7px; color: var(--text-soft); font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.login-card h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.015em; }
.login-lead { margin: 8px 0 26px; color: var(--text-muted); font-size: 12.5px; }
form { display: grid; gap: 15px; }
label { display: grid; gap: 6px; }
label span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
input { height: 40px; padding: 0 11px; }
select { height: 36px; padding: 0 32px 0 11px; }
textarea { min-height: 76px; padding: 9px 11px; resize: vertical; }
input::placeholder { color: var(--text-soft); }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(58,86,92,.1); }
#totp { letter-spacing: .18em; font-variant-numeric: tabular-nums; }
.primary-button { height: 40px; margin-top: 3px; border-radius: var(--r-3); background: var(--brand); color: #fff; font-weight: 650; transition: background .15s, transform .15s; }
.primary-button:hover { background: var(--brand-2); transform: translateY(-1px); }
.primary-button:disabled { transform: none; }
.form-error { margin: -2px 0 0; color: var(--danger); font-size: 12px; }
.security-note { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--border-soft); color: var(--text-soft); font-size: 11px; }
.security-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--tint-green); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--surface-3); border-right: 1px solid var(--border); }
.sidebar-brand { display: flex; align-items: center; height: 68px; padding: 14px 18px; }
.sidebar-brand img { display: block; width: auto; height: 40px; max-width: 146px; object-fit: contain; }
.sidebar nav { flex: 1; display: block; overflow-y: auto; margin: 0; padding: 4px 8px 16px; }
.nav-section-label { padding: 12px 10px 6px; color: var(--text-soft); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nav-item { width: 100%; height: 34px; display: flex; align-items: center; gap: 10px; margin: 1px 0; padding: 0 10px; border-radius: var(--r-2); color: var(--text-muted); font-size: 13px; font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(23,55,61,.05); color: var(--text); }
.nav-item.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.nav-icon { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 auto; color: var(--text-soft); }
.nav-item.active .nav-icon { color: var(--brand); }
.nav-icon svg, .icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer { display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center; gap: 9px; margin-top: auto; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; }
.admin-copy { min-width: 0; }
.admin-copy strong, .admin-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-copy strong { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.admin-copy span { margin-top: 2px; color: var(--text-soft); font-size: 10.5px; }
.icon-button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-2); color: var(--text-soft); }
.icon-button:hover { background: rgba(23,55,61,.06); color: var(--text); }

.content-shell { min-width: 0; padding: 0 28px 72px; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 -28px; padding: 12px 28px; border-bottom: 1px solid var(--border); background: rgba(243,241,238,.94); backdrop-filter: blur(8px); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.breadcrumb { margin: 0 0 3px; color: var(--text-soft); font-size: 11.5px; }
.topbar h1 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.01em; }
.readonly-badge { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); color: var(--text-muted); font-size: 11.5px; font-weight: 600; }
.readonly-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.secondary-button { height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.secondary-button:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 14px; }
.summary-grid article { min-width: 0; padding: 15px 16px; border: 1px solid var(--border); border-radius: var(--r-4); background: var(--surface); box-shadow: var(--shadow-sm); }
.summary-grid span, .summary-grid small, .summary-grid strong { display: block; }
.summary-grid span { color: var(--text-muted); font-size: 11.5px; }
.summary-grid strong { margin: 6px 0 2px; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.summary-grid small { overflow: hidden; color: var(--text-soft); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.registry-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-4); background: var(--surface); box-shadow: var(--shadow-sm); }
.toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) 190px auto auto; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border-soft); }
.search-box { position: relative; }
.search-box span { position: absolute; left: 10px; top: 6px; color: var(--text-soft); font-size: 18px; pointer-events: none; }
.search-box input { height: 36px; padding-left: 34px; font-size: 12.5px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { height: 34px; padding: 0 14px; background: var(--surface-2); color: var(--text-soft); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
td { height: 48px; padding: 8px 14px; border-top: 1px solid var(--border-soft); color: var(--text-muted); font-size: 12.5px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
.organization-cell { display: flex; align-items: center; gap: 10px; }
.org-monogram { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: var(--r-3); background: var(--tint); color: var(--brand); font-size: 10.5px; font-weight: 700; }
.organization-cell strong, .organization-cell small { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.organization-cell strong { color: var(--text); font-size: 12.5px; font-weight: 650; }
.organization-cell small { margin-top: 2px; color: var(--text-soft); font-size: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 999px; background: var(--tint-green); color: var(--success); font-size: 10px; font-weight: 700; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.suspended { background: var(--tint-yellow); color: var(--warning); }
.status-pill.disabled { background: var(--tint-red); color: var(--danger); }
.status-pill.archived { background: var(--surface-3); color: var(--text-soft); }
.row-button { padding: 5px 8px; border-radius: var(--r-2); color: var(--brand); font-size: 11.5px; font-weight: 650; }
.row-button:hover { background: var(--tint); }
.table-status { padding: 28px; color: var(--text-muted); font-size: 12px; text-align: center; }
.empty-state { display: grid; place-items: center; gap: 4px; padding: 48px 20px; color: var(--text-muted); font-size: 12px; }
.empty-state strong { color: var(--text); }

.system-content { display: grid; gap: 14px; margin-top: 22px; }
.system-summary { margin: 0; }
.system-notice { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid #e1d4b9; border-radius: var(--r-3); background: #fbf7ed; color: #6e5a34; font-size: 11.5px; }
.system-notice strong { flex: 0 0 auto; color: #8c641e; }
.system-section { overflow: hidden; }
.system-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.system-section-head h2 { margin: 0; font-size: 14px; }
.system-section-head p { margin: 3px 0 0; color: var(--text-soft); font-size: 10.5px; }
.system-empty { min-height: 112px; }
.mono-cell { max-width: 210px; overflow: hidden; color: var(--text-muted); font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; }
.error-cell, .wide-cell { min-width: 220px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: normal; }

.primary-action { height: 34px; padding: 0 13px; border-radius: var(--r-3); background: var(--brand); color: #fff; font-size: 12px; font-weight: 650; }
.primary-action:hover { background: var(--brand-2); }
.access-card { margin-top: 0; }
.access-form { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(210px, 1fr); gap: 12px; padding: 16px; border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.access-form input, .access-form select { height: 38px; background: var(--surface); }
.access-form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.access-form .form-error { grid-column: 1 / -1; margin: 0; text-align: right; }
.credential-result { margin: 14px; padding: 14px 16px; border: 1px solid #d7c292; border-radius: var(--r-3); background: #fbf7ed; }
.credential-result > div:first-child { display: grid; gap: 2px; }
.credential-result > div:first-child strong { color: #6e5a34; font-size: 12.5px; }
.credential-result > div:first-child span { color: #8a7650; font-size: 10.5px; }
.credential-result dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 7px 12px; margin: 13px 0; }
.credential-result dt { color: #8a7650; font-size: 10.5px; }
.credential-result dd { min-width: 0; margin: 0; }
.credential-result code { display: block; overflow-wrap: anywhere; color: var(--text); font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; user-select: all; }
.credential-actions { display: flex; gap: 8px; }
.compact-select { width: 190px; height: 32px; font-size: 11px; }
.access-actions { display: flex; justify-content: flex-end; gap: 4px; }
.danger-action { color: var(--danger); }
.access-actions .row-button:disabled { color: var(--text-soft); }
.organization-create-card { margin-top: 22px; }
.organization-create-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 12px; padding: 16px; }
.organization-create-form input, .organization-create-form select { height: 38px; }
.form-section-title { grid-column: 1 / -1; margin-top: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--border-soft); color: var(--text-soft); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.form-section-title:first-child { margin-top: 0; }
.form-wide { grid-column: 1 / -1; }
.organization-form-note { padding: 9px 11px; border-radius: var(--r-3); background: var(--tint); color: var(--text-muted); font-size: 10.5px; }
.tenant-credential-result { margin: 14px 0; }
.detail-add-admin { margin-top: 13px; }
.organization-admin-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface-2); }
.organization-admin-inline .form-error { grid-column: 1 / -1; margin: 0; }
.app-management-card { margin-top: 22px; }
.app-upload-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px; padding: 16px; }
.app-upload-form input, .app-upload-form select { height: 38px; }
.app-file-field { padding: 13px; border: 1px dashed var(--border); border-radius: var(--r-3); background: var(--surface-2); }
.app-file-field input { height: auto; margin-top: 8px; padding: 7px; background: var(--surface); }
.app-file-field small { display: block; margin-top: 6px; color: var(--text-soft); font-size: 10.5px; }
.app-upload-confirm { display: flex; align-items: center; gap: 8px; }
.app-upload-confirm input { width: 16px; height: 16px; flex: 0 0 auto; }
.app-upload-confirm span { color: var(--text); font-size: 11.5px; }
.app-release-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 210px; }
.compact-button { height: 30px; padding: 0 9px; font-size: 10.5px; }
.table-action-link, .danger-text-button { padding: 6px 7px; border-radius: var(--r-2); color: var(--brand); font-size: 10.5px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.table-action-link:hover { background: var(--tint); }
.danger-text-button { color: var(--danger); }
.danger-text-button:hover { background: #fff0f0; }
.current-release-label { color: var(--brand); font-size: 10.5px; font-weight: 700; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(23,55,61,.24); backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; top: 0; right: 0; z-index: 21; width: min(520px, 100%); height: 100vh; overflow-y: auto; background: var(--surface); box-shadow: var(--shadow-modal); transform: translateX(105%); transition: transform .22s ease; }
.detail-drawer.open { transform: translateX(0); }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 17px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.95); backdrop-filter: blur(10px); }
.drawer-head .eyebrow { margin: 0 0 5px; }
.drawer-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.drawer-head .icon-button { width: 32px; height: 32px; color: var(--text-muted); font-size: 20px; }
.drawer-content { padding: 20px 24px 38px; }
.detail-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.organization-edit-form { grid-template-columns: 1fr 1fr; gap: 11px 10px; margin-bottom: 20px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface-2); }
.organization-edit-form input, .organization-edit-form select { height: 38px; background: var(--surface); }
.company-partner-list { display: grid; gap: 10px; }
.company-partner-edit { padding: 11px; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); }
.company-partner-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.company-partner-head strong { font-size: 11px; }
.company-partner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-section { margin-top: 21px; }
.detail-section h3 { margin: 0 0 9px; color: var(--text-soft); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--border); }
.detail-field { min-width: 0; padding: 11px 12px; background: var(--surface); }
.detail-field span, .detail-field strong { display: block; }
.detail-field span { margin-bottom: 4px; color: var(--text-soft); font-size: 9.5px; }
.detail-field strong { overflow-wrap: anywhere; font-size: 11.5px; font-weight: 600; }
.administrator { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.administrator:last-child { border: 0; }
.administrator .avatar { background: var(--tint); color: var(--brand); }
.administrator strong, .administrator span { display: block; }
.administrator strong { font-size: 11.5px; }
.administrator span { margin-top: 2px; color: var(--text-soft); font-size: 10px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 40; padding: 10px 13px; border-radius: var(--r-3); background: var(--brand); color: #fff; box-shadow: var(--shadow-pop); font-size: 11.5px; }

@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { grid-template-columns: 70px minmax(0, 1fr); }
  .sidebar-brand { justify-content: center; padding-inline: 10px; overflow: hidden; }
  .sidebar-brand img { height: 32px; max-width: none; transform: translateX(57px); }
  .nav-section-label, .nav-item { font-size: 0; }
  .nav-section-label { height: 12px; padding: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-icon { width: 20px; height: 20px; }
  .sidebar-footer { grid-template-columns: 1fr; justify-items: center; }
  .admin-copy, .sidebar-footer .icon-button { display: none; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 9px 12px 0; }
  .sidebar-brand { width: 118px; height: 38px; justify-content: flex-start; padding: 0; }
  .sidebar-brand img { height: 32px; max-width: 118px; transform: none; }
  .sidebar nav { order: 3; width: 100%; display: flex; gap: 4px; overflow-x: auto; padding: 8px 0 9px; }
  .nav-section-label { display: none; }
  .sidebar .nav-item { width: auto; flex: 0 0 auto; justify-content: flex-start; height: 32px; padding: 0 9px; font-size: 11px; white-space: nowrap; }
  .nav-icon, .nav-icon svg { width: 15px; height: 15px; }
  .sidebar-footer { display: flex; margin-left: auto; padding: 0; border: 0; }
  .sidebar-footer .avatar, .admin-copy { display: none; }
  .sidebar-footer .icon-button { display: grid; }
  .content-shell { padding: 0 12px 40px; }
  .topbar { min-height: 62px; margin-inline: -12px; padding: 10px 12px; align-items: center; }
  .topbar h1 { font-size: 18px; }
  .breadcrumb { font-size: 10px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .secondary-button { width: 34px; padding: 0; font-size: 0; }
  .topbar-actions .secondary-button::after { content: "↻"; font-size: 17px; }
  .readonly-badge { padding: 0 8px; font-size: 10px; }
  .summary-grid { gap: 8px; margin-top: 14px; }
  .summary-grid article { padding: 12px; }
  .summary-grid strong { font-size: 21px; }
  .toolbar { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .login-shell { padding: 18px; }
  .login-card { padding: 28px 24px 24px; }
  .system-notice { align-items: flex-start; flex-direction: column; gap: 3px; }
  .access-form { grid-template-columns: 1fr; }
  .organization-create-form, .organization-admin-inline { grid-template-columns: 1fr; }
  .organization-edit-form, .company-partner-grid { grid-template-columns: 1fr; }
  .app-upload-form { grid-template-columns: 1fr; }
  .organization-admin-inline .form-error { grid-column: 1; }
  .credential-result dl { grid-template-columns: 1fr; gap: 3px; }
  .credential-result dd { margin-bottom: 7px; }
}

/* Organization workspace: keep navigation visible, scroll only the current panel. */
html.organization-open, body.organization-open { overflow: hidden; }
.drawer-backdrop { background: rgba(15,39,43,.32); backdrop-filter: blur(2px); }
.detail-drawer { inset: 24px; margin: auto; width: min(1180px, calc(100% - 48px)); height: calc(100dvh - 48px); max-height: 1000px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; font-size: 15px; line-height: 1.6; transform: translateY(16px); opacity: 0; transition: transform .16s ease, opacity .16s ease; }
.detail-drawer.open { transform: translateY(0); opacity: 1; }
.drawer-head { position: relative; flex-shrink: 0; padding: 22px 30px 18px; background: #fff; backdrop-filter: none; border: 0; }
.drawer-head h2 { font-size: 26px; line-height: 1.25; overflow-wrap: anywhere; }
.drawer-head .eyebrow { font-size: 11px; color: #62777c; letter-spacing: .1em; }
.drawer-head .icon-button { width: 42px; height: 42px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 10px; font-size: 25px; }
.drawer-head .icon-button:hover { background: var(--surface-2); }
.detail-subtitle { margin: 6px 0 0; color: #5b7076; font-size: 13px; }
.organization-tabs { display: flex; flex: 0 0 auto; gap: 6px; padding: 0 28px; border-bottom: 1px solid var(--border); overflow-x: auto; background: #fff; }
.organization-tab { min-height: 48px; padding: 10px 14px; border-bottom: 3px solid transparent; color: #526b72; font-size: 14px; font-weight: 600; white-space: nowrap; }
.organization-tab[aria-selected="true"] { color: var(--brand); border-color: var(--brand); background: #f0f7f5; border-radius: 8px 8px 0 0; }
.organization-tab:hover { color: var(--brand); background: #f5f8f7; }
.detail-drawer :focus-visible { outline: 3px solid #258573; outline-offset: 3px; }
.drawer-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 30px 32px; background: #f7f9f8; scrollbar-gutter: stable; }
.organization-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.organization-metric { min-width: 0; padding: 16px 18px; border: 1px solid #dde6e3; border-radius: 12px; background: #fff; }
.organization-metric > span { display: block; color: #546c72; font-size: 12px; font-weight: 500; }
.organization-metric strong { display: block; margin-top: 5px; font-size: 21px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.organization-metric small { display: block; margin-top: 4px; font-size: 11px; color: #60767b; line-height: 1.45; }
.organization-panel { min-width: 0; }
.organization-panel .detail-section { margin: 0 0 20px; padding: 22px; border: 1px solid #dfe7e4; border-radius: 12px; background: #fff; }
.organization-panel .detail-section .detail-section { margin-top: 18px; }
.organization-panel .detail-section h3 { margin-bottom: 16px; font-size: 16px; color: var(--text); text-transform: none; letter-spacing: normal; font-weight: 650; }
.organization-panel .detail-grid { border-color: #e1e8e5; background: #e1e8e5; border-radius: 8px; }
.organization-panel .detail-field:last-child:nth-child(odd) { grid-column: 1 / -1; }
.billing-state-label.warning { background: #fff0de; color: #785327; }
.organization-panel .detail-field { padding: 14px 16px; }
.organization-panel .detail-field span { margin-bottom: 5px; font-size: 12px; color: #597178; }
.organization-panel .detail-field strong { font-size: 15px; font-weight: 550; line-height: 1.5; }
.organization-panel .detail-status { margin-bottom: 16px; }
.detail-drawer .status-pill { font-size: 12px; padding: 5px 10px; }
.detail-drawer .secondary-button, .detail-drawer .primary-button, .detail-drawer .primary-action { min-height: 40px; height: auto; padding: 8px 14px; font-size: 13px; line-height: 1.45; white-space: normal; }
.detail-drawer .primary-button { background: var(--brand); color: white; border-radius: 8px; }
.detail-drawer label { font-size: 13px; color: #3d5960; }
.detail-drawer input:not([type="checkbox"]), .detail-drawer select, .detail-drawer textarea { width: 100%; min-width: 0; height: auto; min-height: 42px; padding: 9px 12px; font-size: 14px; border: 1px solid #bccdc7; border-radius: 7px; background: #fff; }
.detail-drawer textarea { min-height: 110px; resize: vertical; }
.detail-drawer input[type="checkbox"] { width: 18px; height: 18px; margin: 8px; accent-color: var(--brand); }
.detail-drawer .organization-admin-inline, .detail-drawer .organization-edit-form { gap: 16px; padding: 18px; font-size: 14px; }
.detail-drawer .organization-admin-inline fieldset { min-width: 0; display: grid; align-content: start; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.detail-drawer .organization-admin-inline fieldset legend { padding: 0 6px; font-size: 15px; font-weight: 650; }
.detail-drawer .organization-admin-inline > h4, .detail-drawer .organization-admin-inline > p, .detail-drawer .organization-admin-inline > button { grid-column: 1/-1; }
.detail-drawer .administrator { padding: 14px 0; gap: 14px; }
.detail-drawer .administrator strong { font-size: 15px; }
.detail-drawer .administrator span { font-size: 13px; color: #5c7177; }
.detail-drawer summary { cursor: pointer; font-weight: 600; padding: 8px 0; font-size: 15px; }
.detail-drawer p { overflow-wrap: anywhere; }
.tariff-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.organization-panel .tariff-heading h3 { font-size: 26px; margin: 4px 0 10px; }
.billing-state-label { display: inline-block; background: #e5f3ec; color: #226647; border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 650; }
.tariff-price { text-align: right; flex-shrink: 0; }
.tariff-price strong { display: block; font-size: 25px; letter-spacing: -.025em; }
.tariff-price span { display: block; font-size: 12px; color: #60777c; }
.tariff-description { max-width: 78ch; color: #4d656c; margin: 20px 0; }
.organization-notice { padding: 14px 18px; border-left: 3px solid #438b76; border-radius: 5px; background: #edf6f1; color: #254f42; }
.organization-notice.warning { background: #fff4e9; color: #785327; border-color: #c89550; }
.billing-updated { display: block; margin-top: 18px; font-size: 12px; color: #62787e; }
.billing-amounts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.billing-amounts .detail-field { border: 1px solid var(--border); border-radius: 10px; }
.billing-empty { padding: 28px; text-align: center; border: 1px dashed #c7d7d0; border-radius: 10px; color: #5b7379; background: #f7faf8; }
@media (max-width: 850px) {
 .detail-drawer { inset: 12px; width: calc(100% - 24px); height: calc(100dvh - 24px); border-radius: 14px; }
 .drawer-head { padding: 18px 20px 14px; }
 .drawer-content { padding: 18px 20px 26px; }
 .organization-tabs { padding-inline: 14px; }
 .organization-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
 .organization-metric { padding: 13px 15px; }
 .organization-metric strong { font-size: 19px; }
}
@media (max-width: 520px) {
 .detail-drawer { inset: 0; width: 100%; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
 .drawer-head { padding: 16px; gap: 12px; }
 .drawer-head h2 { font-size: 21px; }
 .drawer-content { padding: 16px 12px 24px; }
 .organization-tabs { padding-inline: 8px; gap: 2px; }
 .organization-tab { padding-inline: 12px; font-size: 13px; }
 .organization-panel .detail-section { padding: 16px; }
 .organization-panel .detail-grid, .billing-amounts { grid-template-columns: 1fr; }
 .organization-panel .detail-field { padding: 12px; }
 .tariff-heading { flex-direction: column; gap: 14px; }
 .tariff-price { text-align: left; }
 .detail-drawer .organization-admin-inline, .detail-drawer .organization-edit-form { grid-template-columns: 1fr; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .detail-drawer { transition: none; } }

/* Organization administrator password recovery. */
.administrator-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.administrator-reset { flex-shrink: 0; }
@media (max-width: 600px) {
  .detail-drawer .administrator { flex-wrap: wrap; }
  .administrator-reset { margin-left: 50px; }
}

.detail-drawer .administrator { flex-wrap: wrap; }
.administrator-reset-confirm { flex-basis: 100%; padding: 12px 16px; border-radius: 8px; background: #fbf7ed; }
.administrator-reset-confirm p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.administrator-reset-confirm .credential-actions { flex-wrap: wrap; }
