:root {
    --navy: #07142a;
    --navy-2: #0d2342;
    --red: #c51f27;
    --gold: #d8aa44;
    --gold-2: #f1d38a;
    --ink: #171b22;
    --muted: #657184;
    --line: #d9dee7;
    --paper: #f6f7f9;
    --white: #ffffff;
    --shadow: 0 18px 45px rgba(7, 20, 42, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: var(--paper);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    padding: 12px clamp(16px, 4vw, 54px);
    color: var(--white);
    background: rgba(7, 20, 42, 0.96);
    border-bottom: 1px solid rgba(216, 170, 68, 0.34);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(216, 170, 68, 0.65);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 18px;
    line-height: 1.1;
}

.brand small {
    color: var(--gold-2);
    font-size: 12px;
    margin-top: 3px;
}

.brand em {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 11px;
    font-style: normal;
    font-weight: 500;
    line-height: 1.25;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-nav a,
.main-nav button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    color: #eef3fb;
    background: transparent;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.main-nav a:hover,
.main-nav button:hover,
.main-nav .nav-action {
    background: rgba(216, 170, 68, 0.16);
    color: var(--gold-2);
}

.nav-notification {
    position: relative;
    min-width: 44px;
    justify-content: center;
    padding-inline: 10px;
}

.nav-notification svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-notification-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.nav-notification-count {
    position: absolute;
    top: 3px;
    right: 3px;
    display: none;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--navy);
    border-radius: 999px;
    color: var(--navy);
    background: var(--gold);
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
}

.nav-notification.has-pending {
    color: var(--gold-2);
    background: rgba(216, 170, 68, 0.16);
}

.nav-notification.has-pending .nav-notification-count {
    display: inline-block;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    display: none;
    min-width: 170px;
    padding: 7px;
    border: 1px solid rgba(216, 170, 68, 0.32);
    border-radius: 8px;
    background: rgba(9, 25, 53, 0.97);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
    display: grid;
    gap: 4px;
}

.nav-dropdown-menu a,
.nav-dropdown-menu button {
    width: 100%;
    justify-content: flex-start;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
    border: 1px solid rgba(216, 170, 68, 0.46);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--gold-2);
}

.hero {
    min-height: 78vh;
    color: var(--white);
    background-image:
        linear-gradient(90deg, rgba(7, 20, 42, 0.94), rgba(7, 20, 42, 0.74) 44%, rgba(7, 20, 42, 0.28)),
        url('../img/htc-card-reference.jpeg');
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    min-height: inherit;
    display: flex;
    align-items: center;
    padding: clamp(44px, 7vw, 88px) clamp(18px, 5vw, 72px);
}

.hero-copy {
    width: min(720px, 100%);
}

.logo-pair {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.logo-pair img {
    width: 66px;
    height: 66px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--white);
    border: 1px solid rgba(216, 170, 68, 0.7);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 14px;
    font-size: 52px;
    line-height: 1;
}

h2 {
    margin-bottom: 12px;
    font-size: 32px;
    line-height: 1.12;
}

h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.hero-text {
    width: min(620px, 100%);
    color: #e6ecf5;
    font-size: 18px;
}

.hero-actions,
.scanner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 24px;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.is-loading {
    cursor: wait;
    opacity: 0.82;
    pointer-events: none;
}

.btn.is-loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 999px;
    animation: htc-spin 0.72s linear infinite;
}

@keyframes htc-spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary {
    color: var(--navy);
    background: var(--gold);
    box-shadow: 0 10px 24px rgba(216, 170, 68, 0.24);
}

.btn-primary:hover {
    background: var(--gold-2);
}

.btn-outline,
.btn-outline-dark {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.46);
    color: var(--white);
}

.btn-outline-dark {
    border-color: var(--line);
    color: var(--navy);
}

.btn-full {
    width: 100%;
}

.section {
    padding: clamp(44px, 6vw, 78px) clamp(18px, 5vw, 72px);
}

.section-light {
    background: var(--white);
}

.section-dark {
    color: var(--white);
    background:
        linear-gradient(135deg, rgba(197, 31, 39, 0.18), transparent 34%),
        var(--navy);
}

.section-heading {
    width: min(780px, 100%);
    margin-bottom: 28px;
}

.landing-section-heading {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.landing-section-title h2 {
    margin-bottom: 0;
}

.landing-section-title {
    min-width: 0;
}

.landing-section-heading .btn {
    flex: 0 0 auto;
}

.feature-grid,
.stats-grid,
.member-grid {
    display: grid;
    gap: 16px;
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.stat-card,
.panel,
.member-card,
.auth-panel,
.scanner-panel {
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.feature-card {
    padding: 24px;
    border: 1px solid var(--line);
}

.feature-icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 8px;
    color: var(--navy);
    background: var(--gold);
    font-weight: 900;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
    gap: clamp(22px, 4vw, 52px);
    align-items: center;
}

.split p {
    color: #dce5f1;
}

.reference-media {
    border: 1px solid rgba(216, 170, 68, 0.44);
    border-radius: 8px;
    overflow: hidden;
    background: #0b1930;
}

.reference-media img {
    width: 100%;
    height: 360px;
    object-fit: cover;
}

.auth-page {
    flex: 1;
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 22px 18px;
    background:
        linear-gradient(135deg, rgba(197, 31, 39, 0.12), transparent 38%),
        var(--paper);
}

.auth-panel {
    width: min(440px, 100%);
    padding: 26px;
    border: 1px solid var(--line);
}

.auth-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 20px;
}

.auth-brand img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.auth-brand h1 {
    margin-bottom: 0;
    font-size: 28px;
}

.member-code-login {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.member-code-login:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(216, 170, 68, 0.2);
}

.member-code-login span {
    display: grid;
    place-items: center;
    min-height: 46px;
    padding: 0 13px;
    color: var(--navy);
    background: #eef2f7;
    border-right: 1px solid var(--line);
    font-weight: 900;
}

.member-code-login input {
    border: 0;
    border-radius: 0;
    min-height: 46px;
    letter-spacing: 0;
    font-weight: 900;
}

.member-code-login input:focus {
    box-shadow: none;
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle[aria-pressed="true"] {
    color: var(--navy);
    background: #f7f0df;
    border-color: rgba(216, 170, 68, 0.38);
    outline: none;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle-eye-off,
.password-toggle[aria-pressed="true"] .password-toggle-eye {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle-eye-off {
    display: block;
}

.form-card label,
.manual-form label {
    display: block;
    margin: 14px 0 7px;
    color: var(--navy);
    font-weight: 800;
}

.form-card .btn-full {
    margin-top: 22px;
}

.login-error {
    margin: 14px 0 -6px;
    padding: 9px 10px;
    border: 1px solid rgba(197, 31, 39, 0.18);
    border-radius: 8px;
    color: #8a1117;
    background: #fde7e9;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.login-error + .btn-full {
    margin-top: 14px;
}

.login-takeover-modal {
    display: flex;
}

.login-takeover-dialog {
    overflow: hidden;
}

.login-takeover-dialog::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--red), var(--gold), var(--navy));
}

.login-takeover-user {
    display: inline-flex;
    align-items: center;
    margin: 8px 0 10px;
    padding: 7px 10px;
    border: 1px solid rgba(216, 170, 68, 0.35);
    border-radius: 8px;
    color: var(--navy);
    background: rgba(216, 170, 68, 0.12);
    font-size: 14px;
    font-weight: 600;
}

.login-takeover-actions form {
    display: flex;
    margin: 0;
}

.login-takeover-actions .btn {
    min-width: 128px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
    background: var(--white);
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(216, 170, 68, 0.2);
}

.form-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.dashboard-shell,
.attendance-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.page-title,
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.page-title h1 {
    color: var(--navy);
    font-size: 34px;
    margin-bottom: 6px;
}

.page-title p:not(.eyebrow) {
    color: var(--muted);
    margin-bottom: 0;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.stat-card {
    padding: 22px;
    border: 1px solid var(--line);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    color: var(--navy);
    font-size: 30px;
    line-height: 1.1;
}

.panel {
    padding: 22px;
    margin-top: 18px;
    border: 1px solid var(--line);
}

.panel h2 {
    margin-bottom: 0;
    color: var(--navy);
    font-size: 24px;
}

.member-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.member-card {
    padding: 14px;
    border: 1px solid var(--line);
    box-shadow: none;
}

.member-card strong,
.member-card span {
    display: block;
}

.member-card strong {
    margin-top: 12px;
    color: var(--navy);
}

.member-card span {
    color: var(--muted);
    font-size: 13px;
}

.qr-box {
    width: 124px;
    min-height: 124px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--white);
}

.qr-box canvas,
.qr-box img {
    width: 112px;
    height: 112px;
}

.qr-box-small {
    width: 94px;
    min-height: 94px;
}

.qr-box-small canvas,
.qr-box-small img {
    width: 82px;
    height: 82px;
}

.qr-box-mini {
    width: 68px;
    min-height: 68px;
}

.qr-box-mini canvas,
.qr-box-mini img {
    width: 58px;
    height: 58px;
}

.qr-box-compact {
    width: 64px;
    min-height: 64px;
}

.qr-box-compact canvas,
.qr-box-compact img {
    width: 54px;
    height: 54px;
}

.qr-box > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 10px);
    aspect-ratio: 1 / 1;
    border: 1px dashed rgba(7, 20, 42, 0.22);
    border-radius: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.qr-cell {
    display: grid;
    gap: 8px;
    justify-items: start;
}

.qr-download-button {
    margin-top: 10px;
}

/* .table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
} */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    min-width: 100%;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--navy);
    font-size: 13px;
    text-transform: uppercase;
}

/* .attendance-shell {
    width: min(1220px, calc(100% - 32px));
} */

.attendance-shell {
    width: 100%;
    max-width: 1220px;

    margin: 0 auto;

    padding-left: 16px;
    padding-right: 16px;
}

/* .scanner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(120px, 0.92fr);
    gap: 18px;
    align-items: stretch;
} */

.scanner-layout {
    display: grid;

    grid-template-columns:
        minmax(320px, 0.78fr) minmax(0, 1.22fr);

    gap: 18px;

    align-items: stretch;

    width: 100%;
}

.scanner-layout > .scanner-panel,
.scanner-layout > .recent-panel {
    margin-top: 0;
    min-height: 0;
}

.recent-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.recent-panel .panel-heading,
.recent-panel .live-list,
.recent-panel .attendance-stats-grid {
    flex: 0 0 auto;
}

.attendance-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.attendance-table-wrap table {
    min-width: 100%;
}

.attendance-stats-grid {
    margin-bottom: 18px;
}

.attendance-stats-grid .stat-card {
    padding: 14px 16px;
}

.attendance-stats-grid .stat-card strong {
    font-size: 24px;
}

/* .scanner-panel {
    padding: 22px;
    border: 1px solid var(--line);   
} */

@media (max-width: 560px) {

    .attendance-shell {
        width: 100%;

        padding-left: 10px;
        padding-right: 10px;
    }

    .scanner-layout {
        grid-template-columns: 1fr;
    }

    .scanner-panel,
    .recent-panel,
    .panel {
        width: 100%;

        min-width: 0;

        padding: 14px;

        border-radius: 18px;
    }

}

@media (max-width: 900px) {
    .recent-panel {
        height: auto !important;
        overflow: visible;
    }

    .attendance-table-wrap {
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
    }
}

.scanner-panel {
    width: 100%;

    min-width: 0;

    overflow: hidden;

    padding: 22px;

    border: 1px solid var(--line);
}

.qr-reader-shell {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.qr-reader-shell .qr-reader {
    max-width: none;
    margin: 0;
}

/* .qr-reader {
    width: 100%;
    min-height: 360px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid rgba(216, 170, 68, 0.54);
    background: #101827;
} */

.qr-reader {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    border-radius: 22px;
    border: 2px solid rgba(216, 170, 68, 0.54);

    background: #000;

    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.qr-reader.is-scan-success {
    border-color: #22c55e;
    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.22),
        0 10px 35px rgba(0, 0, 0, 0.35);
}

.qr-reader.is-scan-error {
    border-color: #ef4444;
    box-shadow:
        0 0 0 4px rgba(239, 68, 68, 0.24),
        0 10px 35px rgba(0, 0, 0, 0.35);
}

/* .qr-reader > div,
.qr-reader video,
.qr-reader canvas {
    width: 100% !important;
    max-width: 100% !important;
} */

.qr-reader>div {
    width: 100% !important;
    height: 100% !important;
}

.qr-reader video,
.qr-reader canvas {
    width: 100% !important;
    height: 100% !important;

    object-fit: cover !important;

    border-radius: 22px;
}

.qr-reader video {
    height: 100% !important;
    object-fit: cover;
}

.scanner-camera-controls {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    margin: 14px auto 0;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(7, 20, 42, 0.76);
    backdrop-filter: blur(10px);
}

.scanner-icon-button {
    width: 100%;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: var(--white);
    background: rgba(7, 20, 42, 0.78);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.scanner-icon-button:hover {
    transform: translateY(-1px);
    background: rgba(13, 34, 70, 0.88);
    border-color: rgba(216, 170, 68, 0.74);
}

.scanner-icon-button:focus-visible {
    outline: 3px solid rgba(216, 170, 68, 0.34);
    outline-offset: 3px;
}

.scanner-icon-button.is-active {
    color: #101827;
    background: var(--gold);
    border-color: rgba(255, 255, 255, 0.58);
}

.scanner-icon-button.is-danger {
    color: var(--white);
    background: rgba(138, 17, 23, 0.88);
}

.scanner-icon-button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
}

.scanner-icon {
    position: relative;
    width: 24px;
    height: 24px;
    display: block;
}

.scanner-icon-camera::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 8px;
    width: 18px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 4px;
    box-sizing: border-box;
}

.scanner-icon-camera::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 11px;
    width: 6px;
    height: 6px;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
}

.scanner-icon-flash::before {
    content: "";
    position: absolute;
    inset: 2px 5px;
    background: currentColor;
    clip-path: polygon(58% 0, 15% 50%, 47% 50%, 34% 100%, 86% 38%, 55% 38%);
}

.scan-status {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--navy);
    background: #eef2f7;
    font-weight: 800;
}

.scan-status.is-success {
    color: #0c5b2b;
    background: #e4f8eb;
}

.scan-status.is-error {
    color: #8a1117;
    background: #fde7e9;
}

.scan-status.is-loading {
    color: #6f4b00;
    background: #fff4d7;
}

.scan-toast {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin-top: 14px;
    padding: 10px 13px;
    border: 1px solid rgba(216, 170, 68, 0.42);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 248, 229, 0.96), rgba(255, 255, 255, 0.96));
    box-shadow: 0 14px 28px rgba(16, 32, 58, 0.12);
}

.scan-toast[hidden] {
    display: none;
}

.scan-toast strong {
    display: none;
}

.scan-toast span {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--navy);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scan-toast.is-success {
    border-left-color: #22c55e;
    background: linear-gradient(135deg, #e4f8eb, #ffffff);
}

.scan-toast.is-error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fde7e9, #ffffff);
}

.cash-scan-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(216, 170, 68, 0.34);
    border-radius: 8px;
    color: var(--navy);
    background: #fbfcfe;
    cursor: pointer;
}

.cash-scan-option input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--gold);
}

.cash-scan-option strong,
.cash-scan-option small {
    display: block;
}

.cash-scan-option small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.attendance-location-form {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(216, 170, 68, 0.32);
    border-radius: 8px;
    background: #fbfcfe;
}

.attendance-location-form label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-weight: 500;
}

.attendance-location-form label > span {
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.attendance-location-form select {
    min-height: 44px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--navy);
    background: var(--white);
    font-size: 14px;
}

.attendance-location-form small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}

.attendance-location-loading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: -4px 0 14px;
    padding: 12px;
    border: 1px solid rgba(216, 170, 68, 0.34);
    border-radius: 8px;
    color: var(--navy);
    background: linear-gradient(180deg, #ffffff 0%, #fff9ec 100%);
}

.attendance-location-loading[hidden] {
    display: none;
}

.attendance-location-loading strong,
.attendance-location-loading small {
    display: block;
}

.attendance-location-loading strong {
    font-size: 13px;
    font-weight: 600;
}

.attendance-location-loading small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

.attendance-location-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(216, 170, 68, 0.28);
    border-top-color: var(--gold-dark);
    border-radius: 50%;
    animation: attendance-location-spin 760ms linear infinite;
}

@keyframes attendance-location-spin {
    to {
        transform: rotate(360deg);
    }
}

.cash-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.cash-status.is-paid {
    color: #0c5b2b;
    background: #e4f8eb;
}

.cash-status.is-unpaid {
    color: #8a1117;
    background: #fde7e9;
}

.attendance-time {
    display: inline-block;
}

.attendance-status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 22px;
    margin-left: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.attendance-status-badge.is-on-time {
    color: #0c5b2b;
    background: #e4f8eb;
}

.attendance-status-badge.is-late {
    color: #8a1117;
    background: #fde7e9;
}

.attendance-status-badge.is-absent {
    color: #5b6472;
    background: #eef1f5;
}

.attendance-status-badge.is-excused {
    color: #7a4b02;
    background: #fff4d7;
}

.attendance-table-wrap .attendance-status-badge {
    margin-top: 4px;
    margin-left: 0;
}

.cash-dashboard-table {
    min-width: 680px;
}

.cash-dashboard-time-col {
    width: 24%;
}

.cash-dashboard-name-col {
    width: 28%;
}

.cash-dashboard-status-col {
    width: 20%;
}

.cash-dashboard-action-col {
    width: 28%;
}

.cash-dashboard-action-cell {
    white-space: nowrap;
}

.cash-dashboard-action-cell .cash-action-form {
    justify-content: flex-start;
}

.cash-dashboard-table .cash-status {
    font-weight: 500;
}

.manual-form {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.manual-member-code-form {
    align-items: stretch;
    grid-template-columns: 1fr;
}

.manual-member-code {
    width: 100%;
}

.live-list {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.live-item {
    padding: 11px 12px;
    border-radius: 8px;
    color: #0c5b2b;
    background: #e4f8eb;
    font-weight: 800;
}

.report-filter-form {
    display: grid;
    grid-template-columns: 180px 180px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.report-filter-form label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-weight: 500;
}

.report-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.report-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--navy);
    background: #fbfcfe;
    border: 1px solid var(--line);
}

.report-summary.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(190px, 1.2fr);
    align-items: stretch;
    gap: 10px;
    padding: 10px;
}

.report-summary-card {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.report-summary-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.report-summary-card strong {
    color: var(--navy);
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
}

.report-summary-card.is-on-time strong {
    color: #0c5b2b;
}

.report-summary-card.is-late strong {
    color: #a16207;
}

.report-summary-card.is-absent strong {
    color: #8a1117;
}

.report-summary-card.is-excused strong {
    color: #7a4b02;
}

.report-summary-period strong {
    font-size: 15px;
    line-height: 1.25;
}

.report-summary span {
    color: var(--muted);
    font-size: 13px;
}

.report-summary .report-summary-card span {
    font-size: 12px;
    font-weight: 500;
}

.attendance-report-time-col {
    width: 22%;
}

.attendance-report-name-col {
    width: 28%;
}

.attendance-report-status-col {
    width: 12%;
}

.attendance-report-location-col {
    width: 38%;
}

.attendance-report-table th,
.attendance-report-table td {
    overflow-wrap: anywhere;
}

.attendance-report-table th {
    white-space: nowrap;
}

.attendance-report-status-cell {
    white-space: nowrap;
}

.attendance-leave-shell {
    gap: 16px;
}

.attendance-leave-submit {
    display: grid;
    gap: 16px;
}

.compact-heading {
    margin-bottom: 16px;
}

.compact-heading h2 {
    margin-bottom: 6px;
    color: var(--navy);
    font-size: 24px;
    font-weight: 500;
}

.compact-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.attendance-leave-table {
    min-width: 760px;
}

.attendance-leave-time-col {
    width: 34%;
}

.attendance-leave-name-col {
    width: 36%;
}

.attendance-leave-status-col {
    width: 30%;
}

.leave-status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.leave-status-badge.is-pending {
    color: #7a4b02;
    background: #fff4d7;
}

.leave-status-badge.is-approved {
    color: #0c5b2b;
    background: #e4f8eb;
}

.leave-status-badge.is-rejected {
    color: #8a1117;
    background: #fde7e9;
}

.leave-status-badge.is-cancelled {
    color: #4b5563;
    background: #eef2f7;
}

.attendance-leave-review-form {
    display: grid;
    gap: 10px;
}

.attendance-leave-review-form label {
    display: grid;
    gap: 7px;
}

.attendance-leave-review-form textarea {
    min-height: 92px;
}

.leave-review-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cash-stats-grid .stat-card strong {
    font-size: clamp(22px, 3vw, 30px);
}

.cash-settings-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px)) auto;
    gap: 12px;
    align-items: end;
}

.cash-filter-form {
    grid-template-columns: 220px auto;
}

.cash-settings-form label,
.cash-filter-form label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-weight: 800;
}

.cash-breakdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.cash-breakdown div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(216, 170, 68, 0.12), transparent 46%),
        #fbfcfe;
}

.cash-breakdown span,
.cash-breakdown strong,
.cash-breakdown small,
.table-muted {
    display: block;
}

.training-table td {
    vertical-align: top;
}

.training-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.training-card {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

.training-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 98px;
}

.training-card-head > div {
    min-width: 0;
}

.training-card h2 {
    margin: 4px 0 0;
    color: var(--navy);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.15;
}

.training-label,
.training-info span {
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.training-card-body {
    display: grid;
    gap: 14px;
}

.training-info {
    display: grid;
    align-content: start;
    gap: 5px;
}

.training-info-address {
    min-height: 136px;
}

.training-info-schedule {
    min-height: 62px;
}

.training-info strong {
    color: var(--ink);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
}

.training-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: auto;
}

.training-map-link,
.training-map-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid rgba(216, 170, 68, 0.48);
    border-radius: 8px;
    color: var(--navy);
    background: linear-gradient(135deg, rgba(216, 170, 68, 0.22), rgba(255, 255, 255, 0.92));
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.training-map-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.training-map-link:hover,
.training-map-button:hover {
    color: var(--gold-dark);
    border-color: rgba(216, 170, 68, 0.8);
    transform: translateY(-1px);
}

.training-admin-actions {
    width: 100%;
    margin-left: 0;
}

.training-admin-actions .btn,
.training-admin-actions form,
.training-admin-actions button {
    width: 100%;
}

.settings-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.settings-menu-card {
    display: grid;
    gap: 7px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--shadow-soft);
}

.settings-menu-card span {
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.settings-menu-card strong {
    color: var(--navy);
    font-size: 20px;
    font-weight: 500;
}

.settings-menu-card small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.settings-menu-card:hover {
    border-color: rgba(222, 174, 64, 0.7);
    transform: translateY(-1px);
}

.attendance-settings-form {
    display: grid;
    gap: 14px;
    width: min(100%, 680px);
}

.settings-toggle-card,
.settings-number-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.settings-number-field {
    display: grid;
    grid-template-columns: minmax(92px, 120px);
    justify-items: stretch;
    gap: 5px;
}

.settings-number-field input {
    min-height: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.settings-number-field small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    text-align: center;
}

.settings-toggle-copy {
    display: grid;
    gap: 4px;
}

.settings-toggle-copy strong {
    color: var(--navy);
    font-size: 17px;
    font-weight: 600;
}

.settings-toggle-copy small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

.settings-switch {
    position: relative;
    display: inline-flex;
    width: 56px;
    height: 32px;
    flex: 0 0 auto;
}

.settings-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.settings-switch span {
    width: 100%;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #dfe4ec;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.settings-switch span::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 2px 7px rgba(7, 20, 42, 0.22);
    transition: transform 0.18s ease;
}

.settings-switch input:checked + span {
    border-color: rgba(216, 170, 68, 0.78);
    background: var(--gold);
}

.settings-switch input:checked + span::after {
    transform: translateX(24px);
}

.settings-switch input:focus-visible + span {
    outline: 2px solid var(--navy);
    outline-offset: 3px;
}

.cash-breakdown span,
.table-muted {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.cash-breakdown strong {
    margin-top: 5px;
    color: var(--navy);
    font-size: 22px;
}

.cash-breakdown small {
    margin-top: 5px;
    color: var(--muted);
}

.cash-action-form {
    margin: 0;
}

.htc-modal[hidden] {
    display: none;
}

.htc-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
}

.htc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 20, 42, 0.74);
    backdrop-filter: blur(6px);
}

.htc-modal-card {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    padding: 22px;
    border: 1px solid rgba(216, 170, 68, 0.5);
    border-radius: 8px;
    color: var(--navy);
    background: var(--white);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.htc-modal-card h2 {
    margin-bottom: 14px;
}

.attendance-alert-modal .htc-modal-card {
    --attendance-modal-header-height: 218px;
    overflow: hidden;
    border-color: rgba(216, 170, 68, 0.72);
    background:
        linear-gradient(180deg, rgba(7, 20, 42, 0.98) 0%, rgba(13, 35, 66, 0.98) var(--attendance-modal-header-height), #ffffff var(--attendance-modal-header-height), #ffffff 100%);
}

.attendance-alert-modal .eyebrow {
    color: var(--gold-2);
}

.attendance-alert-modal h2 {
    color: var(--white);
}

.attendance-alert-modal .htc-modal-card p:not(.eyebrow) {
    margin-top: 22px;
    padding: 14px;
    border: 1px solid rgba(216, 170, 68, 0.26);
    border-radius: 8px;
    color: var(--navy);
    background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.attendance-alert-modal .attendance-alert-schedule {
    margin-top: 22px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.attendance-schedule-message {
    display: block;
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(216, 170, 68, 0.36);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #fff8e7 100%);
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.attendance-schedule-label {
    display: block;
    margin-bottom: 6px;
    color: var(--gold-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.attendance-schedule-note {
    display: block;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #8a1117;
    background: #fde7e9;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.attendance-schedule-place {
    display: block;
    margin-bottom: 10px;
    color: var(--navy);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
}

.attendance-schedule-list {
    display: grid;
    gap: 7px;
}

.attendance-schedule-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(6, 20, 47, 0.055);
}

.attendance-schedule-day {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.attendance-schedule-time {
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.attendance-alert-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border: 1px solid rgba(216, 170, 68, 0.7);
    border-radius: 50%;
    color: var(--navy);
    background: var(--gold);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.attendance-alert-modal .htc-modal-actions {
    justify-content: flex-end;
}

.cash-confirm-member,
.cash-confirm-detail {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fbfcfe;
}

.cash-confirm-member span,
.cash-confirm-member strong,
.cash-confirm-detail span,
.cash-confirm-detail strong {
    display: block;
}

.cash-confirm-member span,
.cash-confirm-detail span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.cash-confirm-member strong,
.cash-confirm-detail strong {
    margin-top: 4px;
    color: var(--navy);
    font-size: 18px;
}

.cash-confirm-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.htc-modal-card p:not(.eyebrow) {
    margin: 14px 0 0;
    color: var(--muted);
}

.htc-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

body.modal-open {
    overflow: hidden;
}

.flash {
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto 0;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
}

.flash-success {
    color: #0c5b2b;
    background: #e4f8eb;
}

.flash-error {
    color: #8a1117;
    background: #fde7e9;
}

.toast-stack {
    position: fixed;
    top: 92px;
    right: 18px;
    z-index: 120;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.app-toast {
    position: relative;
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 14px 14px 14px 16px;
    border: 1px solid rgba(216, 184, 97, 0.45);
    border-radius: 14px;
    color: #07142a;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 18px 42px rgba(7, 20, 42, 0.18);
    pointer-events: auto;
    animation: toast-enter 260ms ease both;
}

.app-toast.is-hiding {
    animation: toast-exit 240ms ease both;
}

.app-toast__mark {
    width: 10px;
    height: 42px;
    border-radius: 999px;
    background: #d8b861;
    box-shadow: 0 0 0 4px rgba(216, 184, 97, 0.14);
}

.app-toast.is-success .app-toast__mark {
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

.app-toast.is-error .app-toast__mark {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.app-toast.is-warning .app-toast__mark {
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(216, 170, 68, 0.18);
}

.app-toast__copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.app-toast__copy strong {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    color: #d8b861;
    text-transform: uppercase;
}

.app-toast__copy span {
    display: block;
    min-width: 0;
    color: #07142a;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.app-toast__close {
    border: 0;
    border-radius: 999px;
    padding: 7px 10px;
    color: #536178;
    background: rgba(7, 20, 42, 0.06);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.app-toast__action {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--navy);
    background: rgba(216, 184, 97, 0.2);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.app-toast__close:hover {
    color: #07142a;
    background: rgba(216, 184, 97, 0.18);
}

.app-toast__action:hover {
    color: var(--navy);
    background: rgba(216, 184, 97, 0.34);
}

@keyframes toast-enter {
    from {
        opacity: 0;
        transform: translateX(18px) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes toast-exit {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(18px);
    }
}

@media (max-width: 560px) {
    .toast-stack {
        top: 84px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .app-toast {
        grid-template-columns: 10px minmax(0, 1fr);
        gap: 10px;
        min-height: 58px;
        padding: 12px;
    }

    .app-toast__close,
    .app-toast__action {
        grid-column: 2;
        justify-self: start;
        padding: 5px 9px;
    }
}

.site-footer {
    padding: 24px clamp(16px, 4vw, 54px);
    color: #dce5f1;
    background: var(--navy);
    border-top: 1px solid rgba(216, 170, 68, 0.32);
}

.footer-content {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: 22px;
    align-items: stretch;
    margin: 0 auto;
}

.footer-left {
    display: grid;
    gap: 14px;
    align-content: center;
}

.site-footer strong,
.site-footer span {
    display: block;
}

.footer-brand span {
    margin-top: 4px;
    color: var(--gold-2);
}

.site-footer .footer-logo {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: contain;
    background: #000;
}

.footer-info {
    display: grid;
    gap: 10px;
    color: #edf2f8;
    font-size: 13px;
    text-align: left;
}

.footer-social {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.social-link,
.contact-link {
    color: #edf2f8;
}

.social-link {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid rgba(216, 170, 68, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 800;
}

.social-link:hover,
.contact-link:hover {
    color: var(--gold-2);
}

.social-link svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-contact {
    display: grid;
    gap: 3px;
}

.footer-contact span {
    display: block;
}

.contact-link {
    min-width: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    color: #edf2f8;
}

.contact-link svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.contact-link span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.footer-credit {
    grid-column: 1 / -1;
    margin: -4px 0 0;
    color: rgba(237, 242, 248, 0.78);
    font-size: 12px;
    font-weight: 400;
    text-align: center;
}

.footer-credit a {
    display: inline;
    color: var(--gold-2);
    font-weight: 600;
}

.footer-credit a:hover {
    color: var(--white);
}

.footer-map {
    position: relative;
    min-height: 230px;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border: 1px solid rgba(216, 170, 68, 0.55);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(216, 170, 68, 0.16), transparent 34%),
        #0b1930;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.footer-map-address {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid rgba(216, 170, 68, 0.32);
    background: rgba(7, 20, 42, 0.88);
    backdrop-filter: blur(6px);
}

.footer-location-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--navy);
    background: var(--gold);
    box-shadow: 0 10px 22px rgba(216, 170, 68, 0.22);
}

.footer-location-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-location-copy {
    min-width: 0;
}

.footer-location-copy span,
.footer-location-copy strong {
    display: block;
}

.footer-location-copy span {
    color: var(--gold-2);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.footer-location-copy strong {
    margin-top: 4px;
    color: var(--white);
    line-height: 1.3;
}

.footer-map-action {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border: 1px solid rgba(216, 170, 68, 0.45);
    border-radius: 8px;
    color: var(--gold-2);
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.footer-map-action:hover {
    color: var(--navy);
    background: var(--gold);
}

.footer-map-frame {
    position: relative;
    min-height: 160px;
    padding: 10px;
}

.footer-map-frame::before {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: 1;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 8px;
}

.footer-map iframe {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 160px;
    display: block;
    border: 0;
    border-radius: 8px;
    filter: saturate(0.95) contrast(1.03);
}

@media (max-width: 920px) {

    .site-header,
    .page-title,
    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .hero {
        min-height: 72vh;
        background-position: center top;
        background-size: cover;
    }

    h1 {
        font-size: 40px;
    }

    h2 {
        font-size: 28px;
    }

    .feature-grid,
    .stats-grid,
    .split,
    .scanner-layout {
        grid-template-columns: 1fr;
    }

    .member-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .site-header {
        gap: 14px;
    }

    .brand img {
        width: 42px;
        height: 42px;
    }

    .main-nav a,
    .main-nav button {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .hero-overlay {
        padding: 36px 18px;
    }

    .hero {
        min-height: 74vh;
        background-image:
            linear-gradient(180deg, rgba(7, 20, 42, 0.88), rgba(7, 20, 42, 0.7) 52%, rgba(7, 20, 42, 0.92)),
            url('../img/htc-card-reference.jpeg');
        background-position: center top;
        background-size: auto 100%;
        background-repeat: no-repeat;
        background-color: var(--navy);
    }

    .attendance-shell {
        width: min(100% - 20px, 1220px);
        padding-top: 22px;
    }

    .scanner-panel {
        padding: 12px;
    }

    h1 {
        font-size: 34px;
    }

    .hero-text {
        font-size: 16px;
    }

    .logo-pair img {
        width: 52px;
        height: 52px;
    }

    .member-grid {
        grid-template-columns: 1fr;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }

    .qr-reader {
        aspect-ratio: 1 / 1;
        min-height: 0;
        height: auto;
        border-radius: 8px;
    }

    .scanner-camera-controls {
        gap: 7px;
        margin-top: 12px;
        padding: 5px;
    }

    .scanner-icon-button {
        height: 42px;
    }

    .reference-media img {
        height: 240px;
    }
}

.members-shell {
    width: calc(100% - 56px);
    max-width: none;
    margin: 0 auto;
    padding: 28px 0 50px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.btn-small {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
}

.btn-micro {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 12px;
}

.member-edit-button {
    min-width: 78px;
    min-height: 34px;
    gap: 7px;
    padding: 7px 11px;
    border-color: rgba(216, 170, 68, 0.48);
    color: var(--navy);
    background: #fffaf0;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(7, 20, 42, 0.05);
}

.member-edit-button:hover {
    border-color: var(--gold);
    background: var(--gold);
    color: var(--navy);
}

.member-edit-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-danger {
    color: var(--white);
    background: var(--red);
}

.btn-danger:hover {
    background: #9f171d;
}

.members-table table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.members-compact-table table {
    border-collapse: collapse;
}

.members-compact-table th:nth-child(1),
.members-compact-table td:nth-child(1) {
    width: 40%;
}

.members-compact-table th:nth-child(2),
.members-compact-table td:nth-child(2) {
    width: 28%;
}

.members-compact-table th:nth-child(3),
.members-compact-table td:nth-child(3) {
    width: 18%;
}

.members-compact-table th:nth-child(4),
.members-compact-table td:nth-child(4) {
    width: 116px;
}

.members-compact-table th,
.members-compact-table td {
    box-sizing: border-box;
    padding: 6px 8px;
    vertical-align: middle;
}

.members-compact-table th {
    font-size: 11px;
    font-weight: 600;
}

.members-compact-table td {
    font-size: 13px;
}

.members-compact-table tbody tr:hover {
    background: #fbfcfe;
}

.member-row-inactive {
    background: #fff8ec;
}

.members-compact-table tbody tr.member-row-inactive:hover {
    background: #fff3dc;
}

.member-desktop-profile {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    min-width: 0;
}

.member-desktop-profile .member-photo-thumb {
    width: 58px;
    height: 100%;
    min-height: 74px;
}

.member-desktop-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.member-desktop-copy strong,
.member-desktop-copy span,
.member-desktop-copy em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-desktop-copy strong {
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.15;
}

.member-desktop-copy span {
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
}

.member-desktop-copy em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
}

.member-status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 18px;
    margin-top: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.member-status-badge.is-active {
    color: #0c5b2b;
    background: #e4f8eb;
}

.member-status-badge.is-inactive {
    color: #8a1117;
    background: #fde7e9;
}

.member-category-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 18px;
    margin-top: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    color: #10203a;
    background: #eef2f7;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.member-category-cell {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #10203a;
    background: #eef2f7;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.member-belt-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.member-belt-cell strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--navy);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.belt-icon {
    --belt-main: #9aa4b2;
    --belt-border: rgba(16, 32, 58, 0.28);
    --belt-stripe: transparent;
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    height: 22px;
}

.belt-icon::before {
    content: "";
    position: absolute;
    top: 8px;
    right: 1px;
    left: 1px;
    height: 7px;
    border: 1px solid var(--belt-border);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0)), var(--belt-main);
    box-shadow: 0 5px 10px rgba(16, 32, 58, 0.12);
}

.belt-icon::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 19px;
    width: 10px;
    height: 15px;
    border: 1px solid var(--belt-border);
    border-radius: 2px;
    background: var(--belt-main);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transform: skewX(-8deg);
}

.belt-icon span {
    position: absolute;
    top: 5px;
    left: 23px;
    z-index: 1;
    display: none;
    width: 3px;
    height: 13px;
    border-radius: 999px;
    background: var(--belt-stripe);
    box-shadow: 0 0 0 1px rgba(16, 32, 58, 0.16);
}

.belt-icon.has-stripe span {
    display: block;
}

.belt-main-white {
    --belt-main: #f8fafc;
    --belt-border: #cbd5e1;
}

.belt-main-yellow {
    --belt-main: #f2c94c;
    --belt-border: #c79216;
}

.belt-main-green {
    --belt-main: #2fb463;
    --belt-border: #208149;
}

.belt-main-blue {
    --belt-main: #2b6fe8;
    --belt-border: #1b4fb2;
}

.belt-main-red {
    --belt-main: #c51f27;
    --belt-border: #8f151b;
}

.belt-main-black {
    --belt-main: #111827;
    --belt-border: #050914;
}

.belt-main-neutral {
    --belt-main: #a8b1c0;
    --belt-border: #7d8796;
}

.belt-stripe-white {
    --belt-stripe: #f8fafc;
}

.belt-stripe-yellow {
    --belt-stripe: #f2c94c;
}

.belt-stripe-green {
    --belt-stripe: #2fb463;
}

.belt-stripe-blue {
    --belt-stripe: #2b6fe8;
}

.belt-stripe-red {
    --belt-stripe: #c51f27;
}

.belt-stripe-black {
    --belt-stripe: #111827;
}

.member-table-stack {
    display: grid;
    gap: 1px;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.member-table-stack span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-table-stack span:first-child {
    color: var(--ink);
    font-weight: 600;
}

.qr-cell-compact {
    gap: 6px;
    width: 66px;
}

.qr-cell-compact .btn-micro {
    width: 64px;
    padding-right: 0;
    padding-left: 0;
}

.action-row-compact {
    display: grid;
    gap: 6px;
    justify-items: stretch;
}

.action-row-compact .btn {
    width: 100%;
}

.action-row-compact form {
    width: 100%;
}

.member-add-inline,
.member-mobile-list {
    display: none;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 156px auto auto auto;
    gap: 10px;
    margin-bottom: 18px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.pagination-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

.pagination-size-form label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

.pagination-size-form select {
    min-height: 34px;
    min-width: 86px;
    padding: 6px 30px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--navy);
    background: var(--white);
    font: inherit;
    font-weight: 500;
}

.members-index-shell .pagination-bar {
    border-top: 0;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pager-link,
.pager-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
}

.pager-link {
    border: 1px solid var(--line);
    color: var(--navy);
    background: var(--white);
}

.pager-link:hover {
    border-color: var(--gold);
}

.pager-link.is-current {
    border-color: var(--navy);
    color: var(--white);
    background: var(--navy);
    font-weight: 600;
}

.pager-link.is-disabled {
    color: #9aa4b2;
    background: #f2f4f7;
}

.pager-ellipsis {
    min-width: 18px;
    padding-right: 2px;
    padding-left: 2px;
    color: var(--muted);
}

.member-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
}

.form-grid label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-weight: 800;
}

.form-grid span {
    font-size: 14px;
}

.form-grid small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.form-wide {
    grid-column: 1 / -1;
}

.schedule-builder {
    display: grid;
    gap: 10px;
}

.coordinate-picker {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--navy);
    font-weight: 500;
}

.coordinate-picker label {
    display: block;
    line-height: 1.2;
}

.coordinate-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 164px;
    gap: 8px;
    align-items: center;
}

.coordinate-auto-button {
    min-height: 48px;
    padding-right: 12px;
    padding-left: 12px;
    white-space: nowrap;
}

.coordinate-status {
    display: block;
    min-height: 18px;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

.coordinate-status[hidden] {
    display: block;
    visibility: hidden;
}

.coordinate-status.is-success {
    color: #0c5b2b;
}

.coordinate-status.is-error {
    color: #8a1117;
}

.coordinate-status.is-loading {
    color: var(--gold-dark);
}

.schedule-builder > span {
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
}

.schedule-rows {
    display: grid;
    gap: 10px;
}

.schedule-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.85fr) minmax(120px, 0.85fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.schedule-row label {
    font-weight: 500;
}

.schedule-time-selects {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}

.schedule-time-selects select {
    min-width: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.schedule-time-selects span {
    color: var(--navy);
    font-size: 16px;
    font-weight: 500;
}

.schedule-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.schedule-remove-button {
    min-height: 42px;
}

.schedule-add-button {
    justify-self: start;
}

.member-form-summary {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.member-form-summary span,
.member-form-summary small {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.member-form-summary strong {
    display: block;
    color: var(--navy);
    font-size: 24px;
    line-height: 1.1;
}

.member-form-summary-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.member-photo-edit-control {
    position: relative;
    display: block;
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
}

.member-photo-edit-control > span {
    position: absolute;
    right: 7px;
    bottom: 7px;
    left: 7px;
    display: block;
    padding: 5px 6px;
    border-radius: 6px;
    color: var(--white);
    background: rgba(4, 15, 35, 0.78);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.member-photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.member-photo-thumb,
.member-photo-preview {
    border-radius: 8px;
    object-fit: cover;
    background: var(--white);
    border: 1px solid var(--line);
}

.member-photo-thumb {
    width: 58px;
    height: 58px;
}

.member-photo-preview {
    width: 108px;
    height: 136px;
}

.member-account-box {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid rgba(216, 170, 68, 0.45);
    border-radius: 8px;
    background: #fffaf0;
}

.member-account-box h2 {
    margin-bottom: 6px;
    color: var(--navy);
    font-size: 22px;
}

.member-account-box p:not(.eyebrow) {
    margin-bottom: 0;
    color: var(--muted);
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
    font-weight: 800;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.form-grid .check-row {
    display: flex;
    align-self: end;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 2px;
    cursor: pointer;
}

.form-grid .check-row input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    accent-color: var(--gold);
    cursor: pointer;
}

.form-grid .check-row span {
    color: var(--navy);
    font-size: 14px;
    line-height: 1.35;
}

.form-grid .check-row small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.form-actions,
.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.form-actions {
    margin-top: 22px;
}

.action-row form {
    margin: 0;
}

.member-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--navy);
    background: rgba(216, 170, 68, 0.18);
    font-weight: 800;
}

.form-errors {
    width: 100%;
    margin: 0 0 18px;
}

.logout-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.logout-modal.is-open {
    display: flex;
}

.logout-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 20, 42, 0.72);
    backdrop-filter: blur(5px);
}

.logout-dialog {
    position: relative;
    width: min(420px, 100%);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid rgba(216, 170, 68, 0.45);
    background: var(--white);
    box-shadow: var(--shadow);
}

.logout-dialog__mark {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 8px;
    background: var(--navy);
    border: 1px solid var(--gold);
}

.logout-dialog__mark img {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    object-fit: cover;
}

.logout-dialog h2 {
    color: var(--navy);
    font-size: 26px;
    margin-bottom: 8px;
}

.logout-dialog p:not(.eyebrow) {
    color: var(--muted);
}

.logout-dialog__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 22px;
}

.member-mobile-card {
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.member-mobile-card + .member-mobile-card {
    margin-top: 8px;
}

.member-mobile-main {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.member-mobile-main .member-photo-thumb {
    width: 46px;
    height: 46px;
}

.member-mobile-copy {
    min-width: 0;
}

.member-mobile-copy strong,
.member-mobile-copy span,
.member-mobile-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-mobile-copy strong {
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.15;
}

.member-mobile-copy span {
    color: var(--ink);
    font-weight: 500;
    font-size: 12px;
}

.member-mobile-copy small,
.member-mobile-meta {
    color: var(--muted);
    font-size: 11px;
}

.member-mobile-copy .member-status-badge,
.member-mobile-copy .member-category-badge,
.member-desktop-copy .member-status-badge,
.member-desktop-copy .member-category-badge,
.public-member-meta .member-status-badge,
.public-member-meta .member-category-badge {
    display: inline-flex;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.member-mobile-meta {
    display: grid;
    gap: 1px;
    margin-top: 6px;
}

.member-mobile-belt-meta {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.member-mobile-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.member-mobile-line span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
}

.member-mobile-line strong {
    color: var(--navy);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.member-mobile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 8px;
}

.member-mobile-actions form {
    margin: 0;
}

.member-mobile-empty {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.empty-state {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fbfcfe;
    color: var(--muted);
}

.empty-state strong {
    color: var(--navy);
}

.public-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.public-member-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.public-person-card,
.gallery-card,
.landing-achievement-card,
.achievement-item,
.profile-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.public-person-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}

.public-card-link {
    display: grid;
    grid-template-rows: auto 1fr;
    color: inherit;
}

.public-person-card:hover {
    border-color: rgba(216, 170, 68, 0.72);
}

.public-person-card.member-row-inactive {
    background: #fff8ec;
}

.public-person-card > img,
.public-card-link > img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eef2f7;
}

.public-person-card > div,
.public-card-link > div {
    padding: 14px;
}

.public-person-card h2,
.gallery-card h2,
.achievement-item h2,
.profile-card h2 {
    color: var(--navy);
    font-size: 22px;
    margin-bottom: 8px;
}

.public-person-card p,
.gallery-card p,
.achievement-item p {
    color: var(--muted);
    margin-bottom: 0;
}

.public-member-meta,
.public-achievements {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 13px;
}

.public-member-meta {
    margin-bottom: 12px;
}

.public-achievements strong {
    color: var(--navy);
}

.public-member-card {
    min-height: 0;
}

.public-member-card .public-card-link {
    grid-template-columns: 82px minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: stretch;
}

.public-member-card .public-card-link > img {
    width: 82px;
    height: 100%;
    min-height: 82px;
    aspect-ratio: auto;
    border-right: 1px solid var(--line);
}

.public-member-card .public-card-link > div {
    min-width: 0;
    padding: 10px;
}

.public-member-card h2 {
    overflow: hidden;
    margin-bottom: 5px;
    font-size: 16px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-member-card .public-member-meta,
.public-member-card .public-achievements {
    gap: 2px;
    font-size: 11px;
    line-height: 1.25;
}

.public-member-card .public-member-meta {
    margin-bottom: 0;
}

.public-member-card .public-member-meta span,
.public-member-card .public-achievements span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-member-card .public-achievements strong {
    font-size: 11px;
}

.public-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 14px 14px;
}

.public-card-actions form {
    margin: 0;
}

.member-profile-link {
    color: inherit;
}

.member-profile-link:hover strong {
    color: var(--red);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.landing-carousel {
    --landing-carousel-gap: 16px;
}

.landing-carousel-viewport {
    overflow: hidden;
    padding-bottom: 2px;
}

.landing-carousel-track {
    display: flex;
    gap: var(--landing-carousel-gap);
    align-items: stretch;
    transition: transform 0.45s ease;
    will-change: transform;
    padding-bottom: 1px;
}

.landing-carousel-slide {
    display: flex;
    flex: 0 0 calc((100% - 32px) / 3);
    align-self: stretch;
    min-width: 0;
}

.landing-carousel-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 22px;
    margin-top: 12px;
}

.landing-carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(12, 27, 51, 0.22);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.landing-carousel-dot.is-active {
    width: 22px;
    background: var(--gold);
}

.gallery-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-shadow: none;
}

.gallery-card::before,
.landing-achievement-card::before {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 4;
    min-height: 30px;
    padding: 6px 12px 6px 35px;
    border: 1px solid rgba(216, 170, 68, 0.52);
    border-radius: 999px;
    background: rgba(8, 23, 44, 0.82);
    box-shadow: 0 12px 26px rgba(3, 10, 24, 0.24);
    color: var(--white);
    content: "Foto";
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 16px;
    pointer-events: none;
}

.gallery-card.is-video::before {
    content: "Video";
}

.gallery-card::after,
.landing-achievement-card::after {
    position: absolute;
    top: 21px;
    left: 23px;
    z-index: 5;
    width: 13px;
    height: 10px;
    border: 2px solid var(--gold);
    border-radius: 3px;
    background: radial-gradient(circle at center, var(--gold) 0 2px, transparent 2.5px);
    content: "";
    pointer-events: none;
}

.gallery-card.is-video::after {
    top: 21px;
    left: 25px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid var(--gold);
    border-right: 0;
    border-radius: 0;
    background: transparent;
}

.gallery-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #eef2f7;
}

.gallery-card [data-gallery-lightbox],
.landing-achievement-image[data-gallery-lightbox] {
    cursor: zoom-in;
}

.gallery-card [data-gallery-lightbox]:focus-visible,
.landing-achievement-image[data-gallery-lightbox]:focus-visible {
    outline: 3px solid rgba(216, 170, 68, 0.78);
    outline-offset: 3px;
}

.gallery-video-shell {
    position: relative;
    display: grid;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(8, 23, 44, 0.94), rgba(12, 31, 58, 0.88)),
        #08172c;
}

.gallery-video-shell video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    background: #08172c;
}

.gallery-video-placeholder {
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 18px;
    color: var(--white);
    text-align: center;
}

.gallery-video-placeholder strong {
    color: var(--white);
    font-size: 17px;
    font-weight: 600;
}

.gallery-video-placeholder small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 400;
}

.gallery-video-icon {
    display: grid;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    place-items: center;
    background: var(--gold);
    box-shadow: 0 14px 30px rgba(216, 170, 68, 0.28);
}

.gallery-video-icon::before {
    display: block;
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid var(--navy);
    content: "";
}

.gallery-video-shell.is-playing .gallery-video-placeholder {
    opacity: 0;
    pointer-events: none;
}

.gallery-card > div:not(.gallery-video-shell) {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 14px;
}

.landing-carousel .gallery-card {
    height: auto;
    min-height: 100%;
}

.landing-carousel .gallery-card > div:not(.gallery-video-shell) {
    min-height: 132px;
}

.landing-carousel .gallery-card h2 {
    display: -webkit-box;
    min-height: 54px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gallery-card .public-card-actions {
    margin-top: auto;
    padding: 14px 0 0;
}

.gallery-lightbox[hidden] {
    display: none;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: grid;
    padding: clamp(14px, 3vw, 34px);
    place-items: center;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 20, 42, 0.78);
    backdrop-filter: blur(7px);
}

.gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    width: min(1120px, 100%);
    max-height: calc(100dvh - 42px);
    overflow: hidden;
    border: 1px solid rgba(216, 170, 68, 0.68);
    border-radius: 8px;
    background: #08172c;
    box-shadow: 0 28px 80px rgba(3, 10, 24, 0.45);
}

.gallery-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    place-items: center;
    background: rgba(8, 23, 44, 0.82);
    color: var(--white);
    cursor: pointer;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible {
    border-color: rgba(216, 170, 68, 0.82);
    background: rgba(216, 170, 68, 0.95);
    color: var(--navy);
    transform: translateY(-1px);
}

.gallery-lightbox-media {
    display: grid;
    min-height: min(66dvh, 640px);
    place-items: center;
    background:
        linear-gradient(135deg, rgba(8, 23, 44, 0.96), rgba(3, 10, 24, 0.94)),
        #030a18;
}

.gallery-lightbox-media img,
.gallery-lightbox-media video {
    display: block;
    width: 100%;
    height: 100%;
    max-height: calc(100dvh - 156px);
    object-fit: contain;
}

.gallery-lightbox-copy {
    display: grid;
    gap: 4px;
    padding: 14px 18px 16px;
    border-top: 1px solid rgba(216, 170, 68, 0.22);
    background: var(--white);
    color: var(--navy);
}

.gallery-lightbox-copy strong {
    font-size: clamp(17px, 2vw, 24px);
    font-weight: 600;
}

.gallery-lightbox-copy span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .gallery-lightbox {
        padding: 10px;
    }

    .gallery-lightbox-dialog {
        max-height: calc(100dvh - 20px);
    }

    .gallery-lightbox-media {
        min-height: 52dvh;
    }

    .gallery-lightbox-media img,
    .gallery-lightbox-media video {
        max-height: calc(100dvh - 126px);
    }

    .gallery-lightbox-close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
    }

    .gallery-lightbox-copy {
        padding: 12px 14px 14px;
    }
}

.achievement-list {
    display: grid;
    gap: 12px;
}

.achievement-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
}

.achievement-panel-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(216, 170, 68, 0.32);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(216, 170, 68, 0.12), rgba(255, 255, 255, 0.96));
}

.achievement-panel-summary > div {
    display: grid;
    gap: 2px;
}

.achievement-panel-summary span,
.achievement-panel-summary small {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
}

.achievement-panel-summary strong {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    margin: 0;
    border-radius: 8px;
    color: var(--navy);
    background: rgba(216, 170, 68, 0.2);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.achievement-item.has-image {
    grid-template-columns: 112px minmax(0, 1fr) auto;
}

.achievement-thumb {
    width: 112px;
    height: 82px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2f7;
}

.achievement-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.achievement-meta span {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--navy);
    background: rgba(216, 170, 68, 0.18);
    font-weight: 800;
    font-size: 13px;
}

.achievement-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.achievement-actions form {
    margin: 0;
}

.member-detail-hero {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.member-detail-hero > img {
    width: 220px;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #eef2f7;
}

.member-detail-hero > div {
    min-width: 0;
}

.member-detail-hero h2 {
    color: var(--navy);
    font-size: 34px;
    margin-bottom: 14px;
}

.member-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.member-detail-grid div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.member-detail-grid span,
.member-detail-grid strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-detail-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.member-detail-grid strong {
    color: var(--navy);
}

.member-id-card-panel {
    overflow: hidden;
}

.member-id-card-stage {
    display: grid;
    gap: 16px;
    justify-items: center;
}

.member-id-card {
    position: relative;
    container-type: inline-size;
    width: min(100%, 940px);
    margin-inline: auto;
    aspect-ratio: 1579 / 996;
    overflow: hidden;
    border-radius: 8px;
    background: var(--navy);
    box-shadow: 0 18px 42px rgba(7, 20, 42, 0.18);
}

.member-id-card-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-id-card-photo {
    position: absolute;
    top: 40.96%;
    left: 6.84%;
    z-index: 2;
    width: 21.66%;
    height: 46.08%;
    object-fit: cover;
    border-radius: 1%;
}

.member-id-card-value {
    position: absolute;
    z-index: 2;
    display: block;
    overflow: hidden;
    color: #f8fafc;
    font-family: Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
    text-overflow: ellipsis;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.72);
    text-transform: uppercase;
    white-space: nowrap;
}

.member-id-card-name {
    top: 53.65%;
    left: 38.63%;
    width: 33%;
    font-size: 24px;
    font-size: clamp(12px, 2.55cqw, 24px);
}

.member-id-card-code {
    top: 64.3%;
    left: 38.63%;
    width: 33%;
    font-size: 24px;
    font-size: clamp(12px, 2.45cqw, 24px);
}

.member-id-card-belt {
    top: 76.25%;
    left: 38.63%;
    width: 23%;
    font-size: 18px;
    font-size: clamp(10px, 1.85cqw, 18px);
}

.member-id-card-category {
    top: 86.9%;
    left: 38.63%;
    width: 23%;
    font-size: 18px;
    font-size: clamp(10px, 1.85cqw, 18px);
}

.member-id-card-qr {
    position: absolute;
    top: 54.42%;
    left: 73.34%;
    z-index: 2;
    width: 17.86%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
}

.member-id-card-qr canvas,
.member-id-card-qr img {
    width: 100%;
    height: 100%;
}

.member-id-card-actions {
    box-sizing: border-box;
    display: grid;
    gap: 12px;
    width: min(100%, 940px);
    margin-inline: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.member-id-card-actions-copy {
    display: grid;
    gap: 4px;
}

.member-id-card-actions-copy strong,
.member-id-card-actions-copy span {
    display: block;
}

.member-id-card-actions-copy strong {
    color: var(--navy);
    font-size: 18px;
}

.member-id-card-actions-copy span {
    color: var(--muted);
    font-size: 13px;
}

.member-id-card-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.member-id-card-action-buttons .btn {
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding-inline: 10px;
    text-align: center;
}

@media (max-width: 560px) {
    .member-id-card-action-buttons {
        grid-template-columns: 1fr;
    }
}

.landing-block {
    border-top: 1px solid var(--line);
}

.landing-achievement-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.landing-achievement-card {
    position: relative;
    display: grid;
    overflow: hidden;
    padding: 0;
}

.landing-achievement-card h3 {
    color: var(--navy);
    margin-bottom: 8px;
}

.landing-achievement-card span,
.landing-achievement-card strong {
    display: block;
}

.landing-achievement-card > div {
    padding: 14px;
}

.landing-achievement-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #eef2f7;
}

.landing-achievement-card span {
    color: var(--muted);
}

.landing-achievement-card strong {
    margin-top: 8px;
    color: var(--red);
}

.landing-more {
    margin-top: 18px;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-password-card,
.profile-member-id-card {
    grid-column: 1 / -1;
}

.profile-qr-card {
    grid-column: 1 / -1;
}

.profile-qr-content {
    display: flex;
    gap: 16px;
    align-items: center;
}

.profile-qr-content strong,
.profile-qr-content span {
    display: block;
}

.profile-qr-content strong {
    color: var(--navy);
    font-size: 24px;
    line-height: 1.1;
}

.profile-qr-content span {
    color: var(--muted);
    margin-top: 4px;
}

.profile-member-title {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.profile-overview-card {
    background: linear-gradient(180deg, var(--white) 0%, #fbfcfe 100%);
}

.profile-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.profile-head-main {
    display: flex;
    min-width: 0;
    gap: 14px;
    align-items: center;
}

.profile-head-copy {
    min-width: 0;
}

.profile-head-copy h2,
.profile-head-copy span {
    overflow-wrap: anywhere;
}

.profile-head img {
    width: 108px;
    height: 136px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.profile-head span {
    color: var(--muted);
    font-weight: 800;
}

.profile-edit-button {
    flex: 0 0 auto;
    min-height: 40px;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.profile-info-grid div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.profile-info-grid span,
.profile-info-grid strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-info-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.profile-info-grid strong {
    color: var(--navy);
}

.profile-info-wide {
    grid-column: 1 / -1;
}

.profile-info-wide strong {
    white-space: normal;
}

.profile-section-title {
    margin-bottom: 14px;
}

.profile-achievement-list {
    display: grid;
    gap: 10px;
}

.profile-achievement-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.profile-achievement-item span,
.profile-achievement-item small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.profile-achievement-item strong {
    color: var(--navy);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.profile-achievement-item em {
    color: var(--red);
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
}

@media (max-width: 920px) {
    .page-actions {
        justify-content: flex-start;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .public-card-grid,
    .gallery-grid,
    .landing-achievement-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .member-detail-hero {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .member-detail-hero > img {
        width: 180px;
        min-height: 260px;
    }

    .member-detail-grid {
        grid-template-columns: 1fr;
    }

    .footer-info {
        text-align: left;
    }

    .footer-social {
        justify-content: flex-start;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .landing-carousel-slide {
        flex-basis: 100%;
    }

    .landing-section-heading {
        gap: 10px;
    }

    .landing-section-heading .btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .site-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        min-height: 72px;
    }

    .brand {
        min-width: 0;
    }

    .brand span {
        min-width: 0;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        grid-column: 1 / -1;
        display: none;
        width: 100%;
        align-items: stretch;
        justify-content: stretch;
        gap: 6px;
        padding-top: 8px;
    }

    .site-header.is-nav-open .main-nav {
        display: grid;
    }

    .main-nav a,
    .main-nav button {
        width: 100%;
        justify-content: flex-start;
        background: rgba(255, 255, 255, 0.06);
    }

    .members-desktop-table {
        display: none;
    }

    .member-mobile-list {
        display: block;
    }

    .member-add-inline {
        display: inline-flex;
    }

    .members-title {
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .auth-page {
        padding: 14px 12px;
    }

    .auth-panel {
        padding: 18px;
    }

    .members-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 22px;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .report-filter-form {
        grid-template-columns: 1fr;
    }

    .report-summary.report-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-summary-period {
        grid-column: 1 / -1;
    }

    .cash-settings-form,
    .cash-breakdown {
        grid-template-columns: 1fr;
    }

    .cash-settings-form .btn {
        width: 100%;
    }

    .htc-modal-actions .btn {
        flex: 1 1 140px;
    }

    .attendance-alert-modal .htc-modal-card {
        --attendance-modal-header-height: 206px;
        width: min(100%, 430px);
        max-height: calc(100dvh - 36px);
        padding: 20px;
        overflow-y: auto;
    }

    .attendance-alert-modal .attendance-alert-schedule {
        margin-top: 18px !important;
    }

    .attendance-alert-modal .htc-modal-card p:not(.eyebrow) {
        margin-top: 18px;
        padding: 12px;
        font-size: 14px;
        line-height: 1.45;
    }

    .attendance-schedule-message {
        padding: 13px;
    }

    .attendance-schedule-label {
        margin-bottom: 5px;
        font-size: 10px;
    }

    .attendance-schedule-place {
        margin-bottom: 9px;
        font-size: 16px;
    }

    .attendance-schedule-list {
        gap: 6px;
    }

    .attendance-schedule-row {
        min-height: 38px;
        padding: 8px 10px;
    }

    .attendance-schedule-day,
    .attendance-schedule-time {
        font-size: 13px;
    }

    .report-filter-actions .btn {
        flex: 1 1 130px;
    }

    .search-form .btn,
    .search-form select {
        width: 100%;
    }

    .pagination-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .pagination-summary,
    .pagination-size-form,
    .pagination-size-form label {
        width: 100%;
    }

    .pagination-summary {
        gap: 8px;
    }

    .pagination-summary > span {
        font-size: 12px;
    }

    .pagination-size-form label {
        justify-content: space-between;
    }

    .pagination-size-form select {
        flex: 1;
        max-width: 170px;
    }

    .pagination-links {
        width: 100%;
    }

    .page-actions,
    .page-actions .btn,
    .page-title > .btn,
    .logout-dialog__actions .btn {
        width: 100%;
    }

    .login-takeover-actions form {
        width: 100%;
    }

    .logout-dialog {
        padding: 20px;
    }

    .member-mobile-actions .btn,
    .member-mobile-actions form {
        flex: 1 1 120px;
    }

    .member-mobile-actions form .btn {
        width: 100%;
    }

    .public-card-grid,
    .gallery-grid,
    .landing-achievement-grid {
        grid-template-columns: 1fr;
    }

    .achievement-item {
        grid-template-columns: 1fr;
    }

    .achievement-item.has-image {
        grid-template-columns: 88px minmax(0, 1fr);
        align-items: start;
    }

    .achievement-thumb {
        width: 88px;
        height: 72px;
    }

    .achievement-panel-summary {
        align-items: flex-start;
    }

    .achievement-item.has-image .achievement-actions {
        grid-column: 2;
    }

    .member-detail-hero {
        grid-template-columns: 1fr;
    }

    .member-detail-hero > img {
        width: 100%;
        max-width: 260px;
        height: 320px;
        min-height: 0;
    }

    .achievement-actions {
        justify-content: flex-start;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .profile-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-head-main {
        align-items: flex-start;
    }

    .profile-edit-button {
        width: 100%;
    }

    .site-footer {
        gap: 12px;
    }

    .site-footer .footer-logo {
        width: 46px;
        height: 46px;
    }

    .footer-map {
        min-height: 220px;
    }

    .footer-map-address {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .footer-map-action {
        grid-column: 1 / -1;
        width: 100%;
    }

    .footer-map iframe {
        min-height: 170px;
    }

    .profile-qr-content {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Typography polish */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0;
}

h1,
h2,
h3,
.brand strong,
.auth-brand h1,
.page-title h1,
.panel h2,
.profile-head-copy h2,
.profile-section-title h2,
.member-detail-hero h2,
.stat-card strong,
.cash-breakdown strong {
    font-weight: 700;
}

strong,
b,
.btn,
.main-nav a,
.main-nav button,
label,
th,
.eyebrow,
.stat-card span,
.scan-status,
.cash-scan-option strong,
.cash-status,
.cash-breakdown span,
.table-muted,
.report-summary strong,
.member-status-badge,
.member-category-badge,
.member-card strong,
.member-desktop-copy strong,
.member-mobile-copy strong,
.public-member-card strong,
.profile-info-grid span,
.member-detail-grid span,
.footer-info strong,
.footer-map-action,
.social-link {
    font-weight: 600;
}

.member-code-login span,
.member-code-login input,
.qr-box > span,
.btn-micro,
.btn-small {
    font-weight: 650;
}

.eyebrow,
th {
    letter-spacing: 0.01em;
}

input,
select,
textarea,
.member-code-login input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.form-card input,
.member-form input,
.member-form select,
.member-form textarea,
.search-form input,
.search-form select,
.report-filter-form input,
.report-filter-form select {
    font-weight: 400;
}

input::placeholder,
textarea::placeholder {
    color: #8a94a6;
    font-weight: 400;
}

.password-field input {
    padding-right: 52px;
}

label,
.form-card label,
.manual-form label,
.form-grid label,
.report-filter-form label,
.cash-settings-form label,
.cash-filter-form label {
    font-weight: 500;
}

.form-grid small,
.member-form-summary span,
.member-form-summary small {
    font-weight: 500;
}

.members-compact-table,
.members-compact-table td,
.member-mobile-card,
.public-member-card {
    font-weight: 400;
}

.members-compact-table .member-desktop-copy strong,
.members-compact-table .member-belt-cell strong,
.member-mobile-card .member-mobile-copy strong,
.public-member-card h2 {
    font-weight: 500;
}

.members-compact-table .member-desktop-copy span,
.members-compact-table .member-desktop-copy em,
.member-mobile-card .member-mobile-copy span,
.member-mobile-card .member-mobile-copy small,
.public-member-card .public-member-meta span,
.public-member-card .public-achievements span {
    font-weight: 400;
}

.members-compact-table .member-status-badge,
.members-compact-table .member-category-cell,
.members-compact-table .member-category-badge,
.member-mobile-card .member-status-badge,
.member-mobile-card .member-category-badge,
.public-member-card .member-status-badge,
.public-member-card .member-category-badge {
    font-weight: 500;
}

/* Final scanner controls override. Keep this at the end so it wins over older button/layout rules. */
.scanner-panel .scanner-camera-controls {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: 14px auto 0 !important;
    gap: 8px !important;
}

.scanner-panel .scanner-camera-controls .scanner-icon-button,
.scanner-panel .scanner-camera-controls #scanner-toggle,
.scanner-panel .scanner-camera-controls #toggle-flash {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    border-radius: 8px !important;
}

@media (max-width: 720px) {
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        display: none;
        gap: 5px;
        width: 100%;
        min-width: 0;
        margin-top: 5px;
        padding: 6px 0 0 12px;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown.is-open .nav-dropdown-menu {
        display: grid;
    }

    .nav-dropdown-menu a,
    .nav-dropdown-menu button {
        background: rgba(255, 255, 255, 0.04);
    }
}

@media (max-width: 560px) {
    .scanner-panel .manual-member-code-form {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .scanner-panel .manual-member-code {
        min-width: 0;
    }

    .training-card {
        padding: 15px;
    }

    .training-card-head,
    .training-info-address,
    .training-info-schedule {
        min-height: 0;
    }

    .training-card-actions,
    .training-map-button,
    .training-admin-actions {
        width: 100%;
    }
}

.settings-shell .cash-settings-form {
    width: min(100%, 640px);
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
}

.settings-shell .cash-settings-form label {
    grid-template-columns: minmax(120px, 1fr) minmax(0, 230px);
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.settings-shell .cash-settings-form label span {
    color: var(--navy);
    font-weight: 500;
}

.settings-shell .cash-settings-form input {
    text-align: right;
}

.settings-shell .cash-settings-form .btn {
    justify-self: end;
    min-width: 180px;
}

@media (max-width: 560px) {
    .settings-shell .cash-settings-form label {
        grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1fr);
        gap: 10px;
        padding: 9px;
    }

    .settings-shell .cash-settings-form .btn {
        width: 100%;
        justify-self: stretch;
    }

    .settings-toggle-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .settings-number-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .settings-number-field {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .settings-switch {
        justify-self: start;
    }
}

.activity-log-table-wrap {
    border-radius: 8px;
    overflow: hidden;
}

.activity-logs-shell .search-form {
    grid-template-columns: minmax(0, 1fr) 156px auto;
}

.activity-log-table {
    width: 100%;
    min-width: 760px;
    table-layout: fixed;
}

.activity-log-time-col {
    width: 18%;
}

.activity-log-user-col {
    width: 22%;
}

.activity-log-desc-col {
    width: 60%;
}

.activity-log-table th,
.activity-log-table td {
    vertical-align: top;
}

.activity-log-table th {
    padding-top: 10px;
    padding-bottom: 10px;
    font-weight: 500;
}

.activity-log-table td {
    font-weight: 400;
    overflow-wrap: anywhere;
}

.activity-log-row {
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.activity-log-row:hover,
.activity-log-row.is-open {
    background: #fbf6e8;
}

.activity-log-row:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

.activity-detail-row td {
    padding: 0 18px 18px;
    background: #fbf6e8;
}

.activity-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(216, 170, 68, 0.38);
    border-radius: 8px;
    background: #fffdf8;
}

.activity-detail-grid div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.activity-detail-grid span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.activity-detail-grid strong {
    color: var(--navy);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.activity-ip-value {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.activity-ip-map-link {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(216, 170, 68, 0.55);
    border-radius: 999px;
    color: var(--gold-dark);
    background: #fff8e8;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.activity-ip-map-link:hover,
.activity-ip-map-link:focus-visible {
    border-color: var(--gold);
    background: #f5dfaa;
    transform: translateY(-1px);
    outline: none;
}

.activity-ip-map-link svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.activity-detail-wide {
    grid-column: 1 / -1;
}

.activity-logs-shell .pagination-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.activity-logs-shell .pagination-bar {
    margin-top: 0;
    border-top: 0;
}

.activity-logs-shell .pagination-size-form {
    margin: 0;
}

.activity-logs-shell .pagination-size-form label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

.activity-logs-shell .pagination-size-form select {
    min-height: 34px;
    min-width: 86px;
    padding: 6px 30px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--navy);
    background: var(--white);
    font: inherit;
    font-weight: 500;
}

@media (max-width: 640px) {
    .schedule-row {
        grid-template-columns: 1fr;
    }

    .coordinate-input-row {
        grid-template-columns: 1fr;
    }

    .coordinate-auto-button {
        width: 100%;
    }

    .schedule-remove-button,
    .schedule-add-button {
        width: 100%;
    }

    .activity-logs-shell {
        width: min(100%, calc(100% - 12px));
    }

    .activity-logs-shell .panel {
        padding: 10px;
        border-radius: 8px;
    }

    .activity-logs-shell .search-form {
        grid-template-columns: minmax(0, 1fr) 76px;
        gap: 8px;
        margin-bottom: 10px;
    }

    .activity-logs-shell .search-form input[type="search"],
    .activity-logs-shell .search-form .btn {
        min-height: 38px;
        font-size: 13px;
    }

    .activity-logs-shell .search-form a.btn {
        grid-column: 1 / -1;
    }

    .activity-logs-shell .pagination-summary,
    .activity-logs-shell .pagination-size-form,
    .activity-logs-shell .pagination-size-form label {
        width: 100%;
    }

    .activity-logs-shell .pagination-summary {
        gap: 8px;
    }

    .activity-logs-shell .pagination-summary > span {
        font-size: 12px;
    }

    .activity-logs-shell .pagination-size-form label {
        justify-content: space-between;
    }

    .activity-logs-shell .pagination-size-form select {
        flex: 1;
        max-width: 170px;
    }

    .activity-logs-shell .pagination-links {
        gap: 5px;
        justify-content: space-between;
    }

    .activity-logs-shell .pager-link,
    .activity-logs-shell .pager-ellipsis {
        min-width: 32px;
        min-height: 32px;
        padding: 5px 8px;
        font-size: 12px;
    }

    .activity-log-table-wrap {
        overflow: visible;
        border-radius: 0;
    }

    .activity-log-table {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .activity-log-table colgroup,
    .activity-log-table thead {
        display: none;
    }

    .activity-log-table tbody {
        display: grid;
        gap: 8px;
    }

    .activity-log-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
        padding: 9px 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--white);
    }

    .activity-log-row td {
        display: block;
        padding: 0;
        border: 0;
    }

    .activity-log-row td:first-child {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.3;
    }

    .activity-log-row td:nth-child(2) {
        color: var(--navy);
        font-size: 14px;
        font-weight: 400;
        line-height: 1.35;
    }

    .activity-log-row td:nth-child(3) {
        color: #42506a;
        font-size: 12.5px;
        line-height: 1.35;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .activity-log-row.is-open td:nth-child(3) {
        white-space: normal;
    }

    .cash-dashboard-row td:nth-child(2) {
        line-height: 1;
    }

    .cash-dashboard-row td:nth-child(3) {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .cash-dashboard-action-cell .cash-action-form {
        display: inline-flex;
        width: auto;
    }

    .cash-dashboard-action-cell .btn {
        min-height: 32px;
        padding: 5px 10px;
        font-size: 12px;
        font-weight: 500;
    }

    .activity-detail-row {
        display: block;
        margin-top: -4px;
    }

    .activity-detail-row[hidden] {
        display: none;
    }

    .activity-detail-row td {
        display: block;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .activity-detail-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
        border-radius: 8px;
    }
}
