:root {
  color-scheme: light;
  --ink: #143228;
  --muted: #68776f;
  --line: #dce7df;
  --surface: #ffffff;
  --canvas: #f3f6f2;
  --orange: #e86624;
  --orange-dark: #b94712;
  --green-soft: #e8f1e8;
  --danger: #a43a31;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.account-shell { min-height: 100dvh; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.account-sidebar { position: sticky; top: 0; height: 100dvh; padding: 28px 24px; background: #163b2f; color: #edf7ef; display: flex; flex-direction: column; gap: 22px; }
.back-link { color: #cfe0d4; text-decoration: none; font-size: 14px; }
.back-link:hover { color: #fff; }
.account-brand { display: flex; align-items: center; gap: 13px; }
.account-brand img { width: 66px; height: 38px; padding: 3px 0; border-top: 1px solid rgb(255 255 255 / .28); border-bottom: 1px solid rgb(255 255 255 / .14); object-fit: contain; }
.account-brand div { display: grid; gap: 3px; }
.account-brand strong { font-size: 19px; }
.account-brand span, .account-sidebar p, .security-note span { color: #bcd1c3; font-size: 13px; line-height: 1.65; }
.security-note { padding: 16px; border: 1px solid rgb(255 255 255 / .15); border-radius: 14px; background: rgb(255 255 255 / .06); display: grid; gap: 7px; }
.ghost-button { margin-top: auto; border: 1px solid rgb(255 255 255 / .22); border-radius: 10px; padding: 11px 14px; background: transparent; color: #fff; cursor: pointer; }
.account-main { padding: 34px clamp(24px, 4vw, 56px) 48px; min-width: 0; }
header { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.eyebrow { color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 8px 0 5px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.04em; }
header p, .panel-head p { margin: 0; color: var(--muted); }
.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.primary-button { color: #fff; background: var(--orange); box-shadow: 0 8px 20px rgb(232 102 36 / .2); }
.primary-button:hover { background: var(--orange-dark); }
.secondary-button { background: var(--green-soft); color: var(--ink); }
.danger-button { background: #f8e8e6; color: var(--danger); }
button:active { transform: translateY(1px); }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; margin: 28px 0 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.summary-item { padding: 18px; background: var(--surface); }
.summary-item span { display: block; color: var(--muted); font-size: 12px; }
.summary-item strong { display: block; margin-top: 6px; font-size: 26px; }
.account-workspace { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(340px, .72fr); gap: 18px; align-items: start; }
.account-list-panel, .editor-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 32px rgb(41 72 59 / .06); }
.panel-head { padding: 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-head h2 { margin: 0 0 5px; font-size: 19px; }
.panel-head input { width: min(260px, 45%); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; color: var(--ink); background: #fbfcfb; }
.account-list { max-height: calc(100dvh - 250px); overflow: auto; }
.account-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(120px, .8fr) 92px; gap: 15px; align-items: center; padding: 17px 20px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: inherit; text-align: left; cursor: pointer; }
.account-row:last-child { border-bottom: 0; }
.account-row:hover, .account-row.active { background: #f7faf7; }
.account-row.active { box-shadow: inset 3px 0 var(--orange); }
.account-row strong, .account-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row small { display: block; margin-top: 4px; color: var(--muted); }
.role-tag, .status-tag { justify-self: start; border-radius: 999px; padding: 5px 9px; background: var(--green-soft); font-size: 12px; font-weight: 700; }
.status-tag.disabled { background: #f0efec; color: #7b7770; }
.editor-panel { position: sticky; top: 24px; min-height: 360px; }
.empty-editor { min-height: 360px; display: grid; place-content: center; text-align: center; gap: 8px; color: var(--muted); }
.empty-editor strong { color: var(--ink); }
.editor-head { padding: 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; }
.editor-head h2 { margin: 0 0 4px; font-size: 20px; }
.editor-head p { margin: 0; color: var(--muted); font-size: 13px; }
.editor-form { padding: 20px; display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field label { color: #41554c; font-size: 13px; font-weight: 700; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; color: var(--ink); background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid rgb(232 102 36 / .22); border-color: var(--orange); }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.staff-inherited-scope { display: grid; gap: 5px; padding: 13px; border: 1px solid #cfe0d8; border-radius: 10px; background: #f2f8f5; }
.staff-inherited-scope strong { font-size: 13px; }
.staff-inherited-scope span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.permission-option-list { display: grid; gap: 8px; }
.permission-option-list > label { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 10px; align-items: start; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; cursor: pointer; }
.permission-option-list > label:has(input:checked) { border-color: #76ac99; background: #f1f8f4; box-shadow: inset 3px 0 #2a8068; }
.permission-option-list input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: #17634e; }
.permission-option-list strong,.permission-option-list small { display: block; }
.permission-option-list strong { font-size: 13px; }
.permission-option-list small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 5px; }
.password-box { margin: 4px 20px 20px; padding: 16px; border-radius: 12px; background: #f7f9f6; border: 1px solid var(--line); }
.password-box h3 { margin: 0 0 5px; font-size: 15px; }
.password-box p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.password-line { display: flex; gap: 9px; }
.password-line input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; }
.empty-list { padding: 44px 20px; text-align: center; color: var(--muted); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: 360px; padding: 12px 16px; border-radius: 10px; background: #173b30; color: #fff; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 960px) {
  .account-shell { grid-template-columns: 1fr; }
  .account-sidebar { position: static; height: auto; }
  .ghost-button { margin-top: 0; }
  .account-workspace { grid-template-columns: 1fr; }
  .editor-panel { position: static; }
}
@media (max-width: 640px) {
  .account-main { padding: 24px 14px 36px; }
  header { align-items: flex-start; flex-direction: column; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .panel-head { align-items: stretch; flex-direction: column; }
  .panel-head input { width: 100%; }
  .account-row { grid-template-columns: 1fr auto; }
  .account-row .status-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
