:root {
    --primary: #4f2ec7;
    --primary-dark: #3e22ab;
    --primary-soft: #f2efff;
    --green: #15863d;
    --green-soft: #effaf2;
    --blue: #1769e0;
    --orange: #e96722;
    --text: #14172a;
    --muted: #667085;
    --border: #dfe3ec;
    --surface: #ffffff;
    --background: #f7f8fb;
    --shadow: 0 10px 28px rgba(23, 27, 52, .07);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--background); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; }
.desktop-only { display: flex; }
.mobile-leading, .mobile-page-title, .mobile-header-action, .bottom-nav { display: none; }
.app-shell { width: min(100%, 920px); margin: 0 auto; padding: 26px 18px 46px; }
.wide-page .app-shell { width: min(100%, 1120px); }
.inner-page:not(.wide-page) .app-shell { width: min(100%, 720px); }

/* Header and navigation */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.topbar-inner { width: min(100%, 1180px); min-height: 68px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; }
.brand { align-items: center; gap: 10px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 21px; }
.brand b, .brand small, .desktop-user b, .desktop-user small { display: block; }
.brand b { font-size: 14px; }
.brand small, .desktop-user small { color: var(--muted); font-size: 10px; margin-top: 1px; }
.desktop-nav { align-items: center; gap: 3px; margin-left: auto; }
.desktop-nav a { padding: 9px 11px; border-radius: 9px; color: #4d5365; text-decoration: none; font-size: 13px; font-weight: 650; white-space: nowrap; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--primary); background: var(--primary-soft); }
.desktop-user { align-items: center; gap: 9px; padding-left: 16px; border-left: 1px solid var(--border); white-space: nowrap; }
.desktop-user > a { margin-left: 3px; color: var(--muted); font-size: 18px; }
.user-avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(135deg, #f0bd97, #6d392b); color: #fff; font-weight: 800; }

/* Shared controls */
.primary-button, .success-button, .outline-button, .danger-button { min-height: 46px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; font-weight: 700; text-decoration: none; cursor: pointer; }
.primary-button { width: 100%; color: #fff; background: linear-gradient(90deg, var(--primary), #5935d5); box-shadow: 0 6px 14px rgba(79,46,199,.2); }
.primary-button:hover { color: #fff; background: var(--primary-dark); }
.success-button { width: 100%; color: #fff; background: linear-gradient(90deg, #13863c, #1aa34b); }
.success-button:hover { color: #fff; background: #117635; }
.danger-button { width: 100%; color: #fff; background: linear-gradient(90deg, #c73535, #e34c4c); }
.danger-button:hover { color: #fff; background: #b52d2d; }
.outline-button { width: 100%; color: var(--text); border-color: var(--border); background: #fff; }
.outline-button:hover { color: var(--primary); border-color: #b8abea; }
.outline-button.compact { width: auto; min-height: 38px; padding: 0 14px; }
.field-label, .form-field > label { display: block; margin: 0 0 8px; color: #20243a; font-size: 12px; font-weight: 750; }
.form-field > label span { color: var(--muted); font-weight: 500; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.required { color: #dc2626 !important; }
.form-control, .form-select, .readonly-field { min-height: 46px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background-color: #fff; font-size: 13px; }
.form-control:focus, .form-select:focus { border-color: #8c79df; box-shadow: 0 0 0 3px rgba(79,46,199,.1); }
.form-field { margin-top: 19px; }
.form-errors, .errorlist { color: #a82424; font-size: 12px; }
.form-errors { margin: 14px 0; padding: 11px 13px; border: 1px solid #f2b8b8; border-radius: 7px; background: #fff4f4; }
.errorlist { margin: 5px 0 0; padding-left: 18px; }
.empty-state { padding: 28px 16px; color: var(--muted); text-align: center; }
.amount { color: var(--green); font-weight: 800; white-space: nowrap; }

/* Notices */
.notice-stack { margin-bottom: 14px; }
.notice { min-height: 48px; padding: 10px 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 1px solid #9fd5ae; border-radius: 7px; color: #155c2a; background: #f1fbf3; font-weight: 700; }
.notice > i { color: #169447; font-size: 19px; }
.notice button { padding: 4px; border: 0; color: inherit; background: transparent; }
.notice-error { color: #922727; border-color: #efb4b4; background: #fff3f3; }
.notice-error > i { color: #c93232; }

/* Login */
.login-screen { position: relative; min-height: 100vh; padding: 40px 18px 70px; display: grid; justify-items: center; align-items: start; background: linear-gradient(to bottom, rgba(12,39,79,.05), rgba(8,39,71,.64)), url("../images/temple-login.png") center 45%/cover no-repeat; isolation: isolate; }
.login-screen::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, transparent 56%, rgba(7,37,65,.55)); }
.login-card { width: min(100%, 390px); margin-top: clamp(210px, 32vh, 320px); padding: 30px 28px 25px; border-radius: 13px; background: rgba(255,255,255,.97); box-shadow: 0 20px 55px rgba(4,23,43,.27); text-align: center; }
.login-logo { width: 52px; height: 52px; margin: 0 auto 8px; display: grid; place-items: center; color: #ec641d; font-size: 34px; }
.login-card h1 { margin: 0; font-size: 20px; font-weight: 800; }
.login-card > p { margin: 8px 0 22px; color: var(--muted); font-size: 13px; }
.input-with-icon { position: relative; display: block; margin-bottom: 13px; }
.input-with-icon > i { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: #667085; font-size: 16px; }
.input-with-icon input { width: 100%; height: 47px; padding: 0 44px 0 40px; border: 1px solid var(--border); border-radius: 7px; outline: 0; }
.input-with-icon input:focus { border-color: #8c79df; box-shadow: 0 0 0 3px rgba(79,46,199,.1); }
.input-with-icon button { position: absolute; top: 0; right: 4px; width: 40px; height: 47px; border: 0; background: transparent; color: #667085; }
.login-options { margin: 15px 0 19px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.login-options label { display: flex; align-items: center; gap: 7px; }
.login-options input { width: 14px; height: 14px; accent-color: var(--primary); }
.login-options span { color: var(--primary); font-weight: 650; }
.login-error { margin-bottom: 13px; padding: 9px; display: flex; gap: 8px; align-items: center; border-radius: 7px; color: #9a2525; background: #fff0f0; font-size: 12px; text-align: left; }
.login-screen footer { position: absolute; bottom: 34px; color: #fff; font-size: 11px; text-shadow: 0 1px 4px rgba(0,0,0,.45); }

/* Dashboard */
.welcome-block { margin-bottom: 20px; }
.welcome-block h1 { margin: 0; font-size: 22px; font-weight: 800; }
.welcome-block p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.stats-grid { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-card { min-height: 126px; padding: 15px; display: flex; flex-direction: column; border: 1px solid; border-radius: 11px; text-decoration: none; }
.stat-card small { font-size: 11px; font-weight: 700; }
.stat-card strong { margin: 8px 0 auto; font-size: 23px; line-height: 1.05; }
.stat-card span { font-size: 10px; font-weight: 750; }
.stat-blue { color: #155bd2; border-color: #cbdcff; background: #f2f6ff; }
.stat-green { color: #137633; border-color: #cce8d4; background: #f2faf4; }
.stat-orange { color: #db5c16; border-color: #f4dbc9; background: #fff7f0; }
.stat-purple { color: var(--primary); border-color: #dbd2fb; background: #f7f4ff; }
.panel { margin-top: 14px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 3px 11px rgba(22,29,53,.03); }
.panel h2 { margin: 0 0 11px; font-size: 14px; font-weight: 800; }
.access-row { min-height: 34px; display: grid; grid-template-columns: 20px 1fr 1.2fr; align-items: center; gap: 8px; }
.access-row i { font-size: 16px; }
.access-row span { font-size: 12px; }
.access-row strong { font-size: 12px; font-weight: 650; }
.text-blue { color: var(--blue); }.text-green { color: var(--green); }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-title span, .panel-title p { color: var(--muted); font-size: 11px; }
.summary-row { min-height: 47px; display: grid; grid-template-columns: 22px 1fr auto 14px; align-items: center; gap: 9px; border-top: 1px solid #edf0f5; color: var(--text); text-decoration: none; font-size: 12px; }
.summary-row:first-of-type { border-top: 0; }
.summary-row strong { font-size: 12px; }
.summary-row .bi-chevron-right { color: #8f96a7; font-size: 11px; }
.color-dot-blue { color: var(--blue); }.color-dot-green { color: var(--green); }.color-dot-orange { color: var(--orange); }
.dashboard-v2 .app-shell { width: min(100%, 1240px); padding-top: 30px; }
.dashboard-heading-row { margin-bottom: 26px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.dashboard-heading-row h1 { margin: 0; font-size: 28px; font-weight: 900; }
.dashboard-heading-row p { margin: 5px 0 0; color: #3f4558; font-size: 15px; font-weight: 650; }
.dashboard-date-filter { position: relative; min-width: 172px; }
.dashboard-date-filter input { width: 100%; height: 52px; padding: 0 45px 0 17px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: #fff; font-weight: 800; }
.dashboard-date-filter i { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #667085; }
.dashboard-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dashboard-stat-card { min-height: 160px; padding: 21px; display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto 1fr; gap: 0 18px; border: 1px solid #e0e4ee; border-radius: 13px; color: var(--text); background: #fff; text-decoration: none; box-shadow: 0 7px 20px rgba(27,34,63,.04); }
.dashboard-stat-card:hover { color: var(--text); transform: translateY(-1px); box-shadow: 0 12px 26px rgba(27,34,63,.08); }
.dashboard-stat-card > span { width: 56px; height: 56px; grid-row: 1 / 4; display: grid; place-items: center; border-radius: 13px; font-size: 27px; }
.dashboard-stat-card small { align-self: end; color: var(--muted); font-size: 13px; font-weight: 750; }
.dashboard-stat-card strong { margin-top: 5px; display: block; font-size: 28px; line-height: 1; }
.dashboard-stat-card em { align-self: end; color: inherit; font-size: 13px; font-style: normal; font-weight: 850; }
.dashboard-stat-card.purple > span { color: var(--primary); background: var(--primary-soft); }.dashboard-stat-card.purple strong, .dashboard-stat-card.purple em { color: var(--primary); }
.dashboard-stat-card.green > span { color: var(--green); background: var(--green-soft); }.dashboard-stat-card.green strong, .dashboard-stat-card.green em { color: var(--green); }
.dashboard-stat-card.orange > span { color: #f97316; background: #fff2e5; }.dashboard-stat-card.orange strong, .dashboard-stat-card.orange em { color: #f97316; }
.dashboard-stat-card.blue > span { color: #1265e4; background: #eaf3ff; }.dashboard-stat-card.blue strong, .dashboard-stat-card.blue em { color: #1265e4; }
.dashboard-report-grid { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dashboard-report-card, .dashboard-recent-card { border: 1px solid #e0e4ee; border-radius: 13px; background: #fff; box-shadow: 0 7px 20px rgba(27,34,63,.04); overflow: hidden; }
.dashboard-report-card { padding: 22px 26px; }
.dashboard-report-card h2, .dashboard-recent-head h2 { margin: 0; font-size: 17px; font-weight: 900; }
.dashboard-report-card h2 span { color: var(--muted); font-size: 13px; font-weight: 750; }
.dashboard-summary-list { margin: 17px 0 18px; }
.dashboard-summary-list div { min-height: 48px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #edf0f5; }
.dashboard-summary-list div:first-child { border-top: 0; }
.dashboard-summary-list dt { color: #3d4457; font-weight: 750; }
.dashboard-summary-list dd { margin: 0; font-weight: 900; }
.dashboard-soft-button { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #e3dcfb; border-radius: 10px; color: var(--primary); background: #fbf9ff; text-decoration: none; font-weight: 850; }
.dashboard-soft-button:hover { color: var(--primary-dark); background: var(--primary-soft); }
.area-bars { margin: 17px 0 18px; display: grid; gap: 11px; }
.area-bar-row { min-height: 42px; display: grid; grid-template-columns: 160px minmax(90px, 1fr) 110px; align-items: center; gap: 13px; color: var(--text); text-decoration: none; }
.area-bar-row strong { font-size: 13px; }
.area-bar-row span { height: 9px; border-radius: 999px; background: #eef0f5; overflow: hidden; }
.area-bar-row span i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #351ab5); box-shadow: 0 2px 6px rgba(79,46,199,.25); }
.area-bar-row b { text-align: right; font-size: 13px; }
.dashboard-recent-card { margin-top: 14px; }
.dashboard-recent-head { min-height: 62px; padding: 0 25px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #edf0f5; }
.dashboard-recent-head a { font-size: 13px; font-weight: 850; text-decoration: none; }
.dashboard-recent-table { font-size: 12px; }
.dashboard-recent-table th { font-size: 11px; }

/* Quick entry and confirmation */
.workflow-section { padding: 18px 0; border-bottom: 1px solid var(--border); }
.workflow-section:first-child { padding-top: 0; }
.segmented-control { margin: 7px 0 18px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.segmented-control label { margin: 0; cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { height: 45px; display: grid; place-items: center; color: #3e4355; background: #fff; font-size: 12px; font-weight: 650; }
.segmented-control input:checked + span { color: #fff; background: linear-gradient(90deg, var(--primary), #5a35d5); }
.search-input-wrap { position: relative; margin-bottom: 17px; }
.search-input-wrap input { width: 100%; height: 47px; padding: 0 48px 0 14px; border: 1px solid var(--border); border-radius: 7px; outline: 0; color: var(--text); }
.search-input-wrap input:focus { border-color: #8c79df; box-shadow: 0 0 0 3px rgba(79,46,199,.1); }
.search-input-wrap > i:last-child { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: #4f5870; font-size: 20px; }
.section-title { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.section-title h2 { margin: 0; font-size: 13px; font-weight: 800; }
.section-title a, .section-title span { font-size: 11px; font-weight: 700; text-decoration: none; }
.recent-row { min-height: 45px; display: grid; grid-template-columns: 82px 1fr auto 62px; align-items: center; gap: 7px; color: var(--text); text-decoration: none; font-size: 11px; }
.recent-row strong { color: #303548; font-size: 11px; }
.recent-row b { color: var(--green); }
.recent-row time { color: #53617b; text-align: right; font-size: 10px; }
.result-row { min-height: 62px; padding: 7px 0; display: grid; grid-template-columns: 1fr auto 15px; align-items: center; gap: 10px; border-top: 1px solid #edf0f5; color: var(--text); text-decoration: none; }
.result-row span:first-child > * { display: block; }
.result-row strong { color: var(--green); font-size: 11px; }.result-row b { margin-top: 2px; font-size: 12px; }.result-row small { color: var(--muted); }
.add-person-callout { min-height: 50px; margin-top: 18px; padding: 0 15px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #e0d9fa; border-radius: 7px; color: var(--primary); background: #faf8ff; text-decoration: none; font-size: 11px; }
.add-person-callout i { font-size: 18px; }.add-person-callout strong { margin-left: 3px; }
.confirmation-panel { margin-bottom: 4px; padding: 16px; border: 1px solid #b9ddc2; border-radius: 9px; background: linear-gradient(135deg,#f7fff8,#f2faf4); }
.confirmation-panel h2 { margin: 0 0 14px; color: #183d24; font-size: 14px; font-weight: 800; }
.confirmation-panel h2 i { margin-right: 6px; color: var(--green); }
.confirmation-panel dl { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; font-size: 12px; }
.confirmation-panel dt { color: #566078; font-weight: 500; }.confirmation-panel dd { margin: 0; font-weight: 750; }
.today-entry-summary { margin-bottom: 18px; padding: 14px; border: 1px solid #dcd4ff; border-radius: 14px; background: radial-gradient(circle at top left, rgba(126,94,237,.16), transparent 35%), linear-gradient(135deg,#ffffff,#f6f3ff); box-shadow: 0 12px 28px rgba(45,33,96,.07); }
.quick-summary-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; }
.summary-hero-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--primary), #7457ec); box-shadow: 0 10px 20px rgba(79,46,199,.22); font-size: 22px; }
.summary-hero-copy span, .summary-eyebrow { color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .02em; text-transform: uppercase; }
.summary-hero-copy h2, .report-summary-copy h2 { margin: 2px 0 4px; color: var(--text); font-size: 17px; font-weight: 850; }
.summary-hero-copy p, .report-summary-copy p { margin: 0; color: var(--muted); font-size: 11px; }
.summary-hero-link { min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d8cef9; border-radius: 999px; color: var(--primary); background: rgba(255,255,255,.76); text-decoration: none; font-size: 11px; font-weight: 800; white-space: nowrap; }
.summary-hero-link:hover { color: var(--primary-dark); background: #fff; }
.quick-total-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-total-card { position: relative; min-height: 105px; margin-top: 13px; padding: 15px; border: 1px solid #d9e5fb; border-radius: 12px; color: var(--text); background: rgba(255,255,255,.82); text-decoration: none; overflow: hidden; }
.quick-total-card::after { content: ""; position: absolute; right: -28px; bottom: -30px; width: 88px; height: 88px; border-radius: 50%; background: rgba(23,105,224,.08); }
.quick-total-card > i { width: 31px; height: 31px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 10px; color: #155bd2; background: #eaf1ff; font-size: 16px; }
.quick-total-card span, .list-summary-card span, .selection-summary span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; }
.quick-total-card strong { display: block; margin-top: 7px; color: #155bd2; font-size: 24px; line-height: 1.05; }
.quick-total-card small, .list-summary-card small { display: block; margin-top: 7px; color: #727b91; font-size: 10px; }
.quick-total-card.amount-card { border-color: #caead3; background: #f2faf4; }
.quick-total-card.amount-card::after { background: rgba(21,134,61,.09); }
.quick-total-card.amount-card > i { color: var(--green); background: #e6f7eb; }
.quick-total-card.amount-card strong { color: var(--green); }

/* Person details and forms */
.person-form { width: 100%; }
.details-panel { padding: 12px 16px; border: 1px solid #d7e3dc; border-radius: 9px; background: linear-gradient(135deg,#fbfffc,#f5faf7); }
.detail-row { min-height: 45px; display: grid; grid-template-columns: minmax(140px, .9fr) minmax(0, 1.4fr); align-items: center; gap: 14px; font-size: 12px; }
.detail-row > span, .detail-row > label { margin: 0; color: #4d566c; font-weight: 500; }
.detail-row small { font-size: 10px; }
.detail-row > strong { text-align: right; }
.detail-row .donor-code { color: var(--green); }
.lock-icon { margin-left: 10px; color: #596177; }
.editable-row > div { display: grid; grid-template-columns: 1fr 20px; align-items: center; gap: 7px; }
.detail-inline-input { width: 100%; min-height: 37px; padding: 6px 8px; border: 0; border-bottom: 1px dashed transparent; outline: 0; background: transparent; text-align: right; font-weight: 700; resize: none; }
.detail-inline-input:focus { border-bottom-color: var(--primary); background: rgba(255,255,255,.7); }
.editable-row i { color: #3f4a66; font-size: 14px; }
.address-row { min-height: 58px; }
.previous-edit-row { min-height: 53px; }
.previous-amount-control { display: grid; grid-template-columns: 34px minmax(0, 1fr) 36px; align-items: center; border: 1px solid #dce3ee; border-radius: 8px; overflow: hidden; background: #fff; }
.previous-amount-control > span { height: 100%; display: grid; place-items: center; border-right: 1px solid #dce3ee; color: #535c70; background: #f7f8fb; font-weight: 750; }
.previous-amount-control input { min-height: 40px; border: 0; border-radius: 0; background: #fff; text-align: right; font-weight: 800; }
.previous-amount-control input[readonly], .previous-amount-control input:disabled { color: #525a6d; background: #f4f5f8; }
.previous-amount-control.unlocked { border-color: #8c79df; box-shadow: 0 0 0 3px rgba(79,46,199,.09); }
.previous-amount-control.unlocked input { background: #fff; }
.unlock-previous-button { height: 40px; border: 0; border-left: 1px solid #dce3ee; color: #596177; background: #fff; }
.unlock-previous-button:hover { color: var(--primary); background: var(--primary-soft); }
.previous-amount-control.not-editable { grid-template-columns: 34px minmax(0, 1fr) 34px; background: #f4f5f8; }
.previous-amount-control .lock-icon { margin: 0; justify-self: center; }
.currency-input { display: grid; grid-template-columns: 42px 1fr; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: #fff; }
.currency-input > span { display: grid; place-items: center; border-right: 1px solid var(--border); color: #535c70; background: #f6f7fa; }
.currency-input input { border: 0; border-radius: 0; font-weight: 750; }
.currency-input.readonly { min-height: 46px; background: #f2f3f6; }
.currency-input.readonly strong { padding: 13px; }
.readonly-field { padding: 13px; background: #fff; }
.readonly-note { min-height: 35px; color: var(--muted); }
.form-actions { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions.one-column { grid-template-columns: 1fr; }
.locked-note { margin-top: 15px; padding: 10px 12px; border: 1px solid #f5dfae; border-radius: 6px; color: #8a5a13; background: #fff9e8; font-size: 10px; }
.delete-person-form, .permission-note, .delete-confirm-panel { margin-top: 14px; padding: 14px; border: 1px solid #f2c7c7; border-radius: 10px; background: #fff7f7; }
.delete-person-form p, .permission-note { color: #8a4c4c; font-size: 11px; }
.delete-person-form p { margin: 9px 0 0; text-align: center; }
.permission-note { display: flex; align-items: center; gap: 8px; border-color: #eadfc7; color: #7b5b25; background: #fffaf0; }
.delete-confirm-panel { padding: 24px; text-align: center; box-shadow: var(--shadow); }
.delete-icon { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 18px; color: #b52d2d; background: #ffe6e6; font-size: 27px; }
.delete-confirm-panel h1 { margin: 0 0 8px; font-size: 20px; font-weight: 850; }
.delete-confirm-panel p { margin: 0 0 18px; color: #6d4850; }
.create-person-form { padding: 20px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.form-intro { margin-bottom: 19px; display: flex; align-items: center; gap: 12px; }
.form-intro > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 21px; }
.form-intro h1 { margin: 0; font-size: 18px; }.form-intro p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.form-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Search, history and users tables */
.search-toolbar { padding: 14px; border: 1px solid var(--border); border-radius: 9px 9px 0 0; background: #fff; }
.search-toolbar .main-search { margin-bottom: 12px; }
.main-search > i:first-child { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: #687086; }
.main-search input { padding-left: 39px; }
.main-search button { position: absolute; top: 5px; right: 5px; width: 36px; height: 36px; border: 0; border-radius: 6px; color: var(--primary); background: var(--primary-soft); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.filter-grid .form-select { min-height: 42px; font-size: 11px; }
.filter-stack { display: grid; gap: 6px; }
.searchable-select { position: relative; }
.searchable-select-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.searchable-select-button { width: 100%; min-height: 46px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: #fff; text-align: left; }
.searchable-select-button i { color: #687086; font-size: 12px; transition: transform .18s ease; }
.searchable-select-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.searchable-select.is-open .searchable-select-button { border-color: #8c79df; box-shadow: 0 0 0 3px rgba(79,46,199,.1); }
.searchable-select.is-open .searchable-select-button i { transform: rotate(180deg); }
.searchable-select-dropdown { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 25; display: none; padding: 10px; border: 1px solid #dddff1; border-radius: 14px; background: rgba(255,255,255,.98); box-shadow: 0 18px 34px rgba(24,30,57,.12); backdrop-filter: blur(12px); }
.searchable-select.is-open .searchable-select-dropdown { display: block; }
.searchable-select-search { position: relative; margin-bottom: 8px; }
.searchable-select-search i { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: #687086; font-size: 13px; }
.searchable-select-search input { width: 100%; min-height: 40px; padding: 0 12px 0 34px; border: 1px solid var(--border); border-radius: 10px; outline: 0; background: #fff; font-size: 12px; }
.searchable-select-search input:focus { border-color: #8c79df; box-shadow: 0 0 0 3px rgba(79,46,199,.1); }
.searchable-select-options { max-height: 320px; overflow: auto; display: grid; gap: 4px; }
.searchable-select-option { width: 100%; min-height: 42px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 10px; color: #2d3345; background: transparent; text-align: left; }
.searchable-select-option:hover { background: #f7f4ff; }
.searchable-select-option i { opacity: 0; color: var(--primary); }
.searchable-select-option.is-selected { color: var(--primary); background: var(--primary-soft); font-weight: 750; }
.searchable-select-option.is-selected i { opacity: 1; }
.searchable-select-empty { padding: 12px; color: var(--muted); font-size: 12px; text-align: center; }
.category-checkbox-bar { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 12px; }
.compact-check { display: inline-flex; align-items: center; gap: 6px; color: #46506a; font-size: 11px; font-weight: 700; cursor: pointer; }
.compact-check input { width: 14px; height: 14px; accent-color: var(--primary); }
.custom-date-range { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; }
.custom-date-range.is-hidden { display: none; }
.custom-date-range label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 750; }
.custom-date-range input { margin-top: 5px; min-height: 40px; font-size: 12px; }
.report-summary-hero { padding: 15px; display: grid; grid-template-columns: minmax(230px, .7fr) minmax(0, 1.3fr); gap: 14px; align-items: stretch; border-left: 1px solid var(--border); border-right: 1px solid var(--border); background: radial-gradient(circle at top left, rgba(79,46,199,.11), transparent 34%), linear-gradient(135deg,#ffffff,#f7f4ff); }
.report-summary-copy { padding: 5px 2px; }
.summary-eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.list-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.list-summary-card { min-height: 92px; padding: 13px; border: 1px solid rgba(224,229,239,.9); border-radius: 12px; background: rgba(255,255,255,.78); box-shadow: 0 8px 18px rgba(40,47,85,.04); }
.list-summary-card strong { display: block; margin-top: 7px; color: var(--primary); font-size: 22px; line-height: 1.05; }
.list-summary-card.amount-card strong { color: var(--green); }
.table-panel { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 9px 9px; background: #fff; overflow: hidden; }
.table-panel-toolbar { padding: 14px; display: flex; justify-content: flex-end; border-bottom: 1px solid #edf0f5; background: linear-gradient(90deg, #fff, #fbfcff); }
.records-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.records-table th { height: 43px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: #34394c; background: #fbfbfd; font-size: 10px; text-align: left; white-space: nowrap; }
.records-table td { height: 51px; padding: 10px 12px; border-bottom: 1px solid #edf0f5; white-space: nowrap; }
.records-table tbody tr { cursor: pointer; }
.records-table tbody tr:hover { background: #faf9ff; }
.records-table td:last-child { color: #7c8497; text-align: right; }
.persons-table tbody tr { cursor: default; }
.persons-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.select-cell { margin: 0; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; }
.inline-row-form { margin: 0; display: inline-flex; }
.inline-row-form button { border: 0; background: transparent; cursor: pointer; }
.row-action { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: #6a7286; text-decoration: none; }
.row-action:hover { color: var(--primary); background: var(--primary-soft); }
.danger-row-action { color: #b52d2d; }
.danger-row-action:hover { color: #fff; background: #d13c3c; }
.selection-summary { min-height: 68px; padding: 13px 14px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid #edf0f5; background: linear-gradient(90deg, #fbfcff, #f7fff9); }
.selection-summary > div { min-width: 180px; padding: 10px 12px; border: 1px solid #dce7dd; border-radius: 8px; background: #fff; }
.selection-summary strong { display: block; margin-top: 4px; color: var(--green); font-size: 16px; }
.pagination-bar { min-height: 68px; padding: 14px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.pagination-bar nav { display: flex; align-items: center; gap: 8px; }
.pagination-bar nav a, .pagination-bar nav strong { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; text-decoration: none; }
.pagination-bar nav strong { color: #fff; background: var(--primary); }
.history-toolbar .main-search { margin-bottom: 10px; }
.date-filter { min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 7px; }
.date-filter select { width: 100%; border: 0; outline: 0; background: transparent; }
.date-filter i { color: #59637a; }
.users-panel { border-top: 1px solid var(--border); border-radius: 9px; }
.panel-title.padded { padding: 18px; align-items: center; }
.panel-title.padded h1 { margin: 0; font-size: 18px; }.panel-title.padded p { margin: 4px 0 0; }
.role-pill { padding: 4px 8px; border-radius: 99px; color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.muted-pill { color: #667085; background: #f2f4f7; }

/* Management */
.management-hero { margin-bottom: 14px; padding: 18px; border: 1px solid #ded7fb; border-radius: 14px; background: radial-gradient(circle at top left, rgba(79,46,199,.13), transparent 40%), #fff; box-shadow: var(--shadow); }
.management-hero h1 { margin: 3px 0 4px; font-size: 22px; font-weight: 850; }
.management-hero p { margin: 0; color: var(--muted); font-size: 12px; }
.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.management-card { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 8px 20px rgba(25,32,60,.04); }
.management-card-title { margin-bottom: 12px; display: flex; align-items: center; gap: 11px; }
.management-card-title > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.management-card-title h2 { margin: 0; font-size: 15px; font-weight: 850; }
.management-card-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.management-assignment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.check-row { margin: 10px 0 14px; display: inline-flex; align-items: center; gap: 8px; color: #3f4558; font-size: 12px; font-weight: 750; }
.management-list-grid { margin-top: 14px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 14px; }
.manage-table td:last-child { text-align: right; }
.area-panel { margin-top: 14px; border-top: 1px solid var(--border); border-radius: 9px; }
.area-columns { padding: 0 16px 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.area-columns h2 { margin: 0 0 8px; font-size: 13px; font-weight: 850; }
.manage-item { min-height: 48px; padding: 9px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid #edf0f5; border-radius: 9px; background: #fbfcff; }
.manage-item span { min-width: 0; font-size: 12px; font-weight: 750; }
.manage-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 600; }
.management-page .app-shell { width: min(100%, 1380px); }
.management-workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow); overflow: visible; }
.management-sidebar { padding: 18px 14px; border-right: 1px solid var(--border); background: linear-gradient(180deg, #fff, #fbfaff); }
.management-sidebar-title { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.management-sidebar-title strong, .management-sidebar-title small { display: block; }
.management-sidebar-title strong { font-size: 14px; }
.management-sidebar-title small { color: var(--muted); font-size: 10px; }
.management-sidebar nav { display: grid; gap: 5px; }
.management-sidebar button { min-height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; color: #687086; background: transparent; font-size: 12px; font-weight: 800; text-align: left; }
.management-sidebar button i { width: 18px; color: #8a91a4; font-size: 15px; }
.management-sidebar button:hover, .management-sidebar button.active { color: var(--primary); background: var(--primary-soft); }
.management-sidebar button.active i { color: var(--primary); }
.management-help { margin-top: 24px; padding: 14px; border: 1px solid #e6dcff; border-radius: 12px; background: #faf8ff; }
.management-help strong { color: var(--primary); font-size: 12px; }
.management-help p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.management-content { min-width: 0; padding: 24px; background: #fff; }
.management-panel { display: none; }
.management-panel.active { display: block; }
.management-panel-head { margin-bottom: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.management-panel-head h1 { margin: 0; font-size: 23px; font-weight: 850; }
.management-panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.management-stats { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.management-stats > div { min-height: 94px; padding: 14px; border: 1px solid #e7eaf2; border-radius: 12px; background: linear-gradient(135deg, #fff, #fbfcff); }
.management-stats i { width: 34px; height: 34px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-size: 16px; }
.management-stats span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; }
.management-stats strong { display: block; margin-top: 4px; color: var(--text); font-size: 22px; line-height: 1; }
.management-two-column { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 16px; align-items: start; }
.add-user-card { min-height: 100%; }
.auto-generated-field { min-height: 54px; margin-top: 10px; padding: 9px 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; border: 1px solid #e5e8ef; border-radius: 8px; background: #f8f9fc; }
.auto-generated-field span { color: #4e5669; font-size: 11px; font-weight: 800; }
.auto-generated-field strong { color: #2d3348; font-size: 13px; font-weight: 850; text-align: right; }
.auto-generated-field small { grid-column: 1 / -1; color: var(--green); font-size: 10px; font-weight: 750; text-align: right; }
.auto-generated-field small i { margin-right: 3px; }
.management-info-stack { display: grid; gap: 12px; }
.info-card { padding: 15px; border: 1px solid #e5e8ef; border-radius: 12px; background: #fff; }
.info-card h2 { margin: 0 0 9px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 850; }
.info-card p, .info-card li { color: #596176; font-size: 11px; }
.info-card p { margin: 0 0 9px; }
.info-card ul { margin: 0; padding-left: 17px; }
.purple-info { border-color: #dfd4ff; background: #fbf8ff; }
.purple-info h2 { color: var(--primary); }
.green-info { border-color: #cdebd6; background: #f3fbf5; }
.green-info h2 { color: var(--green); }
.management-table-card { margin-top: 18px; border: 1px solid #e6e9f0; border-radius: 12px; background: #fff; overflow: visible; }
.management-table-card:first-child { margin-top: 0; }
.management-table-card .table-responsive { position: relative; z-index: 1; overflow-x: auto; overflow-y: visible; }
.table-search-row { position: relative; z-index: 4; min-height: 54px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eef1f6; }
.table-search-row h2 { margin: 0; font-size: 14px; font-weight: 850; }
.table-search-row span { color: var(--muted); font-size: 11px; font-weight: 750; }
.area-values-toolbar { display: flex; align-items: center; gap: 10px; }
.compact-danger-button { width: auto; min-height: 40px; padding: 0 14px; }
.compact-danger-button:disabled { opacity: .55; cursor: not-allowed; }
.hierarchy-filter-form { min-width: 240px; }
.hierarchy-filter { position: relative; z-index: 6; }
.hierarchy-filter-button { min-height: 40px; font-size: 12px; }
.hierarchy-filter-dropdown { min-width: 280px; z-index: 50; }
.hierarchy-filter.is-open .hierarchy-filter-dropdown { display: block; }
.hierarchy-filter.is-open .hierarchy-filter-button { border-color: #8c79df; box-shadow: 0 0 0 3px rgba(79,46,199,.1); }
.hierarchy-filter.is-open .hierarchy-filter-button i { transform: rotate(180deg); }
.hierarchy-filter-actions { margin-bottom: 8px; display: flex; justify-content: flex-end; }
.hierarchy-filter-options { max-height: 320px; overflow: auto; display: grid; gap: 4px; }
.hierarchy-filter-option { min-height: 42px; padding: 9px 12px; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 0 10px; align-items: center; border-radius: 10px; color: #2d3345; cursor: pointer; }
.hierarchy-filter-option:hover { background: #f7f4ff; }
.hierarchy-filter-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }
.hierarchy-filter-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.hierarchy-filter-option small { grid-column: 2; color: var(--muted); font-size: 10px; }
.hierarchy-filter-option.is-hidden { display: none; }
.active-pill { color: var(--green); background: var(--green-soft); }
.danger-pill { color: #b52d2d; background: #fff0f0; }
.enhanced-area-columns { padding: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.user-detail-list { margin: 18px 0; display: grid; gap: 10px; }
.user-detail-list div { min-height: 42px; padding: 10px 0; display: grid; grid-template-columns: 135px 1fr; gap: 12px; border-bottom: 1px solid #edf0f5; }
.user-detail-list dt { color: var(--muted); font-size: 12px; font-weight: 750; }
.user-detail-list dd { margin: 0; color: var(--text); font-weight: 800; }
.compact-management-table td { height: 42px; }
.compact-filter-form { min-width: 220px; }
.compact-filter-form .form-select { min-height: 40px; font-size: 12px; }
.activity-list { display: grid; gap: 10px; }
.activity-item { min-height: 52px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; }
.activity-item > i { color: var(--primary); }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { font-size: 12px; }
.activity-item small, .activity-item time { color: var(--muted); font-size: 10px; }
.assignment-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.assignment-columns { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.assignment-box { min-height: 260px; padding: 14px; border: 1px solid #e5e8ef; border-radius: 12px; background: #fbfcff; }
.assignment-box h3 { margin: 0 0 12px; font-size: 13px; font-weight: 850; }
.assignment-box label { min-height: 32px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.assignment-box input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); }
.assignment-chip { min-height: 46px; padding: 9px 10px; display: grid; gap: 2px; border-bottom: 1px solid #edf0f5; }
.assignment-chip span { font-weight: 800; font-size: 12px; }
.assignment-chip small { color: var(--muted); font-size: 10px; }
.hierarchy-preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.hierarchy-tree { display: grid; gap: 4px; }
.hierarchy-node { min-height: 36px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #f0f2f7; font-size: 12px; }
.hierarchy-node i { color: var(--primary); }
.hierarchy-node strong { min-width: 160px; }
.hierarchy-node span { padding: 3px 8px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 800; }
.summary-line { min-height: 34px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #edf0f5; font-size: 12px; }
.summary-line.total { margin-top: 8px; border-bottom: 0; font-weight: 900; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.settings-card { padding: 17px; border: 1px solid #e6e9f0; border-radius: 13px; background: #fff; box-shadow: 0 7px 18px rgba(27,34,63,.04); }
.settings-card h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; color: var(--primary); font-size: 14px; font-weight: 850; }
.settings-card a { min-height: 35px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #edf0f5; color: #3f4558; text-decoration: none; font-size: 12px; font-weight: 750; }
.settings-card a:last-child { border-bottom: 0; }
.mini-settings-form .form-control { min-height: 40px; font-size: 12px; }
.permission-table td:not(:first-child):not(:nth-child(2)), .permission-table th:not(:first-child):not(:nth-child(2)) { text-align: center; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.readonly-profile-row { min-height: 45px; padding: 9px 0; display: grid; grid-template-columns: 130px 1fr; gap: 12px; border-bottom: 1px solid #edf0f5; }
.readonly-profile-row span { color: var(--muted); font-size: 12px; font-weight: 750; }
.readonly-profile-row strong { font-size: 12px; }

/* Mobile application shell */
@media (max-width: 768px) {
    body { background: #fff; font-size: 13px; }
    .desktop-only { display: none !important; }
    .topbar-inner { min-height: 58px; padding: 0 15px; display: grid; grid-template-columns: 38px 1fr 38px; gap: 8px; }
    .mobile-leading, .mobile-header-action { height: 38px; display: grid; place-items: center; font-size: 20px; }
    .mobile-leading a, .mobile-header-action a { color: inherit; }
    .mobile-page-title { display: block; font-size: 16px; font-weight: 800; text-align: center; }
    .purple-header { color: #fff; border-bottom: 0; background: linear-gradient(90deg, #4a28bc, #5733ce); }
    .dashboard-header { color: var(--text); background: #fff; }
    .dashboard-header .topbar-inner { grid-template-columns: 38px 1fr 38px; }
    .app-shell, .wide-page .app-shell, .inner-page:not(.wide-page) .app-shell { width: 100%; padding: 17px 14px 91px; }
    .inner-page .app-shell { padding-top: 12px; }
    .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; min-height: 67px; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border); background: rgba(255,255,255,.98); box-shadow: 0 -5px 18px rgba(31,35,60,.05); }
    .bottom-nav > a, .more-nav > summary { min-width: 0; padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #555d70; text-decoration: none; list-style: none; font-size: 9px; white-space: nowrap; }
    .bottom-nav > a i, .more-nav > summary i { font-size: 19px; }
    .bottom-nav > a.active { color: var(--primary); font-weight: 800; }
    .more-nav { position: relative; }
    .more-nav summary::-webkit-details-marker { display: none; }
    .more-menu { position: absolute; right: 8px; bottom: 63px; width: 210px; padding: 7px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 14px 35px rgba(18,23,45,.16); }
    .more-menu a { min-height: 42px; padding: 0 10px; display: flex; align-items: center; gap: 10px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 12px; }
    .more-menu a:hover { background: var(--primary-soft); }
    .notice { min-height: 45px; }
    .welcome-block { margin: 2px 1px 16px; }
    .welcome-block h1 { font-size: 17px; }.welcome-block p { font-size: 11px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .stat-card { min-width: 0; min-height: 102px; padding: 10px 8px; }
    .stat-card small { min-height: 28px; font-size: 8px; }.stat-card strong { margin: 5px 0 auto; font-size: 15px; }.stat-card span { font-size: 8px; }
    .dashboard-heading-row { margin-bottom: 15px; display: grid; grid-template-columns: 1fr; }
    .dashboard-heading-row h1 { font-size: 22px; }
    .dashboard-heading-row p { font-size: 12px; }
    .dashboard-date-filter { min-width: 0; }
    .dashboard-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .dashboard-stat-card { min-height: 124px; padding: 14px; grid-template-columns: 44px 1fr; gap: 0 10px; }
    .dashboard-stat-card > span { width: 44px; height: 44px; font-size: 22px; }
    .dashboard-stat-card small { font-size: 11px; }
    .dashboard-stat-card strong { font-size: 22px; }
    .dashboard-stat-card em { font-size: 10px; }
    .dashboard-report-grid { grid-template-columns: 1fr; }
    .dashboard-report-card { padding: 16px; }
    .area-bar-row { grid-template-columns: 92px minmax(70px, 1fr) 86px; gap: 8px; }
    .dashboard-recent-table { min-width: 680px; }
    .panel { padding: 13px; }
    .workflow-section { padding: 16px 0; }
    .search-section { padding-top: 0; }
    .today-entry-summary { margin: 0 0 16px; padding: 12px; }
    .quick-summary-hero { grid-template-columns: auto 1fr; }
    .summary-hero-link { grid-column: 1 / -1; justify-content: center; border-radius: 8px; }
    .details-panel { margin-top: 0; padding: 8px 12px; }
    .detail-row { grid-template-columns: minmax(105px,.85fr) minmax(0,1.4fr); font-size: 11px; }
    .previous-amount-control { grid-template-columns: 30px minmax(0, 1fr) 32px; }
    .filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
    .filter-grid .form-select { padding-left: 8px; padding-right: 27px; }
    .custom-date-range { grid-template-columns: 1fr 1fr; gap: 7px; }
    .custom-date-range button { grid-column: 1 / -1; width: 100%; }
    .search-toolbar { margin: -12px -14px 0; border-left: 0; border-right: 0; border-radius: 0; }
    .report-summary-hero { margin: 0 -14px; grid-template-columns: 1fr; border-left: 0; border-right: 0; }
    .list-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .list-summary-card { min-height: 78px; padding: 11px; }
    .list-summary-card strong { font-size: 18px; }
    .table-panel { margin: 0 -14px; border-left: 0; border-right: 0; border-radius: 0; }
    .records-table { min-width: 620px; }
    .persons-table { min-width: 780px; }
    .history-table { min-width: 560px; }
    .selection-summary { justify-content: stretch; gap: 8px; }
    .selection-summary > div { min-width: 0; flex: 1; }
    .pagination-bar { min-height: 62px; }
    .create-person-form { padding: 16px; border-radius: 8px; box-shadow: none; }
    .management-workspace { margin: -12px -14px 0; grid-template-columns: 1fr; border-left: 0; border-right: 0; border-radius: 0; }
    .management-sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
    .management-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .management-sidebar button { font-size: 11px; }
    .management-content { padding: 16px 14px 22px; }
    .management-panel-head h1 { font-size: 19px; }
    .management-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .management-two-column { grid-template-columns: 1fr; }
    .management-grid, .management-list-grid, .area-columns, .enhanced-area-columns { grid-template-columns: 1fr; }
    .management-assignment-grid { grid-template-columns: 1fr; }
    .form-grid-two { grid-template-columns: 1fr; }
    .category-checkbox-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .assignment-layout, .assignment-columns, .hierarchy-preview-grid, .settings-grid, .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card { min-height: 90px; }
    .quick-total-grid { grid-template-columns: 1fr; }
    .recent-row { grid-template-columns: 72px 1fr auto; }
    .recent-row time { display: none; }
    .add-person-callout { gap: 6px; font-size: 10px; }
}

/* Persons report export dropdown */
.report-export-dropdown {
    position: relative;
    display: inline-block;
    margin-top: 12px;
}

.report-export-dropdown > summary {
    list-style: none;
    user-select: none;
}

.report-export-dropdown > summary::-webkit-details-marker {
    display: none;
}

.report-export-dropdown[open] > summary {
    color: var(--primary);
    border-color: #b8abea;
    background: #faf9ff;
}

.report-export-dropdown .export-chevron {
    margin-left: 3px;
    font-size: 11px;
    transition: transform 0.18s ease;
}

.report-export-dropdown[open] .export-chevron {
    transform: rotate(180deg);
}

.report-export-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 80;
    min-width: 250px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 35px rgba(24, 30, 57, 0.16);
}

.report-export-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 9px;
    color: var(--text);
    text-decoration: none;
}

.report-export-menu a:hover {
    color: var(--primary);
    background: #f6f3ff;
}

.report-export-menu a > i {
    width: 24px;
    font-size: 21px;
    text-align: center;
}

.report-export-menu a span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.report-export-menu a strong {
    font-size: 13px;
}

.report-export-menu a small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

@media (max-width: 640px) {
    .report-export-menu {
        left: 0;
        right: auto;
        min-width: 230px;
    }
}

/* Persons-list page-size selector */
.pagination-info {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.page-size-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.page-size-control .form-select {
    width: 76px;
    min-width: 76px;
    height: 36px;
    padding: 5px 28px 5px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .pagination-bar {
        align-items: flex-start;
        gap: 14px;
    }

    .pagination-info {
        width: 100%;
        justify-content: space-between;
    }
}
/* Persons report top actions */
.person-report-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.page-size-form {
    margin: 0;
}

.page-size-control {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.page-size-control .form-select {
    width: 82px;
    min-width: 82px;
    height: 42px;
    padding: 6px 30px 6px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.person-report-actions .report-export-dropdown {
    margin-top: 0;
}

@media (max-width: 640px) {
    .person-report-actions {
        align-items: stretch;
    }

    .page-size-form,
    .report-export-dropdown {
        width: 100%;
    }

    .page-size-control {
        justify-content: space-between;
        width: 100%;
    }
}