:root {
    --rt-royal: #17458f;
    --rt-azure: #0067c8;
    --rt-navy: #0c2d5e;
    --rt-gold: #f7a81b;
    --rt-gold-deep: #d98c00;
    --bg: #f5f7fa;
    --surface: #fff;
    --border: #e3e8ef;
    --track: #e6ebf2;
    --text: #111827;
    --secondary: #5b6b7f;
    --muted: #9aa6b5;
    --success: #137a34;
    --success-bg: #cdebd6;
    --danger: #b3261e;
    --danger-bg: #f9d3cf;
    --warning: #8a4b00;
    --warning-bg: #fbdfa8;
    --info: #0b5cb0;
    --info-bg: #cde1f7;
    --neutral: #46566b;
    --neutral-bg: #dde3eb;
    --shadow: 0 12px 30px rgba(12, 45, 94, .12)
}

.club-history-layout {
    margin-top: 24px;
    display: grid;
    grid-template-columns:minmax(0, 1.25fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start
}

.club-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px
}

.club-history-list {
    list-style: none;
    margin: 0;
    padding: 0
}

.club-history-list li {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border)
}

.club-history-list li:last-child {
    border-bottom: 0
}

.club-history-list li > div {
    min-width: 0
}

.club-history-list time {
    display: block;
    color: var(--secondary);
    font-size: 13px;
    margin-bottom: 6px
}

.club-history-list strong {
    display: block;
    overflow-wrap: anywhere
}

.club-history-list p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--secondary);
    margin-top: 8px
}

.club-document-grid {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 20px
}

.club-document-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0
}

.club-document-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600
}

.club-document-form input {
    min-width: 0;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px
}

.club-current-file, .club-document-form small, .club-document-form details {
    overflow-wrap: anywhere;
    font-size: 13px
}

.club-document-form details p {
    margin-top: 8px
}

.club-document-form [role=status] {
    font-size: 13px;
    color: var(--secondary);
    min-height: 20px
}

.club-document-actions {
    display: flex;
    gap: 8px;
    margin-top: auto
}

.club-document-actions button {
    flex: 1
}

.club-document-actions button[hidden] {
    display: none
}

.club-history-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap
}

.club-document-form summary {
    cursor: pointer;
    color: var(--rt-azure)
}

@media (max-width: 1100px) {
    .club-document-grid {
        grid-template-columns:1fr
    }

    .club-history-layout {
        grid-template-columns:1fr
    }
}

@media (max-width: 767px) {
    .club-section-heading {
        flex-wrap: wrap
    }

    .club-history-list li {
        gap: 8px
    }

    .club-history-layout {
        gap: 0
    }
}

* {
    box-sizing: border-box
}

html {
    font-family: var(--font-family);
    color: var(--text)
}

body {
    margin: 0;
    background: var(--bg);
    font-size: var(--font-size-body)
}

button, input, select, textarea {
    font: inherit
}

button {
    cursor: pointer
}

a {
    color: inherit;
    text-decoration: none
}

img {
    display: block
}

h1, h2, h3, p {
    margin: 0
}

h1 {
    font-size: 24px;
    line-height: 1.45;
    font-weight: 800;
    letter-spacing: var(--letter-spacing-heading)
}

h2 {
    font-size: 16px;
    font-weight: 700
}

p {
    line-height: var(--line-height-body)
}

small, .muted {
    color: var(--muted)
}

em {
    color: #e24b3b;
    font-style: normal
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0
}

legend {
    padding: 0
}

input:focus, select:focus, textarea:focus, .editor:focus {
    outline: 2px solid rgba(0, 103, 200, .3);
    outline-offset: 0;
    border-color: var(--rt-azure) !important
}

input[readonly], input:disabled {
    background: var(--bg);
    color: var(--secondary)
}

[hidden] {
    display: none !important
}

.app-shell {
    display: flex;
    min-height: 100vh
}

.sidebar {
    width: 240px;
    flex: 0 0 240px;
    background: var(--rt-royal);
    color: #b7cbe8;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30
}

.sidebar-brand {
    height: 80px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .15)
}

.sidebar-brand span, .sidebar-user span:not(.user-avatar) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap
}

.sidebar-brand strong, .sidebar-user strong {
    color: #fff;
    font-size: 14px
}

.sidebar-brand small, .sidebar-user small {
    font-size: 11px;
    color: #b7cbe8
}

.side-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    min-height: 38px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap
}

.side-nav a img {
    width: 17px;
    height: 17px;
    object-fit: contain
}

.side-nav a:hover, .side-nav a.active {
    background: var(--rt-azure);
    color: #fff
}

.nav-group {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 700;
    padding: 14px 10px 6px
}

.sidebar-user {
    height: 65px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #d6dee9;
    display: grid;
    place-items: center;
    overflow: hidden
}

.sidebar-user .user-avatar img {
    width: 36px;
    height: 36px
}

.sidebar-user > a {
    margin-left: auto;
    padding: 6px
}

.sidebar-user > a img {
    width: 16px;
    height: 16px
}

.app-main {
    flex: 1;
    min-width: 0
}

.topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    gap: 16px
}

.crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    min-width: 0
}

.crumb span {
    color: var(--muted);
    font-size: 13px
}

.crumb img {
    width: 14px;
    height: 14px
}

.crumb strong {
    font-size: 17px;
    overflow: hidden;
    text-overflow: ellipsis
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px
}

.term-select, .top-search, .icon-btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    color: var(--text)
}

.term-select {
    padding: 0 10px;
    background: #e8f1fb;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap
}

.term-select img:first-child, .top-search img {
    width: 15px;
    height: 15px
}

.term-select img:last-child {
    width: 14px;
    height: 14px
}

.top-search {
    width: 240px;
    padding: 0 12px
}

.top-search input {
    width: 100%;
    border: 0;
    background: transparent;
    outline: 0 !important;
    font-size: 13px
}

.icon-btn {
    width: 36px;
    justify-content: center;
    font-size: 20px
}

.icon-btn img {
    width: 16px;
    height: 16px
}

.menu-toggle {
    display: none
}

.content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px;
    min-height: calc(100vh - 64px)
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px
}

.page-head p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px
}

.head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 13px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #34445b;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap
}

.btn:hover {
    border-color: #9fbde3;
    background: #f8fbff
}

.btn.primary {
    background: var(--rt-azure);
    border-color: var(--rt-azure);
    color: #fff
}

.btn.primary:hover {
    background: #0057a9
}

.btn.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff
}

.btn.small {
    height: 30px;
    padding: 0 9px;
    font-size: 12px
}

.text-btn {
    border: 0;
    background: none;
    color: var(--rt-azure);
    font-size: 12px;
    font-weight: 700;
    padding: 4px;
    white-space: nowrap
}

.text-btn:hover {
    text-decoration: underline
}

.text-btn.muted {
    color: var(--secondary)
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 18px
}

.card-head {
    flex-wrap: wrap;
    height: auto;
    min-height: 58px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border)
}

.card-head > a {
    font-size: 12px;
    font-weight: 700;
    color: var(--rt-azure)
}

.card-head p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px
}

.card-body {
    padding: 16px
}

.stat-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 20px
}

.stat-grid.four {
    grid-template-columns:repeat(4, minmax(0, 1fr))
}

.stat-card {
    height: 106px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px
}

.stat-card .label {
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary)
}

.stat-card strong {
    font-family: var(--font-family);
    font-size: 23px;
    line-height: 1.25;
    letter-spacing: var(--letter-spacing-heading)
}

.stat-card .mini-track {
    height: 4px;
    margin-top: 4px
}

.dashboard-grid {
    align-items: start;
    display: grid;
    grid-template-columns:minmax(0, 1.85fr) minmax(280px, .88fr);
    gap: 16px
}

.dashboard-grid .card {
    margin-bottom: 0
}

.progress-row {
    padding: 7px 0 13px
}

.progress-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px
}

.progress-row small {
    font-weight: 400
}

.track, .mini-track {
    background: var(--track);
    border-radius: 20px;
    overflow: hidden
}

.track {
    height: 8px
}

.track > span, .mini-track > span {
    height: 100%;
    display: block;
    background: var(--rt-azure);
    border-radius: inherit
}

.officer-row, .recent-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0
}

.officer-row + .officer-row, .recent-row + .recent-row {
    border-top: 1px solid var(--border)
}

.officer-row > span:last-child, .recent-row > span:last-child {
    margin-left: auto
}

.recent-row small {
    display: block;
    font-size: 11px
}

.avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    background: #c9d3e0;
    display: inline-grid;
    place-items: center;
    position: relative;
    color: var(--rt-royal);
    font-weight: 700
}

.avatar.gold {
    border: 3px solid var(--rt-gold);
    background: #fff
}

.avatar.gold:before {
    content: "";
    position: absolute;
    inset: -5px;
    border: 1px solid var(--rt-gold);
    border-radius: 50%
}

.badge, .tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    min-height: 24px;
    padding: 3px 8px
}

.badge.success {
    color: var(--success);
    background: var(--success-bg)
}

.badge.danger {
    color: var(--danger);
    background: var(--danger-bg)
}

.badge.warning {
    color: var(--warning);
    background: var(--warning-bg)
}

.badge.info {
    color: var(--info);
    background: var(--info-bg)
}

.badge.neutral {
    color: var(--neutral);
    background: var(--neutral-bg)
}

.badge.gold {
    background: #fff;
    color: var(--rt-gold-deep);
    border: 1px solid var(--rt-gold)
}

.tag {
    color: var(--secondary);
    border: 1px solid #d5dce5;
    background: #fff
}

.member-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px
}

.member-cell strong {
    display: block;
    font-weight: 700
}

.member-cell small {
    display: block;
    font-size: 11px
}

.member-cell .badge {
    margin-left: 4px
}

.money {
    font-family: var(--font-family);
    font-weight: 700;
    white-space: nowrap
}

.subtext {
    font-size: 11px;
    color: var(--muted)
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border)
}

.toolbar-spacer {
    flex: 1
}

.search-field {
    height: 36px;
    width: 230px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 9px;
    background: #fff;
    color: var(--muted)
}

.search-field input {
    min-width: 0;
    width: 100%;
    border: 0 !important;
    outline: 0 !important;
    font-size: 12px
}

.search-field > span {
    font-size: 20px
}

.toolbar select, .toolbar .chip {
    height: 35px;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0 10px;
    background: #fff;
    color: var(--secondary);
    font-size: 12px
}

.toolbar .chip.active {
    background: var(--rt-azure);
    color: #fff;
    border-color: var(--rt-azure)
}

.table-scroll {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left
}

th {
    background: var(--bg);
    color: var(--secondary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap
}

th, td {
    padding: 12px 16px;
    border-bottom: 1px solid #edf0f4
}

td {
    font-size: 13px;
    vertical-align: middle
}

tr:last-child td {
    border-bottom: 0
}

tbody tr:hover {
    background: #fafcff
}

.data-table td {
    white-space: nowrap
}

.data-table td.wrap {
    white-space: normal
}

.row-actions {
    display: flex;
    gap: 4px;
    align-items: center
}

.row-actions button, .row-actions a {
    height: 28px;
    min-width: 28px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px
}

.row-actions button:hover, .row-actions a:hover {
    color: var(--rt-azure);
    border-color: var(--rt-azure)
}

.table-footer {
    flex-wrap: wrap;
    gap: 8px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted)
}

.pagination {
    display: flex;
    gap: 4px
}

.pagination button {
    height: 28px;
    min-width: 28px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    color: var(--secondary)
}

.pagination button.active {
    background: var(--rt-azure);
    border-color: var(--rt-azure);
    color: #fff
}

.empty-state {
    text-align: center;
    padding: 50px 20px
}

.empty-state h2 {
    margin: 12px 0 4px
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 18px
}

.empty-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e8f1fb;
    color: var(--rt-azure);
    font-size: 28px
}

.form-layout {
    display: grid;
    grid-template-columns:minmax(0, 1.9fr) minmax(260px, .8fr);
    gap: 16px;
    align-items: start
}

.form-card {
    padding: 20px 22px
}

.form-card h2 {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px
}

.form-grid {
    display: grid;
    gap: 14px
}

.form-grid.three {
    grid-template-columns:repeat(3, minmax(0, 1fr))
}

.form-grid.two {
    grid-template-columns:repeat(2, minmax(0, 1fr))
}

.form-grid label, .stack-fields > label, .settings-layout label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--secondary);
    font-size: 12px;
    font-weight: 700
}

.form-grid input, .form-grid select, .form-grid textarea, .stack-fields input, .stack-fields select, .form-card textarea, .settings-layout input, .settings-layout select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 7px;
    min-height: 40px;
    padding: 8px 11px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 400
}

.form-grid textarea, .form-card textarea {
    resize: vertical
}

.span-two {
    grid-column: span 2
}

.span-three {
    grid-column: span 3
}

.span-one {
    grid-column: span 1
}

.stack-fields {
    display: grid;
    gap: 14px
}

.stack-fields fieldset {
    display: grid;
    gap: 8px
}

.stack-fields legend {
    font-size: 12px;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 8px
}

.stack-fields .radio-line, .stack-fields .check-line, .form-grid .toggle-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--secondary);
    font-weight: 500
}

.stack-fields input[type=radio], .stack-fields input[type=checkbox], .form-grid input[type=checkbox] {
    width: auto;
    min-height: auto;
    accent-color: var(--rt-azure)
}

.member-profile-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px
}

.profile-avatar {
    width: 76px;
    height: 76px;
    border: 5px solid var(--rt-gold);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff
}

.profile-avatar img {
    width: 56px;
    height: 56px
}

.profile-upload {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--muted)
}

.input-action {
    display: flex
}

.input-action input {
    border-radius: 7px 0 0 7px
}

.input-action button {
    width: 40px;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 7px 7px 0;
    background: #fff;
    font-size: 20px;
    color: var(--secondary)
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 16px
}

.card-title-row h2 {
    border: 0;
    padding: 0;
    margin: 0
}

.role-assignment {
    display: grid;
    grid-template-columns:115px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg)
}

.role-assignment.current {
    border-color: var(--rt-gold);
    background: #fff8eb
}

.role-assignment select {
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 8px;
    background: #fff
}

.form-actions {
    display: flex;
    justify-content: flex-end
}

.term-layout {
    display: grid;
    grid-template-columns:215px minmax(0, 1fr);
    gap: 16px
}

.term-list {
    display: grid;
    align-content: start;
    gap: 8px
}

.term-item {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 13px;
    text-align: left
}

.term-item.active {
    background: var(--rt-royal);
    color: #fff;
    border-color: var(--rt-royal)
}

.term-item strong {
    font-size: 14px
}

.term-item small {
    display: block;
    font-size: 11px;
    margin-top: 5px
}

.term-item.active small {
    color: #b7cbe8
}

.president-card {
    background: var(--rt-royal);
    color: #fff;
    border: 2px solid var(--rt-gold);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px
}

.president-card .badge {
    margin-left: auto
}

.officer-grid {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 10px
}

.officer-tile {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    min-height: 76px
}

.officer-tile > small {
    display: block;
    color: var(--rt-gold-deep);
    margin-bottom: 8px;
    font-weight: 700
}

.officer-tile > div {
    display: flex;
    align-items: center;
    gap: 8px
}

.officer-tile button {
    margin-left: auto;
    border: 0;
    background: none;
    color: var(--muted)
}

.committee-row {
    display: grid;
    grid-template-columns:minmax(0, 1fr) minmax(0, 340px) auto;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border)
}

.committee-row:last-child {
    border: 0
}

.committee-row > strong {
    min-width: 0;
    font-size: 12px;
    overflow-wrap: anywhere
}

.committee-row > .text-btn {
    justify-self: end;
    white-space: nowrap
}

.info-bar {
    border-radius: 8px;
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--secondary);
    font-size: 12px
}

.info-bar .btn {
    margin-left: auto
}

.phf-card {
    margin-top: 16px
}

.event-box {
    border: 1px solid var(--rt-gold);
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0
}

.event-box legend {
    color: var(--secondary);
    font-size: 12px;
    font-weight: 700
}

.segmented {
    display: flex;
    gap: 5px
}

.segmented label {
    display: block
}

.segmented input {
    position: absolute;
    opacity: 0
}

.segmented span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 12px
}

.segmented input:checked + span {
    background: #e8f1fb;
    border-color: var(--rt-azure);
    color: var(--rt-azure)
}

.editor-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary);
    margin: 12px 0 8px
}

.editor-toolbar {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    padding: 6px
}

.editor-toolbar button {
    border: 0;
    background: none;
    min-width: 29px;
    height: 29px;
    color: var(--secondary)
}

.editor-toolbar button:hover {
    background: #e8f1fb
}

.editor {
    min-height: 250px;
    padding: 13px;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    line-height: 1.7;
    outline: 0
}

.attachment-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 12px;
    padding: 8px;
    font-size: 12px;
    color: var(--secondary)
}

.calendar-card {
    padding: 18px
}

.calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px
}

.calendar-head > div {
    display: flex;
    align-items: center;
    gap: 12px
}

.calendar-grid {
    display: grid;
    grid-template-columns:repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border)
}

.calendar-grid .day, .calendar-grid .weekday {
    min-height: 95px;
    padding: 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border)
}

.calendar-grid .weekday {
    min-height: 35px;
    text-align: center;
    background: var(--bg);
    font-size: 12px;
    color: var(--secondary);
    font-weight: 700
}

.calendar-grid .day {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    cursor: pointer;
    background: var(--surface);
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: left
}

.calendar-grid .day > strong {
    line-height: 24px
}

.calendar-grid .day:hover, .calendar-grid .day.selected {
    background: #e8f1fb
}

.calendar-grid .day.muted {
    color: var(--muted);
    background: #fafbfc
}

.calendar-grid .day.today > strong {
    display: inline-grid;
    place-items: center;
    background: var(--rt-azure);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px
}

.calendar-event {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #e8f1fb;
    color: var(--rt-azure);
    border-radius: 4px;
    padding: 3px;
    margin-top: 4px;
    font-size: 11px
}

.agenda-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border)
}

.agenda-item:last-child {
    border: 0
}

.settings-layout {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 16px
}

.settings-layout .card {
    align-self: start
}

.role-table th, .role-table td {
    text-align: center
}

.role-table th:first-child, .role-table td:first-child {
    text-align: left
}

.role-table input {
    accent-color: var(--rt-azure)
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 45, 94, .6);
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px
}

.modal {
    width: min(100%, 560px);
    max-height: min(90vh, 900px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden
}

.modal.wide {
    width: min(100%, 760px)
}

.modal-head {
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px
}

.modal-head h2 {
    font-size: 17px
}

.modal-head button {
    border: 0;
    background: none;
    font-size: 22px;
    color: var(--secondary)
}

.modal-body {
    padding: 20px;
    overflow-y: auto
}

.modal-foot {
    padding: 12px 20px;
    background: var(--bg);
    display: flex;
    justify-content: flex-end;
    gap: 8px
}

.modal .form-grid {
    gap: 12px
}

.modal .form-grid input, .modal .form-grid select, .modal .form-grid textarea {
    min-width: 0
}

.modal-list {
    max-height: 390px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px
}

.modal-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid var(--border)
}

.modal-list-item:last-child {
    border: 0
}

.modal-list-item > .btn {
    margin-left: auto
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: var(--rt-navy);
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
    font-size: 13px;
    max-width: calc(100vw - 30px);
    text-align: center
}

.toast.error {
    background: var(--danger)
}

.login-page {
    height: 100vh;
    min-height: 650px;
    background: #fff;
    position: relative;
    overflow: hidden
}

.login-brand {
    position: absolute;
    left: 8.3%;
    top: 7.1%;
    display: flex;
    align-items: center;
    gap: 12px
}

.login-panel {
    position: absolute;
    left: 8.3%;
    top: 25%;
    width: 520px;
    z-index: 2
}

.login-panel h1 {
    font-size: 48px;
    line-height: 1.25;
    color: var(--rt-royal);
    letter-spacing: var(--letter-spacing-heading)
}

.login-rule {
    display: block;
    width: 72px;
    height: 4px;
    background: var(--rt-gold);
    margin: 20px 0 35px
}

.login-form {
    width: 370px
}

.login-form > label {
    display: block;
    color: var(--secondary);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 18px
}

.login-form > label input {
    display: block;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    width: 100%;
    height: 38px;
    padding: 0 0 7px;
    font-size: 15px;
    color: var(--text)
}

.login-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap
}

.login-controls .btn {
    width: 180px
}

.check-inline {
    font-size: 12px;
    color: var(--secondary)
}

.check-inline input {
    accent-color: var(--rt-azure)
}

.login-wheel {
    position: absolute;
    width: 820px;
    height: 820px;
    right: -125px;
    top: 16%;
    object-fit: contain
}

.login-footer {
    position: absolute;
    bottom: 9%;
    left: 8.3%;
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary)
}

.login-footer span {
    margin-left: 24px;
    color: var(--muted);
    font-weight: 400
}

@media (max-width: 1199px) {
    .content {
        padding: 24px
    }

    .top-search {
        width: 170px
    }

    .stat-grid.four {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }

    .dashboard-grid {
        grid-template-columns:1fr
    }

    .form-layout {
        grid-template-columns:1fr
    }

    .form-side {
        display: grid;
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap: 16px
    }

    .form-side .card {
        margin: 0
    }

    .settings-layout {
        grid-template-columns:1fr
    }

    .officer-grid {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }
}

@media (max-width: 767px) {
    body {
        font-size: 13px
    }

    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        transition: transform .2s;
        width: 260px;
        height: 100dvh
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .sidebar-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(12, 45, 94, .55);
        z-index: 29
    }

    .topbar {
        height: 56px;
        padding: 0 14px;
        justify-content: flex-start;
        gap: 8px
    }

    .menu-toggle {
        display: flex;
        flex: 0 0 36px
    }

    .crumb {
        flex: 1
    }

    .crumb span, .crumb img {
        display: none
    }

    .crumb strong {
        font-size: 16px
    }

    .topbar-actions {
        gap: 5px
    }

    .term-select {
        width: 34px;
        padding: 0;
        justify-content: center
    }

    .term-select span, .term-select img:last-child {
        display: none
    }

    .top-search {
        display: none
    }

    .content {
        padding: 16px;
        min-height: calc(100vh - 56px)
    }

    .page-head {
        display: block;
        margin-bottom: 16px
    }

    .page-head h1 {
        font-size: 21px
    }

    .head-actions {
        justify-content: flex-start;
        margin-top: 12px
    }

    .head-actions .btn {
        height: 34px;
        font-size: 11px;
        padding: 0 9px
    }

    .stat-grid.four {
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap: 8px
    }

    .stat-card {
        height: 90px;
        padding: 12px
    }

    .stat-card strong {
        font-size: 18px
    }

    .stat-card .label {
        font-size: 11px
    }

    .dashboard-grid {
        gap: 12px
    }

    .card {
        border-radius: 10px;
        margin-bottom: 12px
    }

    .card-head {
        min-height: 54px;
        padding: 12px
    }

    .card-body {
        padding: 12px
    }

    .toolbar {
        padding: 10px;
        gap: 6px
    }

    .search-field {
        width: 100%;
        order: -1
    }

    .toolbar-spacer {
        display: none
    }

    .toolbar select, .toolbar .chip {
        flex: 1;
        min-width: 0
    }

    .table-scroll {
        overflow: visible
    }

    :is(.data-table,.phf-card table,.dashboard-grid table), :is(.data-table,.phf-card table,.dashboard-grid table) tbody, :is(.data-table,.phf-card table,.dashboard-grid table) tr, :is(.data-table,.phf-card table,.dashboard-grid table) td {
        display: block;
        width: 100%
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) thead {
        display: none
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) tr {
        border-bottom: 1px solid var(--border);
        padding: 11px 12px
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) td {
        border: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 4px 0;
        white-space: normal;
        text-align: right
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) td:before {
        content: attr(data-label);
        font-size: 11px;
        color: var(--muted);
        font-weight: 700;
        text-align: left;
        flex: 0 0 92px
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) td:first-child {
        justify-content: flex-start;
        font-size: 14px
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) td:first-child:before {
        display: none
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) td .row-actions {
        justify-content: flex-end
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) td .member-cell {
        text-align: left
    }

    .table-footer {
        padding: 8px 12px
    }

    .form-card {
        padding: 14px
    }

    .form-grid.three, .form-grid.two, .form-side {
        grid-template-columns:1fr
    }

    .span-two, .span-three {
        grid-column: auto
    }

    .form-side {
        display: block
    }

    .form-side .card {
        margin-bottom: 12px
    }

    .term-layout {
        grid-template-columns:1fr
    }

    .term-list {
        display: flex;
        overflow-x: auto
    }

    .term-item {
        min-width: 150px
    }

    .officer-grid {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }

    .info-bar {
        align-items: flex-start;
        flex-wrap: wrap
    }

    .info-bar .btn {
        margin-left: 0
    }

    .calendar-card {
        padding: 10px
    }

    .calendar-grid .day {
        min-height: 54px;
        padding: 4px
    }

    .calendar-grid .weekday {
        min-height: 26px;
        padding: 4px
    }

    .calendar-event {
        font-size: 9px;
        padding: 2px
    }

    .modal-overlay {
        padding: 0;
        align-items: stretch
    }

    .modal, .modal.wide {
        width: 100%;
        height: 100dvh;
        max-height: none;
        border-radius: 0
    }

    .modal-body {
        flex: 1
    }

    .login-page {
        min-height: 100dvh;
        height: auto
    }

    .login-brand {
        left: 22px;
        top: 34px
    }

    .login-panel {
        left: 22px;
        right: 22px;
        top: 170px;
        width: auto
    }

    .login-panel h1 {
        font-size: 32px;
        letter-spacing: var(--letter-spacing-heading)
    }

    .login-form {
        width: 100%
    }

    .login-controls {
        flex-wrap: wrap;
        gap: 10px
    }

    .login-controls .btn {
        width: 100%;
        order: 3
    }

    .login-wheel {
        width: 400px;
        height: 400px;
        right: -210px;
        top: 110px;
        opacity: .18
    }

    .login-footer {
        left: 22px;
        right: 22px;
        bottom: 25px;
        font-size: 10px
    }

    .login-footer span {
        display: block;
        margin: 6px 0
    }

    .segmented {
        flex-wrap: wrap
    }
}

/* Server-backed controls share the existing Rotary tokens. */
.sidebar-user strong {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis
}

.modal-list > button {
    width: 100%;
    background: var(--surface);
    color: var(--text);
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--border)
}

.member-role {
    align-items: end;
    margin-bottom: 12px
}

.committee-row select, .officer-card select {
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 8px;
    background: var(--surface)
}

.notice-body {
    line-height: 1.8;
    overflow-wrap: anywhere;
    padding-top: 16px
}

@media (max-width: 767px) {
    .toolbar .chip {
        flex: 1 1 42%;
        white-space: nowrap;
        min-width: 110px
    }

    .toolbar select {
        flex: 1 1 42%;
        min-width: 110px
    }

    .toolbar > #memberSort {
        flex-basis: 100%;
        text-align: left;
        white-space: nowrap
    }

    .modal .table-scroll {
        overflow-x: auto
    }

    .role-table td input[type=checkbox] {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
        accent-color: var(--rt-azure)
    }

    .committee-row {
        gap: 8px
    }
}

/* Password page spacing is independent of the login illustration layout. */
.password-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding: 64px 8.3%;
    background: var(--surface)
}

.password-panel {
    width: 100%;
    max-width: 440px
}

.password-heading {
    margin-bottom: 32px
}

.password-heading h1 {
    font-size: 32px;
    line-height: 1.35;
    color: var(--rt-royal);
    font-weight: 750
}

.password-heading p {
    margin-top: 16px;
    color: var(--secondary);
    font-size: 15px;
    line-height: 1.8
}

.password-form {
    display: grid;
    gap: 24px
}

.password-form > label {
    display: grid;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
    color: var(--secondary)
}

.password-form input {
    width: 100%;
    min-width: 0;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-weight: 400
}

.password-form input::placeholder {
    color: var(--muted);
    font-size: 14px
}

.password-form .password-help {
    font-size: 13px;
    line-height: 1.7;
    color: var(--secondary)
}

.password-form > .btn {
    height: 48px;
    font-size: 15px
}

.login-form > label input {
    margin-top: 8px
}

.login-panel h1 {
    line-height: 1.4
}

@media (max-width: 767px) {
    .password-page {
        align-items: flex-start;
        padding: 96px 24px 40px
    }

    .password-heading h1 {
        font-size: 28px
    }

    .password-heading p {
        font-size: 14px
    }

    .password-form {
        gap: 22px
    }
}

/* Shared member selection cards and searchable modal. */
.member-choice {
    display: block;
    min-width: 0;
    width: 100%
}

.member-choice-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 72px;
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text)
}

.member-choice-button:hover {
    border-color: var(--rt-azure);
    background: #f8fbff
}

.member-choice-button:focus-visible, .member-picker-row:focus-visible {
    outline: 2px solid var(--rt-azure);
    outline-offset: 2px
}

.picker-avatar {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: 50%;
    background: #e8f1fb;
    color: var(--rt-royal);
    font-size: 18px;
    font-weight: 700
}

.picker-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover
}

.picker-identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1
}

.picker-identity strong {
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere
}

.picker-identity small {
    font-size: 12px;
    line-height: 1.6;
    color: var(--secondary);
    overflow-wrap: anywhere
}

.picker-change {
    flex: 0 0 auto;
    color: var(--rt-azure);
    font-size: 12px;
    font-weight: 600
}

.officer-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface)
}

.officer-card > strong {
    font-size: 13px;
    color: var(--secondary)
}

.officer-grid {
    gap: 16px
}

.president-card {
    padding: 20px;
    border: 0;
    background: var(--rt-royal)
}

.president-card > .officer-card {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent
}

.president-card .officer-card > strong {
    color: #fff;
    font-size: 16px
}

.president-card .member-choice-button {
    min-height: 80px
}

.committee-row > .member-choice {
    width: 100%;
    max-width: none;
    min-width: 0
}

.member-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 45, 94, .6)
}

.member-picker-dialog {
    display: flex;
    flex-direction: column;
    width: min(100%, 640px);
    max-height: min(88dvh, 760px);
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden
}

.member-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border)
}

.member-picker-head h2 {
    font-size: 18px
}

.picker-close {
    border: 0;
    background: none;
    font-size: 26px;
    color: var(--secondary);
    width: 36px;
    height: 36px
}

.member-picker-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 24px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary)
}

.member-picker-search input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text)
}

.member-picker-count {
    padding: 12px 24px;
    color: var(--secondary);
    font-size: 12px
}

.member-picker-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 24px 16px;
    overscroll-behavior: contain
}

.member-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 12px;
    text-align: left;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px
}

.member-picker-row:hover, .member-picker-row[aria-pressed=true] {
    border-color: var(--rt-azure);
    background: #e8f1fb
}

.member-picker-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg)
}

.picker-empty {
    padding: 32px 12px;
    text-align: center;
    color: var(--secondary)
}

@media (max-width: 767px) {
    .officer-grid {
        grid-template-columns:1fr
    }

    .president-card {
        padding: 16px
    }

    .member-picker-overlay {
        padding: 0
    }

    .member-picker-dialog {
        width: 100%;
        height: 100dvh;
        max-height: none;
        border-radius: 0
    }

    .member-picker-head {
        padding: 16px
    }

    .member-picker-search {
        padding: 16px 16px 0
    }

    .member-picker-count {
        padding: 12px 16px
    }

    .member-picker-list {
        padding: 0 16px 16px
    }

    .member-picker-foot {
        padding: 16px
    }

    .member-choice-button {
        gap: 10px
    }
}

/* Keep long categories and native date controls inside their form columns. */
.form-main, .form-side, .form-grid > label, .form-grid > fieldset {
    min-width: 0
}

.form-grid input, .form-grid select, .form-grid textarea {
    min-width: 0;
    max-width: 100%
}

.segmented {
    flex-wrap: wrap
}

#noticeCategoryButtons {
    gap: 6px
}

#noticeForm .form-grid > label.span-three {
    display: block
}

#noticeForm input[name=title] {
    display: block;
    margin-top: 7px
}

.segmented label {
    position: relative
}

.segmented input {
    width: 1px;
    min-width: 0;
    height: 1px;
    min-height: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%)
}

.segmented input:focus-visible + span {
    outline: 2px solid var(--rt-azure);
    outline-offset: 2px
}

/* WEB 01: retain the source layout while using the shared Pretendard family. */
@media (min-width: 768px) {
    .login-brand, .login-panel, .login-footer {
        left: 8.333333%
    }

    .login-panel {
        top: 22.222222%
    }

    .login-panel h1 {
        font-size: 56px;
        line-height: 1.2
    }

    .login-form > label {
        font-size: 13px
    }

    .login-form > label input {
        font-size: 18px
    }

    .login-controls .btn {
        font-size: 15px
    }

    .login-wheel {
        right: -260px;
        top: 15.555556%
    }

    .login-footer {
        bottom: 6.666667%;
        font-size: 13px
    }
}

@media (min-width: 768px) {
    .login-form {
        width: 440px
    }

    .login-controls .btn {
        height: 56px
    }

    .login-controls .check-inline, #resetPassword {
        font-size: 14px
    }

    .check-inline input {
        width: 16px;
        height: 16px;
        vertical-align: middle
    }
}

.stack-fields .radio-line, .stack-fields .check-line, .stack-fields .toggle-line, .form-grid .toggle-line, .settings-layout .toggle-line {
    flex-direction: row
}

.stack-fields .toggle-line {
    align-items: center;
    gap: 10px;
    min-height: 24px;
    font-weight: 500
}

.stack-fields input[type=checkbox], .stack-fields input[type=radio], .form-grid input[type=checkbox] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    flex: 0 0 16px;
    margin: 0;
    padding: 0
}

.settings-layout .toggle-line {
    align-items: center;
    gap: 10px
}

.settings-layout .toggle-line input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    flex: 0 0 16px;
    accent-color: var(--rt-azure)
}

@media (min-width: 1200px) {
    body[data-page=dashboard] .stat-grid.four {
        gap: 20px
    }

    body[data-page=dashboard] .stat-card {
        height: 133px;
        padding: 24px;
        gap: 8px
    }

    body[data-page=dashboard] .stat-card .label {
        font-size: 14px
    }

    body[data-page=dashboard] .stat-card strong {
        font-size: 28px
    }

    body[data-page=dashboard] .dashboard-grid {
        gap: 24px;
        grid-template-columns:minmax(0, 19fr) minmax(280px, 9fr)
    }
}

.profile-avatar img {
    object-fit: cover;
    border-radius: 50%
}

.avatar[data-member-photo] {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: var(--rt-navy);
    font-size: 12px
}

.avatar[data-member-photo] img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit
}

.avatar[data-member-photo].has-photo {
    color: transparent
}

.stat-grid.three {
    grid-template-columns:repeat(3, minmax(0, 1fr))
}

@media (max-width: 767px) {
    .stat-grid.three {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }

    .stat-grid.three > :last-child {
        grid-column: 1/-1
    }
}

.profile-upload {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    overflow-wrap: anywhere
}

.profile-upload > small {
    color: var(--secondary);
    font-size: 12px;
    line-height: 1.6
}

.business-card-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 120px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg)
}

.business-card-preview img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 4px
}

/* Keep committee labels, member cards and actions aligned at every width. */
@media (max-width: 1199px) {
    .committee-row {
        grid-template-columns:minmax(0, 1fr) auto;
        gap: 10px
    }

    .committee-row > .member-choice {
        grid-column: 1 / -1;
        grid-row: 2
    }

    .committee-row > .text-btn {
        grid-column: 2;
        grid-row: 1
    }
}

/* Shared field and choice alignment for page forms and registration dialogs. */
.form-grid label:has(>em) {
    display: block
}

.form-grid label:has(>em) > input, .form-grid label:has(>em) > select, .form-grid label:has(>em) > textarea {
    display: block;
    margin-top: 7px
}

.form-grid label.check-line, .form-grid label.radio-line, .form-grid label.toggle-line {
    align-self: end;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    font-weight: 500
}

.form-grid label.check-line input, .form-grid label.radio-line input, .form-grid label.toggle-line input {
    width: 16px;
    height: 16px;
    min-height: 16px;
    flex: 0 0 16px;
    margin: 0;
    padding: 0
}

.member-role > .btn {
    height: 40px
}

.card-head > div {
    min-width: 0;
    max-width: 100%
}

.card-head > .btn {
    flex-shrink: 0
}

@media (max-width: 767px) {
    :is(.data-table,.phf-card table,.dashboard-grid table) td .text-btn {
        max-width: 100%;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: right
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) td.empty-state {
        display: block;
        text-align: center;
        padding: 32px 16px
    }

    :is(.data-table,.phf-card table,.dashboard-grid table) td.empty-state:before {
        display: none
    }

    .member-role > .btn {
        justify-self: end
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .top-search {
        display: none
    }
}


.modal-head h2 {
    min-width: 0;
    overflow-wrap: anywhere
}

.modal-head > button {
    flex-shrink: 0
}

.modal-body > h2 + p, .modal-body > p + p {
    margin-top: 12px
}

.modal-body > h2 + div {
    margin-top: 16px
}

.modal-body > p:empty {
    display: none
}


@media (max-width: 1199px) {
    .term-layout {
        grid-template-columns:minmax(0, 1fr)
    }

    .term-list {
        display: flex;
        overflow-x: auto
    }

    .term-item {
        flex: 0 0 150px
    }
}

@media (max-width: 1023px) {
    .officer-grid {
        grid-template-columns:minmax(0, 1fr)
    }
}

.agenda-item .head-actions {
    justify-content: flex-start;
    gap: 8px
}

.agenda-item .head-actions strong {
    min-width: 0;
    overflow-wrap: anywhere
}

@media (max-width: 767px) {
    .agenda-item .head-actions {
        display: grid;
        grid-template-columns:auto minmax(0, 1fr) auto auto;
        margin-top: 0
    }

    .agenda-item .head-actions strong {
        grid-column: 2 / -1
    }

    .agenda-item .head-actions > span:not(.badge) {
        grid-column: 1 / 3;
        min-width: 0;
        overflow-wrap: anywhere
    }
}

/* The dashboard officer card stays readable at every sidebar/content width. */
#dashboardOfficers {
    display: grid;
    grid-template-columns:minmax(0, 1fr)
}

#dashboardOfficers .officer-row {
    display: grid;
    grid-template-columns:minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    min-width: 0
}

#dashboardOfficers .officer-row strong {
    min-width: 0;
    overflow-wrap: anywhere
}

#dashboardOfficers .officer-row .badge {
    margin: 0;
    min-width: 100px;
    justify-content: center;
    white-space: nowrap
}

.attachment-row {
    flex-wrap: wrap;
    min-width: 0
}

.attachment-pick {
    flex: none
}

.attachment-selection {
    flex: 1 1 100%;
    min-width: 0;
    display: grid;
    gap: 8px
}

.attachment-selection:empty {
    display: none
}

.attachment-selected-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface)
}

.attachment-selected-file > span {
    min-width: 0;
    overflow-wrap: anywhere
}

.attachment-selected-file > button {
    flex: none
}

.attachment-selection small {
    color: var(--muted);
    font-weight: 400
}

#noticeFiles {
    min-width: 0;
    flex: 1 1 100%
}

#noticeFiles:empty {
    display: none
}

#noticeSaveStatus {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--rt-azure)
}

#noticeSaveStatus:before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--rt-azure);
    border-radius: 50%;
    animation: upload-spin .8s linear infinite
}

.upload-progress {
    position: fixed;
    z-index: 1200;
    bottom: 24px;
    right: 24px;
    width: min(360px, calc(100vw - 32px));
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px
}

.upload-progress p {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere
}

.upload-progress small {
    color: var(--secondary)
}

.upload-progress progress {
    width: 100%;
    height: 8px;
    accent-color: var(--rt-azure);
    border: 0;
    border-radius: 8px;
    overflow: hidden
}

@keyframes upload-spin {
    to {
        transform: rotate(360deg)
    }
}

@media (max-width: 767px) {
    .upload-progress {
        right: 16px;
        bottom: 16px
    }

    .attachment-selected-file {
        align-items: flex-start
    }
}

@media (prefers-reduced-motion: reduce) {
    #noticeSaveStatus:before {
        animation: none
    }
}

.upload-progress progress {
    appearance: none;
    -webkit-appearance: none;
    background: var(--border)
}

.upload-progress progress::-webkit-progress-bar {
    background: transparent;
    border-radius: 8px
}

.upload-progress progress::-webkit-progress-value {
    background: var(--rt-azure);
    border-radius: 8px
}

.upload-progress progress::-moz-progress-bar {
    background: var(--rt-azure);
    border-radius: 8px
}

.upload-progress progress:not([value]) {
    background: linear-gradient(90deg, var(--border) 15%, var(--rt-azure) 50%, var(--border) 85%);
    background-size: 200% 100%;
    animation: upload-wait 1.3s linear infinite
}

@keyframes upload-wait {
    to {
        background-position: -200% 0
    }
}

@media (prefers-reduced-motion: reduce) {
    .upload-progress progress:not([value]) {
        animation: none
    }
}
