.admin-shell {
    display: grid;
    gap: 28px;
    width: min(1480px, calc(100vw - 28px));
    margin: 0 auto;
    padding: 28px 0 88px;
}

body.admin-authenticated #authView {
    display: none !important;
}

body:not(.admin-authenticated) #adminView {
    display: none !important;
}

/* Trang đang nhập: luôn hiện thi form (khong phu thuoc admin.js) */
body.login-page #authView {
    display: grid !important;
    visibility: visible !important;
}

html,
body {
    min-height: 100%;
    background: #eef3f8;
}

body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    background: transparent;
    overflow-x: hidden;
}

#adminView,
.page-shell-admin,
.admin-shell,
#authView.auth-shell {
    min-height: 100vh;
}

.page-shell-admin {
    position: relative;
    padding-bottom: 56px;
}

.page-shell-admin::before,
.page-shell-admin::after {
    content: '';
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(12px);
    pointer-events: none;
}

.page-shell-admin::before {
    top: -110px;
    right: -60px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0) 72%);
}

.page-shell-admin::after {
    left: -140px;
    bottom: 60px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.12) 0%, rgba(20, 184, 166, 0) 72%);
}



.admin-topbar {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    padding: 30px;
    border-radius: 36px;
    background:
        radial-gradient(circle at 86% 18%, rgba(148, 163, 184, 0.18), transparent 24%),
        radial-gradient(circle at 14% 18%, rgba(45, 212, 191, 0.14), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #14213d 50%, #1d4ed8 100%);
    border: none;
    color: #eff6ff;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
    transition: box-shadow 0.24s ease;
}

.admin-topbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 36%),
        linear-gradient(0deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02));
    pointer-events: none;
}

.admin-topbar:hover {
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.2);
}

.admin-brand,
.admin-topbar-actions {
    position: relative;
    z-index: 1;
}

.admin-brand {
    display: grid;
    gap: 12px;
}

.admin-brand h1 {
    margin: 0;
    color: #f8fbff;
    font-size: clamp(2.15rem, 4vw, 3.5rem);
    line-height: 0.95;
}

.admin-brand p {
    margin: 0;
    max-width: 68ch;
    color: rgba(239, 246, 255, 0.8);
    line-height: 1.72;
}

.admin-topbar .eyebrow {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
    color: #dbeafe;
}

.admin-topbar .headline,
.admin-topbar .headline strong {
    color: #ffffff;
}

.admin-topbar-actions {
    display: grid;
    gap: 12px;
    align-items: stretch;
    justify-items: stretch;
    min-width: min(420px, 100%);
}

.admin-action-cluster {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.admin-action-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(219, 234, 254, 0.82);
}

.admin-status-row,
.admin-primary-actions,
.admin-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.admin-topbar-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-primary-actions .admin-checkin-shortcut {
    min-width: 208px;
}

.admin-secondary-actions .btn {
    box-shadow: none;
}

.admin-topbar .btn-outline-light,
.admin-topbar .btn-light {
    min-height: 44px;
    border-radius: 14px;
}

.admin-topbar .btn-outline-light {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f8fbff;
}

.admin-topbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.admin-topbar .btn-light {
    background: #ffffff;
    border-color: transparent;
    color: #1d4ed8;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.admin-topbar .btn-light:hover {
    color: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
}

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

.overview-grid .metric-card,
.system-settings-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.overview-grid .metric-card:hover,
.system-settings-card:hover {
    transform: translateY(-3px);
    border-color: #cadefb;
    box-shadow: 0 24px 46px rgba(37, 99, 235, 0.1);
}

.overview-grid .metric-card {
    display: grid;
    align-content: end;
    gap: 8px;
    min-height: 148px;
    padding: 22px 22px 20px;
    border-radius: 26px;
    border: 1px solid rgba(203, 213, 225, 0.92);
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 255, 0.98) 100%);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.07);
}

.overview-grid .metric-card::after {
    content: '';
    position: absolute;
    top: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(191, 219, 254, 0.56);
}

.overview-grid .metric-card:nth-child(odd)::before {
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
}

.overview-grid .metric-card:nth-child(even)::before {
    background: linear-gradient(90deg, #0f766e 0%, #2dd4bf 100%);
}

.system-settings-card {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    align-items: start;
    gap: 22px;
    padding: 22px 24px;
    border-radius: 28px;
}

.system-settings-card .headline {
    margin: 4px 0 8px;
}

.admin-section-copy {
    display: grid;
    gap: 8px;
    align-content: start;
}

.settings-inline {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.settings-field {
    min-width: 210px;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    grid-column: 2;
}

.compact-number {
    min-width: 140px;
}

.admin-section-panel {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.12), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 249, 255, 0.99) 100%);
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.07);
}

.admin-section-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.32), transparent 28%);
    pointer-events: none;
}

.toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-toolbar,
.content-head,
.sidebar-head {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 20px 22px;
    border-radius: 24px;
    border: 1px solid #d8e5f3;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%),
        linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.admin-toolbar::after,
.content-head::after,
.sidebar-head::after {
    content: '';
    position: absolute;
    inset: auto 22px 0 22px;
    height: 1px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0));
    pointer-events: none;
}

.toolbar-copy,
.content-head > .toolbar-copy,
.sidebar-head > div {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: min(420px, 100%);
}

.toolbar-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.09);
    border: 1px solid rgba(147, 197, 253, 0.5);
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.toolbar-copy .headline,
.content-head .headline,
.sidebar-head .headline {
    margin: 0;
}

.toolbar-copy .muted,
.content-head p,
.sidebar-head p {
    margin: 0;
    color: var(--muted-strong);
    line-height: 1.66;
}

.toolbar-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
}

.toolbar-actions .form-control,
.toolbar-actions .form-select {
    min-width: min(230px, 100%);
    flex: 1 1 220px;
}

.tab-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 8px;
}

.tab-strip .tab-btn.nav-link {
    border-radius: 14px;
    padding: 10px 16px;
    font-weight: 600;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
}

.tab-strip .tab-btn.nav-link:hover {
    color: var(--accent-strong);
    border-color: var(--accent-soft-strong);
    background: #fff;
}

.tab-strip .tab-btn.nav-link.active,
.tab-strip .tab-btn.nav-link.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.event-card-mini {
    border-radius: 22px;
    margin-bottom: 12px;
}

.event-card-mini strong {
    color: var(--text-strong);
}

textarea.welcome-template-input {
    min-height: 6.5rem;
    resize: vertical;
    line-height: 1.55;
}

.event-voice-browser-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid #dbe7f4;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.event-voice-browser-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.event-voice-browser-head strong {
    color: var(--text-strong);
}

.event-voice-browser-head p {
    margin-top: 6px;
}

.voice-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.voice-slider-head strong {
    color: var(--accent-strong);
    font-size: 0.92rem;
}

.event-voice-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.event-voice-browser-hint {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #dbe7f4;
    background: rgba(255, 255, 255, 0.9);
    color: var(--muted-strong);
    font-size: 0.84rem;
    line-height: 1.55;
}

.event-voice-browser-hint[data-tone="success"] {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.event-voice-browser-hint[data-tone="warning"] {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.event-voice-browser-hint[data-tone="danger"] {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

#tabSettings .settings-field .upload-note code {
    font-size: 0.82rem;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-soft);
}

.tab-btn,
.nav-pills .nav-link {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
    color: var(--muted-strong);
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.tab-btn:hover,
.nav-pills .nav-link:hover {
    transform: translateY(-1px);
    color: var(--text);
    border-color: var(--line-strong);
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.tab-btn.is-active,
.tab-btn.active,
.nav-pills .nav-link.active,
.nav-pills .nav-link.is-active {
    color: #ffffff;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-color: transparent;
    box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18);
}

.tab-view {
    display: none;
}

.tab-view.is-active {
    display: block;
}

.home-overview-shell {
    display: grid;
    gap: 24px;
}

.home-overview-shell > .toolbar {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 24px 26px;
    border-radius: 28px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 246, 255, 0.94) 100%);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.home-overview-shell > .toolbar::after {
    content: '';
    position: absolute;
    inset: auto 26px 0 26px;
    height: 1px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0));
}

.home-overview-shell > .toolbar > div {
    position: relative;
    z-index: 1;
    max-width: 72ch;
}

.home-overview-shell > .toolbar .headline {
    margin-bottom: 10px !important;
}

.home-overview-shell > .toolbar .muted {
    font-size: 0.98rem;
    line-height: 1.72;
    color: var(--muted-strong);
}

.home-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.home-event-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 100%;
    padding: 24px !important;
    border-radius: 28px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.95) 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.home-event-panel::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, #2563eb 0%, #60a5fa 100%);
}

.home-dashboard-grid > .home-event-panel:nth-child(2)::before {
    background: linear-gradient(180deg, #0f766e 0%, #2dd4bf 100%);
}

.home-dashboard-grid > .home-event-panel:nth-child(2) {
    border-color: rgba(45, 212, 191, 0.18);
    background:
        radial-gradient(circle at top right, rgba(45, 212, 191, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(245, 255, 252, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
}

.home-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.home-section-head > div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.home-section-head .eyebrow {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.18);
    color: #1d4ed8;
}

.home-dashboard-grid > .home-event-panel:nth-child(2) .home-section-head .eyebrow {
    background: rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.18);
    color: #0f766e;
}

.home-section-head .headline {
    font-size: 1.2rem !important;
    line-height: 1.2;
    color: var(--text-strong);
}

.home-event-stack {
    display: grid;
    gap: 14px;
    align-content: start;
    flex: 1 1 auto;
}

.home-event-stack > .list-meta-bar {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(203, 213, 225, 0.7);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.home-event-stack > .list-meta-bar:hover {
    transform: none;
    border-color: rgba(148, 163, 184, 0.34);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
}

.home-event-stack > .list-meta-bar .list-meta-copy {
    gap: 0;
}

.home-event-stack > .list-meta-bar .list-meta-copy strong {
    display: none;
}

.home-event-stack > .list-meta-bar .list-meta-copy span {
    font-size: 0.88rem;
    color: var(--muted-strong);
}

.home-event-stack > .list-meta-bar .list-meta-actions {
    margin-left: auto;
}

.home-event-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
    min-height: 100%;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.94) 100%);
    border: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-event-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.82);
    box-shadow: 0 20px 36px rgba(37, 99, 235, 0.12);
}

.home-dashboard-grid > .home-event-panel:nth-child(2) .home-event-card:hover {
    border-color: rgba(45, 212, 191, 0.75);
    box-shadow: 0 20px 36px rgba(13, 148, 136, 0.14);
}

.home-event-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.home-event-card-title {
    display: grid;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.home-event-card-title > .d-flex {
    min-width: 0;
}

.home-event-card-title strong {
    color: var(--text-strong);
    font-size: 1.04rem;
    line-height: 1.35;
}

.home-event-meta {
    display: grid;
    gap: 6px;
    color: var(--muted-strong);
    font-size: 0.94rem;
    line-height: 1.58;
}

.home-event-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-event-stats .badge {
    border-radius: 999px;
    padding: 0.5rem 0.78rem;
}

.home-event-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 6px;
}

.home-event-actions > .btn {
    min-height: 40px;
    border-radius: 999px;
    padding-inline: 14px;
    font-weight: 600;
}

.home-event-actions > .btn-primary {
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.home-event-empty {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px dashed rgba(148, 163, 184, 0.65);
    color: var(--muted-strong);
    text-align: center;
    line-height: 1.7;
}

.catalog-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98) 0%, rgba(238, 245, 255, 0.96) 100%);
    border: 1px solid #dbe7f7;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.catalog-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 34%);
    pointer-events: none;
}

.catalog-hero:hover {
    transform: translateY(-2px);
    border-color: #c9dcf7;
    box-shadow: 0 22px 42px rgba(37, 99, 235, 0.08);
}

.catalog-hero-copy {
    display: grid;
    gap: 8px;
}

.catalog-hero-copy .headline {
    margin-top: 6px;
}

.catalog-hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.catalog-subtab-shell {
    display: grid;
    gap: 10px;
    padding: 8px;
    border-radius: 22px;
    border: 1px solid rgba(215, 228, 244, 0.9);
    background: rgba(248, 251, 255, 0.92);
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.admin-layout-members .sidebar-panel {
    position: sticky;
    top: 24px;
}

/* Left compact menu for Admin / Guide */
/* New left sidebar (replaces old compact left-menu) */
.left-sidebar {
    position: fixed;
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: 292px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 24%),
        radial-gradient(circle at 0% 100%, rgba(45, 212, 191, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
    border: 1px solid rgba(30, 41, 59, 0.9);
    border-radius: 30px;
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 12px 14px;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease, background 0.22s ease;
}

.left-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 34%);
    pointer-events: none;
}

.left-menu-scroll {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
}

.left-menu-title {
    display: grid;
    gap: 8px;
    padding: 8px 12px 4px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.left-menu-heading {
    color: #f8fafc;
    font-size: 1.02rem;
    letter-spacing: -0.02em;
}

.left-menu-title .eyebrow {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 163, 184, 0.22);
    color: rgba(191, 219, 254, 0.9);
}

.left-menu-section {
    display: grid;
    gap: 6px;
    padding: 4px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.left-menu-section-title {
    padding: 6px 12px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(191, 219, 254, 0.72);
}

.left-sidebar .left-menu-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    padding: 0 14px;
    border: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.82);
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
}

.left-sidebar .left-menu-btn.is-submenu {
    min-height: 42px;
    padding-left: 24px;
    font-weight: 600;
}

.left-sidebar .left-menu-btn i { 
    width: 20px;
    min-width: 20px;
    font-size: 18px;
    opacity: 0.84;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.left-sidebar .left-menu-btn:hover {
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 163, 184, 0.24);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.left-sidebar .left-menu-btn:hover i {
    transform: scale(1.04);
    opacity: 1;
}

.left-sidebar .left-menu-btn.active {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(224, 231, 255, 0.96) 100%);
    color: #1d4ed8;
    border-color: rgba(191, 219, 254, 0.48);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.16);
}

.left-sidebar .left-menu-btn.active::before {
    content: "";
    position: absolute;
    inset: 8px auto 8px 6px;
    width: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
}

.left-sidebar .left-menu-btn.active i { opacity: 1 }

.left-sidebar .toggle-btn {
    margin-top: auto;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.18);
    justify-content: center;
}

.left-sidebar.is-collapsed {
    width: 88px;
    left: 12px;
}

.left-sidebar.is-collapsed .left-menu-title,
.left-sidebar.is-collapsed .left-menu-section-title {
    display: none;
}

.left-sidebar.is-collapsed .left-menu-label { display: none }
.left-sidebar.is-collapsed .left-menu-section {
    padding: 0;
    background: transparent;
    border-color: transparent;
}
.left-sidebar.is-collapsed .left-menu-btn {
    justify-content: center;
    padding: 0;
}
.left-sidebar.is-collapsed .left-menu-btn.active::before {
    inset: auto 12px 6px 12px;
    width: auto;
    height: 4px;
}
.left-sidebar.is-collapsed .left-menu-btn.is-submenu { padding: 0; }

.admin-shell { 
    padding-left: 324px;
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}
.admin-shell:has(.left-sidebar.is-collapsed) {
    padding-left: 124px;
}
.admin-topbar { 
    margin-left: 0;
    width: 100%;
}

.page-shell {
    background: var(--bg);
    min-height: 100vh;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .admin-topbar {
        display: grid;
        gap: 16px;
    }

    .admin-topbar-actions {
        min-width: 0;
        justify-items: stretch;
    }

    .admin-status-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .admin-primary-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .admin-primary-actions .admin-checkin-shortcut {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .admin-secondary-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 2px 4px;
        margin: 0 -2px;
        scrollbar-width: none;
    }

    .admin-secondary-actions::-webkit-scrollbar,
    .left-menu-scroll::-webkit-scrollbar {
        display: none;
    }

    .admin-secondary-actions .btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .left-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100% !important;
        height: auto;
        flex-direction: row;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.96));
        gap: 0;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        border-radius: 24px 24px 0 0;
        border: none;
        border-top: 1px solid rgba(216, 224, 234, 0.92);
        box-shadow: 0 -18px 40px rgba(15, 23, 42, 0.08);
        justify-content: space-around;
    }
    .left-menu-scroll {
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-right: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        scroll-snap-type: x proximity;
        scroll-padding: 0 10px;
    }
    .left-menu-title,
    .left-menu-section-title {
        display: none;
    }
    .left-menu-section {
        display: contents;
    }
    .left-sidebar .left-menu-btn { 
        width: auto; 
        flex: 0 0 92px;
        min-width: 92px;
        flex-direction: column;
        height: auto;
        min-height: 64px;
        padding: 10px 8px;
        border-radius: 16px;
        gap: 4px;
        font-size: 11px;
        scroll-snap-align: start;
    }
    .left-sidebar .left-menu-btn:hover {
        transform: none;
    }
    .left-sidebar .left-menu-btn i { font-size: 20px }
    .left-sidebar .left-menu-label { display: inline-block }
    .left-sidebar .left-menu-btn.is-submenu { padding-left: 0; }
    .left-sidebar .toggle-btn { display: none }
    .admin-shell { padding-left: 0; padding-bottom: 80px; }
    .admin-layout { grid-template-columns: 1fr; }
    .home-dashboard-grid { grid-template-columns: 1fr; }
    .home-section-head,
    .home-event-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .home-event-actions > .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .left-menu { top: 80px; left: 8px }
    .left-menu-btn { font-size: 12px }
}

/* Guide panel */
.guide-panel {
    position: fixed;
    right: 24px;
    top: 120px;
    width: 520px;
    max-height: 72vh;
    overflow-y: auto;
    z-index: 60;
}
.guide-card .guide-icon { width: 44px; text-align:center }
.guide-cards { padding: 8px }
.guide-tips { padding-left: 18px }

.sidebar-panel,
.content-panel {
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.sidebar-panel:hover,
.content-panel:hover {
    border-color: #d0dceb;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
}

.sidebar-head {
    margin-bottom: 16px;
}

.sidebar-head h2,
.content-head h2 {
    margin: 0;
    font-size: 1.18rem;
}

.dept-list {
    display: grid;
    gap: 14px;
    max-height: min(68vh, 700px);
    overflow-y: auto;
    padding-right: 8px;
    align-content: start;
    scrollbar-gutter: stable;
}

.dept-filter-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-soft);
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.dept-filter-card:hover {
    transform: translateY(-2px);
    border-color: #c8daf4;
    box-shadow: 0 20px 38px rgba(37, 99, 235, 0.1);
}

.dept-filter-card.is-active {
    background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
    border-color: var(--accent-soft-strong);
    box-shadow: 0 20px 38px rgba(37, 99, 235, 0.12);
}

.dept-filter-card strong {
    display: block;
    color: var(--text-strong);
    font-size: 0.98rem;
}

.dept-filter-card span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.dept-filter-card__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #d7e4f4;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
}

.dept-manage-grid {
    display: grid;
    gap: 16px;
}

.organization-grid,
.position-grid,
.organization-type-grid {
    display: grid;
    gap: 16px;
}

.dept-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.12), transparent 28%),
        rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(216, 226, 240, 0.96);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.07);
}

.dept-card::after,
.position-card::after,
.employee-card::after,
.event-card::after,
.permission-group-card::after,
.account-info-card::after,
.permission-editor::after,
.list-meta-bar::after,
.table-shell.card::after,
.scope-card::after,
.capture-panel::after,
.doc-chip::after,
.thumb-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), transparent 34%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.dept-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-soft-strong);
    box-shadow: 0 24px 44px rgba(37, 99, 235, 0.12);
}

.dept-card:hover::after,
.position-card:hover::after,
.employee-card:hover::after,
.event-card:hover::after,
.permission-group-card:hover::after,
.account-info-card:hover::after,
.permission-editor:hover::after,
.list-meta-bar:hover::after,
.table-shell.card:hover::after,
.scope-card:hover::after,
.capture-panel:hover::after,
.doc-chip:hover::after,
.thumb-card:hover::after {
    opacity: 1;
}

.dept-card.is-active {
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    border-color: var(--accent-soft-strong);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.1);
}

.position-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 14px;
    padding: 20px 22px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.12), transparent 28%),
        rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(216, 226, 240, 0.96);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.07);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.position-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-soft-strong);
    box-shadow: 0 24px 44px rgba(37, 99, 235, 0.12);
}

.position-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.position-card-top strong {
    font-size: 1.05rem;
}

.position-card-top span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.6;
}

.dept-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.dept-card strong {
    font-size: 1rem;
    color: var(--text-strong);
}

.dept-card span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.dept-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.dept-manage-card {
    gap: 14px;
}

.dept-manage-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dept-info-list {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid #d7e4f4;
}

.dept-info-list span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--line);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.icon-btn:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--line-strong);
    background: var(--surface-soft);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.1);
}

.content-panel {
    display: grid;
    gap: 18px;
    align-content: start;
}

.content-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.content-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.list-meta-bar {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 20px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.12), transparent 26%),
        linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
    border: 1px solid #d7e4f4;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.list-meta-bar:hover {
    transform: translateY(-1px);
    border-color: #c8daf4;
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.08);
}

.list-meta-copy {
    display: grid;
    gap: 6px;
}

.list-meta-copy strong {
    font-size: 1rem;
    color: var(--text-strong);
}

.list-meta-copy span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.list-meta-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.page-size-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.82rem;
}

.compact-select {
    width: auto;
    min-width: 96px;
    min-height: 42px;
    padding: 0 14px;
}

.pager-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pager-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
}

.btn-compact {
    min-height: 42px;
    padding: 0 16px;
}

.employee-grid {
    display: grid;
    gap: 18px;
}

.employee-card,
.event-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.12), transparent 28%),
        rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(216, 226, 240, 0.96);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.07);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.employee-card:hover,
.event-card:hover {
    transform: translateY(-3px);
    border-color: #cadefb;
    box-shadow: 0 26px 48px rgba(15, 23, 42, 0.1);
}

.employee-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.employee-top h3 {
    margin: 0;
    font-size: 1.18rem;
    color: var(--text-strong);
}

.employee-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.employee-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.employee-actions .btn,
.dept-actions .btn {
    white-space: nowrap;
    min-height: 42px;
    border-radius: 14px;
}

.employee-detail-list,
.event-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.employee-detail-item {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid #dbe7f4;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.employee-detail-item span {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.employee-detail-item strong {
    color: var(--text-strong);
    font-size: 0.95rem;
    line-height: 1.5;
}

.employee-detail-item code {
    width: fit-content;
}

.event-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(82px, 82px));
    gap: 12px;
}

.thumbnail-card {
    position: relative;
    width: 82px;
    height: 82px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #ffffff;
}

.thumbnail-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-card button {
    position: absolute;
    top: 8px;
    right: 8px;
}

.upload-note {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.65;
}

.capture-panel {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fd 100%);
    border: 1px solid #d7e4f4;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    align-content: start;
}

.capture-panel:hover {
    transform: translateY(-2px);
    border-color: #c7daf5;
    box-shadow: 0 20px 38px rgba(37, 99, 235, 0.08);
}

.capture-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.capture-head strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-strong);
}

.capture-head p {
    margin: 0;
}

.capture-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.capture-stage {
    position: relative;
    width: min(100%, 340px);
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    min-height: 0;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(96, 165, 250, 0.24), transparent 54%),
        linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.capture-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scaleX(-1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.capture-video.is-live {
    opacity: 1;
}

.capture-stage::before {
    content: '';
    position: absolute;
    inset: 16px;
    border-radius: 22px;
    border: 1px solid rgba(191, 219, 254, 0.34);
    box-shadow: inset 0 0 0 1px rgba(191, 219, 254, 0.08);
    pointer-events: none;
}

.capture-stage[data-capture-state='tracking']::before {
    border-color: rgba(125, 211, 252, 0.72);
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.22), 0 0 0 1px rgba(14, 165, 233, 0.12);
}

.capture-stage[data-capture-state='warning']::before {
    border-color: rgba(253, 224, 71, 0.76);
    box-shadow: inset 0 0 0 1px rgba(253, 224, 71, 0.18), 0 0 0 1px rgba(245, 158, 11, 0.12);
}

.capture-stage[data-capture-state='ready']::before {
    border-color: rgba(74, 222, 128, 0.76);
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.2), 0 0 0 1px rgba(22, 163, 74, 0.12);
}

.capture-focus-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.capture-focus-ellipse {
    position: absolute;
    inset: 14% 18%;
    border-radius: 50%;
    border: 1.5px solid rgba(226, 232, 240, 0.54);
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.12);
}

.capture-stage[data-capture-state='tracking'] .capture-focus-ellipse,
.capture-stage[data-capture-state='ready'] .capture-focus-ellipse {
    border-color: rgba(125, 211, 252, 0.78);
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.12), 0 0 24px rgba(56, 189, 248, 0.18);
}

.capture-stage[data-capture-state='ready'] .capture-focus-ellipse {
    border-color: rgba(74, 222, 128, 0.84);
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.14), 0 0 26px rgba(34, 197, 94, 0.2);
}

.capture-focus-corner {
    position: absolute;
    width: 44px;
    height: 44px;
    border-color: rgba(226, 232, 240, 0.88);
    border-style: solid;
    border-width: 0;
    filter: drop-shadow(0 6px 18px rgba(15, 23, 42, 0.22));
}

.capture-focus-corner.is-top-left {
    top: 26px;
    left: 26px;
    border-top-width: 3px;
    border-left-width: 3px;
    border-top-left-radius: 14px;
}

.capture-focus-corner.is-top-right {
    top: 26px;
    right: 26px;
    border-top-width: 3px;
    border-right-width: 3px;
    border-top-right-radius: 14px;
}

.capture-focus-corner.is-bottom-left {
    bottom: 26px;
    left: 26px;
    border-bottom-width: 3px;
    border-left-width: 3px;
    border-bottom-left-radius: 14px;
}

.capture-focus-corner.is-bottom-right {
    right: 26px;
    bottom: 26px;
    border-right-width: 3px;
    border-bottom-width: 3px;
    border-bottom-right-radius: 14px;
}

.capture-status-pill {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.capture-hint {
    position: absolute;
    inset: auto 16px 16px 16px;
    z-index: 1;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.34);
    color: var(--text-strong);
    font-size: 0.84rem;
    line-height: 1.55;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.filter-panel {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.table-wrap {
    overflow: auto;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: #ffffff;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.table-wrap:hover {
    border-color: #cfdae8;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.report-slot,
.table-shell {
    display: grid;
    gap: 14px;
}

.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid #ebf0f5;
}

.data-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 1;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.data-table tr:hover td {
    background: #f8fbff;
}

.data-table a {
    color: var(--accent-strong);
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.28);
    text-underline-offset: 3px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-card {
    position: relative;
    overflow: hidden;
    width: min(560px, 100%);
    padding: 32px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.94);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 56px rgba(15, 23, 42, 0.12);
}

.auth-card h1 {
    margin: 18px 0 12px;
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    line-height: 0.96;
}

.auth-card p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.7;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 96px));
    gap: 12px;
}

.preview-item {
    position: relative;
    display: grid;
    gap: 8px;
}

.preview-item img {
    width: 96px;
    height: 96px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.preview-item span {
    color: var(--muted);
    font-size: 0.75rem;
}

.preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    width: 30px;
    height: 30px;
}

.preview-empty {
    grid-column: 1 / -1;
    min-height: 72px;
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed var(--line-strong);
    color: var(--muted);
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.72);
}

.member-card-grid,
.event-card-grid {
    display: flex;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: center;
}

.thumb-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid #d7e4f4;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    height: 200px;
    width: 200px;
}

.thumb-card:hover {
    transform: translateY(-2px);
    border-color: #c8daf4;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.08);
}

.thumb-card strong,
.member-info strong,
.event-card-grid strong {
    color: var(--text-strong);
}

.thumb-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
}

.empty-thumb {
    display: grid;
    place-items: center;
    min-height: 120px;
    border-radius: 16px;
    border: 1px dashed var(--line-strong);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
}

.member-info,
.event-card-grid {
    color: var(--muted);
    line-height: 1.68;
}

.member-info {
    display: grid;
    gap: 10px;
}

.event-grid {
    display: grid;
    gap: 18px;
}

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

.check-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--text);
    line-height: 1.5;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(216, 226, 240, 0.96);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.small-check {
    font-size: 0.85rem;
    color: var(--muted);
}

.checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
    border: 1px solid #d7e4f4;
}

.permission-editor {
    position: relative;
    overflow: auto;
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.14), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border: 1px solid #d7e4f4;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.permission-editor:hover {
    transform: translateY(-2px);
    border-color: #c8daf4;
    box-shadow: 0 20px 38px rgba(37, 99, 235, 0.08);
}

.permission-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.permission-inline-summary {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: #e8f0ff;
    color: #1d4ed8;
    font-weight: 700;
}

.permission-group-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.permission-group-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #d7e4f4;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.permission-group-card:hover {
    transform: translateY(-2px);
    border-color: #c8daf4;
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.08);
}

.permission-group-card header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.permission-group-card header span {
    color: var(--muted);
    font-size: 0.85rem;
}

.permission-option-list {
    display: grid;
    gap: 10px;
}

.permission-option {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid #dfe7f3;
}

.permission-option .form-check-input {
    margin-top: 2px;
}

.permission-option .form-check-label {
    display: grid;
    gap: 4px;
}

.permission-option strong {
    font-size: 0.94rem;
}

.permission-option small {
    color: var(--muted);
    line-height: 1.5;
}

.permission-group-list.is-admin-mode .permission-option {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.permission-chip-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.stack-field {
    display: grid;
    gap: 10px;
}

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

.doc-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.doc-list-head strong {
    color: var(--text-strong);
}

.doc-chip {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.doc-chip:hover {
    transform: translateY(-2px);
    border-color: #c8daf4;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.08);
    background: #f8fbff;
}

.doc-chip-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.doc-chip-copy a,
.doc-chip-copy strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text-strong);
}

.doc-chip-note {
    color: var(--muted-strong);
    font-size: 0.82rem;
    line-height: 1.5;
}

.doc-chip-pending {
    background: #f8fbff;
    border-color: #d7e4f4;
    color: var(--muted-strong);
}

.doc-chip-removed {
    background: #fef2f2;
    border-color: #fecaca;
}

.doc-chip-removed .doc-chip-copy a,
.doc-chip-removed .doc-chip-copy strong,
.doc-chip-removed .doc-chip-note {
    color: #991b1b;
}

.thumb-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.member-thumb-item {
    position: relative;
    width: 92px;
}
.member-thumb-item.has-action {
    padding-bottom: 40px;
}
.member-thumb-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    border: 1px solid var(--line);
}
.member-thumb-item.is-pending-remove img {
    opacity: 0.36;
    filter: grayscale(0.45);
    border-color: rgba(220, 38, 38, 0.28);
}
.member-thumb-item .delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff4d4f;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s;
    z-index: 2;
}
.member-thumb-item .delete-btn:hover {
    background: #ff7875;
    transform: scale(1.1);
}
.member-thumb-item .delete-btn.is-undo {
    background: #1677ff;
}
.member-thumb-item .delete-btn.is-undo:hover {
    background: #4096ff;
}
.member-thumb-item .thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 0 0 8px 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-thumb-item.has-action .thumb-label {
    bottom: 40px;
}
.member-thumb-item .member-thumb-action {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    background: rgba(254, 242, 242, 0.92);
    color: #b91c1c;
    font-size: 0.76rem;
    font-weight: 600;
    transition: all 0.18s ease;
}
.member-thumb-item .member-thumb-action:hover {
    border-color: rgba(220, 38, 38, 0.32);
    background: #fee2e2;
}
.member-thumb-item .member-thumb-action.is-undo {
    border-color: rgba(37, 99, 235, 0.2);
    background: rgba(239, 246, 255, 0.96);
    color: #1d4ed8;
}
.member-thumb-item .member-thumb-action.is-undo:hover {
    border-color: rgba(37, 99, 235, 0.34);
    background: #dbeafe;
}
.thumb-strip-note {
    flex-basis: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(254, 242, 242, 0.92);
    border: 1px dashed rgba(220, 38, 38, 0.22);
    color: #991b1b;
    font-size: 0.82rem;
}

.event-modal-card {
    width: min(900px, 100%);
}

#memberModal .modal-card {
    width: min(1040px, 100%);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

#memberModal .modal-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    column-gap: 18px;
    row-gap: 18px;
}

#memberModal .preview-grid {
    align-content: start;
}

.btn-outline-light,
.btn-outline-secondary {
    border-color: var(--line);
    color: var(--text);
    background: rgba(255, 255, 255, 0.9);
}

.btn-outline-light:hover,
.btn-outline-secondary:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: #ffffff;
    color: var(--text-strong);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.btn-close {
    filter: none;
    opacity: 0.58;
}

.btn-close:hover {
    opacity: 0.82;
}

.card,
.modal-content,
.list-group-item,
.table,
.form-control,
.form-select {
    background-color: rgba(255, 255, 255, 0.96);
    border-color: var(--line);
    color: var(--text);
}

.card {
    box-shadow: var(--shadow-soft);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.card:hover {
    border-color: #d0dceb;
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.08);
}

/* Admin modals use custom `is-open` instead of Bootstrap's `.show`.
   Force the fade state to become visible when JS opens the modal. */
.modal.fade {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease, background-color 0.22s ease;
}

.modal.is-open,
.modal.fade.is-open {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible;
}

.modal {
    padding: clamp(14px, 2.2vw, 30px);
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.18), transparent 24%),
        rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(18px);
}

.modal .modal-dialog {
    width: min(880px, calc(100vw - 32px));
    max-width: min(880px, calc(100vw - 32px));
    margin: auto;
    pointer-events: auto;
}

.modal .modal-dialog.modal-lg {
    width: min(960px, calc(100vw - 32px));
    max-width: min(960px, calc(100vw - 32px));
}

.modal .modal-dialog.modal-xl {
    width: min(1240px, calc(100vw - 32px));
    max-width: min(1240px, calc(100vw - 32px));
}

.modal.fade .modal-dialog {
    transform: translateY(30px) scale(0.984);
    opacity: 0;
    transition: transform 0.24s ease, opacity 0.24s ease;
}

.modal.fade.is-open .modal-dialog,
.modal.is-open .modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-content {
    border: 1px solid var(--line);
    border-radius: 32px;
    box-shadow: 0 36px 80px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 255, 0.99) 100%);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.modal-content::before {
    content: '';
    display: block;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 44%, #14b8a6 100%);
}

.modal-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 58px rgba(15, 23, 42, 0.12);
}

.modal-header,
.modal-footer {
    border-color: #ebf0f5;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 24px 30px 20px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.16), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.modal-body {
    padding: 26px 30px 28px;
    max-height: min(calc(100vh - 210px), 78vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.94) 0%, rgba(247, 250, 255, 0.98) 100%);
}

.modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 20px 30px 26px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
}

.modal-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
}

.modal-footer .btn,
.modal-footer-actions .btn,
.modal .input-group .btn {
    min-height: 48px;
    border-radius: 16px;
}

.modal-save-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 22px;
    color: #36506b;
    font-size: 0.94rem;
    font-weight: 600;
}

.modal-save-status::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(37, 99, 235, 0.18);
    border-top-color: #2563eb;
    animation: admin-spin 0.78s linear infinite;
}

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

.modal-saving-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(248, 251, 255, 0.78);
    backdrop-filter: blur(3px);
}

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

.modal-saving-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
    color: #1f2937;
    font-weight: 600;
}

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

.modal-body .eyebrow,
.modal-header .eyebrow {
    margin-bottom: 0;
}

.admin-modal-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
    max-width: min(760px, 100%);
}

.admin-modal-subtitle {
    color: var(--muted-strong);
    line-height: 1.66;
    max-width: 68ch;
}

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

.admin-form-section {
    position: relative;
    display: grid;
    gap: 16px;
    align-content: start;
    padding: 20px 22px;
    border-radius: 26px;
    border: 1px solid #dbe7f4;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.admin-form-section--full {
    grid-column: 1 / -1;
}

.admin-form-section--span-4 {
    grid-column: span 4;
}

.admin-form-section--span-5 {
    grid-column: span 5;
}

.admin-form-section--span-6 {
    grid-column: span 6;
}

.admin-form-section--span-7 {
    grid-column: span 7;
}

.admin-form-section--span-8 {
    grid-column: span 8;
}

.admin-form-section-head {
    display: grid;
    gap: 6px;
}

.admin-form-section-head strong {
    color: var(--text-strong);
    font-size: 1.02rem;
    letter-spacing: -0.02em;
}

.admin-form-section-head p {
    color: var(--muted);
    line-height: 1.66;
}

.admin-form-field {
    display: grid;
    gap: 8px;
}

.admin-form-field > .form-label,
.admin-form-field > .muted.small,
.admin-form-field > label.muted.small {
    color: var(--muted-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.admin-form-note {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px dashed rgba(59, 130, 246, 0.22);
    background: rgba(239, 246, 255, 0.76);
}

.admin-form-aside {
    align-content: start;
}

.admin-form-check {
    margin-top: 0;
}

.form-label {
    color: var(--muted-strong);
    font-weight: 600;
}

.modal-grid .stack-field {
    min-width: 0;
}

.form-control::placeholder {
    color: #90a0b6;
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.1);
    color: var(--text);
}

.form-check-input {
    background-color: #ffffff;
    border-color: var(--line-strong);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.input-group .btn {
    border-color: var(--line);
}

.modal .form-control,
.modal .form-select,
.modal textarea {
    min-height: 50px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border-color: #d6e2f0;
    box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.06);
}

.modal textarea {
    min-height: 118px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.modal .check-grid,
.modal .checkbox-list,
.modal .seat-assignment-shell,
.modal .permission-editor,
.modal .capture-panel {
    border-radius: 22px;
}

.confirm-copy {
    display: grid;
    gap: 8px;
}

.confirm-note {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
    border: 1px solid #fed7aa;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.confirm-note:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(194, 65, 12, 0.08);
}

.confirm-note p {
    white-space: pre-line;
}

.confirm-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #ffedd5;
    color: #c2410c;
    font-size: 1.2rem;
}

.confirm-modal .modal-dialog {
    max-width: 520px;
}

.toast-container {
    z-index: 1090;
}

.toast {
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.toast-copy {
    margin-top: 6px;
    white-space: pre-line;
    line-height: 1.58;
}

.config-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px;
}

.permission-filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px 220px;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid #dbe7f4;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.single-search {
    grid-template-columns: minmax(0, 1fr);
}

.permission-subtabs,
.catalog-subtabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.checkin-admin-shell {
    display: grid;
    gap: 18px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid #dbe7f4;
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.94) 0%, rgba(245, 249, 255, 0.96) 100%);
}

.permission-subtabs,
.checkin-admin-subtabs {
    padding: 6px;
    border-radius: 20px;
    border: 1px solid #dbe7f4;
    background: rgba(255, 255, 255, 0.92);
    width: fit-content;
}

.checkin-admin-subtabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checkin-admin-panel {
    display: none;
    gap: 16px;
}

.checkin-admin-panel.is-active {
    display: grid;
}

.checkin-admin-panel[hidden] {
    display: none !important;
}

.log-cell-stack {
    display: grid;
    gap: 4px;
    min-width: 140px;
}

.log-cell-stack strong {
    color: var(--text-strong);
    font-size: 0.94rem;
}

.log-cell-stack span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.log-image-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.log-image-links a {
    font-weight: 700;
}

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

.log-feedback-text {
    min-width: 260px;
    max-width: 560px;
    white-space: pre-wrap;
    line-height: 1.65;
}

.permission-admin-view,
.catalog-admin-view {
    display: none;
    gap: 16px;
}

.permission-admin-view.is-active,
.catalog-admin-view.is-active {
    display: grid;
}

.permission-overview {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.permission-metric-card {
    min-height: 116px;
}

.permission-copy-cell {
    min-width: 280px;
    color: var(--muted);
    line-height: 1.6;
}

.account-card-grid {
    display: grid;
    gap: 18px;
}

.permission-role-grid {
    display: grid;
    gap: 18px;
}

.account-card {
    gap: 16px;
}

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

.account-info-card {
    gap: 12px;
}

.account-info-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    line-height: 1.55;
}

.account-info-line span {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--muted);
}

.account-info-line b {
    font-weight: 700;
    color: var(--text-strong);
}

.employee-meta code,
.account-info-line code {
    color: #1e3a8a;
    background: #eef4ff;
    padding: 4px 8px;
    border-radius: 999px;
}

.scope-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
    border-color: #cfe0fb;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.scope-card:hover {
    transform: translateY(-2px);
    border-color: #bcd4fb;
    box-shadow: 0 22px 42px rgba(37, 99, 235, 0.1);
}

.scope-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-shell.card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-radius: 26px;
}

.table-shell .list-meta-bar {
    margin-bottom: 0;
}

.admin-table {
    min-width: 840px;
}

.admin-table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border-bottom-color: #e6edf5;
    background: #f8fafc;
}

.admin-table tbody td {
    border-bottom-color: #edf2f7;
    color: var(--text);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover td {
    background: #f8fbff;
    border-bottom-color: #dbe7f7;
}

.admin-table code {
    color: #1e3a8a;
    background: #eef4ff;
    padding: 4px 8px;
    border-radius: 999px;
}

.badge {
    font-weight: 700;
    border: 1px solid transparent;
}

.text-bg-primary {
    color: #1e3a8a !important;
    background: #e0ebff !important;
    border-color: #bfd3ff !important;
}

.text-bg-secondary,
.badge.text-bg-light,
.text-bg-dark {
    color: #475569 !important;
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

.text-bg-success {
    color: #166534 !important;
    background: #dcfce7 !important;
    border-color: #bbf7d0 !important;
}

.text-bg-warning {
    color: #92400e !important;
    background: #fef3c7 !important;
    border-color: #fde68a !important;
}

.text-bg-danger {
    color: #991b1b !important;
    background: #fee2e2 !important;
    border-color: #fecaca !important;
}

.text-bg-info {
    color: #0f4c81 !important;
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
}

.seat-assignment-shell {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #d7e4f4;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.seat-assignment-card {
    display: grid;
    gap: 14px;
}

.btn:focus-visible,
.tab-btn:focus-visible,
.nav-pills .nav-link:focus-visible,
.icon-btn:focus-visible,
.btn-outline-light:focus-visible,
.btn-outline-secondary:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.seat-assignment-table {
    min-width: 760px;
    margin-bottom: 0;
}

#eventModal .modal-grid {
    display: grid;
    gap: 18px;
}

#eventModal .modal-content {
    position: relative;
}

#eventModal .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#eventModal .event-voice-actions .btn {
    min-width: 180px;
}

#eventModal .checkbox-list {
    max-height: 300px;
    overflow: auto;
    min-height: 100px;
}

#eventModal .textarea-field {
    min-height: 120px;
}

#eventModal .large-textarea {
    min-height: 184px;
}

.seat-assignment-card .list-meta-bar {
    margin-bottom: 12px;
}

.seat-assignment-toolbar {
    align-items: flex-start;
}

.seat-toolbar-controls {
    display: flex;
    flex: 1 1 420px;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.seat-search-field {
    min-width: min(320px, 100%);
    flex: 1 1 320px;
}

.seat-department-select {
    width: 220px;
    flex: 0 0 220px;
}

.seat-filter-select {
    width: 170px;
    flex: 0 0 170px;
}

.seat-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.seat-summary-chip {
    display: grid;
    gap: 4px;
    min-width: 92px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid #dbe7f5;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 18px rgba(148, 163, 184, 0.08);
}

.seat-summary-chip strong {
    color: var(--text-strong);
    font-size: 1.05rem;
    line-height: 1.1;
}

.seat-summary-chip small {
    color: var(--muted-strong);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.seat-bulk-panel {
    border: 1px dashed #c7d8ed;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
}

.seat-bulk-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-strong);
    list-style: none;
}

.seat-bulk-panel summary::-webkit-details-marker {
    display: none;
}

.seat-bulk-panel[open] summary {
    border-bottom: 1px solid #e2e8f0;
}

.seat-bulk-body {
    display: grid;
    gap: 12px;
    padding: 14px 16px 16px;
}

.seat-bulk-textarea {
    min-height: 122px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.seat-bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.seat-bulk-actions code {
    font-size: 0.82rem;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-soft);
}

.seat-assignment-table-wrap {
    overflow: auto;
    border: 1px solid #dbe7f5;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
}

.seat-assignment-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 14px;
    background: #f8fbff;
    border-bottom: 1px solid #e2e8f0;
    color: var(--muted-strong);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.seat-assignment-table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-color: #eaf0f6;
}

.seat-assignment-table tbody tr[data-seat-state="assigned"] {
    background: rgba(220, 252, 231, 0.45);
}

.seat-assignment-table tbody tr[data-seat-state="missing"] {
    background: rgba(248, 250, 252, 0.92);
}

.seat-member-cell {
    min-width: 260px;
}

.seat-member-name {
    color: var(--text-strong);
    font-weight: 700;
}

.seat-member-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.seat-member-code {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.seat-input {
    min-width: 130px;
}

.seat-row-clear {
    min-width: 68px;
}

.seat-assignment-empty {
    padding: 24px 18px !important;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 1200px) {
    .overview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .system-settings-card {
        grid-template-columns: 1fr;
    }

    .settings-inline {
        justify-content: flex-start;
    }

    .settings-actions {
        grid-column: auto;
        justify-content: flex-start;
    }

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

    .admin-layout-members .sidebar-panel {
        position: static;
    }

    .home-overview-shell > .toolbar,
    .home-event-panel {
        padding: 22px !important;
    }

    .dept-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 960px) {
    .config-grid {
        grid-template-columns: 1fr;
    }

    .admin-shell {
        width: min(1440px, calc(100vw - 16px));
        padding-top: 16px;
    }

    .toolbar-actions,
    .content-head .toolbar-actions {
        width: 100%;
        justify-content: stretch;
        margin-left: 0;
    }

    .toolbar-actions .form-control,
    .toolbar-actions .form-select,
    .toolbar-actions .btn {
        min-width: 0;
        width: 100%;
        flex: 1 1 100%;
    }

    .catalog-hero {
        flex-direction: column;
    }

    .catalog-hero-meta {
        justify-content: flex-start;
    }

    .permission-filter-bar,
    .permission-overview {
        grid-template-columns: 1fr;
    }

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

    .home-overview-shell > .toolbar {
        padding: 22px 20px;
    }
}

@media (max-width: 920px) {
    .modal {
        padding: 10px;
    }

    .modal .modal-dialog,
    .modal .modal-dialog.modal-lg,
    .modal .modal-dialog.modal-xl {
        width: min(100%, calc(100vw - 20px));
        max-width: min(100%, calc(100vw - 20px));
    }

    .modal-header {
        padding: 18px 18px 16px;
    }

    .modal-body {
        padding: 18px;
        max-height: min(calc(100vh - 180px), 76vh);
    }

    .modal-footer {
        padding: 14px 18px 18px;
    }

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

    .admin-form-section,
    .admin-form-section--span-4,
    .admin-form-section--span-5,
    .admin-form-section--span-6,
    .admin-form-section--span-7,
    .admin-form-section--span-8,
    .admin-form-section--full {
        grid-column: 1;
        padding: 18px;
    }

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

    .modal-footer-actions {
        width: 100%;
        justify-content: stretch;
    }

    .modal-save-status {
        width: 100%;
    }

    .modal-footer-actions > .btn {
        flex: 1 1 0;
    }

    #employeeModal .modal-card {
        width: min(760px, 100%);
    }

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

    #eventModal .event-voice-actions {
        display: grid;
    }

    #eventModal .event-voice-actions .btn {
        width: 100%;
        min-width: 0;
    }

    #memberModal .modal-grid {
        grid-template-columns: 1fr;
    }

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

    .seat-toolbar-controls {
        justify-content: stretch;
    }

    .seat-search-field,
    .seat-department-select,
    .seat-filter-select,
    .seat-toolbar-controls .btn {
        width: 100%;
        flex: 1 1 100%;
    }
}

@media (max-height: 860px) {
    #employeeModal .modal-card {
        max-height: calc(100vh - 16px);
    }

    .capture-stage {
        width: min(100%, 300px);
    }
}

@media (max-width: 720px) {
    .admin-topbar,
    .sidebar-panel,
    .content-panel {
        padding: 16px;
    }

    .admin-topbar {
        border-radius: 26px;
    }

    .seat-assignment-shell {
        padding: 14px;
    }

    .seat-summary-chip {
        min-width: calc(50% - 5px);
        flex: 1 1 calc(50% - 5px);
    }

    .seat-bulk-body {
        padding: 12px;
    }

    .seat-assignment-table {
        min-width: 640px;
    }

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

    .employee-card,
    .event-card {
        padding: 16px;
    }

    .auth-card {
        padding: 22px;
        border-radius: 28px;
    }

    .admin-topbar-actions,
    .admin-action-cluster,
    .admin-status-row,
    .admin-primary-actions {
        gap: 10px;
    }

    .admin-topbar-actions {
        min-width: 0;
    }

    .admin-action-cluster {
        padding: 12px;
    }

    .admin-status-row,
    .admin-primary-actions,
    .admin-secondary-actions {
        justify-content: stretch;
    }

    .admin-secondary-actions {
        padding-bottom: 2px;
    }

    .admin-topbar-actions .btn,
    .admin-topbar-actions .badge {
        width: 100%;
        justify-content: center;
    }

    .admin-toolbar,
    .content-head,
    .sidebar-head,
    .checkin-admin-shell,
    .permission-filter-bar,
    .catalog-subtab-shell {
        padding: 16px;
    }

    .list-meta-actions,
    .pager-actions,
    .page-size-box {
        width: 100%;
        justify-content: space-between;
    }

    .compact-select {
        flex: 1 1 120px;
        min-width: 0;
    }

    .btn-compact,
    .pager-status {
        flex: 1 1 0;
    }

    .capture-stage {
        width: min(100%, 300px);
    }

    .capture-stage::before {
        inset: 12px;
        border-radius: 18px;
    }

    .capture-focus-corner.is-top-left {
        top: 20px;
        left: 20px;
    }

    .capture-focus-corner.is-top-right {
        top: 20px;
        right: 20px;
    }

    .capture-focus-corner.is-bottom-left {
        bottom: 20px;
        left: 20px;
    }

    .capture-focus-corner.is-bottom-right {
        right: 20px;
        bottom: 20px;
    }
}

@media (max-width: 560px) {
    .overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .employee-detail-list,
    .event-detail-grid {
        grid-template-columns: 1fr;
    }

    .overview-grid .metric-card {
        min-height: 104px;
    }

    .admin-brand h1 {
        font-size: clamp(1.56rem, 8.4vw, 2.15rem);
        line-height: 1.02;
    }
}

@media (max-width: 380px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-topbar,
    .admin-topbar .btn-light,
    .overview-grid .metric-card,
    .system-settings-card,
    .tab-btn,
    .nav-pills .nav-link,
    .catalog-hero,
    .sidebar-panel,
    .content-panel,
    .dept-card,
    .position-card,
    .icon-btn,
    .list-meta-bar,
    .employee-card,
    .event-card,
    .capture-panel,
    .table-wrap,
    .auth-card,
    .thumb-card,
    .permission-editor,
    .permission-group-card,
    .doc-chip,
    .card,
    .modal-content,
    .confirm-note,
    .scope-card,
    .admin-table tbody td {
        transition: none;
        animation: none;
    }
}
