body.modal-open { overflow: hidden; }
.auth-page, .admin-auth-page, .workspace-page, .admin-page { min-height: 100vh; background: #f1f1ed; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) minmax(460px, 1fr); }
.auth-visual { min-height: 100vh; position: relative; overflow: hidden; color: #fff; background: var(--ink); }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(20,21,18,.16), rgba(20,21,18,.2) 48%, rgba(20,21,18,.92)); pointer-events: none; }
.auth-visual img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: center 48%; filter: saturate(.7) contrast(1.08); }
.auth-mark { position: absolute; top: 38px; left: 42px; z-index: 2; color: #fff; }
.auth-mark i { color: #c7c8c1; border-color: rgba(255,255,255,.28); }
.auth-quote { position: absolute; right: 42px; bottom: 48px; left: 42px; z-index: 2; }
.auth-quote p { margin: 0; font: 700 clamp(27px, 3vw, 42px)/1.3 var(--font-display); }
.auth-quote span { display: block; margin-top: 11px; color: #c6b17f; font-size: 10px; font-weight: 700; }
.auth-panel { min-height: 100vh; padding: 52px clamp(32px, 7vw, 110px); display: grid; place-items: center; background: #fff; }
.auth-box { width: min(430px, 100%); }
.auth-back { margin-bottom: 62px; display: inline-flex; align-items: center; gap: 7px; color: #777a71; font-size: 11px; }
.auth-back .icon { width: 14px; transform: rotate(180deg); }
.auth-box h1 { margin: 0; font: 700 38px/1.2 var(--font-display); }
.auth-box > p { margin: 11px 0 0; color: var(--muted); font-size: 12px; }
.auth-tabs { height: 48px; margin: 35px 0 25px; display: flex; gap: 30px; border-bottom: 1px solid var(--line); }
.auth-tabs button { height: 48px; padding: 0 2px; position: relative; color: #8a8c84; border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.auth-tabs button.active { color: var(--accent); }
.auth-tabs button.active::after { content: ""; height: 2px; position: absolute; right: 0; bottom: -1px; left: 0; background: var(--accent); }
form label { display: grid; gap: 7px; color: #454740; font-size: 11px; font-weight: 700; }
form label + label, form .form-grid + label, form label + .form-grid { margin-top: 16px; }
input, textarea, select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); border: 1px solid #d8d9d3; border-radius: 3px; outline: 0; background: #fff; font-size: 13px; font-weight: 400; }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(50,99,111,.12); }
input[aria-invalid="true"] { border-color: var(--danger); }
label small { color: #96988f; font-size: 9px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label + label { margin-top: 0; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-error { min-height: 20px; margin: 10px 0 4px; color: var(--danger); font-size: 11px; }
.form-submit { width: 100%; }
.auth-terms { margin-top: 22px !important; text-align: center; font-size: 9px !important; }

.admin-auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 42%) minmax(460px, 1fr); }
.admin-auth-brand { min-height: 100vh; padding: 46px clamp(34px, 6vw, 76px); display: flex; flex-direction: column; color: #fff; background: var(--ink); }
.admin-auth-brand .wordmark { color: #fff; }
.admin-auth-brand .wordmark i { color: #a9aca3; border-color: #4a4c46; }
.admin-auth-brand > div { margin: auto 0; }
.admin-auth-brand h1 { margin: 0; font: 700 clamp(48px, 6vw, 78px)/1.02 var(--font-display); }
.admin-auth-brand p { max-width: 410px; margin: 25px 0 0; color: #aeb0a8; font-size: 13px; line-height: 1.9; }
.admin-auth-note { color: #777a71; font-size: 9px; }
.admin-auth-form { min-height: 100vh; padding: 40px; display: grid; place-items: center; background: #ecece8; }
.admin-login-box { width: min(430px, 100%); padding: 45px 42px 38px; background: #fff; border-top: 3px solid var(--accent); box-shadow: var(--shadow); }
.console-label { color: var(--accent); font: 700 9px/1 Georgia, serif; }
.admin-login-box h2 { margin: 14px 0 0; font: 700 30px/1.2 var(--font-display); }
.admin-login-box > p:not(.form-error) { margin: 8px 0 30px; color: var(--muted); font-size: 11px; }
.admin-login-box > a { margin-top: 18px; display: block; color: var(--muted); text-align: center; font-size: 10px; }

.workspace-header { height: 66px; padding: 0 28px; display: flex; align-items: center; background: #fff; border-bottom: 1px solid var(--line); }
.workspace-account { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.workspace-account > div:nth-child(2) { min-width: 92px; }
.workspace-account strong, .workspace-account span { display: block; }
.workspace-account strong { font-size: 11px; }
.workspace-account span { color: var(--muted); font-size: 9px; }
.account-avatar { width: 35px; height: 35px; display: grid; place-items: center; flex: none; color: #fff; background: var(--accent); border-radius: 50%; font: 700 15px/1 var(--font-display); }
.member-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.member-heading { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.member-heading h1 { margin: 0; font: 700 36px/1.2 var(--font-display); }
.member-heading p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.member-stats { min-height: 132px; display: grid; grid-template-columns: repeat(3, 1fr) minmax(210px, 1.35fr); background: #fff; border-top: 3px solid var(--ink); }
.member-stats > div { min-width: 0; padding: 24px 26px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); }
.member-stats > div:last-child { border-right: 0; }
.member-stats span { color: var(--muted); font-size: 10px; }
.member-stats strong { margin-top: 5px; overflow: hidden; font: 700 25px/1.2 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.checkin-cell { align-items: flex-start; background: var(--paper); }
.checkin-cell small { margin-top: 8px; color: #8a8c84; font-size: 9px; }
.member-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr 1.25fr; gap: 22px; }
.workspace-panel { background: #fff; border: 1px solid var(--line); }
.workspace-panel > header { min-height: 64px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.workspace-panel > header h2 { margin: 0; font: 700 17px/1.2 var(--font-display); }
.workspace-panel > header span { color: var(--muted); font-size: 9px; }
.profile-panel dl { margin: 0; padding: 9px 22px; }
.profile-panel dl div { min-height: 56px; display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; border-bottom: 1px solid #ecece7; }
.profile-panel dl div:last-child { border-bottom: 0; }
.profile-panel dt { color: var(--muted); font-size: 10px; }
.profile-panel dd { margin: 0; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.point-list { padding: 9px 22px; }
.point-row { min-height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid #ecece7; }
.point-row:last-child { border-bottom: 0; }
.point-row strong, .point-row span { display: block; }
.point-row strong { font-size: 11px; }
.point-row span { color: var(--muted); font-size: 9px; }
.point-row > em { color: var(--active); font: 700 15px/1 Georgia, serif; font-style: normal; }
.panel-empty { margin: 0; padding: 28px 0; color: var(--muted); text-align: center; font-size: 11px; }
.member-resource-callout { min-height: 118px; margin-top: 22px; padding: 22px 27px; display: flex; align-items: center; justify-content: space-between; gap: 30px; color: #fff; background: var(--ink-2); }
.member-resource-callout > div { display: flex; align-items: center; gap: 18px; }
.member-resource-callout > div > span { width: 45px; height: 45px; display: grid; place-items: center; color: #d0b675; border: 1px solid #56584f; }
.member-resource-callout h2 { margin: 0; font: 700 17px/1.3 var(--font-display); }
.member-resource-callout p { margin: 5px 0 0; color: #9ea098; font-size: 10px; }
.member-resource-callout .btn { color: var(--ink); background: #fff; border-color: #fff; }

.admin-header { position: relative; z-index: 20; }
.admin-avatar { background: var(--ink); }
.admin-shell { min-height: calc(100vh - 66px); display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.admin-sidebar { padding: 27px 16px 22px; display: flex; flex-direction: column; color: #aeb0a8; background: var(--ink); }
.sidebar-label { margin: 0 12px 12px; color: #686b63; font-size: 9px; font-weight: 700; }
.admin-sidebar nav { display: grid; gap: 4px; }
.admin-sidebar button, .admin-sidebar > a { width: 100%; min-height: 42px; padding: 0 13px; display: flex; align-items: center; gap: 11px; color: #aeb0a8; border: 0; border-radius: 3px; background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; text-align: left; }
.admin-sidebar button:hover, .admin-sidebar button.active { color: #fff; background: #2a2c27; }
.admin-sidebar button.active { box-shadow: inset 2px 0 var(--accent); }
.admin-sidebar .icon { width: 16px; height: 16px; }
.admin-sidebar > a { margin-top: auto; border-top: 1px solid #30322d; border-radius: 0; }
.admin-main { min-width: 0; padding: 40px clamp(24px, 4vw, 58px) 70px; overflow: hidden; }
.admin-view { width: min(1260px, 100%); margin: 0 auto; }
.admin-title { min-height: 76px; margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.admin-title h1 { margin: 0; font: 700 32px/1.2 var(--font-display); }
.admin-title p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.admin-title > span { color: #8d8f87; font-size: 10px; }
.admin-stats { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 3px solid var(--ink); }
.admin-stats article { min-height: 126px; padding: 23px; border-right: 1px solid var(--line); }
.admin-stats article:last-child { border-right: 0; }
.admin-stats span, .admin-stats small, .admin-stats strong { display: block; }
.admin-stats span { color: #65675f; font-size: 10px; font-weight: 700; }
.admin-stats strong { margin-top: 9px; font: 700 29px/1 var(--font-display); }
.admin-stats small { margin-top: 9px; color: #a0a29a; font-size: 9px; }
.admin-panel { margin-bottom: 22px; background: #fff; border: 1px solid var(--line); }
.admin-panel > header { min-height: 68px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); }
.admin-panel > header h2 { margin: 0; font: 700 17px/1.2 var(--font-display); }
.admin-panel > header h2 em { color: var(--accent); font: 700 12px/1 Georgia, serif; font-style: normal; }
.admin-panel > header p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; text-align: left; }
.wide-table { min-width: 850px; }
th { height: 40px; padding: 0 16px; color: #8c8e86; background: #fafaf8; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 700; white-space: nowrap; }
td { min-height: 55px; padding: 13px 16px; color: #4b4d46; border-bottom: 1px solid #ecece7; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td strong { color: var(--ink); font-size: 11px; }
td small { max-width: 260px; margin-top: 3px; overflow: hidden; color: #989a92; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.table-empty { height: 92px; color: var(--muted); text-align: center; }
.table-status { min-width: 52px; min-height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 2px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.table-status.active { color: #276342; background: #e5f1e9; }
.table-status.done { color: #3f5965; background: #e7eef1; }
.table-status.queued, .table-status.neutral { color: #676a62; background: #eeeFec; }
.table-status.vip { color: #765713; background: #f5eccf; }
.table-status.danger { color: #76531b; background: #f4eddf; }
.table-link { color: var(--accent); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.series-admin-panel table { min-width: 720px; }
.admin-series-list { min-width: 0; }
.admin-toolbar { min-height: 66px; margin-bottom: 16px; padding: 12px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); }
.admin-toolbar label { width: min(420px, 100%); min-height: 40px; padding-left: 12px; display: flex; align-items: center; gap: 8px; border: 1px solid #dbdcd6; }
.admin-toolbar label:focus-within { border-color: var(--accent); }
.admin-toolbar label .icon { width: 15px; color: #898b83; }
.admin-toolbar input { min-height: 38px; padding: 0; border: 0; box-shadow: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 20px; display: grid; place-items: center; background: rgba(16,17,15,.62); }
.modal { width: min(650px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-top: 3px solid var(--accent); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal-small { width: min(480px, 100%); }
.modal > header { height: 64px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal > header h2 { margin: 0; font: 700 19px/1.2 var(--font-display); }
.modal-close { display: grid; place-items: center; color: #777970; border: 0; background: transparent; cursor: pointer; }
.modal form { padding: 22px; }
.modal form footer { margin-top: 24px; display: flex; justify-content: flex-end; gap: 8px; }
.checkbox-label { margin-top: 17px; display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.checkbox-label input { width: 16px; min-height: 16px; margin: 0; }
.member-modal-name { margin: 0 0 19px; padding: 12px 14px; color: #62645d; background: var(--paper); font-size: 11px; font-weight: 700; }

@media (max-width: 980px) {
  .auth-shell, .admin-auth-shell { grid-template-columns: 38% 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-stats article:nth-child(2) { border-right: 0; }
  .admin-stats article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .member-stats { grid-template-columns: 1fr 1fr; }
  .member-stats > div:nth-child(2) { border-right: 0; }
  .member-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .member-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .auth-shell, .admin-auth-shell { display: block; }
  .auth-visual { min-height: 210px; height: 210px; }
  .auth-visual img { object-position: center 42%; }
  .auth-visual::after { background: linear-gradient(to bottom, rgba(20,21,18,.1), rgba(20,21,18,.72)); }
  .auth-mark { top: 25px; left: 22px; }
  .auth-quote { right: 22px; bottom: 22px; left: 22px; }
  .auth-quote p { font-size: 25px; }
  .auth-panel { min-height: calc(100vh - 210px); padding: 32px 20px 50px; place-items: start center; }
  .auth-back { margin-bottom: 32px; }
  .auth-box h1 { font-size: 32px; }
  .admin-auth-brand { min-height: 190px; height: 190px; padding: 28px 24px; }
  .admin-auth-brand > div { margin: auto 0 0; }
  .admin-auth-brand h1 { font-size: 31px; }
  .admin-auth-brand h1 br, .admin-auth-brand p, .admin-auth-note { display: none; }
  .admin-auth-form { min-height: calc(100vh - 190px); padding: 28px 16px 50px; place-items: start center; }
  .admin-login-box { padding: 30px 23px; }
  .workspace-header { height: 60px; padding: 0 14px; }
  .workspace-account > div:nth-child(2) { display: none; }
  .workspace-account { gap: 7px; }
  .member-shell { width: min(100% - 24px, 600px); padding: 28px 0 55px; }
  .member-heading { align-items: flex-start; flex-direction: column; }
  .member-heading h1 { font-size: 30px; }
  .member-stats { grid-template-columns: 1fr 1fr; }
  .member-stats > div { min-height: 104px; padding: 18px; }
  .member-stats strong { font-size: 21px; }
  .member-resource-callout { align-items: flex-start; flex-direction: column; }
  .member-resource-callout .btn { width: 100%; }
  .admin-shell { display: block; min-height: calc(100vh - 60px); }
  .admin-sidebar { position: sticky; top: 0; z-index: 15; padding: 7px 10px; display: block; overflow-x: auto; }
  .sidebar-label, .admin-sidebar > a { display: none; }
  .admin-sidebar nav { min-width: max-content; display: flex; }
  .admin-sidebar button { width: auto; min-height: 40px; padding: 0 11px; }
  .admin-sidebar button.active { box-shadow: inset 0 -2px var(--accent); }
  .admin-main { padding: 26px 12px 50px; }
  .admin-title { min-height: 0; margin-bottom: 20px; align-items: flex-start; }
  .admin-title h1 { font-size: 27px; }
  .admin-title > span { display: none; }
  .admin-panel > header { align-items: flex-start; flex-direction: column; justify-content: center; padding-top: 13px; padding-bottom: 13px; }
  .admin-panel > header .row-actions { width: 100%; justify-content: flex-start; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-toolbar label, .admin-toolbar .btn { width: 100%; }
  .modal-backdrop { padding: 8px; place-items: end center; }
  .modal { max-height: calc(100vh - 16px); }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .form-grid-3 label:last-child { grid-column: 1 / -1; }
}

@media (max-width: 470px) {
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .form-grid label + label { margin-top: 0; }
  .member-stats { grid-template-columns: 1fr; }
  .member-stats > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .member-stats > div:last-child { border-bottom: 0; }
  .profile-panel dl div { grid-template-columns: 82px minmax(0, 1fr); }
  .member-resource-callout > div > span { display: none; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-stats article { min-height: 112px; padding: 18px; }
  .admin-title { flex-direction: column; }
  .admin-title > .btn { width: 100%; }
  .modal form { padding: 18px 16px; }
}
