:root {
  --ink: #172c27;
  --muted: #6c7d77;
  --line: #dfe7e3;
  --canvas: #f4f7f5;
  --card: #ffffff;
  --green: #176b56;
  --green-dark: #0e5140;
  --green-soft: #e5f2ed;
  --gold: #d99c42;
  --gold-soft: #fff2dc;
  --rose: #a95353;
  --rose-soft: #fbeaea;
  --shadow: 0 18px 45px rgba(20, 52, 43, .08);
}

* { box-sizing: border-box; }
html { font-size: 15px; min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--green); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 22px 24px; background: var(--ink); color: white; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: white; padding: 0 8px 31px; }
.brand:hover { color: white; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #e3b663, #c9852a); color: #17372f; font: 800 21px Georgia, serif; box-shadow: inset 0 1px rgba(255,255,255,.45); }
.brand strong, .brand small { display: block; }
.brand strong { font: 700 19px Georgia, serif; letter-spacing: .01em; }
.brand small { color: #a9bbb5; font-size: 11px; margin-top: 2px; letter-spacing: .05em; text-transform: uppercase; }
.side-nav { display: grid; gap: 7px; }
.side-nav a { display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 0 13px; border-radius: 11px; color: #b8c7c2; font-weight: 600; transition: .18s ease; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: white; }
.side-nav a.active { background: rgba(255,255,255,.11); color: white; box-shadow: inset 3px 0 var(--gold); }
.nav-symbol { display: inline-grid; place-items: center; width: 23px; font-size: 20px; color: #d9a753; }
.sidebar-note { display: flex; gap: 10px; align-items: flex-start; margin-top: auto; padding: 15px 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: rgba(255,255,255,.04); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { margin-top: 2px; color: #9eafa9; font-size: 10px; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #62c79f; box-shadow: 0 0 0 4px rgba(98,199,159,.12); }

.main-panel { min-width: 0; }
.topbar { min-height: 112px; display: flex; align-items: center; gap: 18px; padding: 25px clamp(24px, 4vw, 58px); background: rgba(255,255,255,.78); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar > div { flex: 1; }
.topbar h1 { margin: 2px 0 0; font: 700 clamp(25px, 2.4vw, 34px)/1.1 Georgia, serif; }
.eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: #bcd4ca; }
.mobile-menu { display: none; border: 0; background: transparent; color: var(--ink); font-size: 25px; }
.quick-add span { font-size: 20px; line-height: 0; }
.content-wrap { padding: 34px clamp(24px, 4vw, 58px) 55px; }

.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; padding: 9px 16px; font-weight: 700; font-size: 13px; border: 1px solid transparent; }
.btn-primary { background: var(--green); border-color: var(--green); color: white; box-shadow: 0 7px 17px rgba(23,107,86,.18); }
.btn-primary:hover, .btn-primary:focus { background: var(--green-dark); border-color: var(--green-dark); color: white; }
.btn-outline-primary { color: var(--green); border-color: #9dbbb2; background: white; }
.btn-outline-primary:hover { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.btn-secondary { background: var(--ink); border-color: var(--ink); color: white; }
.btn-secondary:hover { background: #24463d; border-color: #24463d; }
.btn-quiet { color: #61736d; border-color: var(--line); background: #fff; }
.btn-quiet:hover { background: #eef3f0; color: var(--ink); }
.app-alert { display: flex; align-items: center; gap: 10px; margin: 22px clamp(24px, 4vw, 58px) 0; padding: 13px 16px; border: 1px solid #b9d9cc; border-radius: 10px; background: #edf8f3; color: #185b49; font-weight: 650; }
.app-alert .btn-close { margin-left: auto; font-size: 10px; }
.success-check { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: white; background: var(--green); }

.welcome-band { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.6fr .7fr; gap: 35px; align-items: center; min-height: 210px; padding: clamp(28px, 4vw, 45px); border-radius: 19px; background: linear-gradient(125deg, #173b33, #1c5a49); color: white; box-shadow: var(--shadow); }
.welcome-band::after { content: ""; position: absolute; right: -80px; top: -135px; width: 310px; height: 310px; border: 55px solid rgba(255,255,255,.045); border-radius: 50%; }
.welcome-band h2 { max-width: 700px; margin: 10px 0 12px; font: 700 clamp(27px, 3vw, 41px)/1.13 Georgia, serif; }
.welcome-band p:not(.eyebrow) { max-width: 640px; margin: 0; color: #c8d8d2; }
.welcome-total { position: relative; z-index: 1; padding-left: 34px; border-left: 1px solid rgba(255,255,255,.2); }
.welcome-total span, .welcome-total small, .welcome-total strong { display: block; }
.welcome-total span { color: #bdd0c9; font-size: 12px; }
.welcome-total strong { margin: 6px 0; color: #f3c875; font: 700 clamp(27px, 3vw, 40px) Georgia, serif; }
.welcome-total strong.negative { color: #ffb5ad; }
.welcome-total small { color: #9eb7ae; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.metric-card { min-width: 0; display: grid; grid-template-columns: 45px minmax(0, 1fr) 20px; gap: 12px; align-items: center; padding: 21px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 7px 25px rgba(20,52,43,.035); }
.metric-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 19px; font-weight: 700; }
.metric-icon.payment { color: var(--green); background: var(--green-soft); }
.metric-icon.income { color: #176b56; background: #dff5eb; }
.metric-icon.withdrawal { color: var(--rose); background: var(--rose-soft); }
.metric-icon.total { color: #8b641f; background: var(--gold-soft); }
.metric-icon.invoice { color: #536d87; background: #edf2f7; }
.metric-card p { margin: 0 0 3px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card strong { display: block; overflow: hidden; font: 700 19px Georgia, serif; text-overflow: ellipsis; }
.metric-card > a { color: #9bacA6; font-size: 18px; }

.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--card); box-shadow: 0 8px 30px rgba(20,52,43,.035); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 24px 25px 18px; }
.panel-heading.compact { padding-bottom: 13px; }
.panel-heading h2 { margin: 4px 0 0; font: 700 23px Georgia, serif; }
.text-link { font-size: 12px; font-weight: 750; }
.text-link span { margin-left: 5px; }
.empty-state { max-width: 510px; margin: 0 auto; padding: 58px 25px 65px; text-align: center; }
.empty-symbol { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 15px; border-radius: 16px; background: var(--green-soft); color: var(--green); font-size: 25px; }
.empty-state h3 { margin: 0 0 7px; font: 700 22px Georgia, serif; }
.empty-state p { color: var(--muted); margin: 0 auto 20px; }

.table-responsive { border-radius: 0 0 15px 15px; }
.app-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.app-table th { padding: 11px 17px; border-top: 1px solid #eef2f0; border-bottom: 1px solid var(--line); color: #788981; background: #f9fbfa; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.app-table td { padding: 14px 17px; border-bottom: 1px solid #edf1ef; color: #40534d; vertical-align: middle; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table tbody tr:hover { background: #fbfdfc; }
.app-table td > strong, .app-table td > small { display: block; }
.app-table td > strong { color: var(--ink); }
.app-table td > small { margin-top: 3px; color: #87968f; font-size: 10px; }
.date-cell { min-width: 98px; }
.date-cell strong, .date-cell span { display: inline; }
.date-cell strong { margin-right: 4px; color: var(--ink); font-size: 18px; font-family: Georgia, serif; }
.date-cell span { color: #7a8983; font-size: 10px; text-transform: uppercase; }
.type-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 20px; font-size: 10px; font-weight: 750; }
.type-badge.payment { background: var(--green-soft); color: var(--green-dark); }
.type-badge.income { background: #dff5eb; color: #12634f; }
.type-badge.withdrawal { background: var(--rose-soft); color: #8e4141; }
.file-count { display: inline-flex; align-items: center; gap: 5px; color: #587466; font-weight: 700; }
.amount-cell { color: var(--ink) !important; font: 700 14px Georgia, serif; white-space: nowrap; }
.amount-cell.income { color: var(--green) !important; }
.amount-cell.outflow { color: #8e4141 !important; }
.row-actions { min-width: 100px; text-align: right; white-space: nowrap; }
.row-actions a, .row-actions button { display: inline; border: 0; padding: 3px 5px; background: none; color: var(--green); font-size: 11px; font-weight: 700; }
.row-actions form { display: inline; }
.row-actions button { color: #a44d4d; }
.document-link { display: inline-flex; gap: 8px; align-items: center; max-width: 250px; }
.document-link > span:first-child { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; background: #eef4f1; }
.document-link strong, .document-link small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-link strong { color: var(--ink); font-size: 11px; }
.document-link small { color: #87968f; font-size: 9px; }

.page-actions { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 18px; }
.filter-bar { flex: 1; display: flex; gap: 9px; align-items: center; }
.search-box { width: min(370px, 45vw); display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.search-box span { color: #899991; font-size: 20px; }
.search-box input { width: 100%; min-height: 41px; border: 0; outline: none; color: var(--ink); background: transparent; font-size: 12px; }
.filter-bar select { min-height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 9px; background-color: white; color: #52665f; font-size: 12px; }
.split-add { display: flex; gap: 8px; }

.form-page { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(520px, 1.45fr); gap: clamp(28px, 4vw, 65px); align-items: start; max-width: 1160px; }
.form-intro { padding-top: 16px; }
.form-intro h2 { max-width: 320px; margin: 10px 0 12px; font: 700 clamp(28px, 3vw, 39px)/1.13 Georgia, serif; }
.form-intro p:last-child { max-width: 310px; color: var(--muted); line-height: 1.7; }
.form-panel { padding: clamp(22px, 3vw, 34px); }
.type-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 26px; }
.type-picker label { cursor: pointer; }
.type-picker input { position: absolute; opacity: 0; pointer-events: none; }
.type-picker label > span { display: grid; grid-template-columns: 38px 1fr; column-gap: 11px; align-items: center; min-height: 72px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; transition: .15s ease; }
.type-picker b { grid-row: 1 / span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #eef3f1; color: var(--green); font-size: 18px; }
.type-picker strong, .type-picker small { display: block; }
.type-picker strong { align-self: end; font-size: 13px; }
.type-picker small { align-self: start; color: var(--muted); font-size: 9px; }
.type-picker input:checked + span { border-color: #559582; background: #f4faf7; box-shadow: 0 0 0 2px rgba(23,107,86,.08); }
.type-picker input:focus + span { box-shadow: 0 0 0 3px rgba(23,107,86,.16); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field label:not(.file-drop) { display: block; margin-bottom: 7px; color: #42564f; font-size: 11px; font-weight: 750; }
.field > input, .field > select, .field > textarea { width: 100%; border: 1px solid #d8e1dd; border-radius: 8px; background: #fcfdfc; color: var(--ink); outline: 0; }
.field > input, .field > select { min-height: 44px; padding: 0 12px; }
.field > textarea { padding: 11px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .amount-input:focus-within { border-color: #6ba18f; box-shadow: 0 0 0 3px rgba(23,107,86,.08); background: white; }
.amount-input { display: flex; align-items: center; border: 1px solid #d8e1dd; border-radius: 8px; background: #fcfdfc; }
.amount-input > span { padding-left: 12px; color: #8a9993; }
.amount-input input { min-width: 0; width: 100%; min-height: 42px; border: 0; padding: 0 12px 0 8px; outline: 0; background: transparent; color: var(--ink); }
.field > span.field-validation-error { display: block; margin-top: 5px; color: #a14444; font-size: 10px; }
.field-help { display: block; margin-top: 5px; color: #8a9893; font-size: 9px; }
.validation-summary { margin-bottom: 16px; padding: 10px 12px; border-radius: 8px; background: var(--rose-soft); color: #8d4141; font-size: 11px; }
.validation-summary.validation-summary-valid { display: none; }
.validation-summary ul { margin: 0; padding-left: 18px; }
.file-drop { display: flex; align-items: center; gap: 13px; min-height: 78px; padding: 13px; border: 1px dashed #a9bbb4; border-radius: 10px; background: #f8fbf9; cursor: pointer; }
.file-drop:hover { border-color: var(--green); background: #f3f9f6; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-symbol { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 21px; }
.file-drop strong, .file-drop small { display: block; }
.file-drop strong { color: var(--green); font-size: 12px; }
.file-drop small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.form-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 26px; padding-top: 20px; border-top: 1px solid #edf1ef; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-band { grid-template-columns: 1.3fr .7fr; }
  .page-actions { align-items: flex-start; }
  .filter-bar { flex-wrap: wrap; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 246px; transition: transform .2s ease; box-shadow: 18px 0 45px rgba(0,0,0,.2); }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { min-height: 92px; padding: 18px 20px; }
  .content-wrap { padding: 24px 18px 40px; }
  .app-alert { margin: 16px 18px 0; }
  .welcome-band { grid-template-columns: 1fr; }
  .welcome-total { padding: 16px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.2); }
  .form-page { grid-template-columns: 1fr; }
  .form-intro { padding-top: 0; }
  .form-intro p:last-child { max-width: 600px; }
  .form-intro h2 { max-width: none; }
  .page-actions { flex-direction: column; }
  .filter-bar, .search-box { width: 100%; }
}

@media (max-width: 560px) {
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 22px; }
  .quick-add { width: 42px; padding: 0; font-size: 0; }
  .quick-add span { font-size: 20px; }
  .welcome-band { padding: 26px 22px; }
  .welcome-band h2 { font-size: 28px; }
  .metric-grid { grid-template-columns: 1fr; }
  .type-picker, .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .filter-bar select { flex: 1; }
  .split-add { width: 100%; }
  .split-add .btn { flex: 1; }
  .form-panel { padding: 19px 15px; }
}

/* Authentication and authorization */
.account-card { display: grid; grid-template-columns: 35px minmax(0, 1fr) 28px; gap: 9px; align-items: center; margin-top: auto; padding: 13px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.045); }
.account-avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: #d5a555; color: var(--ink); font: 700 16px Georgia, serif; }
.account-card strong, .account-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card strong { color: white; font-size: 11px; }
.account-card small { margin-top: 2px; color: #a6b8b1; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.account-card button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(255,255,255,.07); color: #c5d2cd; }
.account-card button:hover { background: rgba(255,255,255,.13); color: white; }
.role-readonly { padding: 7px 11px; border: 1px solid #cbd7d2; border-radius: 20px; color: #667a72; background: #f8faf9; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.error-alert { border-color: #efc4c4; background: #fff1f1; color: #8f3e3e; }
.error-check { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: white; background: #a94e4e; font-weight: 800; }
.empty-readonly { display: block; color: #71827b; font-size: 11px; }

.limit-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 21px; padding: 11px 13px; border: 1px solid #bfdbd0; border-radius: 10px; background: #f0f8f5; }
.limit-banner > span { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; background: var(--green); color: white; font: 700 18px Georgia, serif; }
.limit-banner strong, .limit-banner small { display: block; }
.limit-banner strong { color: var(--ink); font-size: 11px; }
.limit-banner small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.limit-banner.limit-reached { border-color: #e5bcbc; background: #fff2f2; }
.limit-banner.limit-reached > span { background: var(--rose); }

.permission-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.permission-legend > span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); font-size: 10px; }
.permission-legend strong { color: var(--ink); }
.role-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.role-dot.viewer { background: #7c8fa1; }
.role-dot.operator { background: #d29a3d; }
.role-dot.admin { background: var(--green); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell > span { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 10px; background: var(--green-soft); color: var(--green); font: 700 15px Georgia, serif; }
.user-cell strong, .user-cell small { display: block; }
.user-cell strong { color: var(--ink); }
.user-cell small { margin-top: 2px; color: #86958f; font-size: 10px; }
.you-label { display: inline !important; margin-left: 4px; padding: 2px 5px; border-radius: 10px; background: #eef2f0; color: #71827b !important; font-size: 8px !important; text-transform: uppercase; }
.role-badge { display: inline-flex; padding: 5px 9px; border-radius: 20px; font-size: 10px; font-weight: 750; }
.role-badge.viewer { background: #edf1f4; color: #576a7c; }
.role-badge.operator { background: var(--gold-soft); color: #865f1c; }
.role-badge.admin { background: var(--green-soft); color: var(--green-dark); }
.account-status { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; }
.account-status i { width: 7px; height: 7px; border-radius: 50%; }
.account-status.active { color: var(--green); }
.account-status.active i { background: #50af88; }
.account-status.inactive { color: #9a4a4a; }
.account-status.inactive i { background: #c86565; }
.role-picker { display: grid; gap: 8px; }
.role-picker label { cursor: pointer; }
.role-picker input { position: absolute; opacity: 0; pointer-events: none; }
.role-picker label > span { display: grid; grid-template-columns: 12px 86px minmax(0, 1fr); gap: 9px; align-items: center; min-height: 54px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.role-picker label > span strong { color: var(--ink); font-size: 11px; }
.role-picker label > span small { color: var(--muted); font-size: 9px; }
.role-picker input:checked + span { border-color: #5d9986; background: #f3faf7; box-shadow: 0 0 0 2px rgba(23,107,86,.07); }
.role-picker input:focus + span { box-shadow: 0 0 0 3px rgba(23,107,86,.14); }
.switch-field { display: flex !important; align-items: center; gap: 11px; cursor: pointer; }
.switch-field > input { position: absolute; opacity: 0; }
.switch-track { position: relative; width: 42px; height: 23px; flex: 0 0 auto; border-radius: 20px; background: #b8c3bf; transition: .15s; }
.switch-track i { position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; transition: .15s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.switch-field input:checked + .switch-track { background: var(--green); }
.switch-field input:checked + .switch-track i { transform: translateX(19px); }
.switch-field strong, .switch-field small { display: block; }
.switch-field strong { color: var(--ink); font-size: 11px; }
.switch-field small { color: var(--muted); font-size: 9px; }

/* Sign-in and first-run setup */
.auth-body { min-height: 100vh; margin: 0; background: #edf2ef; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(330px, .9fr) minmax(430px, 1.1fr); }
.auth-story { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 5vw, 70px); background: linear-gradient(145deg, #142f29, #1d5849); color: white; }
.auth-story::after { content: ""; position: absolute; right: -160px; bottom: -155px; width: 450px; height: 450px; border: 75px solid rgba(255,255,255,.04); border-radius: 50%; }
.auth-brand { position: relative; z-index: 1; padding: 0; }
.auth-story h1 { max-width: 600px; margin: 12px 0 18px; font: 700 clamp(34px, 4vw, 55px)/1.08 Georgia, serif; }
.auth-story div > p:last-child { max-width: 580px; color: #bed0c9; line-height: 1.7; }
.auth-footnote { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: #b1c5bd; }
.auth-content { display: grid; place-items: center; padding: 32px; background: #f7f9f8; }
.auth-form-wrap { width: min(100%, 440px); }
.auth-form-wrap h2 { margin: 9px 0 8px; font: 700 35px/1.15 Georgia, serif; }
.auth-lead { margin: 0 0 27px; color: var(--muted); }
.auth-form { display: grid; gap: 17px; }
.auth-submit { width: 100%; margin-top: 4px; }
.check-field { display: flex; align-items: center; gap: 8px; color: #53665f; font-size: 11px; cursor: pointer; }
.check-field input { accent-color: var(--green); }
.setup-notice { display: grid; gap: 3px; margin: 0 0 22px; padding: 13px 15px; border: 1px solid #d9c38e; border-radius: 10px; background: #fff8e8; }
.setup-notice strong { color: #6f4f17; font-size: 11px; }
.setup-notice span { color: #806d48; font-size: 10px; }
.setup-notice a { margin-top: 4px; font-size: 10px; font-weight: 800; }
.access-denied .denied-symbol { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 18px; border-radius: 15px; background: var(--rose-soft); color: var(--rose); font: 800 25px Georgia, serif; }

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 310px; padding: 30px; }
  .auth-story h1 { font-size: 34px; }
  .auth-footnote { margin-top: 38px; }
  .auth-content { padding: 45px 22px; }
  .user-page-actions { align-items: stretch; }
}

@media (max-width: 560px) {
  .permission-legend { display: grid; grid-template-columns: 1fr; width: 100%; }
  .role-picker label > span { grid-template-columns: 12px 70px minmax(0, 1fr); }
  .user-table .row-actions { min-width: 130px; }
}
