/* Caravelli visual theme. The application structure and interaction hooks live in app.js. */
:root {
  --bg: #0c0c0b;
  --surface: #121311;
  --surface-2: #1c1c18;
  --border: #3d3525;
  --text: #eeeae0;
  --muted: #aaa496;
  --gold: #d3b478;
  --gold-light: #f0dba9;
  --scroll-track: #10110d;
  --scroll-thumb: #967b4b;
  --purple: var(--gold);
  --green: #a3c68c;
  --red: #e69b82;
  --amber: #e0bd73;
  --serif: 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  font-family: 'Segoe UI', Arial, sans-serif;
}

body {
  background: radial-gradient(ellipse at 80% 0, #70603c0c, transparent 55%), var(--bg);
}
::selection { background: #d3b47840; color: #fff5de; }
/* Apply the same finish to page, sidebar, table and dialog scrollbars. */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
@supports selector(::-webkit-scrollbar) {
  * { scrollbar-width: auto; scrollbar-color: auto; }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: var(--scroll-track); border-radius: 10px; }
  *::-webkit-scrollbar-thumb {
    border: 2px solid var(--scroll-track); border-radius: 10px;
    background: linear-gradient(135deg, #735a33, #b99a60);
    background-clip: padding-box;
    min-height: 36px; min-width: 36px;
  }
  *::-webkit-scrollbar-thumb:hover { background: linear-gradient(135deg, #a38650, #dfc18a); background-clip: padding-box; }
  *::-webkit-scrollbar-thumb:active { background: var(--gold-light); background-clip: padding-box; }
  *::-webkit-scrollbar-corner { background: var(--scroll-track); }
  *::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}
@media (forced-colors: active) {
  * { scrollbar-color: auto; scrollbar-width: auto; }
  *::-webkit-scrollbar-thumb { background: ButtonText; border-color: Canvas; }
  *::-webkit-scrollbar-track, *::-webkit-scrollbar-corner { background: Canvas; }
}
h1, h2, h3 { font-family: var(--serif); }
input, select, textarea { background: #0e0f0d; border-color: #443b2b; border-radius: 5px; }
input::placeholder { color: #8b8577; }
input[readonly] { background: #181814; }
label { color: #d7d0c1; }
.eyebrow { color: var(--gold); font-size: 9px; font-weight: 500; letter-spacing: 2.4px; }
.btn { border-radius: 5px; border-color: #695438; background: linear-gradient(180deg, #2a261d, #1a1915); color: #e5c995; font-weight: 500; }
.btn:hover { border-color: #c2a16a; background: #30291d; }
.btn.primary { color: #1b160e; background: linear-gradient(120deg, #ecd7a8, #c4a267); border-color: #e7cb92; box-shadow: inset 0 1px #fff2cc60, 0 3px 14px #0004; }
.btn.primary:hover { background: linear-gradient(120deg, #f6e4bd, #d4b57c); }
.btn.subtle { color: var(--gold-light); background: #12130f80; }
.btn.danger { color: var(--red); }
.icon-btn { color: #c4ad80; }
.icon-btn:hover { background: #c4a26916; color: var(--gold-light); }
.loading-crest { width: 112px; height: 112px; }

/* Generated rose crest with transparent background; wordmark stays sharp HTML text. */
.brand { gap: 0; flex-direction: column; text-align: center; }
.brand-crest { width: 90px; height: 90px; object-fit: contain; }
.brand-word { display: block; color: var(--gold-light); font-family: var(--serif); font-size: 24px; letter-spacing: 3px; font-weight: 400; }
.brand-word small { display: block; margin-top: 9px; font-family: 'Segoe UI', Arial, sans-serif; font-size: 6px; font-weight: 400; letter-spacing: 2.1px; color: #b5a079; }
.sidebar {
  width: 236px; padding: 22px 16px 18px;
  border-right: 1px solid #665131;
  background: radial-gradient(ellipse at 20% 90%, #74604012, transparent 55%), linear-gradient(145deg, #151611, #0c0d0b 60%);
  overflow-y: auto;
}
.sidebar .brand { padding-left: 0; margin-bottom: 24px; padding-bottom: 25px; position: relative; }
.sidebar .brand::after { content: '◆'; position: absolute; bottom: 0; color: var(--gold); font-size: 7px; width: 105px; background: linear-gradient(90deg, transparent, #c8a565 40%, transparent 40%, transparent 60%, #c8a565 60%, transparent) center / 100% 1px no-repeat; }
.workspace { padding: 10px; margin-bottom: 25px; border-color: #393222; border-radius: 5px; background: #b7955710; }
.workspace-icon { color: var(--gold); background: #b7955714; border-color: #685334; border-radius: 4px; }
.workspace strong { font-family: var(--serif); font-size: 14px; font-weight: 400; }
.workspace small { font-size: 9px; }
.workspace > svg { color: #a88e60; }
.nav-label { color: #92846b; font-size: 8px; letter-spacing: 2px; margin-bottom: 9px; }
.nav-link { min-height: 44px; margin: 5px 0; font-family: var(--serif); font-size: 15px; color: #d0cabc; border: 1px solid transparent; border-radius: 5px; }
.nav-link svg { color: var(--gold); width: 18px; height: 18px; }
.nav-link:hover { background: #c3a2690d; color: #fff1d5; border-color: #625034; }
.nav-link.active { background: linear-gradient(110deg, #65523270, #2d271bc0); color: #f8e6bf; border-color: #a18652; box-shadow: inset 0 0 14px #e0bf7520, 0 2px 12px #0003; }
.nav-link .count { background: #73402a40; color: #edb595; font-family: 'Segoe UI', Arial, sans-serif; }
.nav-group + .nav-group { margin-top: 25px; padding-top: 24px; border-top: 1px solid #59492f; }
.secure-note { color: #a3977f; font-size: 9px; }
.profile { border-color: #57462b; }
.profile-name strong { color: #e8ddc8; }
.avatar, .avatar.v0, .avatar.v1, .avatar.v2, .avatar.v3, .avatar.v4 { color: #dcc497; background: radial-gradient(circle at 30% 20%, #4a422e, #1d1d17); border: 1px solid #7d6842; }
.main { margin-left: 236px; }
.topbar { height: 67px; padding: 0 28px; background: #0c0d0bc9; border-bottom: 1px solid #4b3c25; }
.breadcrumb { color: #ac9872; font-size: 11px; }
.breadcrumb b { color: #e8ddc8; font-family: var(--serif); font-size: 15px; }
.topbar-date { color: #c4bba9; }
.topbar-date svg { color: var(--gold); }
.live-pill { color: #afa894; }
.live-dot { background: var(--green); box-shadow: 0 0 8px #a3c68c33; }
.content { padding: 25px 28px 22px; max-width: 1780px; }
.page-heading { align-items: center; margin-bottom: 23px; }
.page-heading h1 { font-size: 29px; letter-spacing: -.5px; font-weight: 400; color: #f1eadb; }
.page-heading p { font-size: 11px; }
.week-select { background-color: #141510; border-color: #675233; color: #e1ceb0; border-radius: 5px; }

/* The estate image remains decorative: all labels and controls are real HTML. */
.estate-banner {
  min-height: 186px; margin-bottom: 26px; padding: 18px 28px;
  display: flex; gap: 19px; align-items: center; position: relative; overflow: hidden;
  border: 1px solid #77603a; border-radius: 7px;
  background: linear-gradient(90deg, #090a08e0, #090a0860 55%, #090a0810), url('/assets/caravelli-estate.e8a1207ea67a.webp') center 55% / cover, #151610;
  box-shadow: inset 0 0 25px #0008, 0 8px 30px #0003;
}
.estate-banner::after { content: ''; position: absolute; inset: 7px; border: 1px solid #c8aa6421; border-radius: 3px; pointer-events: none; }
.banner-crest { width: 128px; height: 128px; filter: drop-shadow(0 4px 8px #000); }
.banner-copy { position: relative; text-align: center; text-shadow: 0 2px 8px #000; }
.banner-copy .eyebrow { font-size: 8px; letter-spacing: 4px; margin-bottom: 6px; }
.banner-name { font-family: var(--serif); font-size: clamp(32px, 3.2vw, 54px); letter-spacing: 6px; line-height: 1.1; color: #eddaad; }
.banner-subtitle { color: #dec494; font-size: 9px; letter-spacing: 4px; display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 10px; }
.banner-subtitle span { width: 35px; height: 1px; background: #bc9b60; }
.banner-values { font-size: 7px; letter-spacing: 2.8px; color: #d8c7a5; margin-top: 19px; }
.banner-values i { margin: 0 11px; font-style: normal; color: #ddbc75; }
.hero-grid { gap: 16px; margin-bottom: 17px; grid-template-columns: 1.55fr 1fr; }
.hero, .deadline-card { border: 1px solid #645132; border-radius: 7px; padding: 22px 24px; background: radial-gradient(ellipse at 100% 0, #8a713219, transparent 65%), linear-gradient(135deg, #1b1b16, #11120f); box-shadow: inset 0 1px #ddbc7510; }
.hero::after { border-color: #dbc18b0b; }
.hero .eyebrow { color: #c2a774; }
.hero h2 { font-size: 25px; color: #eee2c9; font-weight: 400; }
.hero h2 span { color: #aaa18e; font-family: 'Segoe UI', Arial, sans-serif; font-size: 11px; }
.hero-progress-label { color: #b5ad9b; margin-top: 21px; }
.hero-progress-label strong { color: #e7c990; }
.progress, .progress::-webkit-progress-bar { background: #343022; }
.progress::-webkit-progress-value { background: linear-gradient(90deg, #9b793e, #eed49d); }
.progress::-moz-progress-bar { background: #d3b478; }
.deadline-top { color: #c9bba2; }
.deadline-date { font-family: var(--serif); color: #eaddc2; font-size: 23px; font-weight: 400; }
.deadline-date span { font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; }
.deadline-foot { color: #a89d85; font-size: 9px; }
.chip { background: #b4955e14; color: #d7c39c; border-radius: 4px; }
.chip.open { color: #cbbf9f; background: #bca77d14; }
.chip.waived { color: #b8c7ce; background: #a5b5da12; }
.chip.paid, .chip.green, .chip.approved, .chip.done { color: var(--green); background: #a3c68c12; }
.chip.red, .chip.overdue, .chip.blocked { color: var(--red); background: #d7744918; }
.chip.amber, .chip.partial, .chip.pending { color: var(--amber); background: #d9ad5318; }
.stats-grid { gap: 14px; margin-bottom: 22px; }
.stat { border: 1px solid #77603b; border-radius: 7px; padding: 17px 19px; background: linear-gradient(160deg, #302b1e70, #11120f 65%); box-shadow: inset 0 1px #d9b76c12, 0 3px 15px #0002; }
.stat-top { color: #d7cdb9; font-size: 11px; margin-bottom: 10px; }
.stat-icon, .stat-icon.green, .stat-icon.amber, .stat-icon.red { background: transparent; color: var(--gold); width: 29px; height: 29px; }
.stat-icon svg { width: 23px; height: 23px; }
.stat-value { font-family: var(--serif); font-weight: 400; font-size: 29px; letter-spacing: -.5px; color: #f2e9d6; }
.stat-value .unit { font-family: var(--serif); color: #ccb88d; font-size: 20px; }
.stat-foot { color: #a79d87; font-size: 9px; line-height: 1.5; }

/* Panels, journals, settings and dialogs share the same material treatment. */
.panel { border-color: #6b5634; border-radius: 7px; background: linear-gradient(145deg, #171813, #10110e); box-shadow: inset 0 1px #dfbd6d0b, 0 4px 20px #0002; }
.panel-heading { padding: 18px 20px; }
.panel-heading h2 { font-size: 18px; font-weight: 400; color: #e9ddc5; }
.panel-heading p { color: #a89e8b; font-size: 10px; }
.collection-summary { margin-bottom: 18px; }
.panel-controls { padding: 0 20px 15px; gap: 12px; flex-wrap: wrap; }
.tabs { background: #0e0f0c; border-color: #3b3324; border-radius: 5px; }
.tab { color: #b4aa94; font-size: 10px; }
.tab.active { color: #efd8a7; background: #b8995828; }
.tab .tab-count { color: #c4b38d; }
.search { flex: 1; min-width: 150px; max-width: 260px; }
.search input { color: #d9cdb5; background: #0d0e0b; border-color: #443a27; }
.search svg { color: #b19a6d; }
th { color: #b5a78a; background: #25231b; border-color: #51432c; font-size: 9px; font-weight: 500; letter-spacing: .4px; }
td { border-color: #373124; color: #ded8ca; padding-top: 15px; padding-bottom: 15px; }
tbody tr:hover { background: #d9b66b07; }
.person-name { color: #eee5d4; font-size: 12px; }
.person-sub { color: #a89c84; }
.money-label { color: #e0d3b8; }
.money-label small { color: #a6997e; }
.money-cell.green .money-label { color: #c4d7af; }
.table-footer { border-color: #4d402b; color: #a5997f; }
.notice, .notice.demo { border-color: #59472a; background: #a8853910; color: #c8b78e; border-radius: 5px; }
.notice.demo { font-size: 9px; padding: 8px 12px; margin-bottom: 16px; }
.notice a, .notice button { color: var(--gold-light); }
.sync-notice { border-color: #4a5a36; background: #a3c68c08; color: #bdc9ab; }
.empty h3 { color: #e3d6ba; }
.empty svg { color: var(--gold); }
.settings-section + .settings-section, .form-footer { border-color: #4b3d29; }
.settings-section h2, .help-card h3 { font-size: 19px; font-weight: 400; }
.timeline-entry { border-color: #423824; }
.timeline-dot { background: var(--gold); box-shadow: 0 0 0 3px #d3b47812; }
.timeline-entry time { color: #b1a184; }
.help-link { color: #b6a27d; }
.strike { color: #938875; }
dialog { background: linear-gradient(135deg, #1c1d17, #10110e); border-color: #a08450; border-radius: 8px; box-shadow: 0 25px 100px #000b; }
dialog::backdrop { background: #050603cc; }
.modal-header, .modal-footer { border-color: #514329; }
.modal-header h2 { font-size: 24px; font-weight: 400; color: #edddbc; }
#toast { color: #eeddbb; background: #282419; border-color: #b5965c; border-radius: 5px; }
#toast.error { color: #f0baa5; background: #332219; border-color: #aa6f52; }
.page-footer { color: #9b8b6a; font-size: 8px; padding-top: 25px; letter-spacing: .5px; }
.footer-divider { padding: 0 10px; color: #655334; }

.overview-columns { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.overview-columns > .panel { min-width: 0; }
.overview-aside { display: grid; gap: 18px; min-width: 0; }
.overview-aside .panel-heading { padding: 16px; gap: 8px; }
.overview-aside h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.overview-aside h2 svg { width: 18px; height: 18px; color: var(--gold); }
.dues-list { padding: 0 12px; }
.due-row { display: flex; gap: 9px; align-items: center; padding: 13px 0; border-top: 1px solid #4a3d27; }
.due-row .avatar { width: 30px; height: 30px; font-size: 9px; }
.due-person { flex: 1; min-width: 0; }
.due-person strong, .due-amount strong { font-size: 11px; font-weight: 500; display: block; }
.due-person strong { overflow-wrap: anywhere; }
.due-person small { display: block; font-size: 9px; margin-top: 4px; }
.due-amount { text-align: right; }
.due-amount strong { color: #e8d4ac; font-variant-numeric: tabular-nums; white-space: nowrap; }
.due-amount .chip { font-size: 8px; padding: 4px 5px; margin-top: 5px; }
.due-row .icon-btn { padding: 3px; }
.due-row .icon-btn svg { width: 14px; }
.dues-complete { display: flex; gap: 9px; align-items: center; padding: 12px 4px 24px; color: #c6d4b2; font-size: 11px; line-height: 1.6; }
.panel-more { border-top: 1px solid #4a3d27; padding: 11px 16px; font-size: 10px; color: var(--gold); display: flex; justify-content: space-between; align-items: center; }
.panel-more:hover { background: #d3b4780a; }
.panel-more svg { width: 13px; height: 13px; }
.preview-timeline { padding: 0 18px 7px; }
.preview-entry { display: flex; gap: 13px; padding: 12px 0; border-top: 1px solid #403623; }
.preview-entry .timeline-dot { margin-top: 6px; width: 5px; height: 5px; }
.preview-entry strong { display: block; font-family: var(--serif); font-size: 13px; font-weight: 400; color: #e6d9bd; }
.preview-entry small { display: block; font-size: 9px; margin-top: 5px; }
.preview-entry time { display: block; color: #a6987c; font-size: 8px; margin-top: 5px; }
.preview-empty { padding: 5px 0 15px; color: var(--muted); font-size: 11px; }
.week-management { padding-inline: 2px; }

/* Login, waiting for approval and blocked states retain their existing actions. */
.login-screen { grid-template-columns: minmax(0, 1.25fr) minmax(400px, 1fr); background: #0c0d0a; }
.login-story {
  padding: 40px 54px 28px; position: relative; isolation: isolate; border-color: #7b633b;
  background: linear-gradient(180deg, #090a07b0, #090a0750 45%, #090a08e6), url('/assets/caravelli-estate.e8a1207ea67a.webp') 71% center / cover, #181a14;
}
.login-story::after { content: ''; position: absolute; inset: 16px; border: 1px solid #d1ad6a35; pointer-events: none; z-index: -1; }
.login-story .brand { align-self: flex-start; margin-bottom: auto; }
.login-story .brand-crest { width: 95px; height: 95px; }
.login-story .brand-word { font-size: 26px; }
.login-title { padding: 85px 0 90px; }
.login-title .eyebrow { color: #e9ce98; letter-spacing: 3px; font-size: 9px; }
.login-title h1 { color: #f2ead9; font-family: var(--serif); font-size: clamp(43px, 4.5vw, 70px); font-weight: 400; line-height: 1.15; letter-spacing: -1.8px; text-shadow: 0 3px 18px #000; }
.login-title h1 span { color: #e5c68c; }
.login-title > p { color: #d1c6b2; font-size: 13px; max-width: 330px; text-shadow: 0 1px 6px #000; }
.login-features { gap: 19px; border-top: 1px solid #a689514a; padding-top: 23px; }
.login-features span { color: #d7c9ae; font-size: 9px; }
.login-features svg { color: #e3c48b; }
.login-story .page-footer { color: #b6a17c; padding-top: 25px; font-size: 7px; }
.login-side { padding: 54px; background: radial-gradient(ellipse at 100% 0, #c4a46810, transparent 60%); }
.login-card { max-width: 390px; padding: 35px 30px 26px; border: 1px solid #645133; border-radius: 8px; background: linear-gradient(145deg, #23221860, #10110d); box-shadow: 0 16px 60px #0004, inset 0 1px #dec28a15; }
.login-eyebrow { font-size: 7px; letter-spacing: 1.8px; margin-bottom: 30px; }
.login-icon { width: 53px; height: 53px; background: #a9853d12; color: #dfbf86; border: 1px solid #9f824c; border-radius: 50%; margin-bottom: 25px; }
.login-card h2 { font-family: var(--serif); font-size: 30px; letter-spacing: -.6px; font-weight: 400; color: #f0e3c9; }
.login-card > p:not(.eyebrow) { color: #bdb19c; font-size: 12px; line-height: 1.9; margin-bottom: 25px; }
.login-card > .btn { min-height: 46px; font-size: 11px; }
.login-card > .btn.primary { justify-content: space-between; gap: 7px; }
.login-foot { color: #aa9a7c; font-size: 9px; line-height: 1.7; align-items: center; }
.login-card .notice { margin-bottom: 0; font-size: 10px; }
.login-card .notice.demo { font-size: 9px; }

/* Member directory: restrained gold details, clear hierarchy, and generous row spacing. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.members-page { padding-top: 7px; }
.members-eyebrow { margin-bottom: 12px; letter-spacing: 3px; font-size: 8px; }
.members-page .page-heading { margin-bottom: 27px; }
.members-page .page-heading h1 { font-size: 35px; letter-spacing: -.7px; }
.members-page .page-heading p { margin-top: 9px; font-size: 12px; color: #afa692; line-height: 1.7; }
.members-page .heading-actions .btn { min-height: 42px; padding-inline: 17px; }
.member-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #5a4a30; background: linear-gradient(110deg, #25211670, #13140f 70%); border-radius: 8px; padding: 22px 0; margin-bottom: 28px; }
.member-metric { position: relative; display: grid; grid-template-columns: 39px 1fr; column-gap: 14px; padding: 0 25px; }
.member-metric + .member-metric { border-left: 1px solid #4a3f2c; }
.member-metric-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #a98b4d38; color: #cfb47c; border-radius: 9px; background: #c9a15c08; margin-top: 3px; }
.member-metric-icon svg { width: 18px; height: 18px; }
.member-metric > div > span { display: block; font-size: 11px; color: #c1b69e; }
.member-metric strong { display: block; font-family: var(--serif); font-size: 35px; font-weight: 400; color: #f0e2c5; margin-top: 4px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.member-metric > small { grid-column: 2; color: #998d74; font-size: 9px; margin-top: 5px; }
.directory-panel { border-color: #655333; background: linear-gradient(135deg, #181913, #11120f 60%); border-radius: 9px; }
.directory-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 24px 21px; }
.directory-heading h2 { font-size: 23px; font-weight: 400; color: #eee2ca; letter-spacing: -.3px; }
.directory-heading p { font-size: 11px; color: #a89e88; margin-top: 7px; line-height: 1.6; }
.directory-seal { display: flex; align-items: center; gap: 7px; font-family: var(--serif); letter-spacing: 2px; font-size: 10px; color: #9f885e; }
.directory-seal svg { width: 15px; height: 15px; }
.directory-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 0 24px 22px; }
.directory-tabs { display: inline-flex; align-items: center; gap: 3px; padding: 4px; border-radius: 6px; background: #0c0d0a; border: 1px solid #3a3325; }
.directory-tab { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 4px; min-height: 32px; padding: 6px 12px; font-size: 11px; font-weight: 500; color: #b0a58d; }
.directory-tab:hover { color: #e3cea3; background: #d0b06b0a; }
.directory-tab.active { color: #f0d7a4; border-color: #a8894e45; background: linear-gradient(135deg, #66502c55, #2a2418); box-shadow: 0 1px 6px #0004; }
.directory-tab > span { font-size: 9px; color: #a99b7a; padding: 2px 5px; border-radius: 3px; background: #bfa5760d; font-variant-numeric: tabular-nums; }
.directory-tab.active > span { color: #e1c48a; background: #bfa57617; }
.directory-tools { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 440px; }
.directory-search { position: relative; flex: 1; min-width: 155px; }
.directory-search > svg { position: absolute; left: 12px; top: 12px; width: 15px; height: 15px; color: #a99468; pointer-events: none; }
.directory-search input { height: 39px; padding: 10px 12px 10px 36px; font-size: 11px; border-radius: 5px; background: #0d0e0b; border-color: #4a3e29; }
.directory-search input::placeholder { color: #968b75; }
.directory-tools select { width: 132px; min-width: 100px; height: 39px; padding: 8px 27px 8px 12px; border-radius: 5px; font-size: 11px; color: #cfc0a0; background-color: #151610; border-color: #4a3e29; }
.directory-table-wrap { overflow-x: auto; }
.directory-table { width: 100%; }
.directory-table th { background: #25231b; border-color: #51432c; padding: 13px 18px; font-size: 9px; letter-spacing: 1px; color: #b4a483; }
.directory-table th:first-child, .directory-table td:first-child { padding-left: 24px; }
.directory-table th:last-child, .directory-table td:last-child { padding-right: 24px; }
.directory-table td { padding: 18px; border-bottom: 1px solid #bca06915; font-size: 11px; }
.directory-table tbody tr { background: transparent; }
.directory-table tbody tr:hover { background: #ba9d5c07; }
.directory-table .person { gap: 13px; }
.directory-table .avatar { width: 42px; height: 42px; font-family: var(--serif); font-size: 14px; color: #e8d2a1; border-color: #a689514d; background: radial-gradient(circle at 30% 20%, #49402c, #1d1e16); }
.directory-table .person-name { font-family: var(--serif); font-size: 16px; font-weight: 400; line-height: 1.3; }
.directory-table .person-sub { font-size: 9px; color: #a3967c; letter-spacing: .2px; margin-top: 5px; }
.directory-rank { display: inline-flex; align-items: center; max-width: 190px; white-space: normal; overflow-wrap: anywhere; padding: 5px 9px; border: 1px solid #aa8c4d30; background: #b1955d0a; color: #d5c09a; border-radius: 4px; font-size: 10px; }
.directory-source { display: inline-flex; align-items: center; gap: 9px; color: #c4b9a2; font-size: 11px; }
.directory-source > svg { width: 16px; height: 16px; color: #ad966b; }
.directory-source small { display: block; margin-top: 4px; color: #928771; font-size: 9px; }
.directory-joined { color: #bfb49d; font-size: 11px; font-variant-numeric: tabular-nums; }
.member-status { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 62px; padding: 5px 9px; border: 1px solid #a3c68c23; background: #9cbb7e0a; border-radius: 20px; color: #b0c794; font-size: 10px; font-weight: 400; white-space: nowrap; }
.member-status > span { width: 5px; height: 5px; border-radius: 50%; background: #a5c283; }
.member-status.is-archived { color: #b1a791; border-color: #b1a7912b; background: #a99b7608; }
.member-status.is-archived > span { background: #9a8d72; }
.directory-archived .person-name { color: #bdb5a4; }
.directory-archived .avatar { opacity: .65; }
.directory-action { text-align: right; }
.directory-action .btn { margin-left: 6px; }
.member-edit { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 9px; color: #d3b982; font-size: 10px; border: 1px solid #ac8b4a2b; border-radius: 4px; background: #c7a66605; }
.member-edit:hover { background: #c7a66612; border-color: #b4995c78; color: #f1d8a3; }
.member-edit svg { width: 13px; height: 13px; }
.directory-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 15px 24px; border-top: 1px solid #53432a; background: #080a060f; font-size: 10px; color: #a99b7d; }
.directory-footer > span:last-child { display: flex; align-items: center; gap: 6px; font-size: 9px; color: #94866a; }
.directory-footer svg { width: 12px; height: 12px; }
.directory-access-note { display: flex; align-items: flex-start; gap: 8px; padding: 18px 3px 0; color: #a4977c; font-size: 10px; line-height: 1.8; }
.directory-access-note > svg { margin-top: 2px; width: 13px; height: 13px; color: #9d865b; }
.directory-access-note a { display: inline-flex; align-items: center; gap: 4px; color: #d0b57d; margin-left: 7px; }
.directory-access-note a:hover { color: #f0dba9; text-decoration: underline; }
.directory-access-note a svg { width: 11px; height: 11px; }

.member-modal { width: min(570px, calc(100vw - 32px)); border-color: #9b7e48; }
.member-modal .modal-header { padding: 25px 28px 22px; }
.member-modal .modal-header h2 { font-size: 27px; }
.member-modal .modal-header p { max-width: 390px; line-height: 1.8; color: #b4a68a; }
.member-modal .modal-body { padding: 24px 28px; gap: 24px; }
.member-profile-preview { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid #9c7e4438; border-radius: 6px; background: linear-gradient(120deg, #a5833b13, #11120e); }
.member-profile-preview .avatar, .member-new-avatar { width: 45px; height: 45px; flex-shrink: 0; }
.member-new-avatar { display: grid; place-items: center; color: #d8b775; background: #be9a4b0e; border: 1px solid #987d434f; border-radius: 50%; }
.member-new-avatar svg { width: 22px; height: 22px; }
.member-profile-preview > div { flex: 1; min-width: 0; }
.member-profile-preview strong { display: block; font-family: var(--serif); font-size: 17px; font-weight: 400; color: #e8d8b7; overflow-wrap: anywhere; }
.member-profile-preview > div > span { display: block; font-size: 10px; color: #a99a7d; margin-top: 5px; line-height: 1.6; }
.member-profile-preview .member-status { font-size: 9px; }
.member-form-section > .eyebrow { font-size: 8px; letter-spacing: 2px; margin-bottom: 17px; }
.member-form-section label { font-size: 11px; gap: 9px; }
.member-form-section label.full { position: relative; }
.member-form-section label.full > small { position: absolute; right: 0; top: 0; font-size: 9px; color: #9d8f73; font-weight: 400; }
.member-form-section input { min-height: 43px; font-size: 12px; }
.member-form-section .member-field-help { color: #a39478; font-size: 10px; font-weight: 400; line-height: 1.6; }
.member-active-control { padding: 16px; background: #b9954d09; border: 1px solid #8f764339; border-radius: 5px; }
.member-active-control small { font-size: 10px; }
.member-form-note { display: flex; align-items: flex-start; gap: 9px; font-size: 10px; line-height: 1.8; color: #b6a688; }
.member-form-note svg { width: 15px; height: 15px; margin-top: 2px; color: #c9ae72; }
.member-modal .modal-footer { padding: 18px 28px; gap: 10px; background: #06080320; }

@media (max-width: 1150px) {
  .member-metric { padding-inline: 19px; column-gap: 10px; }
  .member-metric > div > span { font-size: 10px; }
  .directory-toolbar { gap: 14px; }
  .directory-tools { max-width: none; }
  .directory-table th, .directory-table td { padding-inline: 14px; }
  .directory-table .person-name { font-size: 15px; }
}
@media (max-width: 700px) {
  .members-page .page-heading { gap: 18px; margin-bottom: 22px; }
  .members-page .page-heading h1 { font-size: 31px; }
  .members-page .page-heading p { font-size: 11px; }
  .members-page .heading-actions .btn { width: 100%; margin: 0; min-height: 43px; font-size: 11px; }
  .member-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 16px 0; margin-bottom: 22px; }
  .member-metric { display: flex; flex-direction: column; padding: 0 13px; gap: 0; }
  .member-metric-icon { width: 28px; height: 28px; border-radius: 6px; margin: 0 0 10px; }
  .member-metric-icon svg { width: 15px; height: 15px; }
  .member-metric > div > span { font-size: 9px; line-height: 1.6; min-height: 29px; }
  .member-metric strong { font-size: 29px; margin-top: 5px; }
  .member-metric > small { display: none; }
  .directory-heading { padding: 20px 17px 18px; }
  .directory-heading h2 { font-size: 21px; }
  .directory-heading p { font-size: 10px; }
  .directory-seal { display: none; }
  .directory-toolbar { padding: 0 16px 19px; gap: 13px; }
  .directory-tabs { width: 100%; }
  .directory-tab { flex: 1; padding-inline: 7px; min-height: 34px; font-size: 10px; gap: 7px; }
  .directory-tools { width: 100%; gap: 8px; }
  .directory-search { min-width: 0; }
  .directory-search input { font-size: 10px; padding-left: 32px; }
  .directory-search > svg { left: 10px; width: 14px; }
  .directory-tools select { width: 106px; min-width: 90px; font-size: 10px; padding-left: 9px; }
  .directory-table-wrap { overflow: visible; }
  .directory-table, .directory-table tbody { display: block; white-space: normal; }
  .directory-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .directory-table tbody { padding: 0 13px 13px; }
  .directory-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 15px; border: 1px solid #79613844; border-radius: 6px; padding: 17px; background: #d0ad6003; }
  .directory-table tr + tr { margin-top: 10px; }
  .directory-table td, .directory-table td:first-child, .directory-table td:last-child { display: block; padding: 0; border: 0; min-width: 0; white-space: normal; }
  .directory-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 7px; font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: #a2967c; }
  .directory-table .directory-identity { grid-column: 1 / -1; padding-bottom: 15px; border-bottom: 1px solid #8d744329; }
  .directory-table .person-name { font-size: 18px; overflow-wrap: anywhere; }
  .directory-table .person-sub { font-size: 9px; overflow-wrap: anywhere; }
  .directory-table .person { align-items: center; }
  .directory-table .person > div { min-width: 0; }
  .directory-table .avatar { width: 41px; height: 41px; }
  .directory-source { align-items: flex-start; font-size: 10px; }
  .directory-source small { font-size: 8px; line-height: 1.5; }
  .directory-source > svg { width: 14px; height: 14px; }
  .directory-table .directory-action { grid-column: 1 / -1; padding-top: 1px; }
  .directory-action .member-edit { width: 100%; justify-content: center; min-height: 37px; background: #c7a66608; font-size: 11px; }
  .directory-action .btn { width: 100%; min-height: 37px; margin: 8px 0 0; }
  .directory-footer { padding: 14px 17px; font-size: 9px; }
  .directory-footer > span:last-child { font-size: 8px; }
  .directory-access-note { padding: 15px 2px 0; font-size: 9px; }
  .directory-access-note a { margin-left: 0; }
  .member-modal .modal-header { padding: 22px; }
  .member-modal .modal-body { padding: 20px 22px; gap: 21px; }
  .member-modal .modal-footer { padding: 16px 22px; }
  .member-profile-preview { flex-wrap: wrap; padding: 14px; }
  .member-profile-preview strong { font-size: 16px; }
  .member-profile-preview .member-status { margin-left: 0; }
  .member-form-section .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .member-form-section .form-grid .full { grid-column: 1; }
}

@media (min-width: 1700px) {
  .content { padding: 28px 34px; }
  .estate-banner { min-height: 205px; }
  .overview-columns { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1350px) {
  .sidebar { width: 218px; padding-inline: 12px; }
  .main { margin-left: 218px; }
  .content { padding-inline: 22px; }
  .overview-columns { grid-template-columns: minmax(0, 1fr); }
  .overview-aside { grid-template-columns: 1fr 1fr; }
  .brand-word { font-size: 22px; }
  .login-story { padding-inline: 40px; }
  .login-side { padding: 35px; }
}
@media (max-width: 1000px) {
  .banner-crest { width: 100px; height: 100px; }
  .estate-banner { min-height: 160px; padding: 20px; gap: 14px; }
  .banner-name { font-size: 35px; letter-spacing: 4px; }
  .banner-subtitle { font-size: 8px; letter-spacing: 2px; }
  .banner-values { font-size: 6px; letter-spacing: 2px; }
  .login-screen { grid-template-columns: 1.05fr 1fr; }
  .login-side { padding: 24px; }
  .login-card { padding: 28px 23px; }
  .login-story { padding-inline: 30px; }
}
@media (max-width: 850px) {
  .sidebar { width: 236px; }
  .main { margin-left: 0; }
  .topbar { height: 62px; padding-inline: 20px; }
  .content { padding: 22px 20px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-story { min-height: 390px; padding: 28px 36px 25px; border-right: 0; border-bottom: 1px solid #7b633b; background-position: 70% 55%; }
  .login-story .brand { flex-direction: row; text-align: left; gap: 10px; }
  .login-story .brand-crest { width: 60px; height: 60px; }
  .login-story .brand-word { font-size: 23px; }
  .login-title { padding: 35px 0 30px; }
  .login-title h1 { font-size: 46px; }
  .login-title .eyebrow { margin-bottom: 15px; }
  .login-side { padding: 32px 24px; }
  .login-card { max-width: 430px; }
  .hero-grid { grid-template-columns: 1.3fr 1fr; }
}
@media (max-width: 600px) {
  .content { padding: 18px 14px; }
  .topbar { padding-inline: 14px; }
  .breadcrumb { gap: 8px; font-size: 10px; }
  .breadcrumb b { font-size: 12px; }
  .estate-banner { min-height: 145px; padding: 16px 12px; gap: 5px; margin-bottom: 23px; background-position: 65% 50%; }
  .banner-crest { width: 80px; height: 90px; }
  .banner-name { font-size: clamp(23px, 6vw, 34px); letter-spacing: 2.5px; }
  .banner-copy .eyebrow { font-size: 6px; letter-spacing: 2px; }
  .banner-subtitle { font-size: 6px; gap: 7px; letter-spacing: 2px; }
  .banner-subtitle span { width: 18px; }
  .banner-values { font-size: 5px; margin-top: 14px; letter-spacing: 1px; }
  .banner-values i { margin-inline: 5px; }
  .page-heading { align-items: stretch; margin-bottom: 20px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading p { font-size: 10px; }
  .heading-actions { flex-wrap: wrap; gap: 8px; }
  .heading-actions .btn { font-size: 10px; padding-inline: 11px; }
  .week-select { max-width: none; font-size: 10px; }
  .hero-grid { grid-template-columns: 1fr; gap: 12px; }
  .hero { padding: 20px; }
  .hero h2 { font-size: 24px; }
  .hero h2 span { font-size: 10px; }
  .hero-progress-label { font-size: 10px; gap: 12px; }
  .deadline-card { padding: 17px; }
  .deadline-date { font-size: 20px; }
  .deadline-foot { font-size: 8px; }
  .stats-grid { gap: 10px; }
  .stat { padding: 14px; }
  .stat-top { font-size: 10px; min-height: 29px; gap: 6px; }
  .stat-icon svg { width: 20px; height: 20px; }
  .stat-value { font-size: 27px; overflow-wrap: anywhere; }
  .stat-value .unit { font-size: 17px; }
  .stat-foot { font-size: 8px; }
  .overview-aside { grid-template-columns: 1fr; gap: 14px; }
  .overview-columns { gap: 14px; }
  .panel-heading { padding: 16px; }
  .panel-heading h2 { font-size: 18px; }
  .panel-controls { padding-inline: 14px; }
  .collection-summary :is(th, td) { padding-inline: 8px; }
  .collection-summary .person { white-space: normal; overflow-wrap: anywhere; gap: 7px; }
  .collection-summary .avatar { width: 28px; height: 28px; }
  .tabs { width: 100%; }
  .tab { font-size: 9px; padding-inline: 6px; }
  .search { max-width: none; }
  .week-management { gap: 14px; padding: 16px 0; }
  .week-management .data-row-actions { margin-left: auto; flex-wrap: wrap; }
  .page-footer { line-height: 1.8; padding-top: 18px; font-size: 7px; }
  .login-story { min-height: 365px; padding: 26px 25px; }
  .login-story::after { inset: 10px; }
  .login-title { padding: 30px 0 26px; }
  .login-title h1 { font-size: clamp(34px, 9vw, 45px); letter-spacing: -1px; }
  .login-title .eyebrow { font-size: 7px; letter-spacing: 2px; }
  .login-features { gap: 10px 15px; padding-top: 17px; }
  .login-features span { font-size: 8px; }
  .login-side { padding: 25px 16px; }
  .login-card { padding: 28px 24px; }
  .login-eyebrow { font-size: 6px; letter-spacing: 1.7px; }
  .login-card h2 { font-size: 29px; }
}
.heading-actions .btn[data-action="share"] { display: inline-flex; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
