/* =====================================================
   ระบบจองโต๊ะปัจฉิมฯ - Custom Styles
   =====================================================*/

/* Font */
body {
    font-family: 'Sarabun', sans-serif;
    background-color: #f8fafc;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    /* Only hide horizontal */
    margin: 0 !important;
}

/* Page transition (smooth navigation) */
:root {
    --page-transition-in: 260ms;
    --page-transition-out: 180ms;
    --page-transition-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --admin-modal-z: 3000;
    --admin-modal-panel-z: 3001;
    --admin-upload-overlay-z: 3500;
    --admin-swal-z: 5000;
}

body.page-fade-in {
    animation: pageFadeIn var(--page-transition-in) var(--page-transition-ease) both;
}

body.page-fade-out {
    animation: pageFadeOut var(--page-transition-out) ease-in both;
    pointer-events: none;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        filter: saturate(0.98);
    }
    to {
        opacity: 1;
        filter: none;
    }
}

@keyframes pageFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.page-fade-in,
    body.page-fade-out {
        animation: none !important;
        transform: none !important;
    }
}

/* Modal overlay */
.admin-modal-root,
.modal-overlay,
#club-edit-modal,
#club-name-modal,
#advisor-modal,
#attendance-detail-modal {
    position: fixed !important;
    inset: 0 !important;
    display: none;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    overscroll-behavior: contain;
    padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1rem calc(env(safe-area-inset-bottom, 0px) + 1rem);
    isolation: isolate;
    z-index: var(--admin-modal-z) !important;
    box-sizing: border-box;
}

.admin-modal-root:not(.hidden),
.modal-overlay:not(.hidden),
#club-edit-modal:not(.hidden),
#club-name-modal:not(.hidden),
#advisor-modal:not(.hidden),
#attendance-detail-modal:not(.hidden) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: var(--admin-modal-z) !important;
}

.admin-modal-root > .modal-stage,
.modal-overlay > .modal-stage,
#club-edit-modal > .modal-stage,
#club-name-modal > .modal-stage,
#advisor-modal > .modal-stage,
#attendance-detail-modal > .modal-stage {
    position: static !important;
    inset: unset !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    transform: none !important;
    box-sizing: border-box;
}

.admin-modal-root .modal-backdrop,
.modal-overlay .modal-backdrop,
#club-edit-modal .modal-backdrop,
#club-name-modal .modal-backdrop,
#advisor-modal .modal-backdrop,
#attendance-detail-modal .modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.admin-modal-root > .modal-panel,
.admin-modal-root > .modal-stage > .modal-panel,
.admin-modal-root > .bg-white,
.admin-modal-root > .club-modal-panel,
.admin-modal-root > .relative.z-10,
.modal-overlay > .modal-panel,
.modal-overlay > .modal-stage > .modal-panel,
.modal-overlay > .bg-white,
.modal-overlay > .club-modal-panel,
.modal-overlay > .relative.z-10,
#club-edit-modal > .modal-panel,
#club-edit-modal > .modal-stage > .modal-panel,
#club-edit-modal > div,
#club-name-modal > .modal-panel,
#club-name-modal > .modal-stage > .modal-panel,
#club-name-modal > div,
#advisor-modal > .modal-panel,
#advisor-modal > .modal-stage > .modal-panel,
#advisor-modal > div,
#attendance-detail-modal > .modal-panel,
#attendance-detail-modal > .modal-stage > .modal-panel,
#attendance-detail-modal > .relative.z-10 {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    z-index: var(--admin-modal-panel-z) !important;
    margin: 0 !important;
    width: min(calc(100vw - 2rem), var(--modal-max-width, 72rem)) !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    filter: none !important;
    box-sizing: border-box;
    overflow-y: auto !important;
    transform: translate(-50%, -50%);
}

.admin-modal-root .modal-panel.animate-fade-in-up,
.modal-overlay .modal-panel.animate-fade-in-up,
.admin-modal-root .club-modal-panel.animate-fade-in-up,
.modal-overlay .club-modal-panel.animate-fade-in-up,
#club-edit-modal .modal-panel.animate-fade-in-up,
#club-name-modal .modal-panel.animate-fade-in-up,
#advisor-modal .modal-panel.animate-fade-in-up,
#attendance-detail-modal .modal-panel.animate-fade-in-up {
    animation: modalPanelIn 0.3s ease-out;
}

/* Setup picker modal (teacher) must stay above mobile bottom dock */
#setup-picker-modal {
    z-index: calc(var(--admin-modal-z) + 5) !important;
    isolation: isolate;
}

@keyframes modalPanelIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Admin modal sizes */
#config-modal .modal-panel {
    width: min(calc(100vw - 2rem), max(24rem, 26vw)) !important;
}

#admin-table-modal .modal-panel {
    width: min(calc(100vw - 2rem), max(42rem, 48vw)) !important;
    height: min(calc(100dvh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)), 920px) !important;
    overflow: hidden !important;
}

#admin-table-modal-content {
    height: 100% !important;
    min-height: 0 !important;
}

#admin-table-modal-right {
    min-height: 0 !important;
    overflow: hidden !important;
}

#admin-table-modal-right #admin-modal-body {
    min-height: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    #admin-table-modal {
        padding: 0.5rem !important;
    }

    #admin-table-modal .modal-panel {
        width: calc(100vw - 1rem) !important;
        height: calc(100dvh - 1rem) !important;
        max-height: calc(100dvh - 1rem) !important;
        border-radius: 1rem !important;
        transform: translate(-50%, -50%) !important;
    }

    #admin-table-modal-content {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #admin-table-modal-left,
    #admin-table-modal-right {
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    #admin-table-modal-right #admin-modal-body {
        max-height: none !important;
        min-height: 0 !important;
    }
}

#club-form-modal .modal-panel,
#student-form-modal .modal-panel,
#import-modal .modal-panel {
    width: min(calc(100vw - 2rem), max(32rem, 38vw)) !important;
}

#club-import-modal .modal-panel,
#teacher-form-modal .modal-panel {
    width: min(calc(100vw - 2rem), max(28rem, 34vw)) !important;
}

#paste-import-modal .modal-panel {
    width: min(calc(100vw - 2rem), max(48rem, 64vw)) !important;
}

#attendance-detail-modal .modal-panel {
    width: min(calc(100vw - 2rem), max(72rem, 84vw)) !important;
    overflow: hidden !important;
}

#club-edit-modal > div {
    width: min(calc(100vw - 2rem), max(66rem, 86vw)) !important;
    overflow: hidden !important;
}

.modal-overlay > .club-modal-panel,
#club-edit-modal > div,
#club-name-modal > div,
#advisor-modal > div,
#attendance-detail-modal > .relative.z-10 {
    overflow: hidden !important;
}

/* Club detail modal refresh */
.club-modal-panel {
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.club-modal-header {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(130deg, #fdf4ff 0%, #ffffff 56%, #f8fafc 100%);
}

.club-modal-title {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.45rem;
    line-height: 1.25;
    color: #0f172a;
}

.club-modal-title span {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #d8b4fe;
    background: #fdf4ff;
    color: #7e22ce !important;
    font-size: 0.78rem;
    line-height: 1.1;
    font-weight: 800 !important;
}

.club-modal-seat-info {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #e9d5ff;
    background: #fae8ff;
    color: #6b21a8 !important;
    font-size: 0.78rem;
    line-height: 1.1;
    font-weight: 700;
}

.club-modal-close {
    border-radius: 0.75rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.club-modal-close:hover {
    color: #334155 !important;
    border-color: #cbd5e1;
    background: rgba(255, 255, 255, 0.95);
}

.club-modal-body {
    padding: 1rem;
    overscroll-behavior: contain;
    background: radial-gradient(circle at top right, rgba(255, 237, 213, 0.55), transparent 45%);
}

.club-modal-scroll {
    scrollbar-color: #cbd5e1 #f8fafc;
}

.club-modal-scroll::-webkit-scrollbar {
    width: 7px;
}

.club-modal-scroll::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 8px;
}

.club-modal-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    border-radius: 8px;
}

.club-modal-content {
    display: grid;
    gap: 0.72rem;
    margin-bottom: 0.9rem;
}

.club-modal-section {
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    padding: 0.82rem;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.club-modal-section--description {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.club-modal-section--attendance {
    margin-top: 0.9rem;
    border-top: 1px solid #e2e8f0;
}

.club-modal-section-title {
    margin: 0;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.club-modal-description {
    margin-top: 0.46rem;
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1.58;
}

.club-modal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
}

.club-modal-info-card {
    border: 1px solid #e9d5ff;
    border-radius: 0.8rem;
    padding: 0.68rem;
    background: linear-gradient(180deg, #fdf4ff 0%, #ffffff 100%);
}

.club-modal-info-label {
    margin: 0 0 0.32rem;
    color: #a855f7;
    font-size: 0.7rem;
    line-height: 1.1;
    font-weight: 800;
    text-transform: uppercase;
}

.club-modal-info-value {
    color: #7c2d12;
    font-size: 0.92rem;
    line-height: 1.4;
    font-weight: 700;
}

.club-modal-info-value--multiline p {
    margin: 0;
}

.club-modal-loading {
    border: 1px dashed #d8b4fe;
    border-radius: 0.75rem;
    color: #a855f7;
    background: #fdf4ff;
}

.club-modal-list {
    margin: 0 0 0.7rem;
    max-height: 15.8rem;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.82rem;
    background: #ffffff;
}

.club-modal-list--attendance {
    margin-bottom: 0.55rem;
    max-height: 16.2rem;
}

.club-modal-list--history {
    margin-bottom: 0;
    max-height: 12rem;
}

.club-modal-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.62rem 0.72rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.club-modal-list-item:last-child {
    border-bottom: none;
}

.club-modal-list-item.is-me {
    background: linear-gradient(90deg, #fdf4ff 0%, #ffffff 100%);
}

.club-modal-list-main {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.club-modal-rank {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: #f1f5f9;
    font-size: 0.73rem;
    font-weight: 800;
    flex: 0 0 auto;
}

.club-modal-name {
    color: #1e293b;
    font-weight: 600;
    line-height: 1.32;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.club-modal-name--me {
    color: #7e22ce;
    font-weight: 800;
}

.club-modal-meta {
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.1;
    white-space: nowrap;
}

.club-modal-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 0.75rem;
    color: #64748b;
    background: #f8fafc;
}

.club-attendance-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.club-attendance-kpi {
    border-radius: 0.75rem;
    padding: 0.52rem 0.42rem;
    text-align: center;
    border: 1px solid transparent;
}

.club-attendance-kpi--present {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.club-attendance-kpi--leave {
    border-color: #fde68a;
    background: #fffbeb;
}

.club-attendance-kpi--absent {
    border-color: #fda4af;
    background: #fff1f2;
}

.club-attendance-kpi--rate {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.club-attendance-total {
    color: #64748b;
}

.club-modal-subtitle {
    margin: 0 0 0.5rem;
    color: #0f172a;
    font-size: 0.9rem;
    line-height: 1.3;
    font-weight: 700;
}

.club-attendance-summary {
    color: #475569;
}

.club-modal-action-btn {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.club-modal-action-btn--primary {
    color: #ffffff;
    border-color: #7c3aed;
    background: linear-gradient(90deg, #7c3aed 0%, #ec4899 100%);
}

.club-modal-action-btn--primary:hover {
    filter: brightness(0.98);
}

.club-modal-action-btn--danger {
    color: #dc2626;
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.club-modal-action-btn--danger:hover {
    color: #ffffff;
    border-color: #ef4444;
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.club-modal-action-btn--disabled {
    color: #94a3b8;
    border-color: #e2e8f0;
    background: #f8fafc;
    box-shadow: none;
}

@media (max-width: 640px) {
    .club-modal-panel {
        border-radius: 1rem;
        max-height: 95dvh;
    }

    .club-modal-header {
        padding: 0.78rem 0.88rem;
    }

    .club-modal-title {
        font-size: 1.03rem;
        gap: 0.32rem;
    }

    .club-modal-title span {
        font-size: 0.72rem;
    }

    .club-modal-seat-info {
        font-size: 0.71rem;
    }

    .club-modal-body {
        padding: 0.78rem;
    }

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

    .club-modal-list {
        max-height: 13rem;
    }

    .club-modal-list--attendance {
        max-height: 13.5rem;
    }

    .club-modal-list--history {
        max-height: 9.8rem;
    }

    .club-modal-list-item {
        padding: 0.56rem 0.62rem;
        gap: 0.52rem;
    }

    .club-modal-meta {
        font-size: 0.69rem;
    }
}

/* Fade-in-up animation */
.animate-fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SweetAlert2 Custom Font */
.swal2-popup {
    font-family: 'Sarabun', sans-serif !important;
    border-radius: 1rem !important;
}

.swal2-container {
    z-index: var(--admin-swal-z) !important;
}

@media (max-width: 640px) {
    .swal2-container {
        padding: 0.75rem !important;
    }

    .swal2-popup {
        width: min(100%, calc(100vw - 1.5rem)) !important;
        padding: 1.25rem !important;
    }

    .swal2-actions {
        width: 100% !important;
        gap: 0.5rem !important;
    }

    .swal2-styled {
        flex: 1 1 0 !important;
        margin: 0 !important;
    }
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #a855f7;
    /* Orange-500 */
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9333ea;
    /* Orange-600 */
}

/* Keep club modal scrollbar neutral, not orange */
.club-modal-scroll.custom-scrollbar::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.club-modal-scroll.custom-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 8px;
}

.club-modal-scroll.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    border-radius: 8px;
}

.club-modal-scroll.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #94a3b8, #64748b);
}

/* Hide Scrollbar */
.hide-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Table card hover */
.table-card {
    transition: all 0.2s ease;
}

.table-card:not(.pointer-events-none):hover {
    transform: translateY(-2px);
}

.table-card.pointer-events-none {
    pointer-events: none !important;
    cursor: not-allowed !important;
    user-select: none;
}

/* Club card redesign (dashboard index) */
.club-card-modern {
    position: relative;
    overflow: hidden;
    border: 1px solid #d5e0ef;
    border-radius: 0.88rem;
    background: linear-gradient(165deg, #ffffff 0%, #f7fbff 62%, #fff7ef 100%);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.08),
        0 1px 2px rgba(15, 23, 42, 0.05);
    transition:
        border-color 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.club-card-modern::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ff7a18 0%, #ff3d6e 52%, #f472b6 100%);
    opacity: 1;
    z-index: 1;
}

.club-card-modern::after {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    right: -76px;
    top: -88px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 122, 24, 0.22) 0%, rgba(255, 122, 24, 0) 74%);
    pointer-events: none;
    z-index: 0;
}

.club-card-modern.table-card:not(.pointer-events-none):hover {
    transform: translateY(-1.5px);
    border-color: #bfd0e7;
    box-shadow:
        0 14px 24px rgba(15, 23, 42, 0.12),
        0 1px 2px rgba(15, 23, 42, 0.05);
}

.club-card-modern--my {
    border-color: #67e3a5;
    background: linear-gradient(165deg, #ffffff 0%, #f1fff7 62%, #edfff5 100%);
    box-shadow:
        0 12px 22px rgba(16, 185, 129, 0.13),
        0 1px 2px rgba(16, 185, 129, 0.14);
}

.club-card-modern--my::before {
    background: linear-gradient(90deg, #00b77a 0%, #1ed48f 56%, #5ce7b1 100%);
}

.club-card-modern--my::after {
    background: radial-gradient(circle, rgba(30, 212, 143, 0.2) 0%, rgba(30, 212, 143, 0) 74%);
}

.club-card-flat {
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.club-card-flat.is-expanded {
    border-color: #ff9f43;
    box-shadow:
        0 18px 30px rgba(255, 159, 67, 0.22),
        0 1px 2px rgba(15, 23, 42, 0.05);
}

.club-card-flat:focus-visible {
    outline: none;
    border-color: #ff9f43;
    box-shadow: 0 0 0 3px rgba(255, 159, 67, 0.24);
}

.club-card-flat__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 0.66rem;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.club-main {
    min-width: 0;
}

.club-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.club-card-kicker {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.52rem;
    border-radius: 999px;
    border: 1px solid #ffb57b;
    background: linear-gradient(180deg, #fff5ea 0%, #ffebd2 100%);
    font-size: 0.6rem;
    line-height: 1.1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e85d04;
}

.club-card-title {
    margin: 0.32rem 0 0;
    font-size: 1rem;
    line-height: 1.26;
    font-weight: 800;
    color: #0f172a;
    word-break: break-word;
}

.club-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.24rem 0.62rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.62rem;
    line-height: 1.2;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.club-main__meta {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem;
}

.club-main__meta-item {
    margin: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.58rem;
    background: rgba(255, 255, 255, 0.82);
}

.club-main__meta-item:first-child {
    grid-column: 1 / -1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.club-main__meta-label {
    color: #94a3b8;
    font-size: 0.52rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.club-main__meta-value {
    min-width: 0;
    color: #1e293b;
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 700;
    white-space: normal;
    word-break: break-word;
}

.club-summary {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.38rem;
    padding: 0.55rem 0.62rem;
    border: 1px solid #d8e3f1;
    border-radius: 0.72rem;
    background: linear-gradient(180deg, #f8fbff 0%, #edf4fd 100%);
    transition:
        border-color 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.club-card-flat.is-expanded .club-summary {
    border-color: #ffbe82;
    background: linear-gradient(180deg, #fffaf2 0%, #ffeed9 100%);
    transform: translateY(-1px);
}

.club-summary__numbers {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.56rem;
}

.club-summary__registered {
    color: #0f172a;
    font-size: 0.96rem;
    line-height: 1;
    font-weight: 800;
}

.club-summary__remaining {
    display: inline-flex;
    align-items: center;
    padding: 0.13rem 0.45rem;
    border-radius: 999px;
    border: 1px solid #d5deea;
    background: rgba(255, 255, 255, 0.88);
    color: #475569;
    font-size: 0.64rem;
    line-height: 1.1;
    font-weight: 700;
}

.club-status-open {
    background: #fff2e8;
    border-color: #ffc59c;
    color: #ef5b09;
}

.club-status-my {
    background: #dcfce9;
    border-color: #7be7ad;
    color: #0f9f5a;
}

.club-status-closed {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

.club-status-full {
    background: #ffe8ef;
    border-color: #ffb4c6;
    color: #e11d48;
}

.club-status-booked {
    background: #e6f0ff;
    border-color: #9bbcff;
    color: #1954d8;
}

.club-status-level {
    background: #fff6d6;
    border-color: #ffd766;
    color: #c57a00;
}

.club-card-desc {
    margin: 0;
    color: #334155;
    font-size: 0.85rem;
    line-height: 1.55;
}

.club-meta-list {
    margin-top: 0.62rem;
    border-top: 1px solid #e2e8f0;
}

.club-meta-row {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 0.62rem;
    align-items: start;
    padding: 0.46rem 0;
    border-bottom: 1px dashed #e7edf5;
}

.club-meta-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.club-meta-label {
    margin: 0;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.club-meta-value {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.45;
    color: #1f2937;
    word-break: break-word;
}

.club-meta-value--teachers {
    display: grid;
    gap: 0.12rem;
}

.club-teacher-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.club-teacher-line-full {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    word-break: break-word;
}

.club-seat-track {
    height: 0.3rem;
    background: #dde6f2;
    border-radius: 999px;
    overflow: hidden;
}

.club-seat-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.club-seat-fill--open {
    background: linear-gradient(90deg, #ff6b00 0%, #ff9e1b 100%);
}

.club-seat-fill--my {
    background: linear-gradient(90deg, #00b77a 0%, #39d98a 100%);
}

.club-seat-fill--full {
    background: linear-gradient(90deg, #ff5377 0%, #e11d48 100%);
}

.club-expand-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    width: auto;
    align-self: flex-end;
    padding: 0.24rem 0.45rem;
    border-radius: 999px;
    border: 1px solid #cfdced;
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
    font-size: 0.62rem;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
    transition:
        border-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.club-expand-toggle:hover {
    border-color: #ff9f43;
    color: #ef5b09;
    background: #fdf4ff;
}

.club-expand-icon {
    width: 13px;
    height: 13px;
    transition: transform 0.22s ease;
}

.club-expand-toggle.is-expanded .club-expand-icon {
    transform: rotate(180deg);
}

.club-card-flat__details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    border-top: 1px solid transparent;
    margin-top: 0;
    padding-top: 0;
    transform: translateY(-6px);
    will-change: max-height, opacity, transform;
    transition:
        max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        margin-top 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        padding-top 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.club-card-flat__details.is-open {
    max-height: 1200px;
    opacity: 1;
    transform: translateY(0);
    border-top-color: #e2e8f0;
    margin-top: 0.68rem;
    padding-top: 0.68rem;
}

.club-card-flat__details .club-card-action {
    margin-top: 0.72rem;
}

.club-card-action .compact-mobile-btn {
    min-height: 2.25rem;
    border-radius: 0.72rem !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.club-card-action .compact-mobile-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

@media (max-width: 959px) {
    .club-card-flat__summary {
        grid-template-columns: 1fr;
        gap: 0.58rem;
    }

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

    .club-main__meta-item:first-child {
        grid-column: 1 / -1;
    }

    .club-main__meta-value {
        max-width: none;
    }

    .club-summary {
        padding: 0.52rem 0.56rem;
    }

    .club-summary__registered {
        font-size: 0.9rem;
    }

    .club-expand-toggle {
        width: auto;
    }
}

@media (max-width: 640px) {
    .club-meta-row {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 0.54rem;
    }

    .club-card-action .compact-mobile-btn {
        min-height: 2.2rem;
        font-size: 0.7rem !important;
    }
}

@media (max-width: 420px) {
    .club-main__meta {
        grid-template-columns: 1fr;
    }

    .club-main__meta-item:first-child {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .club-card-modern,
    .club-summary,
    .club-expand-toggle,
    .club-card-flat__details,
    .club-expand-icon {
        transition: none !important;
        animation: none !important;
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #9333ea;
    /* Orange-600 */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Upload loading overlay */
.upload-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--admin-upload-overlay-z);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 15% 20%, rgba(192, 132, 252, 0.22), transparent 45%),
        radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.16), transparent 42%),
        rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
}

.upload-loading-card {
    width: min(92vw, 420px);
    border-radius: 20px;
    padding: 1.25rem 1.25rem 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.2);
}

.upload-loading-card.is-feedback {
    width: min(94vw, 760px);
}

.upload-loading-orb {
    position: relative;
    width: 74px;
    height: 74px;
    margin: 0 auto 0.9rem;
}

.upload-loading-ring {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 2px solid rgba(168, 85, 247, 0.32);
    animation: uploadPulse 1.6s ease-out infinite;
}

.upload-loading-ring.upload-loading-ring--delay {
    animation-delay: 0.8s;
}

.upload-loading-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 9999px;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #a855f7 0%, #fb7185 100%);
    box-shadow: 0 0 0 10px rgba(168, 85, 247, 0.14);
    animation: uploadDot 1.2s ease-in-out infinite alternate;
}

.upload-loading-progress {
    position: relative;
    height: 0.35rem;
    width: 100%;
    margin-top: 0.9rem;
    border-radius: 9999px;
    background: #e2e8f0;
    overflow: hidden;
}

.upload-loading-progress-bar {
    position: absolute;
    inset: 0;
    width: 42%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #a855f7 0%, #38bdf8 100%);
    animation: uploadSweep 1.1s linear infinite;
}

@keyframes uploadPulse {
    0% {
        transform: scale(0.55);
        opacity: 0.9;
    }

    100% {
        transform: scale(1.18);
        opacity: 0;
    }
}

@keyframes uploadDot {
    0% {
        transform: translate(-50%, -50%) scale(0.85);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes uploadSweep {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(320%);
    }
}

/* Shine Effect for buttons */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0) 100%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Stats card pulse for clickable */
.stats-card-clickable {
    transition: all 0.2s ease;
    cursor: pointer;
}

.stats-card-clickable:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Dropdown */
.dropdown-item {
    transition: background-color 0.15s ease;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* =========================================
   Modern UI Additions
   ========================================= */

/* Hero Gradient Background */
/* Animated Hero Gradient: Purple, Pink, White */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-gradient {
    /* Purple, Pink, White */
    background: linear-gradient(-45deg, #7c3aed, #a855f7, #ec4899, #ffffff);
    background-size: 300% 300%;
    animation: gradientAnimation 8s ease infinite;
    position: relative;
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(to right, #9333ea, #db2777);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Floating Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Text Shadows for better contrast */
.text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.text-shadow-md {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.text-shadow-lg {
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Soft Shadow */
.shadow-soft {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
}

.shadow-soft:hover {
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.12);
}

/* Button Gradient Hover */
.btn-gradient {
    background-size: 200% auto;
    transition: 0.5s;
}

.btn-gradient:hover {
    background-position: right center;
}

/* =========================================
   Admin Dashboard Layout (Header-Top Refactor)
   ========================================= */
:root {
    --app-header-height: 60px;
    --mobile-sidebar-gap: 8px;
    --bottom-nav-height: 72px;
    --mobile-viewport-offset-bottom: 0px;
}

/* Main wrapper: Flex container (Sidebar + Content) */
.admin-layout {
    display: flex !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    overflow: hidden !important;
    height: calc(100vh - var(--app-header-height)) !important;
    height: calc(100dvh - var(--app-header-height)) !important;
    min-height: calc(100vh - var(--app-header-height)) !important;
    min-height: calc(100dvh - var(--app-header-height)) !important;
    position: relative;
}

/* Admin view transitions */
.admin-page .view-section {
    opacity: 1;
    transition: opacity 220ms ease;
}

.admin-page .view-section.is-prep,
.admin-page .view-section.is-fading-out {
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .admin-page .view-section {
        transition: none;
    }
}

/* --- Header --- */
.admin-header,
.app-unified-header {
    height: 68px;
    width: 100% !important;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.6rem;
    position: sticky !important;
    top: 0;
    /* Keep header pinned while content scrolls */
    flex: 0 0 auto !important;
    /* Fixed height */
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.admin-header #brand-logo-header,
.app-unified-header .app-header-brand > img {
    width: 2.2rem !important;
    height: 2.2rem !important;
}

.admin-header #page-title,
.app-unified-header .header-brand-title {
    font-size: 1.08rem !important;
    line-height: 1.18;
}

.admin-header #header-brand-meta,
.app-unified-header .header-subline-nowrap {
    margin-top: 0.2rem;
    font-size: 0.82rem !important;
    line-height: 1.2;
}

.app-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.app-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.app-header-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.app-header-brand-copy .header-brand-title,
.app-header-brand-copy .header-subline-nowrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    width: 100%;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    flex: 0 0 auto;
}

.header-account-menu {
    position: relative;
}

.header-account-toggle {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    min-height: 40px;
    padding: 0.3rem 0.55rem 0.3rem 0.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 10px 24px -24px rgba(15, 23, 42, 0.6);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.header-account-toggle:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.header-account-toggle[aria-expanded="true"] {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
}

.header-account-toggle__avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    color: #ffffff;
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    flex: 0 0 auto;
}

.header-account-toggle__avatar.is-teacher {
    background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
}

.header-account-toggle__name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-account-toggle__chevron {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.header-account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(290px, calc(100vw - 20px));
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 42px -24px rgba(15, 23, 42, 0.35);
    z-index: 90;
    padding: 0.45rem;
}

.header-account-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.5rem 0.55rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.2rem;
}

.header-account-card__avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.84rem;
    color: #ffffff;
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    flex: 0 0 auto;
}

.header-account-card__avatar.is-teacher {
    background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
}

.header-account-card__meta {
    min-width: 0;
}

.header-account-card__name {
    margin: 0;
    font-size: 0.93rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-account-card__role {
    margin: 0.1rem 0 0;
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-account-actions {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.header-account-action {
    width: 100%;
    border: 0;
    background: #ffffff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.5rem 0.55rem;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.header-account-action:hover {
    background: #f8fafc;
    color: #1e293b;
}

.header-account-action.is-danger {
    color: #dc2626;
}

.header-account-action.is-danger:hover {
    background: #fff1f2;
    color: #b91c1c;
}

.header-account-action__icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.app-header-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: #ffffff;
    box-shadow: 0 10px 24px -18px rgba(59, 130, 246, 0.75);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.app-header-auth-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.app-header-auth-btn--login {
    background: linear-gradient(135deg, var(--site-secondary-color) 0%, var(--site-primary-color) 100%);
}

.app-header-auth-btn--logout {
    background: linear-gradient(135deg, #ef4444 0%, #8b5cf6 100%);
}

.app-header-auth-btn:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -16px rgba(79, 70, 229, 0.6);
}

.mobile-icon-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.mobile-icon-auth-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.mobile-icon-auth-btn__label {
    display: inline-flex;
    align-items: center;
}

.app-mobile-dock {
    display: none;
}

.app-mobile-dock-link {
    border: 0;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    min-width: 0;
    min-height: 54px;
    padding: 0.28rem 0.15rem;
    border-radius: 16px;
    color: #64748b;
    text-align: center;
    transition: color 0.18s ease, transform 0.18s ease, background 0.18s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.app-mobile-dock-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.app-mobile-dock-link__icon svg {
    width: 1.18rem;
    height: 1.18rem;
    display: block;
}

.app-mobile-dock-link__label {
    display: block;
    min-width: 0;
    font-size: 0.6rem;
    line-height: 1.32;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    padding-bottom: 0.08rem;
    color: inherit;
}

.app-mobile-dock-link.active {
    transform: translateY(-1px);
}

@media (max-width: 1023px) {
    .app-mobile-dock {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: var(--mobile-viewport-offset-bottom, 0px) !important;
        display: grid !important;
        gap: 0.15rem;
        padding: 0.45rem 0.65rem calc(0.55rem + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px));
        min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px));
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.99));
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid rgba(148, 163, 184, 0.24);
        border-top-left-radius: 24px;
        border-top-right-radius: 24px;
        box-shadow: 0 -18px 38px rgba(15, 23, 42, 0.18);
        z-index: 82 !important;
        pointer-events: auto !important;
    }

    .app-mobile-dock--1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

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

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

    .app-mobile-dock--5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

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

    .admin-page .app-mobile-dock-link.active {
        color: var(--site-primary-color);
        font-weight: 700;
    }

    .teacher-modern-ui .app-mobile-dock-link.active {
        color: var(--site-primary-color, var(--ui-primary));
        font-weight: 700;
    }

    .admin-page #admin-sidebar,
    .teacher-modern-ui #teacher-sidebar {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .admin-header,
    .app-unified-header {
        padding: 0 1rem;
    }

    #page-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
    }

    #header-brand-meta {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: clip !important;
        max-width: none !important;
    }

    .app-header-brand-copy .header-subline-nowrap {
        font-size: 10.5px;
        letter-spacing: -0.01em;
    }

    .app-header-auth-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 1023px) {
    .mobile-icon-auth-btn {
        width: 48px !important;
        min-width: 48px !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 0 !important;
        gap: 0 !important;
        border-radius: 16px !important;
    }

    .mobile-icon-auth-btn.mobile-icon-auth-btn--center {
        margin-left: auto;
        margin-right: auto;
    }

    .mobile-icon-auth-btn__label {
        display: none !important;
    }

    .mobile-icon-auth-btn.mobile-icon-auth-btn--with-label {
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 44px !important;
        padding: 0.5rem 0.75rem !important;
        gap: 0.5rem !important;
        border-radius: 0.75rem !important;
    }

    .mobile-icon-auth-btn.mobile-icon-auth-btn--with-label .mobile-icon-auth-btn__label {
        display: inline-flex !important;
    }

    .mobile-icon-auth-btn__icon svg,
    .mobile-icon-auth-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* --- Sidebar --- */
.admin-sidebar {
    width: 260px;
    min-width: 260px;
    background: #fff;
    border-right: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Fills admin-layout height */
    overflow-y: auto;
    /* Sidebar scrolls internally if needed */
    position: relative;
    z-index: 40;
    transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}

/* Active sidebar link */
.sidebar-link.active {
    background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
    color: #9333ea !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #9333ea;
}

.sidebar-link .nav-label--short {
    display: none;
}

.sidebar-link .nav-label--full {
    display: inline;
}

.sidebar-link:hover:not(.active) {
    background: #f9fafb;
}

/* --- Main Area --- */
.admin-main {
    flex: 1 1 auto;
    /* Take remaining space */
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
    width: auto;
}

/* --- Content --- */
.admin-content {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 1.5rem;
    overflow-y: auto;
    /* Scrollable area */
    background: #f8fafc;
}

/* --- Footer --- */
.admin-footer {
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.site-footer-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: auto;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

#dashboard-view {
    min-height: 100vh;
    min-height: 100dvh;
}

.site-footer-line {
    margin: 0;
    white-space: nowrap;
    font-size: clamp(9px, 2.2vw, 13px);
    line-height: 1.2;
    color: #64748b;
}

.site-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.site-footer-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-footer-link:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
    border-radius: 999px;
}

.site-footer-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 999px;
    flex: 0 0 18px;
}

/* --- Mobile Responsive --- */
@media (max-width: 1023px) {
    body.admin-page {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px));
        overflow-x: hidden;
    }

    .admin-page .admin-layout {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px));
        overflow: visible !important;
        min-height: auto !important;
    }

    .admin-page .admin-content {
        padding-bottom: calc(1.5rem + var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px));
        overflow: visible !important;
        min-height: auto !important;
    }

    .admin-page .admin-main {
        height: auto !important;
        min-height: auto !important;
    }

    .admin-page #sidebar-toggle {
        display: none !important;
    }

    .admin-page #sidebar-overlay {
        display: none !important;
    }

    .admin-page .admin-sidebar {
        position: fixed !important;
        inset-inline: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        width: 100% !important;
        min-width: 100% !important;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid rgba(148, 163, 184, 0.35);
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.98));
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        box-shadow: 0 -16px 36px rgba(15, 23, 42, 0.18);
        transform: translateY(0) !important;
        overflow: hidden;
        padding-bottom: env(safe-area-inset-bottom);
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 70 !important;
        pointer-events: auto !important;
        display: flex !important;
        align-items: stretch !important;
        justify-content: center !important;
        isolation: isolate;
        overflow: visible !important;
        touch-action: manipulation;
        margin: 0 !important;
        will-change: transform;
        contain: layout paint style;
    }

    .admin-page #admin-sidebar {
        position: fixed !important;
        inset-inline: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        border-top-right-radius: 18px;
        display: flex !important;
        align-items: stretch !important;
        justify-content: center !important;
        margin: 0 !important;
    }

    .admin-page .admin-sidebar.open {
        transform: translateY(0);
    }

    .admin-page .admin-footer {
        padding-bottom: calc(1rem + var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px));
    }

    .admin-page .admin-sidebar-nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        gap: 0.2rem;
        padding: 0.35rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: hidden;
        flex-wrap: nowrap;
        scrollbar-width: none;
        width: 100% !important;
        height: 100% !important;
        min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        flex: 1 1 auto !important;
        margin: 0 !important;
        align-self: stretch !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .admin-page .admin-sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .admin-page .admin-sidebar-nav > * {
        margin-top: 0 !important;
    }

    .admin-page .admin-sidebar-nav p {
        display: none !important;
    }

    .admin-page .admin-sidebar-user {
        display: none !important;
    }

    .admin-page #nav-places,
    .admin-page #nav-attendance,
    .admin-page #nav-system-update {
        display: none !important;
    }

    .admin-page .sidebar-link {
        width: 100%;
        min-width: 0;
        flex: 1 1 0;
        min-height: 54px;
        padding: 0.3rem 0.16rem;
        border-radius: 16px;
        flex-direction: column;
        gap: 0.24rem;
        justify-content: center;
        text-align: center;
        position: relative;
        border: 1px solid transparent;
        background: transparent;
        transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
        will-change: transform;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        appearance: none;
        -webkit-appearance: none;
        border: 0;
        outline: none;
        color: #475569 !important;
        cursor: pointer;
        touch-action: manipulation;
        pointer-events: auto !important;
    }

    .admin-page .sidebar-link svg {
        width: 1.2rem;
        height: 1.2rem;
        transition: transform 0.2s ease, color 0.2s ease;
        flex-shrink: 0;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: inherit !important;
    }

    .admin-page .sidebar-link .nav-label {
        font-size: 0.58rem;
        line-height: 1.1;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        letter-spacing: -0.01em;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: inherit !important;
    }

    .admin-page .sidebar-link .nav-label--full {
        display: none;
    }

    .admin-page .sidebar-link .nav-label--short {
        display: block;
    }

    .admin-page .sidebar-link.active {
        background: transparent !important;
        border-color: transparent !important;
        box-shadow: none !important;
        transform: none;
        animation: none;
    }

    .admin-page .sidebar-link.active svg {
        color: var(--site-primary-color);
        transform: translateY(-1px) scale(1.08);
    }

    .admin-page .sidebar-link.active .nav-label {
        color: var(--site-primary-color);
        font-weight: 700;
    }

    .admin-page .sidebar-link:active {
        transform: scale(0.96);
    }
}

@keyframes navSelectPulse {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px) scale(1.02);
    }
    100% {
        transform: translateY(-2px);
    }
}

/* Sidebar brand text */
.sidebar-brand {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   Mobile Table -> Card
   ========================================= */
.attendance-mobile-identity {
    display: none;
}

@media (max-width: 767px) {
    .admin-page #admin-sidebar .admin-sidebar-user {
        display: none !important;
    }

    .admin-page #admin-sidebar .admin-sidebar-nav {
        padding-top: 0.35rem;
    }

    .mobile-table-shell {
        overflow-x: visible !important;
    }

    .mobile-card-table {
        width: 100%;
        border-collapse: separate !important;
        border-spacing: 0 12px !important;
        table-layout: auto !important;
        background: transparent !important;
    }

    .mobile-card-table thead {
        display: none !important;
    }

    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td {
        display: block;
        width: 100%;
    }

    .mobile-card-table tr {
        margin: 0 0 0.65rem 0;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
        overflow: hidden;
        position: relative;
    }

    .mobile-card-table tr:last-child {
        margin-bottom: 0;
    }

    .mobile-card-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.85rem;
        padding: 0.55rem 0.9rem !important;
        border: 0 !important;
        border-bottom: 1px dashed #e2e8f0;
        font-size: 0.78rem;
        line-height: 1.25;
        white-space: normal !important;
        overflow: visible;
        text-overflow: clip !important;
        scrollbar-width: none;
    }

    .mobile-card-table td::-webkit-scrollbar {
        display: none;
    }

    .mobile-card-table td:last-child {
        border-bottom: 0 !important;
    }

    .mobile-card-table td::before {
        content: attr(data-label);
        color: #64748b;
        font-weight: 700;
        text-transform: none;
        letter-spacing: 0.04em;
        font-size: 0.62rem;
        flex: 0 0 auto;
        margin-right: 0.75rem;
        display: inline-flex;
        align-items: center;
        padding-left: 1.35rem;
        background-repeat: no-repeat;
        background-position: left center;
        background-size: 14px 14px;
        background-image: var(--card-label-icon);
    }

    .mobile-card-table td>* {
        margin-left: auto;
        max-width: 64%;
        white-space: normal !important;
        text-overflow: clip !important;
        overflow: visible !important;
        text-align: right;
        font-weight: 600;
    }

    .mobile-card-table {
        --card-icon-default: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'12'%20cy%3D'12'%20r%3D'9'%2F%3E%3Cpath%20d%3D'M12%208h.01M11%2012h1v4h1'%2F%3E%3C%2Fsvg%3E");
        --card-icon-hash: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M5%209h14M5%2015h14M9%203L7%2021M17%203l-2%2018'%2F%3E%3C%2Fsvg%3E");
        --card-icon-pin: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%2021c-4-4-7-7-7-11a7%207%200%201%201%2014%200c0%204-3%207-7%2011z'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'10'%20r%3D'2.5'%2F%3E%3C%2Fsvg%3E");
        --card-icon-status: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M9%2012l2%202%204-4'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'12'%20r%3D'9'%2F%3E%3C%2Fsvg%3E");
        --card-icon-users: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M16%207a4%204%200%201%201-8%200%204%204%200%200%201%208%200z'%2F%3E%3Cpath%20d%3D'M6%2020v-1a6%206%200%200%201%2012%200v1'%2F%3E%3C%2Fsvg%3E");
        --card-icon-settings: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'12'%20cy%3D'12'%20r%3D'3'%2F%3E%3Cpath%20d%3D'M19.4%2015a1%201%200%200%200%20.2%201.1l.1.1a2%202%200%200%201-2.8%202.8l-.1-.1a1%201%200%200%200-1.1-.2%201%201%200%200%200-.6.9V20a2%202%200%200%201-4%200v-.2a1%201%200%200%200-.6-.9%201%201%200%200%200-1.1.2l-.1.1a2%202%200%200%201-2.8-2.8l.1-.1a1%201%200%200%200%20.2-1.1%201%201%200%200%200-.9-.6H4a2%202%200%200%201%200-4h.2a1%201%200%200%200%20.9-.6%201%201%200%200%200-.2-1.1l-.1-.1a2%202%200%200%201%202.8-2.8l.1.1a1%201%200%200%200%201.1.2%201%201%200%200%200%20.6-.9V4a2%202%200%200%201%204%200v.2a1%201%200%200%200%20.6.9%201%201%200%200%200%201.1-.2l.1-.1a2%202%200%200%201%202.8%202.8l-.1.1a1%201%200%200%200-.2%201.1%201%201%200%200%200%20.9.6H20a2%202%200%200%201%200%204h-.2a1%201%200%200%200-.9.6z'%2F%3E%3C%2Fsvg%3E");
        --card-icon-id: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'3'%20y%3D'4'%20width%3D'18'%20height%3D'16'%20rx%3D'2'%2F%3E%3Cpath%20d%3D'M8%208h8M8%2012h4M8%2016h6'%2F%3E%3C%2Fsvg%3E");
        --card-icon-user: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M16%207a4%204%200%201%201-8%200%204%204%200%200%201%208%200z'%2F%3E%3Cpath%20d%3D'M4%2020v-1a8%208%200%200%201%2016%200v1'%2F%3E%3C%2Fsvg%3E");
        --card-icon-grid: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'3'%20y%3D'3'%20width%3D'7'%20height%3D'7'%2F%3E%3Crect%20x%3D'14'%20y%3D'3'%20width%3D'7'%20height%3D'7'%2F%3E%3Crect%20x%3D'3'%20y%3D'14'%20width%3D'7'%20height%3D'7'%2F%3E%3Crect%20x%3D'14'%20y%3D'14'%20width%3D'7'%20height%3D'7'%2F%3E%3C%2Fsvg%3E");
        --card-icon-bookmark: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M6%204h12a1%201%200%200%201%201%201v15l-7-4-7%204V5a1%201%200%200%201%201-1z'%2F%3E%3C%2Fsvg%3E");
        --card-icon-clipboard: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'8'%20y%3D'4'%20width%3D'8'%20height%3D'4'%20rx%3D'1'%2F%3E%3Cpath%20d%3D'M9%208H6a2%202%200%200%200-2%202v8a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2v-8a2%202%200%200%200-2-2h-3'%2F%3E%3C%2Fsvg%3E");
        --card-icon-cap: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%203l9%205-9%205-9-5%209-5z'%2F%3E%3Cpath%20d%3D'M7%2012v5a5%205%200%200%200%2010%200v-5'%2F%3E%3C%2Fsvg%3E");
        --card-icon-alert: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%203l10%2018H2L12%203z'%2F%3E%3Cpath%20d%3D'M12%209v5m0%204h.01'%2F%3E%3C%2Fsvg%3E");
        --card-icon-chart: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%2012h4l3%208%204-16%203%208h4'%2F%3E%3C%2Fsvg%3E");
    }

    .mobile-card-table td {
        --card-label-icon: var(--card-icon-default);
    }

    .mobile-card-table td[data-label="#"],
    .mobile-card-table td[data-label="ลำดับ"] {
        --card-label-icon: var(--card-icon-hash);
        background: linear-gradient(90deg, rgba(248, 250, 252, 0.85), transparent);
    }

    .mobile-card-table td[data-label="สถานที่"] { --card-label-icon: var(--card-icon-pin); }
    .mobile-card-table td[data-label="สถานะ"],
    .mobile-card-table td[data-label="สถานะนักเรียน"],
    .mobile-card-table td[data-label="สถานะชุมนุม"] { --card-label-icon: var(--card-icon-status); }
    .mobile-card-table td[data-label="ใช้งานในชุมนุม"],
    .mobile-card-table td[data-label="สมาชิก"] { --card-label-icon: var(--card-icon-users); }
    .mobile-card-table td[data-label="จัดการ"] { --card-label-icon: var(--card-icon-settings); }
    .mobile-card-table td[data-label="รหัสนักเรียน"],
    .mobile-card-table td[data-label="รหัสครู"],
    .mobile-card-table td[data-label="เลขประชาชน"] { --card-label-icon: var(--card-icon-id); }
    .mobile-card-table td[data-label="ชื่อ-นามสกุล"],
    .mobile-card-table td[data-label="ชื่อครู"],
    .mobile-card-table td[data-label="เพศ"] { --card-label-icon: var(--card-icon-user); }
    .mobile-card-table td[data-label="ระดับชั้น"] { --card-label-icon: var(--card-icon-cap); }
    .mobile-card-table td[data-label="นักเรียนทั้งหมด"] { --card-label-icon: var(--card-icon-users); }
    .mobile-card-table td[data-label="จองแล้ว"],
    .mobile-card-table td[data-label="ลงทะเบียนแล้ว"] { --card-label-icon: var(--card-icon-bookmark); }
    .mobile-card-table td[data-label="ยังไม่จอง"],
    .mobile-card-table td[data-label="ยังไม่ลงทะเบียน"] { --card-label-icon: var(--card-icon-alert); }
    .mobile-card-table td[data-label="ชุมนุมที่เปิดรับ"] { --card-label-icon: var(--card-icon-cap); }
    .mobile-card-table td[data-label="ที่นั่งรวมที่รับระดับนี้"],
    .mobile-card-table td[data-label="ที่นั่งคงเหลือปัจจุบัน"] { --card-label-icon: var(--card-icon-chart); }
    .mobile-card-table td[data-label="สถานะความเพียงพอ"] { --card-label-icon: var(--card-icon-status); }
    .mobile-card-table td[data-label="ชั้น / ห้อง / เลขที่"] { --card-label-icon: var(--card-icon-grid); }
    .mobile-card-table td[data-label="สถานะการจอง"] { --card-label-icon: var(--card-icon-bookmark); }
    .mobile-card-table td[data-label="กิจกรรมที่จอง"] { --card-label-icon: var(--card-icon-clipboard); }
    .mobile-card-table td[data-label="ชุมนุมที่รับผิดชอบ"] { --card-label-icon: var(--card-icon-cap); }

    .mobile-card-table td[data-label="จัดการ"] > * {
        max-width: 100%;
        text-align: right;
    }

    .admin-level-capacity-shell {
        border-color: rgba(129, 140, 248, 0.38) !important;
        box-shadow: 0 16px 34px -28px rgba(79, 70, 229, 0.6), 0 1px 0 rgba(255, 255, 255, 0.78) inset;
    }

    .admin-level-capacity-shell::after {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(238, 242, 255, 0.3), rgba(250, 245, 255, 0.35));
        opacity: 0.45;
    }

    .admin-level-summary-card {
        box-shadow: 0 8px 24px -18px rgba(15, 23, 42, 0.45);
    }

    .admin-page .admin-level-capacity-table tr {
        border-color: #d6d9ff;
        background: linear-gradient(150deg, #ffffff 0%, #f8faff 48%, #f5f3ff 100%);
        box-shadow: 0 12px 24px -24px rgba(67, 56, 202, 0.78);
    }

    .admin-page .admin-level-capacity-table tr::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
    }

    .admin-page .admin-level-capacity-table tr[data-capacity-status="insufficient"]::before {
        background: linear-gradient(90deg, #f97316 0%, #ef4444 100%);
    }

    .admin-page .admin-level-capacity-table td::before {
        color: #475569;
        font-size: 0.63rem;
        border: 1px solid #dbe7ff;
        border-radius: 999px;
        background-color: #f8faff;
        padding: 0.24rem 0.64rem 0.24rem 1.45rem;
        background-position: 0.46rem center;
        background-size: 12px 12px;
    }

    .admin-page .admin-level-capacity-table td > * {
        max-width: 61%;
        font-weight: 700;
        color: #0f172a;
    }

    .admin-page .admin-level-capacity-table .admin-level-chip {
        display: inline-flex;
        align-items: center;
        border-radius: 999px;
        border: 1px solid #c7d2fe;
        background: linear-gradient(90deg, #eef2ff 0%, #f5f3ff 100%);
        padding: 0.2rem 0.68rem;
        font-weight: 700;
        color: #3730a3;
        box-shadow: 0 6px 14px -12px rgba(55, 48, 163, 0.75);
    }

    .admin-page .admin-level-capacity-table .admin-level-metric {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 2.1rem;
        padding: 0.16rem 0.5rem;
        border-radius: 10px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        box-shadow: 0 4px 10px -10px rgba(15, 23, 42, 0.8);
    }

    .admin-page .admin-level-capacity-table .admin-level-metric-booked {
        color: #047857;
        background: #ecfdf5;
        border-color: #a7f3d0;
    }

    .admin-page .admin-level-capacity-table .admin-level-metric-unbooked {
        color: #c2410c;
        background: #fff7ed;
        border-color: #fdba74;
    }

    .admin-page .admin-level-capacity-table .admin-level-metric-left {
        color: #4338ca;
        background: #eef2ff;
        border-color: #c7d2fe;
    }

    .admin-page .admin-level-capacity-table .admin-level-open-clubs {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 2.1rem;
        padding: 0.16rem 0.52rem;
        border-radius: 10px;
        background: #ede9fe;
        border: 1px solid #c4b5fd;
        color: #5b21b6;
        box-shadow: 0 4px 10px -10px rgba(91, 33, 182, 0.75);
    }

    .admin-page .admin-level-capacity-table .admin-level-status-cell {
        width: 100%;
        align-items: flex-end;
    }

    /* Attendance cards on teacher page: extra compact mobile layout */
    .mobile-card-table.teacher-attendance-table {
        border-spacing: 0 5px !important;
    }

    .mobile-card-table.teacher-attendance-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(150px, 44%);
        grid-template-areas: "order status";
        border: 1px solid #dbe5f0;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
        margin-bottom: 0.5rem;
        overflow: hidden;
    }

    .mobile-card-table.teacher-attendance-table tr:last-child {
        margin-bottom: 0;
    }

    .mobile-card-table.teacher-attendance-table tr::before,
    .mobile-card-table.teacher-attendance-table tr::after {
        content: '';
        display: none;
    }

    .mobile-card-table.teacher-attendance-table td {
        width: auto;
        min-height: 0;
        padding: 0.28rem 0.58rem !important;
        border: 0 !important;
        white-space: normal !important;
        overflow: visible !important;
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .mobile-card-table.teacher-attendance-table td::before {
        color: #64748b;
        font-size: 0.54rem;
        font-weight: 700;
        letter-spacing: 0.03em;
    }

    .mobile-card-table.teacher-attendance-table td>* {
        margin-left: 0 !important;
        max-width: 100%;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: 0.74rem;
        line-height: 1.15;
        font-weight: 600;
    }

    .mobile-card-table.teacher-attendance-table td:nth-child(1) {
        grid-area: order;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding-top: 0.36rem !important;
        padding-bottom: 0.32rem !important;
        border-bottom: 0 !important;
        border-right: 1px dashed #e5edf6 !important;
    }

    .mobile-card-table.teacher-attendance-table td:nth-child(1)::before {
        content: '';
        display: none;
    }

    .mobile-card-table.teacher-attendance-table td:nth-child(1)>* {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        max-width: none !important;
    }

    .mobile-card-table.teacher-attendance-table .attendance-order-index {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        padding: 0 7px;
        border-radius: 999px;
        border: 1px solid #d1d9e6;
        background: #f8fafc;
        color: #475569;
        font-size: 0.68rem;
        font-weight: 700;
        line-height: 1;
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    .mobile-card-table.teacher-attendance-table .attendance-mobile-identity {
        display: flex;
        align-items: center;
        gap: 0.52rem;
        min-width: 0;
        flex: 1 1 auto;
    }

    .mobile-card-table.teacher-attendance-table .attendance-mobile-avatar {
        width: 34px;
        height: 34px;
        border-radius: 999px;
        background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
        color: #3730a3;
        border: 1px solid #c7d2fe;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.82rem;
        font-weight: 800;
        line-height: 1;
        flex: 0 0 auto;
    }

    .mobile-card-table.teacher-attendance-table .attendance-mobile-text {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.06rem;
    }

    .mobile-card-table.teacher-attendance-table .attendance-mobile-name {
        color: #0f172a;
        font-size: 0.84rem;
        font-weight: 800;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-card-table.teacher-attendance-table .attendance-mobile-meta {
        color: #64748b;
        font-size: 0.68rem;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-card-table.teacher-attendance-table td:nth-child(2),
    .mobile-card-table.teacher-attendance-table td:nth-child(3),
    .mobile-card-table.teacher-attendance-table td:nth-child(4),
    .mobile-card-table.teacher-attendance-table td:nth-child(5),
    .mobile-card-table.teacher-attendance-table td:nth-child(6),
    .mobile-card-table.teacher-attendance-table td:nth-child(7),
    .mobile-card-table.teacher-attendance-table td:nth-child(8) {
        display: none !important;
    }

    .mobile-card-table.teacher-attendance-table td:nth-child(9) {
        grid-area: status;
        padding: 0.28rem 0.42rem !important;
        align-items: center;
        justify-content: flex-end;
    }

    .mobile-card-table.teacher-attendance-table td:nth-child(9)>div {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-radius: 8px;
        overflow: hidden;
    }

    .mobile-card-table.teacher-attendance-table .att-btn {
        min-width: 0 !important;
        width: 100%;
        min-height: 30px !important;
        padding: 0.2rem 0.1rem !important;
        font-size: 0.6rem !important;
        line-height: 1.05;
    }

    .mobile-card-table.teacher-attendance-table tr[data-att-status="present"] {
        border-color: #86efac;
    }

    .mobile-card-table.teacher-attendance-table tr[data-att-status="present"] td:nth-child(9) {
        background: #f0fdf4;
    }

    .mobile-card-table.teacher-attendance-table tr[data-att-status="leave"] {
        border-color: #fcd34d;
    }

    .mobile-card-table.teacher-attendance-table tr[data-att-status="leave"] td:nth-child(9) {
        background: #fffbeb;
    }

    .mobile-card-table.teacher-attendance-table tr[data-att-status="absent"] {
        border-color: #fda4af;
    }

    .mobile-card-table.teacher-attendance-table tr[data-att-status="absent"] td:nth-child(9) {
        background: #fff1f2;
    }

    .mobile-card-table.teacher-attendance-table tr[data-mobile-message="1"]::before,
    .mobile-card-table.teacher-attendance-table tr[data-mobile-message="1"]::after {
        display: none;
        content: '';
    }

    .mobile-card-table.teacher-attendance-table tr[data-mobile-message="1"] td {
        grid-column: 1 / -1;
    }

    .mobile-card-table tr[data-mobile-message="1"] td {
        justify-content: center;
        text-align: center;
        white-space: nowrap !important;
        padding: 0.85rem !important;
        border-bottom: 0 !important;
    }

    .mobile-card-table tr[data-mobile-message="1"] td::before {
        content: '';
        display: none;
    }

    .mobile-card-table tbody.divide-y> :not([hidden])~ :not([hidden]) {
        border-top-width: 0 !important;
        border-bottom-width: 0 !important;
    }
}

@media (max-width: 420px) {
    .mobile-card-table.teacher-attendance-table tr {
        border-radius: 10px;
    }

    .mobile-card-table.teacher-attendance-table td {
        padding: 0.24rem 0.46rem !important;
    }

    .mobile-card-table.teacher-attendance-table td>* {
        font-size: 0.7rem;
    }

    .mobile-card-table.teacher-attendance-table .attendance-order-index {
        min-width: 20px;
        height: 20px;
        font-size: 0.64rem;
    }

    .mobile-card-table.teacher-attendance-table .attendance-mobile-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.74rem;
    }

    .mobile-card-table.teacher-attendance-table .attendance-mobile-name {
        font-size: 0.78rem;
    }

    .mobile-card-table.teacher-attendance-table .attendance-mobile-meta {
        font-size: 0.64rem;
    }

    .mobile-card-table.teacher-attendance-table .att-btn {
        min-height: 28px !important;
        padding: 0.16rem 0.05rem !important;
        font-size: 0.56rem !important;
    }
}

/* =========================================
   Custom Tag Input Theme
   ========================================= */
.tag-item {
    animation: fadeIn 0.1s ease-out;
}

.tag-remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* Scrollbar for results */
#tag-search-results::-webkit-scrollbar {
    width: 6px;
}

#tag-search-results::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#tag-search-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#tag-search-results::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Room Filter Custom Style */
.room-filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* =====================================================
   Flip Clock Countdown (Refined)
   ===================================================== */
.flip-clock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Increased gap */
}

.flip-clock .separator {
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    padding-bottom: 20px;
    /* Align with cards */
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0.3;
    }
}

.flip-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.flip-unit-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.flip-card {
    position: relative;
    width: 60px;
    /* Slightly larger */
    height: 70px;
    perspective: 400px;
    /* Increased perspective */
    border-radius: 6px;
    background: #1a1a1a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Common styles for all halves */
.flip-card .top,
.flip-card .bottom,
.flip-card .top-flip,
.flip-card .bottom-flip {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
    backface-visibility: hidden;
    /* Crucial for 3D */
}

/* TOP HALF (Static & Animating) */
.flip-card .top,
.flip-card .top-flip {
    top: 0;
    background: #2d2d2d;
    /* Lighter top */
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
    /* Crease line */
    transform-origin: bottom;
    z-index: 1;
}

/* BOTTOM HALF (Static & Animating) */
.flip-card .bottom,
.flip-card .bottom-flip {
    bottom: 0;
    background: #1a1a1a;
    /* Darker bottom */
    border-radius: 0 0 6px 6px;
    transform-origin: top;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    /* Align bottom text */
}

/* Text positioning */
.flip-card .top span,
.flip-card .top-flip span {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Sarabun', 'TH Sarabun New', sans-serif;
    font-variant-numeric: tabular-nums;
    color: #f0f0f0;
}

.flip-card .bottom span,
.flip-card .bottom-flip span {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, 50%);
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Sarabun', 'TH Sarabun New', sans-serif;
    font-variant-numeric: tabular-nums;
    color: #f0f0f0;
}

/* ANIMATION LAYERS */
.flip-card .top-flip {
    z-index: 2;
    /* On top of static top */
    transform-origin: bottom;
}

.flip-card .bottom-flip {
    z-index: 2;
    /* On top of static bottom */
    transform-origin: top;
    transform: rotateX(90deg);
    /* Start folded up */
}

/* ANIMATION KEYFRAMES */
.flip-card.flip .top-flip {
    animation: flipTop 0.45s ease-in forwards;
}

.flip-card.flip .bottom-flip {
    animation: flipBottom 0.45s ease-out 0.45s forwards;
    /* Delay match top duration */
}

@keyframes flipTop {
    0% {
        transform: rotateX(0deg);
    }

    100% {
        transform: rotateX(-90deg);
    }
}

@keyframes flipBottom {
    0% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

/* Countdown wrapper refined */
.countdown-wrapper {
    margin-top: 1.5rem;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    border: 0;
    display: inline-block;
    box-shadow: none;
}

.countdown-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.countdown-shell {
    width: 100%;
    display: flex;
    justify-content: center;
}

.countdown-shell .countdown-wrapper {
    margin-top: 0;
    width: min(100%, 980px);
    display: block;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0.25rem 0;
}

.countdown-shell .countdown-label {
    text-align: center;
    margin-bottom: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #111827;
    text-shadow: none;
}

.countdown-shell .countdown-schedule {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.85rem;
    width: min(100%, 740px);
    margin: 0 auto 0.9rem;
}

.countdown-shell .countdown-schedule-item {
    margin: 0;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.58rem;
    padding: 0.42rem 0.68rem;
    border-radius: 0.95rem;
    border: 1px solid transparent;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.3;
    font-weight: 700;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.countdown-shell .countdown-schedule-item:hover {
    transform: translateY(-1px);
}

.countdown-shell .countdown-schedule-label {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.countdown-shell .countdown-schedule-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.countdown-shell .countdown-schedule-value {
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.countdown-shell .countdown-schedule-item--open {
    border-color: rgba(59, 130, 246, 0.38);
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.95) 0%, rgba(239, 246, 255, 0.98) 100%);
    box-shadow: 0 8px 20px -16px rgba(37, 99, 235, 0.75);
}

.countdown-shell .countdown-schedule-item--open .countdown-schedule-label {
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(59, 130, 246, 0.28);
}

.countdown-shell .countdown-schedule-item--open .countdown-schedule-dot {
    background: #2563eb;
}

.countdown-shell .countdown-schedule-item--open .countdown-schedule-value {
    color: #1e3a8a;
}

.countdown-shell .countdown-schedule-item--close {
    border-color: rgba(239, 68, 68, 0.35);
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(255, 241, 242, 0.98) 100%);
    box-shadow: 0 8px 20px -16px rgba(220, 38, 38, 0.72);
}

.countdown-shell .countdown-schedule-item--close .countdown-schedule-label {
    color: #b91c1c;
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(248, 113, 113, 0.32);
}

.countdown-shell .countdown-schedule-item--close .countdown-schedule-dot {
    background: #dc2626;
}

.countdown-shell .countdown-schedule-item--close .countdown-schedule-value {
    color: #7f1d1d;
}

.countdown-shell .flip-clock {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 12px;
}

.countdown-shell .flip-unit {
    gap: 9px;
}

.countdown-shell .flip-unit-label {
    font-size: 1.125rem;
    letter-spacing: 0.06em;
    color: #111827;
    text-shadow: none;
}

.countdown-shell .flip-card {
    width: 90px;
    height: 105px;
    border-radius: 9px;
}

.countdown-shell .flip-card .top,
.countdown-shell .flip-card .top-flip {
    border-radius: 9px 9px 0 0;
}

.countdown-shell .flip-card .bottom,
.countdown-shell .flip-card .bottom-flip {
    border-radius: 0 0 9px 9px;
}

.countdown-shell .flip-card .top span,
.countdown-shell .flip-card .top-flip span,
.countdown-shell .flip-card .bottom span,
.countdown-shell .flip-card .bottom-flip span {
    font-size: 3.75rem;
}

.countdown-shell .flip-clock .separator {
    font-size: 3rem;
    padding-bottom: 30px;
    color: #111827;
    text-shadow: none;
}

/* Responsive */
@media (max-width: 480px) {
    .countdown-shell .countdown-schedule {
        grid-template-columns: 1fr;
        gap: 0.42rem;
        margin-bottom: 0.72rem;
    }

    .countdown-shell .countdown-schedule-item {
        min-height: 2.12rem;
        font-size: 0.82rem;
        padding: 0.34rem 0.52rem;
        border-radius: 0.72rem;
        gap: 0.44rem;
    }

    .countdown-shell .countdown-schedule-label {
        font-size: 0.68rem;
        padding: 0.16rem 0.42rem;
    }

    .countdown-shell .countdown-schedule-value {
        font-size: 0.78rem;
    }

    .countdown-shell .flip-card {
        width: 63px;
        height: 84px;
        border-radius: 8px;
    }

    .countdown-shell .flip-card .top,
    .countdown-shell .flip-card .top-flip {
        border-radius: 8px 8px 0 0;
    }

    .countdown-shell .flip-card .bottom,
    .countdown-shell .flip-card .bottom-flip {
        border-radius: 0 0 8px 8px;
    }

    .countdown-shell .flip-card .top span,
    .countdown-shell .flip-card .bottom span,
    .countdown-shell .flip-card .top-flip span,
    .countdown-shell .flip-card .bottom-flip span {
        font-size: 2.7rem;
    }

    .countdown-shell .flip-clock .separator {
    font-size: 3rem;
    padding-bottom: 30px;
    color: #111827;
    text-shadow: none;
}

    .countdown-wrapper {
        padding: 0;
    }

    .countdown-shell .countdown-wrapper {
        border-radius: 0;
        padding: 0.25rem 0;
    }

    .countdown-shell .flip-clock {
        gap: 8px;
    }

    .countdown-shell .flip-unit-label {
    font-size: 1.125rem;
    letter-spacing: 0.06em;
    color: #111827;
    text-shadow: none;
}
}

/* =====================================================
   Index Mobile Readability Helpers
   ===================================================== */
.no-ellipsis-inline {
    display: block;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    text-wrap: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow: hidden;
    text-overflow: clip;
}

.compact-mobile-btn {
    white-space: nowrap;
}

@media (max-width: 640px) {
    #dashboard-view .mobile-brand-title {
        font-size: clamp(0.7rem, 3.6vw, 0.95rem);
        letter-spacing: -0.01em;
    }

    #dashboard-view .mobile-hero-title {
        font-size: clamp(1.05rem, 5.4vw, 1.6rem);
        line-height: 1.15;
        margin-bottom: 0.5rem;
        white-space: normal;
        text-wrap: balance;
    }

    #dashboard-view #hero-user-info {
        font-size: clamp(0.78rem, 3.3vw, 1rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
    }

    #dashboard-view .mobile-hero-search {
        font-size: 0.95rem;
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
        padding-left: 2.9rem;
        padding-right: 1rem;
    }

    #dashboard-view .mobile-filter-btn {
        font-size: 0.72rem;
        padding: 0.35rem 0.65rem;
        line-height: 1.32;
    }

    #dashboard-view #club-filters {
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    #dashboard-view #club-filters::-webkit-scrollbar {
        display: none;
    }

    #dashboard-view .no-ellipsis-inline {
        font-size: clamp(0.67rem, 2.85vw, 0.95rem);
        letter-spacing: -0.01em;
    }

    #dashboard-view .compact-mobile-btn {
        font-size: 0.7rem !important;
        line-height: 1.2;
        padding-top: 0.48rem !important;
        padding-bottom: 0.48rem !important;
        padding-left: 0.56rem !important;
        padding-right: 0.56rem !important;
    }

    #dashboard-view .club-card-modern {
        padding: 0.78rem !important;
        border-radius: 0.82rem;
    }

    #dashboard-view .club-card-title {
        font-size: 0.95rem;
    }

    #dashboard-view .club-card-desc {
        font-size: 0.78rem;
    }

    #dashboard-view .club-meta-row {
        grid-template-columns: 66px minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.4rem 0;
    }

    #dashboard-view .club-meta-label {
        font-size: 0.57rem;
    }

    #dashboard-view .club-meta-value {
        font-size: 0.73rem;
    }

    #dashboard-view .club-status-pill {
        font-size: 0.58rem;
        padding: 0.2rem 0.5rem;
    }

    #dashboard-view .club-main__meta {
        gap: 0.24rem;
    }

    #dashboard-view .club-main__meta-item {
        padding: 0.28rem 0.36rem;
    }

    #dashboard-view .club-main__meta-label {
        font-size: 0.51rem;
    }

    #dashboard-view .club-main__meta-value {
        font-size: 0.68rem;
    }

    #dashboard-view .club-summary {
        gap: 0.32rem;
    }

    #dashboard-view .club-summary__registered {
        font-size: 0.88rem;
    }

    #dashboard-view .club-summary__remaining {
        font-size: 0.62rem;
    }

    #dashboard-view .club-expand-toggle {
        font-size: 0.58rem;
        padding: 0.22rem 0.42rem;
    }

    #dashboard-view .club-card-flat__details.is-open {
        max-height: 1400px;
    }
}

/* Login loading overlay */
.login-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 18% 22%, rgba(168, 85, 247, 0.28), transparent 45%),
        radial-gradient(circle at 84% 14%, rgba(239, 68, 68, 0.22), transparent 40%),
        rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
}

.login-loading-card {
    width: min(92vw, 360px);
    border-radius: 20px;
    padding: 1.3rem 1.1rem 1.1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.24);
}

.login-loading-orb {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 0.8rem;
}

.login-loading-ring {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 2px solid rgba(168, 85, 247, 0.32);
    animation: loginOrbPulse 1.6s ease-out infinite;
}

.login-loading-ring.login-loading-ring--delay {
    animation-delay: 0.8s;
}

.login-loading-core {
    position: absolute;
    inset: 22px;
    border-radius: 9999px;
    background: linear-gradient(145deg, #a855f7, #ef4444);
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.5);
    animation: loginOrbCore 1.1s ease-in-out infinite alternate;
}

.login-loading-title {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 800;
}

.login-loading-subtitle {
    margin: 0.24rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.35;
    font-weight: 600;
}

@keyframes loginOrbPulse {
    0% {
        opacity: 0.95;
        transform: scale(0.72);
    }

    75% {
        opacity: 0.1;
        transform: scale(1.06);
    }

    100% {
        opacity: 0;
        transform: scale(1.12);
    }
}

@keyframes loginOrbCore {
    from {
        transform: scale(0.92);
    }

    to {
        transform: scale(1.06);
    }
}

/* Modern logout SweetAlert */
.swal2-popup.logout-swal-popup {
    width: min(92vw, 420px) !important;
    border-radius: 20px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 1.25rem 1.15rem 1rem !important;
    box-shadow: 0 28px 62px rgba(15, 23, 42, 0.28) !important;
    background:
        radial-gradient(circle at top right, rgba(129, 140, 248, 0.18), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

.swal2-title.logout-swal-title {
    margin-top: 0.2rem !important;
    color: #0f172a !important;
    font-size: 1.2rem !important;
    font-weight: 800 !important;
}

.swal2-html-container.logout-swal-text {
    margin-top: 0.5rem !important;
    color: #475569 !important;
    font-size: 0.95rem !important;
    line-height: 1.45 !important;
}

.swal2-popup.logout-swal-popup .swal2-icon.swal2-question {
    border-color: #c7d2fe !important;
    color: #4f46e5 !important;
}

.swal2-popup.logout-swal-popup .swal2-actions {
    width: 100%;
    margin-top: 1rem !important;
    gap: 0.65rem;
}

.swal2-popup.logout-swal-popup .swal2-actions .swal2-confirm.logout-swal-confirm,
.swal2-popup.logout-swal-popup .swal2-actions .swal2-cancel.logout-swal-cancel {
    margin: 0 !important;
    min-height: 42px;
    min-width: 132px;
    border-radius: 12px !important;
    border: 1px solid transparent !important;
    padding: 0.55rem 1rem !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.swal2-popup.logout-swal-popup .swal2-actions .swal2-confirm.logout-swal-confirm {
    color: #fff !important;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.3) !important;
}

.swal2-popup.logout-swal-popup .swal2-actions .swal2-cancel.logout-swal-cancel {
    color: #334155 !important;
    background: #fff !important;
    border-color: #cbd5e1 !important;
}

.swal2-popup.logout-swal-popup .swal2-actions .swal2-confirm.logout-swal-confirm:hover,
.swal2-popup.logout-swal-popup .swal2-actions .swal2-cancel.logout-swal-cancel:hover {
    transform: translateY(-1px);
}

.swal2-popup.logout-swal-popup .swal2-actions .swal2-confirm.logout-swal-confirm:focus-visible,
.swal2-popup.logout-swal-popup .swal2-actions .swal2-cancel.logout-swal-cancel:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.35);
    outline-offset: 2px;
}

@media (max-width: 540px) {
    .swal2-popup.logout-swal-popup .swal2-actions {
        flex-direction: column-reverse;
    }

    .swal2-popup.logout-swal-popup .swal2-actions .swal2-confirm.logout-swal-confirm,
    .swal2-popup.logout-swal-popup .swal2-actions .swal2-cancel.logout-swal-cancel {
        width: 100%;
    }
}

/* Modern danger confirmation SweetAlert (delete member/clear members) */
.swal2-popup.danger-swal-popup {
    width: min(92vw, 460px) !important;
    border-radius: 20px !important;
    border: 1px solid #fecaca !important;
    padding: 1.25rem 1.15rem 1rem !important;
    box-shadow: 0 28px 62px rgba(15, 23, 42, 0.3) !important;
    background:
        radial-gradient(circle at top right, rgba(248, 113, 113, 0.2), transparent 40%),
        linear-gradient(180deg, #ffffff 0%, #fff7f7 100%) !important;
}

.swal2-title.danger-swal-title {
    margin-top: 0.2rem !important;
    color: #111827 !important;
    font-size: 1.2rem !important;
    font-weight: 800 !important;
}

.swal2-html-container.danger-swal-text {
    margin-top: 0.5rem !important;
    color: #475569 !important;
    font-size: 0.95rem !important;
    line-height: 1.52 !important;
}

.swal2-popup.danger-swal-popup .swal-danger-note {
    display: inline-block;
    margin-top: 0.45rem;
    color: #b91c1c;
    font-size: 0.82rem;
    font-weight: 700;
}

.swal2-popup.danger-swal-popup .swal2-icon.swal2-warning {
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

.swal2-popup.danger-swal-popup .swal2-actions {
    width: 100%;
    margin-top: 1rem !important;
    gap: 0.65rem;
}

.swal2-popup.danger-swal-popup .swal2-actions .swal2-confirm.danger-swal-confirm,
.swal2-popup.danger-swal-popup .swal2-actions .swal2-cancel.danger-swal-cancel {
    margin: 0 !important;
    min-height: 42px;
    min-width: 132px;
    border-radius: 12px !important;
    border: 1px solid transparent !important;
    padding: 0.55rem 1rem !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.swal2-popup.danger-swal-popup .swal2-actions .swal2-confirm.danger-swal-confirm {
    color: #fff !important;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 12px 26px rgba(220, 38, 38, 0.3) !important;
}

.swal2-popup.danger-swal-popup .swal2-actions .swal2-cancel.danger-swal-cancel {
    color: #334155 !important;
    background: #fff !important;
    border-color: #cbd5e1 !important;
}

.swal2-popup.danger-swal-popup .swal2-actions .swal2-confirm.danger-swal-confirm:hover,
.swal2-popup.danger-swal-popup .swal2-actions .swal2-cancel.danger-swal-cancel:hover {
    transform: translateY(-1px);
}

@media (max-width: 540px) {
    .swal2-popup.danger-swal-popup .swal2-actions {
        flex-direction: column-reverse;
    }

    .swal2-popup.danger-swal-popup .swal2-actions .swal2-confirm.danger-swal-confirm,
    .swal2-popup.danger-swal-popup .swal2-actions .swal2-cancel.danger-swal-cancel {
        width: 100%;
    }
}
.header-subline-nowrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}
.header-brand-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}
.header-kicker {
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .header-kicker {
        display: none !important;
    }
}

/* =====================================================
   App cards: compact, modern, icon-friendly
   ===================================================== */
.app-card {
    position: relative;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 18px 40px -32px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    isolation: isolate;
}

.app-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.app-card[data-card-icon]::before {
    content: "";
    position: absolute;
    top: -14px;
    right: -14px;
    width: 72px;
    height: 72px;
    background-image: var(--app-card-icon);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

.app-card > * {
    position: relative;
    z-index: 1;
}

.app-card[data-card-icon="filter"] { --app-card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%204h18l-6%207v7l-6%202v-9L3%204z'%2F%3E%3C%2Fsvg%3E"); }
.app-card[data-card-icon="users"] { --app-card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M16%207a4%204%200%201%201-8%200%204%204%200%200%201%208%200z'%2F%3E%3Cpath%20d%3D'M6%2020v-1a6%206%200%200%201%2012%200v1'%2F%3E%3C%2Fsvg%3E"); }
.app-card[data-card-icon="user"] { --app-card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M16%207a4%204%200%201%201-8%200%204%204%200%200%201%208%200z'%2F%3E%3Cpath%20d%3D'M4%2020v-1a8%208%200%200%201%2016%200v1'%2F%3E%3C%2Fsvg%3E"); }
.app-card[data-card-icon="map"] { --app-card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%2021c-4-4-7-7-7-11a7%207%200%201%201%2014%200c0%204-3%207-7%2011z'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'10'%20r%3D'2.5'%2F%3E%3C%2Fsvg%3E"); }
.app-card[data-card-icon="list"] { --app-card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M4%206h16M4%2012h16M4%2018h10'%2F%3E%3C%2Fsvg%3E"); }
.app-card[data-card-icon="chart"] { --app-card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%2012h4l3%208%204-16%203%208h4'%2F%3E%3C%2Fsvg%3E"); }
.app-card[data-card-icon="calendar"] { --app-card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20fill%3D'none'%20viewBox%3D'0%200%2024%2024'%20stroke%3D'%2364748b'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M8%207V3m8%204V3m-9%208h10M5%2021h14a2%202%200%200%200%202-2V7a2%202%200%200%200-2-2H5a2%202%200%200%200-2%202v12a2%202%200%200%200%202%202z'%2F%3E%3C%2Fsvg%3E"); }
.index-student-logout {
    margin-top: 0.1rem;
    box-shadow: 0 10px 22px -18px rgba(225, 29, 72, 0.8);
}

.index-student-logout:hover {
    transform: translateY(-1px);
}

/* =====================================================
   Student Dashboard UX Refresh
   ===================================================== */
.student-dashboard {
    background:
        radial-gradient(circle at 12% 8%, rgba(168, 85, 247, 0.12), transparent 36%),
        radial-gradient(circle at 88% 0%, rgba(236, 72, 153, 0.12), transparent 40%),
        #e2e8f0;
}

.student-topbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 10px 30px -22px rgba(15, 23, 42, 0.28);
}

.student-hero {
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
}

.hero-kicker {
    margin: 0 0 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 9999px;
    padding: 0.34rem 0.72rem;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-ux-pills {
    margin: 1rem auto 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}

.hero-ux-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 0.38rem 0.72rem;
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.96);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.hero-ux-pill span {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 0.67rem;
    font-weight: 800;
}

.student-main {
    position: relative;
    margin-top: 0 !important;
    padding-top: 10px !important;
}

.club-section-head {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.club-section-title {
    line-height: 1.32;
    overflow: visible;
    padding-bottom: 0.08em;
}

.club-section-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.35;
    font-weight: 500;
}

.club-toolbar-shell {
    position: sticky;
    top: calc(var(--app-header-height) + 8px);
    z-index: 15;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.65rem 0.72rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 30px -26px rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(8px);
}

.club-toolbar-note {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px dashed #e2e8f0;
}

.club-results-meta {
    margin: 0;
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.2;
    font-weight: 700;
}

.club-results-meta--empty {
    color: #a21caf;
}

.club-filter-pill {
    box-shadow: none;
    line-height: 1.32;
    padding-block: 0.08em;
}

.club-filter-pill--active {
    box-shadow: 0 10px 20px -14px rgba(168, 85, 247, 0.85);
}

.club-empty-state {
    box-shadow: 0 14px 30px -24px rgba(15, 23, 42, 0.25);
}

.stats-card-modern {
    position: relative;
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 14px 26px -22px rgba(15, 23, 42, 0.6);
}

.stats-card-modern__bg-icon {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 74px;
    height: 74px;
    color: rgba(255, 255, 255, 0.24);
    opacity: 0.98;
    pointer-events: none;
    z-index: 1;
    transform: rotate(-10deg);
}

.stats-card-modern__bg-icon svg {
    width: 100%;
    height: 100%;
}

.stats-card-modern__bg-icon--seats {
    transform: rotate(8deg);
}

.stats-card-modern__bg-icon--booked {
    transform: rotate(-6deg);
    color: rgba(209, 250, 229, 0.34);
}

.stats-card-modern--clubs {
    background: linear-gradient(150deg, var(--site-primary-color) 0%, var(--site-secondary-color) 85%);
}

.stats-card-modern--seats {
    background: linear-gradient(150deg, var(--site-secondary-color) 0%, var(--site-primary-color) 88%);
}

.stats-card-modern--booked {
    background: linear-gradient(150deg, #34d399 0%, #10b981 48%, #047857 92%);
}


@media (max-width: 640px) {
    .stats-card-modern__bg-icon {
        width: 58px;
        height: 58px;
        top: 0.3rem;
        right: 0.3rem;
        color: rgba(255, 255, 255, 0.22);
    }
}
.student-profile-card {
    box-shadow: 0 18px 34px -28px rgba(15, 23, 42, 0.45);
}

.student-meta-row {
    flex-wrap: wrap;
    row-gap: 0.2rem;
}

.student-meta-chip {
    font-weight: 700;
}

@media (max-width: 640px) {
    body input,
    body select,
    body textarea {
        font-size: 16px !important;
    }

    #dashboard-view .mobile-hero-search {
        font-size: 16px !important;
    }

    .student-hero {
        border-bottom-left-radius: 24px;
        border-bottom-right-radius: 24px;
    }

    .hero-kicker {
        font-size: 0.64rem;
        padding: 0.3rem 0.56rem;
        letter-spacing: 0.04em;
    }

    .hero-ux-pills {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 0.15rem;
        margin-top: 0.8rem;
    }

    .hero-ux-pills::-webkit-scrollbar {
        display: none;
    }

    .hero-ux-pill {
        font-size: 0.67rem;
        padding: 0.34rem 0.64rem;
    }

    .hero-ux-pill span {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }

    .club-toolbar-shell {
        top: calc(var(--app-header-height) + 6px);
        padding: 0.56rem;
        border-radius: 14px;
    }

    .club-section-title {
        font-size: 1.35rem !important;
        line-height: 1.32;
    }

    .club-section-subtitle {
        font-size: 0.76rem;
    }

    .club-results-meta {
        font-size: 0.66rem;
    }

    .student-profile-card {
        padding: 0.95rem !important;
        border-radius: 1rem;
    }
}

/* =====================================================
   Club Card - Catalog Style (No Image)
   ===================================================== */
.club-card-modern {
    border: 1px solid #dce6f5;
    border-radius: 0.98rem;
    background: #ffffff;
    box-shadow:
        0 10px 22px rgba(15, 23, 42, 0.1),
        0 1px 2px rgba(15, 23, 42, 0.04);
}

.club-card-modern::before,
.club-card-modern::after {
    display: none;
}

.club-card-flat__summary {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 0.54rem;
    height: 100%;
    flex: 1 1 auto;
}

.club-main {
    display: grid;
    gap: 0.5rem;
}

.club-card-top {
    position: relative;
    border-radius: 0.88rem;
    padding: 0.7rem 0.76rem 0.74rem;
    min-height: 82px;
    background: linear-gradient(136deg, #7c3aed 0%, #ec4899 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 10px 20px rgba(255, 95, 109, 0.24);
}

.club-card-modern--my .club-card-top {
    background: linear-gradient(136deg, #0ecb8f 0%, #18b7cf 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 10px 20px rgba(14, 203, 143, 0.24);
}

.club-card-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.48rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.58rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.club-card-title {
    margin: 0.42rem 0 0;
    color: #ffffff;
    font-size: 1.01rem;
    line-height: 1.28;
    font-weight: 800;
    padding-right: 5.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.club-status-pill {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.26rem;
    padding: 0.26rem 0.62rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: 0.01em;
    box-shadow:
        0 8px 16px rgba(15, 23, 42, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.club-status-pill__icon {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
}

.club-status-pill__icon svg {
    width: 0.65rem;
    height: 0.65rem;
}

.club-status-pill__text {
    line-height: 1;
}

.club-status-open {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border-color: #15803d;
    color: #f0fdf4;
}

.club-status-my {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.club-status-booked {
    background: #eaf1ff;
    border-color: #b7cbff;
    color: #3159cc;
}

.club-status-full {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #be123c;
}

.club-status-level {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.club-status-closed {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #334155;
}

.club-main__meta {
    margin-top: 0;
    grid-template-columns: 1fr;
    gap: 0.24rem;
}

.club-main__meta-item {
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    padding: 0.38rem 0.48rem;
    border: 1px solid #e3ebf7;
    border-radius: 0.62rem;
    background: #f8fbff;
}

.club-main__meta-item:first-child {
    grid-column: auto;
}

.club-main__meta-label {
    font-size: 0.52rem;
    font-weight: 800;
    color: #7e92aa;
    white-space: nowrap;
}

.club-main__meta-value {
    font-size: 0.72rem;
    line-height: 1.2;
    color: #1f2f46;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.club-summary {
    gap: 0.35rem;
    padding: 0.52rem 0.6rem;
    border: 1px solid #dce7f5;
    border-radius: 0.75rem;
    background: #f4f8ff;
}

.club-card-flat.is-expanded .club-summary {
    border-color: #ffce9c;
    background: #fff6eb;
}

.club-summary__registered {
    font-size: 1rem;
}

.club-summary__remaining {
    padding: 0.12rem 0.44rem;
    font-size: 0.63rem;
    border-color: #d4dfed;
    background: #ffffff;
}

.club-seat-track {
    height: 0.34rem;
    background: #d7e1ee;
}

.club-seat-fill--open {
    background: linear-gradient(90deg, #a855f7 0%, #f472b6 100%);
}

.club-seat-fill--my {
    background: linear-gradient(90deg, #0ecb8f 0%, #19b8cd 100%);
}

.club-seat-fill--full {
    background: linear-gradient(90deg, #ff5c84 0%, #e11d48 100%);
}

.club-quick-book-btn {
    width: 100%;
    min-height: 2.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.34rem 0.62rem;
    border-radius: 0.62rem;
    border: 1px solid #1d4ed8;
    background: linear-gradient(90deg, #1d4ed8 0%, #0ea5e9 100%);
    color: #ffffff;
    font-size: 0.7rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 16px rgba(29, 78, 216, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.club-quick-book-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.33);
    filter: saturate(1.12);
}

.club-card-modern--my .club-quick-book-btn {
    border-color: #1d4ed8;
    background: linear-gradient(90deg, #1d4ed8 0%, #0ea5e9 100%);
    box-shadow: 0 8px 16px rgba(29, 78, 216, 0.28);
}

.club-expand-toggle {
    width: auto;
    align-self: flex-start;
    padding: 0.22rem 0.44rem;
    font-size: 0.6rem;
    border-radius: 999px;
    border-color: #cfdcf0;
    background: #ffffff;
    color: #39506d;
}

.club-expand-toggle:hover {
    border-color: #ff9f43;
    background: #fff8ef;
    color: #e85d04;
}

.club-card-flat__details.is-open {
    margin-top: 0.62rem;
    padding-top: 0.62rem;
}

.club-card-flat__details .club-card-action {
    margin-top: 0.66rem;
}

.club-card-action .compact-mobile-btn {
    min-height: 2.2rem;
    border-radius: 0.72rem !important;
    font-size: 0.71rem !important;
    font-weight: 800;
}

.club-modal-action-zone {
    margin-top: 0.75rem;
    padding-top: 0.72rem;
    border-top: 1px solid #dbe5f3;
}

.club-grid-responsive {
    grid-template-columns: 1fr !important;
}

@media (min-width: 860px) {
    .club-grid-responsive {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1280px) {
    .club-grid-responsive {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1680px) {
    .club-grid-responsive {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    #dashboard-view .club-card-modern {
        padding: 0.72rem !important;
        border-radius: 0.92rem;
    }

    #dashboard-view .club-card-top {
        min-height: 76px;
        padding: 0.62rem 0.66rem 0.66rem;
        border-radius: 0.8rem;
    }

    #dashboard-view .club-card-kicker {
        font-size: 0.54rem;
        padding: 0.16rem 0.42rem;
    }

    #dashboard-view .club-card-title {
        font-size: 0.92rem;
        padding-right: 4.9rem;
        margin-top: 0.34rem;
    }

    #dashboard-view .club-status-pill {
        font-size: 0.55rem;
        padding: 0.18rem 0.46rem;
    }

    #dashboard-view .club-main__meta-item {
        padding: 0.31rem 0.38rem;
        border-radius: 0.56rem;
    }

    #dashboard-view .club-main__meta-label {
        font-size: 0.49rem;
    }

    #dashboard-view .club-main__meta-value {
        font-size: 0.67rem;
    }

    #dashboard-view .club-summary {
        padding: 0.48rem 0.52rem;
        border-radius: 0.68rem;
    }

    #dashboard-view .club-summary__registered {
        font-size: 0.88rem;
    }

    #dashboard-view .club-summary__remaining {
        font-size: 0.6rem;
    }

    #dashboard-view .club-quick-book-btn {
        min-height: 1.9rem;
        font-size: 0.66rem;
        border-radius: 0.56rem;
    }

    #dashboard-view .club-expand-toggle {
        font-size: 0.56rem;
        padding: 0.18rem 0.4rem;
    }

    #dashboard-view .club-card-action .compact-mobile-btn {
        min-height: 2.05rem;
        font-size: 0.68rem !important;
    }

    #dashboard-view .club-grid-responsive {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Club Modal UX/UI Polish
   ===================================================== */
.club-modal-panel {
    border: 1px solid #d9e3f1;
    border-radius: 1.1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.2);
}

.club-modal-header {
    padding: 0.86rem 0.96rem;
    border-bottom: 1px solid #dde6f3;
    background:
        radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.12), transparent 34%),
        radial-gradient(circle at 90% 0%, rgba(255, 122, 24, 0.14), transparent 32%),
        #ffffff;
}

.club-modal-title {
    font-size: clamp(1rem, 1vw + 0.8rem, 1.22rem);
    font-weight: 800;
}

.club-modal-title span {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8 !important;
    font-size: 0.72rem;
}

.club-modal-seat-info {
    border-color: #bae6fd;
    background: #ecfeff;
    color: #0e7490 !important;
    font-size: 0.72rem;
}

.club-modal-body {
    padding: 0.88rem;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.26), transparent 44%),
        radial-gradient(circle at top left, rgba(255, 237, 213, 0.34), transparent 40%),
        #f8fbff;
}

.club-modal-content {
    gap: 0.56rem;
    margin-bottom: 0.68rem;
}

.club-modal-section {
    border: 1px solid #dbe6f4;
    border-radius: 0.86rem;
    padding: 0.68rem;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.club-modal-section--description {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.club-modal-section--attendance {
    margin-top: 0.62rem;
    border-top: 1px solid #e2e8f0;
}

.club-modal-section-title {
    color: #4b5f77;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.club-modal-description {
    margin-top: 0.34rem;
    font-size: 0.88rem;
    line-height: 1.48;
}

.club-modal-info-grid {
    gap: 0.52rem;
}

.club-modal-info-card {
    border: 1px solid #d9e6f8;
    border-radius: 0.76rem;
    padding: 0.58rem;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.club-modal-info-label {
    margin: 0 0 0.26rem;
    color: #475569;
    font-size: 0.64rem;
}

.club-modal-info-value {
    color: #0f172a;
    font-size: 0.86rem;
    line-height: 1.35;
    font-weight: 700;
}

.club-modal-list {
    border-color: #dbe6f4;
    border-radius: 0.78rem;
    background: #ffffff;
}

.club-modal-list-item {
    padding: 0.55rem 0.62rem;
}

.club-modal-list-item.is-me {
    background: linear-gradient(90deg, #fdf4ff 0%, #f9fcff 100%);
}

.club-modal-rank {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.68rem;
}

.club-modal-name {
    font-size: 0.89rem;
}

.club-modal-meta {
    font-size: 0.7rem;
}

.club-attendance-kpi-grid {
    gap: 0.44rem;
}

.club-attendance-kpi {
    border-radius: 0.68rem;
    padding: 0.44rem 0.34rem;
}

.club-modal-subtitle {
    margin: 0 0 0.38rem;
    font-size: 0.84rem;
    line-height: 1.26;
}

.club-attendance-summary {
    font-size: 0.71rem;
}

.club-modal-action-zone {
    margin-top: 0.72rem;
    padding-top: 0.72rem;
    border-top: 1px solid #dbe5f3;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0) 0%, rgba(248, 251, 255, 0.85) 36%);
}

.club-modal-action-btn {
    min-height: 2.65rem;
    border-radius: 0.8rem !important;
}

.club-modal-action-btn--primary {
    border-color: #2563eb;
    background: linear-gradient(90deg, #1d4ed8 0%, #0ea5e9 100%);
}

.club-modal-action-btn--danger {
    color: #dc2626;
    border-color: #fca5a5;
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.club-modal-action-btn--danger:hover {
    color: #ffffff;
    border-color: #ef4444;
    background: linear-gradient(90deg, #ef4444 0%, #fb7185 100%);
}

@media (max-width: 640px) {
    .club-modal-panel {
        border-radius: 0.96rem;
    }

    .club-modal-header {
        padding: 0.72rem 0.8rem;
    }

    .club-modal-title {
        font-size: 1rem;
    }

    .club-modal-title span {
        font-size: 0.66rem;
        padding: 0.12rem 0.46rem;
    }

    .club-modal-seat-info {
        font-size: 0.66rem;
        padding: 0.16rem 0.48rem;
    }

    .club-modal-body {
        padding: 0.72rem;
    }

    .club-modal-section {
        border-radius: 0.78rem;
        padding: 0.56rem;
    }

    .club-modal-description {
        font-size: 0.82rem;
    }

    .club-modal-info-label {
        font-size: 0.6rem;
    }

    .club-modal-info-value {
        font-size: 0.8rem;
    }

    .club-modal-list-item {
        padding: 0.48rem 0.54rem;
    }

    .club-modal-name {
        font-size: 0.8rem;
    }

    .club-modal-meta {
        font-size: 0.64rem;
    }

    .club-modal-action-zone {
        margin-top: 0.62rem;
        padding-top: 0.62rem;
    }

    .club-modal-action-btn {
        min-height: 2.45rem;
    }
}

/* =====================================================
   Club Card UX Upgrade (Layer + Icon + Smart Progress)
   ===================================================== */
.club-card-modern {
    border: 1px solid rgba(214, 226, 243, 0.95);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.96) 100%);
    box-shadow:
        0 14px 28px rgba(15, 23, 42, 0.1),
        0 1px 2px rgba(15, 23, 42, 0.04);
}

.club-card-modern.table-card:not(.pointer-events-none):hover {
    transform: translateY(-3px);
    box-shadow:
        0 22px 34px rgba(15, 23, 42, 0.14),
        0 2px 4px rgba(15, 23, 42, 0.05);
}

.club-card-top {
    min-height: 96px;
    border-radius: 0.9rem;
}

.club-card-subtitle {
    margin: 0.3rem 0 0;
    color: rgba(255, 255, 255, 0.93);
    font-size: 0.76rem;
    line-height: 1.3;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.club-main__meta {
    margin-top: 0.55rem;
    display: grid;
    gap: 0;
    grid-template-columns: 1fr;
}

.club-main__meta-item {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    align-items: center;
    gap: 0.36rem;
    padding: 0.34rem 0;
    border-radius: 0;
    border: 0;
    background: transparent;
}

.club-main__meta-item:first-child {
    background: transparent;
}

.club-main__meta-item + .club-main__meta-item {
    border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.club-main__meta-icon {
    width: 1rem;
    height: 1rem;
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.club-main__meta-icon svg {
    width: 1rem;
    height: 1rem;
}

.club-main__meta-label {
    font-size: 0.56rem;
}

.club-main__meta-value {
    color: #23364f;
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.club-summary {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.26);
    background: transparent;
    border-radius: 0;
    padding: 0.52rem 0 0;
    gap: 0.44rem;
}

.club-card-flat.is-expanded .club-summary {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.32);
    background: transparent;
    transform: none;
}

.club-summary__numbers {
    align-items: center;
    justify-content: flex-start;
}

.club-summary__registered {
    font-size: 1rem;
}

.club-summary__percent {
    display: none;
    align-items: center;
    padding: 0.14rem 0.46rem;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.64rem;
    line-height: 1;
    font-weight: 800;
}

.club-seat-track {
    position: relative;
    height: 0.5rem;
    border-radius: 999px;
    overflow: hidden;
    background: #c3d2e6;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.12);
}

.club-seat-fill {
    position: relative;
    overflow: hidden;
    border-radius: inherit;
}

.club-seat-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%;
    width: 34%;
    height: 100%;
    background: rgba(255, 255, 255, 0.42);
    filter: blur(1px);
    animation: clubSeatShimmer 2s linear infinite;
}

@keyframes clubSeatShimmer {
    0% {
        left: -40%;
    }

    100% {
        left: 120%;
    }
}

.club-seat-state-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.16rem 0.52rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.64rem;
    line-height: 1.1;
    font-weight: 800;
}

.club-seat-state-open {
    background: #ecfdf5;
    border-color: #86efac;
    color: #047857;
}

.club-seat-state-near {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #a21caf;
}

.club-seat-state-full {
    background: #fff1f2;
    border-color: #fda4af;
    color: #be123c;
}

.club-quick-book-btn {
    min-height: 2.2rem;
    padding: 0.38rem 0.7rem;
}

.club-quick-book-btn__icon {
    width: 0.88rem;
    height: 0.88rem;
    transition: transform 0.2s ease;
}

.club-quick-book-btn:hover .club-quick-book-btn__icon {
    transform: translateX(2px);
}

.club-expand-toggle {
    margin-top: 0.24rem;
    align-self: flex-start;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #36506c;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1.2px;
    text-underline-offset: 0.18em;
}

.club-expand-toggle:hover {
    border: 0;
    background: transparent;
    color: #1d4ed8;
}

.club-expand-toggle:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
    border-radius: 0.24rem;
}

.club-expand-toggle .club-expand-icon {
    width: 0.88rem;
    height: 0.88rem;
}

@media (max-width: 1024px) {
    .club-card-top {
        min-height: 90px;
    }

    .club-main__meta-item {
        grid-template-columns: 0.95rem minmax(0, 1fr);
        gap: 0.32rem;
    }
}

@media (max-width: 640px) {
    #dashboard-view .club-card-subtitle {
        font-size: 0.68rem;
    }

    #dashboard-view .club-main__meta-item {
        padding: 0.3rem 0;
    }

    #dashboard-view .club-main__meta-label {
        font-size: 0.48rem;
    }

    #dashboard-view .club-main__meta-value {
        font-size: 0.66rem;
    }

    #dashboard-view .club-summary__percent {
        font-size: 0.58rem;
    }

    #dashboard-view .club-seat-state-badge {
        font-size: 0.58rem;
    }
}

/* Club card typography tune: readable on all devices + Thai-safe fallback */
#dashboard-view .club-card-modern,
#dashboard-view .club-card-modern * {
    font-family: 'Sarabun', 'TH Sarabun New', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

#dashboard-view .club-card-kicker {
    font-size: clamp(0.72rem, 0.2vw + 0.68rem, 0.84rem);
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-transform: none;
}

#dashboard-view .club-card-title {
    font-size: clamp(1.06rem, 0.4vw + 0.95rem, 1.28rem);
    line-height: 1.36;
}

#dashboard-view .club-card-subtitle {
    font-size: clamp(0.86rem, 0.24vw + 0.8rem, 0.98rem);
    line-height: 1.45;
    -webkit-line-clamp: 2;
}

#dashboard-view .club-status-pill {
    font-size: clamp(0.74rem, 0.18vw + 0.7rem, 0.86rem);
    line-height: 1.24;
    letter-spacing: 0.01em;
}

#dashboard-view .club-main__meta-label {
    font-size: clamp(0.7rem, 0.16vw + 0.66rem, 0.8rem);
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-transform: none;
}

#dashboard-view .club-main__meta-value {
    font-size: clamp(0.84rem, 0.2vw + 0.8rem, 0.96rem);
    line-height: 1.42;
}

#dashboard-view .club-summary__registered {
    font-size: clamp(1.36rem, 0.28vw + 1.3rem, 1.52rem);
    line-height: 1.05;
}

#dashboard-view .club-summary__percent,
#dashboard-view .club-seat-state-badge,
#dashboard-view .club-expand-toggle {
    font-size: clamp(0.74rem, 0.16vw + 0.7rem, 0.86rem);
    line-height: 1.22;
}

#dashboard-view .club-quick-book-btn,
#dashboard-view .club-card-action .compact-mobile-btn {
    font-size: clamp(0.84rem, 0.2vw + 0.8rem, 0.96rem) !important;
    line-height: 1.3;
}

#dashboard-view .club-card-desc {
    font-size: clamp(0.9rem, 0.18vw + 0.86rem, 1rem);
    line-height: 1.56;
}

#dashboard-view .club-meta-label {
    font-size: clamp(0.72rem, 0.16vw + 0.68rem, 0.82rem);
    line-height: 1.28;
    letter-spacing: 0.01em;
    text-transform: none;
}

#dashboard-view .club-meta-value {
    font-size: clamp(0.86rem, 0.2vw + 0.82rem, 0.98rem);
    line-height: 1.5;
}

@media (max-width: 640px) {
    #dashboard-view .club-card-kicker {
        font-size: 0.72rem;
    }

    #dashboard-view .club-card-title {
        font-size: 1rem;
        line-height: 1.34;
    }

    #dashboard-view .club-card-subtitle {
        font-size: 0.84rem;
        line-height: 1.42;
    }

    #dashboard-view .club-status-pill {
        font-size: 0.72rem;
    }

    #dashboard-view .club-main__meta-label {
        font-size: 0.68rem;
    }

    #dashboard-view .club-main__meta-value {
        font-size: 0.82rem;
    }

    #dashboard-view .club-summary__registered {
        font-size: 1.24rem;
    }

    #dashboard-view .club-summary__percent,
    #dashboard-view .club-seat-state-badge,
    #dashboard-view .club-expand-toggle {
        font-size: 0.72rem;
    }

    #dashboard-view .club-quick-book-btn,
    #dashboard-view .club-card-action .compact-mobile-btn {
        font-size: 0.82rem !important;
    }
}

/* Dashboard info/stat cards: readable typography + Thai-safe fallback */
#dashboard-view .student-profile-card,
#dashboard-view .student-profile-card *,
#dashboard-view .stats-card-modern,
#dashboard-view .stats-card-modern * {
    font-family: 'Sarabun', 'TH Sarabun New', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

#dashboard-view .student-profile-card__kicker {
    font-size: clamp(0.82rem, 0.14vw + 0.78rem, 0.92rem);
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-transform: none;
}

#dashboard-view .student-profile-card__name {
    font-size: clamp(1.24rem, 0.3vw + 1.16rem, 1.42rem);
    line-height: 1.32;
}

#dashboard-view .student-profile-card__meta {
    font-size: clamp(0.84rem, 0.14vw + 0.8rem, 0.94rem);
    line-height: 1.4;
}

#dashboard-view .student-profile-card__chip {
    font-size: clamp(0.84rem, 0.14vw + 0.8rem, 0.94rem);
    line-height: 1.2;
}

#dashboard-view .student-profile-card__status-label {
    font-size: clamp(0.76rem, 0.14vw + 0.72rem, 0.86rem);
    line-height: 1.26;
    letter-spacing: 0.01em;
    text-transform: none;
}

#dashboard-view .student-profile-card__status-value {
    font-size: clamp(1rem, 0.18vw + 0.95rem, 1.1rem);
    line-height: 1.34;
}

#dashboard-view .student-profile-card .bg-amber-50 .text-xs.text-gray-500 {
    font-size: clamp(0.82rem, 0.12vw + 0.78rem, 0.9rem);
    line-height: 1.42;
}

#dashboard-view .student-profile-card .compact-mobile-btn {
    font-size: clamp(0.9rem, 0.14vw + 0.86rem, 0.98rem) !important;
    line-height: 1.3;
}

#dashboard-view .stats-card-modern__label {
    font-size: clamp(0.84rem, 0.14vw + 0.8rem, 0.94rem);
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-transform: none;
}

#dashboard-view .stats-card-modern__value {
    font-size: clamp(2.1rem, 0.7vw + 1.88rem, 2.62rem);
    line-height: 1.06;
}

#dashboard-view .stats-card-modern__unit {
    font-size: clamp(0.88rem, 0.14vw + 0.84rem, 0.98rem);
    line-height: 1.36;
    letter-spacing: 0.005em;
    text-transform: none;
}

@media (max-width: 640px) {
    #dashboard-view .student-profile-card__kicker {
        font-size: 0.8rem;
    }

    #dashboard-view .student-profile-card__name {
        font-size: 1.14rem;
    }

    #dashboard-view .student-profile-card__meta,
    #dashboard-view .student-profile-card__chip {
        font-size: 0.8rem;
    }

    #dashboard-view .student-profile-card__status-label {
        font-size: 0.74rem;
    }

    #dashboard-view .student-profile-card__status-value {
        font-size: 0.96rem;
    }

    #dashboard-view .student-profile-card .bg-amber-50 .text-xs.text-gray-500 {
        font-size: 0.8rem;
    }

    #dashboard-view .student-profile-card .compact-mobile-btn {
        font-size: 0.86rem !important;
    }

    #dashboard-view .stats-card-modern__label {
        font-size: 0.78rem;
    }

    #dashboard-view .stats-card-modern__value {
        font-size: 1.86rem;
    }

    #dashboard-view .stats-card-modern__unit {
        font-size: 0.82rem;
    }
}

/* =====================================================
   Theme Color Bindings
   ===================================================== */
:root {
    --site-primary-color: #7c3aed;
    --site-secondary-color: #ec4899;
    --site-button-color: #9333ea;
    --site-badge-color: #db2777;
    --site-progress-color: #a855f7;
    --site-card-primary-color: #7c3aed;
    --site-card-secondary-color: #ec4899;
    --site-card-button-color: #9333ea;
    --site-card-badge-color: #db2777;
    --site-card-progress-color: #a855f7;
    --site-primary-soft: #f3e8ff;
    --site-secondary-soft: #fce7f3;
}

@supports (color: color-mix(in srgb, #000 50%, #fff 50%)) {
    :root {
        --site-primary-soft: color-mix(in srgb, var(--site-primary-color) 12%, #ffffff);
        --site-secondary-soft: color-mix(in srgb, var(--site-secondary-color) 12%, #ffffff);
    }
}

.public-theme-gradient-btn {
    border: 1px solid transparent !important;
    background: linear-gradient(120deg, var(--site-secondary-color) 0%, var(--site-primary-color) 100%) !important;
    color: #ffffff !important;
}

.public-theme-gradient-btn:hover {
    filter: brightness(0.96);
}

.public-theme-outline-btn {
    border: 1px solid #d8b4fe !important;
    background: #ffffff !important;
    color: var(--site-primary-color) !important;
}

.public-theme-outline-btn:hover {
    background: var(--site-primary-soft) !important;
}

.public-theme-accent-text {
    color: var(--site-primary-color) !important;
}

.public-theme-accent-bar {
    background: linear-gradient(180deg, var(--site-primary-color) 0%, var(--site-secondary-color) 100%) !important;
}

.public-theme-title-gradient {
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(90deg, var(--site-primary-color) 0%, var(--site-secondary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    display: inline-block;
    line-height: 1.32;
    padding-bottom: 0.08em;
    overflow: visible;
}

.public-theme-link-hover:hover {
    color: var(--site-primary-color) !important;
}

.public-card-theme-gradient-btn {
    border: 1px solid transparent !important;
    background: linear-gradient(120deg, var(--site-card-secondary-color) 0%, var(--site-card-primary-color) 100%) !important;
    color: #ffffff !important;
}

.public-card-theme-gradient-btn:hover {
    filter: brightness(0.96);
}

.public-card-theme-accent-text {
    color: var(--site-card-primary-color) !important;
}

.public-card-theme-link-hover:hover {
    color: var(--site-card-primary-color) !important;
}

.public-card-theme-badge-soft {
    border: 1px solid #f9a8d4 !important;
    background: #fdf2f8 !important;
    color: var(--site-card-badge-color) !important;
}

.public-theme-badge-soft {
    border: 1px solid #e9d5ff !important;
    background: var(--site-primary-soft) !important;
    color: var(--site-primary-color) !important;
}

.public-theme-focus:focus,
.public-theme-focus:focus-visible,
.public-theme-focus:focus-within {
    outline: none !important;
    border-color: var(--site-primary-color) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22) !important;
}

.public-theme-spinner {
    border-color: var(--site-primary-color) !important;
    border-bottom-color: transparent !important;
}

@supports (color: color-mix(in srgb, #000 50%, #fff 50%)) {
    .public-card-theme-badge-soft {
        border-color: color-mix(in srgb, var(--site-card-badge-color) 32%, #ffffff) !important;
        background: color-mix(in srgb, var(--site-card-badge-color) 12%, #ffffff) !important;
    }

    .public-theme-outline-btn {
        border-color: color-mix(in srgb, var(--site-primary-color) 28%, #ffffff) !important;
    }

    .public-theme-focus:focus,
    .public-theme-focus:focus-visible,
    .public-theme-focus:focus-within {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-primary-color) 22%, transparent) !important;
    }
}

.club-card-top {
    background: linear-gradient(136deg, var(--site-card-primary-color) 0%, var(--site-card-secondary-color) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 10px 20px rgba(15, 23, 42, 0.22);
}

.club-card-modern--my .club-card-top {
    background: linear-gradient(136deg, var(--site-card-secondary-color) 0%, var(--site-card-primary-color) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 10px 20px rgba(15, 23, 42, 0.22);
}

.club-status-open {
    background: var(--site-card-badge-color);
    border-color: var(--site-card-badge-color);
    color: #f8fafc;
}

.club-seat-fill--open {
    background: linear-gradient(90deg, var(--site-card-progress-color) 0%, var(--site-card-progress-color) 100%);
}

.club-quick-book-btn,
.club-card-modern--my .club-quick-book-btn,
.club-modal-action-btn--primary {
    border-color: var(--site-card-button-color);
    background: linear-gradient(90deg, var(--site-card-button-color) 0%, var(--site-card-button-color) 100%);
    color: #ffffff;
}

.club-quick-book-btn:hover,
.club-modal-action-btn--primary:hover {
    filter: brightness(0.95);
}

/* =====================================================
   Dense Club Grid (Large Desktop)
   ===================================================== */
@media (min-width: 1024px) {
    #dashboard-view .club-grid-responsive {
        grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
        gap: 0.56rem !important;
    }

    #dashboard-view .club-card-modern {
        padding: 0.64rem !important;
        border-radius: 0.84rem;
    }

    #dashboard-view .club-card-top {
        min-height: 84px;
        padding: 0.58rem 0.6rem 0.62rem;
        border-radius: 0.68rem;
    }

    #dashboard-view .club-card-kicker {
        font-size: 0.62rem;
        padding: 0.14rem 0.36rem;
    }

    #dashboard-view .club-card-title {
        font-size: 0.86rem;
        line-height: 1.28;
        padding-right: 0;
        margin-top: 0.3rem;
    }

    #dashboard-view .club-card-subtitle {
        font-size: 0.66rem;
        line-height: 1.34;
        -webkit-line-clamp: 1;
    }

    #dashboard-view .club-status-pill {
        position: static;
        margin-top: 0.4rem;
        justify-content: center;
        width: fit-content;
        max-width: 100%;
        font-size: 0.58rem;
        padding: 0.16rem 0.38rem;
        box-shadow: none;
    }

    #dashboard-view .club-main__meta {
        margin-top: 0.42rem;
        gap: 0;
    }

    #dashboard-view .club-main__meta-item {
        grid-template-columns: 0.86rem minmax(0, 1fr);
        gap: 0.32rem;
        padding: 0.26rem 0;
    }

    #dashboard-view .club-main__meta-icon,
    #dashboard-view .club-main__meta-icon svg {
        width: 0.86rem;
        height: 0.86rem;
    }

    #dashboard-view .club-main__meta-value {
        font-size: 0.67rem;
        line-height: 1.28;
    }

    #dashboard-view .club-summary {
        padding: 0.4rem 0.48rem;
        border-radius: 0.62rem;
        gap: 0.28rem;
    }

    #dashboard-view .club-summary__registered {
        font-size: 1rem;
    }

    #dashboard-view .club-seat-track {
        height: 0.28rem;
    }

    #dashboard-view .club-seat-state-badge {
        font-size: 0.58rem;
        padding: 0.12rem 0.34rem;
    }

    #dashboard-view .club-quick-book-btn,
    #dashboard-view .club-card-action .compact-mobile-btn {
        min-height: 1.74rem;
        font-size: 0.65rem !important;
        border-radius: 0.54rem;
        padding: 0.22rem 0.36rem;
    }

    #dashboard-view .club-expand-toggle {
        font-size: 0.56rem;
        padding: 0.16rem 0.3rem;
    }
}

/* Club cards: always show the full club name without ellipsis or internal scroll */
#dashboard-view .club-card-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: unset !important;
    gap: 0.42rem;
}

#dashboard-view .club-card-title {
    display: block !important;
    margin-top: 0.3rem;
    padding-right: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
}

#dashboard-view .club-card-subtitle {
    display: none !important;
}

#dashboard-view .club-status-pill {
    position: static !important;
    align-self: flex-start;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    white-space: normal;
}

@media (min-width: 1024px) {
    #dashboard-view .club-grid-responsive {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1280px) {
    #dashboard-view .club-grid-responsive {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1536px) {
    #dashboard-view .club-grid-responsive {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1920px) {
    #dashboard-view .club-grid-responsive {
        grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    }
}

/* =====================================================
   Theme Palette Overrides (Purple/Pink)
   ===================================================== */
:root {
    --theme-purple-50: #faf5ff;
    --theme-purple-100: #f3e8ff;
    --theme-purple-200: #e9d5ff;
    --theme-purple-300: #d8b4fe;
    --theme-purple-400: #c084fc;
    --theme-purple-500: #a855f7;
    --theme-purple-600: #9333ea;
    --theme-purple-700: #7e22ce;
    --theme-purple-800: #6b21a8;
    --theme-purple-900: #581c87;

    --theme-pink-50: #fdf2f8;
    --theme-pink-100: #fce7f3;
    --theme-pink-200: #fbcfe8;
    --theme-pink-300: #f9a8d4;
    --theme-pink-400: #f472b6;
    --theme-pink-500: #ec4899;
    --theme-pink-600: #db2777;
    --theme-pink-700: #be185d;
    --theme-pink-800: #9d174d;
    --theme-pink-900: #831843;
}

@supports (color: color-mix(in srgb, #000 50%, #fff 50%)) {
    :root {
        --theme-purple-50: color-mix(in srgb, var(--site-primary-color) 8%, #ffffff);
        --theme-purple-100: color-mix(in srgb, var(--site-primary-color) 14%, #ffffff);
        --theme-purple-200: color-mix(in srgb, var(--site-primary-color) 22%, #ffffff);
        --theme-purple-300: color-mix(in srgb, var(--site-primary-color) 34%, #ffffff);
        --theme-purple-400: color-mix(in srgb, var(--site-primary-color) 56%, #ffffff);
        --theme-purple-500: var(--site-primary-color);
        --theme-purple-600: color-mix(in srgb, var(--site-primary-color) 88%, #000000);
        --theme-purple-700: color-mix(in srgb, var(--site-primary-color) 72%, #000000);
        --theme-purple-800: color-mix(in srgb, var(--site-primary-color) 58%, #000000);
        --theme-purple-900: color-mix(in srgb, var(--site-primary-color) 46%, #000000);

        --theme-pink-50: color-mix(in srgb, var(--site-secondary-color) 8%, #ffffff);
        --theme-pink-100: color-mix(in srgb, var(--site-secondary-color) 14%, #ffffff);
        --theme-pink-200: color-mix(in srgb, var(--site-secondary-color) 22%, #ffffff);
        --theme-pink-300: color-mix(in srgb, var(--site-secondary-color) 34%, #ffffff);
        --theme-pink-400: color-mix(in srgb, var(--site-secondary-color) 56%, #ffffff);
        --theme-pink-500: var(--site-secondary-color);
        --theme-pink-600: color-mix(in srgb, var(--site-secondary-color) 88%, #000000);
        --theme-pink-700: color-mix(in srgb, var(--site-secondary-color) 72%, #000000);
        --theme-pink-800: color-mix(in srgb, var(--site-secondary-color) 58%, #000000);
        --theme-pink-900: color-mix(in srgb, var(--site-secondary-color) 46%, #000000);
    }
}

/* Orange => Purple */
.text-orange-50 { color: var(--theme-purple-50) !important; }
.text-orange-100 { color: var(--theme-purple-100) !important; }
.text-orange-200 { color: var(--theme-purple-200) !important; }
.text-orange-300 { color: var(--theme-purple-300) !important; }
.text-orange-400 { color: var(--theme-purple-400) !important; }
.text-orange-500 { color: var(--theme-purple-500) !important; }
.text-orange-600 { color: var(--theme-purple-600) !important; }
.text-orange-700 { color: var(--theme-purple-700) !important; }
.text-orange-800 { color: var(--theme-purple-800) !important; }
.text-orange-900 { color: var(--theme-purple-900) !important; }

.bg-orange-50 { background-color: var(--theme-purple-50) !important; }
.bg-orange-100 { background-color: var(--theme-purple-100) !important; }
.bg-orange-200 { background-color: var(--theme-purple-200) !important; }
.bg-orange-300 { background-color: var(--theme-purple-300) !important; }
.bg-orange-400 { background-color: var(--theme-purple-400) !important; }
.bg-orange-500 { background-color: var(--theme-purple-500) !important; }
.bg-orange-600 { background-color: var(--theme-purple-600) !important; }
.bg-orange-700 { background-color: var(--theme-purple-700) !important; }
.bg-orange-800 { background-color: var(--theme-purple-800) !important; }
.bg-orange-900 { background-color: var(--theme-purple-900) !important; }
.bg-orange-50\\/50 { background-color: rgb(250 245 255 / 0.5) !important; }
.bg-orange-50\\/60 { background-color: rgb(250 245 255 / 0.6) !important; }
.hover\\:bg-orange-50:hover { background-color: var(--theme-purple-50) !important; }
.hover\\:bg-orange-50\\/60:hover { background-color: rgb(250 245 255 / 0.6) !important; }

.border-orange-50 { border-color: var(--theme-purple-50) !important; }
.border-orange-100 { border-color: var(--theme-purple-100) !important; }
.border-orange-200 { border-color: var(--theme-purple-200) !important; }
.border-orange-300 { border-color: var(--theme-purple-300) !important; }
.border-orange-400 { border-color: var(--theme-purple-400) !important; }
.border-orange-500 { border-color: var(--theme-purple-500) !important; }
.border-orange-600 { border-color: var(--theme-purple-600) !important; }
.border-orange-700 { border-color: var(--theme-purple-700) !important; }
.border-orange-800 { border-color: var(--theme-purple-800) !important; }
.border-orange-900 { border-color: var(--theme-purple-900) !important; }
.hover\\:border-orange-300:hover { border-color: var(--theme-purple-300) !important; }

.ring-orange-500 { --tw-ring-color: var(--theme-purple-500) !important; }
.focus\\:ring-orange-500:focus { --tw-ring-color: var(--theme-purple-500) !important; }
.focus\\:border-orange-500:focus { border-color: var(--theme-purple-500) !important; }
.focus-within\\:ring-orange-500:focus-within { --tw-ring-color: var(--theme-purple-500) !important; }
.focus-within\\:border-orange-500:focus-within { border-color: var(--theme-purple-500) !important; }

.from-orange-400 {
    --tw-gradient-from: var(--theme-purple-400) !important;
    --tw-gradient-to: rgb(192 132 252 / 0) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}
.from-orange-500 {
    --tw-gradient-from: var(--theme-purple-500) !important;
    --tw-gradient-to: rgb(168 85 247 / 0) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}
.from-orange-600 {
    --tw-gradient-from: var(--theme-purple-600) !important;
    --tw-gradient-to: rgb(147 51 234 / 0) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}
.to-orange-400 { --tw-gradient-to: var(--theme-purple-400) !important; }
.to-orange-500 { --tw-gradient-to: var(--theme-purple-500) !important; }
.to-orange-600 { --tw-gradient-to: var(--theme-purple-600) !important; }
.via-orange-500 { --tw-gradient-stops: var(--tw-gradient-from), var(--theme-purple-500), var(--tw-gradient-to) !important; }

.shadow-orange-200 { --tw-shadow-color: var(--theme-purple-200) !important; }
.shadow-orange-500 { --tw-shadow-color: var(--theme-purple-500) !important; }
.shadow-orange-500\\/30 { --tw-shadow-color: rgb(168 85 247 / 0.3) !important; }
.hover\\:shadow-orange-500\\/30:hover { --tw-shadow-color: rgb(168 85 247 / 0.3) !important; }

/* Amber/Yellow => Pink */
.text-amber-50 { color: var(--theme-pink-50) !important; }
.text-amber-100 { color: var(--theme-pink-100) !important; }
.text-amber-200 { color: var(--theme-pink-200) !important; }
.text-amber-300 { color: var(--theme-pink-300) !important; }
.text-amber-400 { color: var(--theme-pink-400) !important; }
.text-amber-500 { color: var(--theme-pink-500) !important; }
.text-amber-600 { color: var(--theme-pink-600) !important; }
.text-amber-700 { color: var(--theme-pink-700) !important; }
.text-amber-800 { color: var(--theme-pink-800) !important; }
.text-amber-900 { color: var(--theme-pink-900) !important; }

.bg-amber-50 { background-color: var(--theme-pink-50) !important; }
.bg-amber-100 { background-color: var(--theme-pink-100) !important; }
.bg-amber-200 { background-color: var(--theme-pink-200) !important; }
.bg-amber-300 { background-color: var(--theme-pink-300) !important; }
.bg-amber-400 { background-color: var(--theme-pink-400) !important; }
.bg-amber-500 { background-color: var(--theme-pink-500) !important; }
.bg-amber-600 { background-color: var(--theme-pink-600) !important; }
.bg-amber-700 { background-color: var(--theme-pink-700) !important; }
.bg-amber-800 { background-color: var(--theme-pink-800) !important; }
.bg-amber-900 { background-color: var(--theme-pink-900) !important; }
.bg-amber-50\\/40 { background-color: rgb(253 242 248 / 0.4) !important; }
.bg-amber-50\\/50 { background-color: rgb(253 242 248 / 0.5) !important; }
.bg-amber-50\\/60 { background-color: rgb(253 242 248 / 0.6) !important; }
.bg-amber-100\\/70 { background-color: rgb(252 231 243 / 0.7) !important; }
.hover\\:bg-amber-50:hover { background-color: var(--theme-pink-50) !important; }

.border-amber-50 { border-color: var(--theme-pink-50) !important; }
.border-amber-100 { border-color: var(--theme-pink-100) !important; }
.border-amber-200 { border-color: var(--theme-pink-200) !important; }
.border-amber-300 { border-color: var(--theme-pink-300) !important; }
.border-amber-400 { border-color: var(--theme-pink-400) !important; }
.border-amber-500 { border-color: var(--theme-pink-500) !important; }
.border-amber-600 { border-color: var(--theme-pink-600) !important; }
.border-amber-700 { border-color: var(--theme-pink-700) !important; }
.border-amber-800 { border-color: var(--theme-pink-800) !important; }
.border-amber-900 { border-color: var(--theme-pink-900) !important; }

.ring-amber-500 { --tw-ring-color: var(--theme-pink-500) !important; }
.focus\\:ring-amber-500:focus { --tw-ring-color: var(--theme-pink-500) !important; }
.focus\\:border-amber-500:focus { border-color: var(--theme-pink-500) !important; }
.focus-within\\:ring-amber-500:focus-within { --tw-ring-color: var(--theme-pink-500) !important; }
.focus-within\\:border-amber-500:focus-within { border-color: var(--theme-pink-500) !important; }

.from-amber-500 {
    --tw-gradient-from: var(--theme-pink-500) !important;
    --tw-gradient-to: rgb(236 72 153 / 0) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}
.to-amber-500 { --tw-gradient-to: var(--theme-pink-500) !important; }
.via-amber-500 { --tw-gradient-stops: var(--tw-gradient-from), var(--theme-pink-500), var(--tw-gradient-to) !important; }

/* Yellow => Pink (for legacy warning chips) */
.text-yellow-50 { color: var(--theme-pink-50) !important; }
.text-yellow-700 { color: var(--theme-pink-700) !important; }
.text-yellow-800 { color: var(--theme-pink-800) !important; }
.bg-yellow-50 { background-color: var(--theme-pink-50) !important; }
.border-yellow-200 { border-color: var(--theme-pink-200) !important; }
.from-yellow-500 {
    --tw-gradient-from: var(--theme-pink-500) !important;
    --tw-gradient-to: rgb(236 72 153 / 0) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}
.to-yellow-500 { --tw-gradient-to: var(--theme-pink-500) !important; }
.via-yellow-500 { --tw-gradient-stops: var(--tw-gradient-from), var(--theme-pink-500), var(--tw-gradient-to) !important; }

/* =========================================
   Responsive UX Refresh
   ========================================= */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-mobile-content-shell {
    width: 100%;
    scroll-padding-top: calc(var(--app-header-height) + 1rem);
}

.admin-page .admin-content > .view-section {
    width: 100%;
    max-width: none;
    margin-inline: 0;
}

.teacher-modern-ui .admin-content > * {
    width: min(100%, 1480px);
    margin-inline: auto;
}

.view-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.view-toolbar__meta {
    min-width: 0;
    flex: 1 1 auto;
}

.view-toolbar__meta h2,
.view-toolbar--static h2 {
    line-height: 1.35;
    overflow: visible;
    padding-block: 0.04em;
}

.view-toolbar__meta p,
.view-toolbar--static p {
    line-height: 1.55;
    overflow: visible;
    padding-block: 0.02em;
}

.view-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.view-toolbar__actions > * {
    flex: 0 0 auto;
}

.admin-page .admin-teacher-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.admin-page .admin-club-toolbar-actions,
.admin-page .admin-student-toolbar-actions,
.admin-page .admin-place-toolbar-actions {
    justify-content: flex-end;
}

.admin-page .admin-teacher-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    min-height: 40px;
    padding: 0 0.78rem;
    border-radius: 13px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 10px 18px -14px rgba(15, 23, 42, 0.4);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.admin-page .admin-teacher-action-btn__label {
    display: inline-flex;
    align-items: center;
    line-height: 1.3;
    padding-block: 0.04em;
    overflow: visible;
}

.admin-page .admin-teacher-action-btn svg,
.admin-page .admin-teacher-action-btn img {
    width: 15px;
    height: 15px;
    display: block;
    flex: 0 0 auto;
}

.admin-page .admin-teacher-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px -16px rgba(15, 23, 42, 0.46);
}

.admin-page .admin-teacher-action-btn:active {
    transform: translateY(0);
}

.admin-page .admin-teacher-action-btn--ghost {
    color: #334155;
    background: #f8fafc;
    border-color: #d8e1ec;
}

.admin-page .admin-teacher-action-btn--ghost:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.admin-page .admin-teacher-action-btn--blue {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.admin-page .admin-teacher-action-btn--blue:hover {
    filter: brightness(1.05);
}

.admin-page .admin-teacher-action-btn--sky {
    color: #fff;
    background: linear-gradient(135deg, #0284c7, #0369a1);
}

.admin-page .admin-teacher-action-btn--sky:hover {
    filter: brightness(1.05);
}

.admin-page .admin-teacher-action-btn--emerald {
    color: #fff;
    background: linear-gradient(135deg, #059669, #047857);
}

.admin-page .admin-teacher-action-btn--emerald:hover {
    filter: brightness(1.05);
}

.admin-page .admin-teacher-action-btn--danger {
    color: #b91c1c;
    background: #fff1f2;
    border-color: #fecdd3;
}

.admin-page .admin-teacher-action-btn--danger:hover {
    background: #ffe4e6;
    border-color: #fda4af;
}

.admin-page .admin-teacher-action-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

.admin-page .admin-teacher-action-btn--primary:hover {
    filter: brightness(1.05);
}

.admin-page .admin-teacher-action-btn--rose {
    color: #fff;
    background: linear-gradient(135deg, #e11d48, #be123c);
}

.admin-page .admin-teacher-action-btn--rose:hover {
    filter: brightness(1.05);
}

.view-toolbar--static {
    display: block;
    padding: 0;
    margin-bottom: 1.5rem;
}

.app-surface-panel {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.app-hero-card {
    position: relative;
    overflow: hidden;
}

.app-hero-card::after {
    content: '';
    position: absolute;
    inset: auto -10% -35% auto;
    width: 220px;
    height: 220px;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 72%);
    pointer-events: none;
}

@media (max-width: 1023px) {
    .app-mobile-content-shell {
        padding-inline: 14px !important;
        padding-top: 14px !important;
    }

    .admin-header,
    .app-unified-header {
        min-height: 64px;
        height: auto;
        padding: 0.65rem 0.9rem !important;
        gap: 0.75rem;
    }

    .admin-header > div:first-child,
    .admin-header > div:last-child,
    .app-header-brand,
    .app-header-right {
        min-width: 0;
    }

    #page-title,
    .header-brand-title,
    .mobile-brand-title {
        font-size: 0.98rem !important;
        line-height: 1.15 !important;
    }

    #header-brand-meta,
    .app-header-brand-copy .header-subline-nowrap {
        font-size: 0.68rem !important;
        line-height: 1.2 !important;
    }

    .admin-page .admin-content,
    .teacher-modern-ui .admin-content {
        padding-inline: 14px !important;
        padding-top: 14px !important;
    }

    .header-account-toggle {
        min-height: 38px;
        padding: 0.2rem 0.32rem;
        gap: 0.38rem;
    }

    .header-account-toggle__name,
    .header-account-toggle__chevron {
        display: none;
    }

    .header-account-toggle__avatar {
        width: 30px;
        height: 30px;
    }

    .header-account-dropdown {
        top: calc(100% + 8px);
        right: -2px;
        width: min(280px, calc(100vw - 16px));
    }

    .student-main.app-mobile-content-shell {
        max-width: 100% !important;
        padding-inline: 14px !important;
        padding-top: 14px !important;
    }

    .view-toolbar {
        position: sticky;
        top: calc(var(--app-header-height) + 0.55rem);
        z-index: 24;
        padding: 1rem;
        border: 1px solid rgba(226, 232, 240, 0.96);
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .view-toolbar--static {
        position: relative;
        top: auto;
        padding: 1rem;
    }

    .view-toolbar__actions {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .view-toolbar__actions::-webkit-scrollbar,
    .teacher-modern-ui .teacher-action-grid::-webkit-scrollbar,
    #club-filters::-webkit-scrollbar {
        display: none;
    }

    .view-toolbar__actions > *,
    .teacher-modern-ui .teacher-action-grid > *,
    #club-filters > * {
        scroll-snap-align: start;
        min-height: 46px;
    }

    .view-toolbar__actions > * {
        border-radius: 16px !important;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        width: 100%;
        gap: 0.5rem;
        overflow-x: auto !important;
        overflow-y: hidden;
        padding-bottom: 0.2rem !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions::-webkit-scrollbar {
        display: none;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions > * {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn {
        width: auto;
        min-width: max-content;
        min-height: 42px;
        padding: 0.56rem 0.72rem;
        border-radius: 12px;
        justify-content: center;
        box-shadow: none;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn__label {
        display: inline-block;
        min-width: 0;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.3;
        padding-block: 0.04em;
        white-space: nowrap;
    }

    .admin-page #admin-stats-grid {
        gap: 0.9rem !important;
    }

    .admin-page #admin-charts-grid .grid {
        grid-template-columns: 1fr !important;
        gap: 0.9rem !important;
    }

    .admin-page #admin-club-list {
        gap: 1.2rem !important;
        margin-top: 0.35rem;
    }

    .admin-page .bg-white.rounded-xl.shadow-sm.border,
    .admin-page .bg-white.rounded-2xl.shadow-sm.border,
    .admin-page .app-surface-panel {
        border-radius: 22px !important;
        box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    }

    .teacher-modern-ui .teacher-page-card {
        border-radius: 22px !important;
        box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08) !important;
    }

    .teacher-modern-ui .teacher-card-header,
    .teacher-modern-ui .club-context-layout,
    .teacher-modern-ui .report-workflow {
        gap: 0.9rem !important;
    }

    .teacher-modern-ui .teacher-action-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .teacher-modern-ui .teacher-action-grid > * {
        flex: 0 0 auto;
    }

    .teacher-modern-ui #teacher-date-controls .teacher-date-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .teacher-modern-ui .teacher-user-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .teacher-modern-ui .club-context-layout {
        grid-template-columns: 1fr !important;
    }

    .teacher-modern-ui .teacher-overview-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .teacher-modern-ui .report-dropzone-grid {
        grid-template-columns: 1fr !important;
    }

    #dashboard-view {
        background:
            radial-gradient(circle at top right, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 28%),
            linear-gradient(180deg, #eef2ff 0%, #f8fafc 38%, #ffffff 100%);
    }

    #dashboard-view .glass-card,
    #dashboard-view .club-toolbar-shell,
    #table-modal .club-modal-panel {
        border-radius: 24px !important;
    }

    #dashboard-view .app-hero-card {
        padding: 1.2rem !important;
    }

    #dashboard-view .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-4 {
        gap: 0.9rem !important;
        margin-bottom: 1.4rem !important;
    }

    #dashboard-view .club-toolbar-shell {
        position: sticky;
        top: calc(var(--app-header-height) + 0.55rem);
        z-index: 24;
        padding: 1rem;
        border: 1px solid rgba(226, 232, 240, 0.9);
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    #club-filters {
        flex-wrap: nowrap !important;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    #club-filters .club-filter-pill {
        flex: 0 0 auto;
        min-height: 42px;
    }

    #dashboard-view .club-section-title {
        font-size: 1.35rem !important;
        line-height: 1.32;
    }

    #dashboard-view .club-section-subtitle {
        font-size: 0.86rem;
        line-height: 1.55;
    }

    #table-modal .club-modal-header {
        padding: 1rem !important;
    }

    #table-modal .club-modal-body {
        padding: 1rem !important;
    }
}

@media (max-width: 767px) {
    .admin-page .admin-content > .view-section {
        padding-bottom: 0.35rem;
    }

    .admin-page .view-toolbar:not(.view-toolbar--static) {
        top: 0.3rem;
    }

    .admin-page #view-clubs #admin-club-list {
        gap: 1rem !important;
        margin-top: 0.8rem;
    }

    .admin-page input,
    .admin-page select,
    .admin-page textarea,
    .teacher-modern-ui input,
    .teacher-modern-ui select,
    .teacher-modern-ui textarea,
    #dashboard-view input,
    #dashboard-view select,
    #dashboard-view textarea {
        font-size: 16px !important;
    }

    .teacher-modern-ui #teacher-date-controls .teacher-date-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .teacher-modern-ui .attendance-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .teacher-modern-ui .teacher-user-summary-grid,
    .teacher-modern-ui .teacher-overview-stat-grid {
        grid-template-columns: 1fr !important;
    }

    #dashboard-view .club-toolbar-shell > .flex {
        flex-direction: column;
        align-items: stretch !important;
    }

    #dashboard-view .club-toolbar-shell .relative.w-full.md\\:w-72 {
        width: 100% !important;
    }

    #dashboard-view .glass-card,
    #dashboard-view .club-toolbar-shell,
    .teacher-modern-ui .teacher-page-card,
    .admin-page .app-surface-panel {
        border-radius: 20px !important;
    }

    .site-footer-line {
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .app-mobile-dock {
        padding-inline: 0.45rem !important;
        border-top-left-radius: 22px !important;
        border-top-right-radius: 22px !important;
    }

    .app-mobile-dock-link {
        min-height: 56px;
        border-radius: 14px;
    }

    .app-mobile-dock-link__icon svg {
        width: 1.22rem;
        height: 1.22rem;
    }

    .app-mobile-dock-link__label {
        font-size: 0.58rem;
        line-height: 1.3;
        overflow: visible;
        text-overflow: clip;
        padding-bottom: 0.1rem;
    }

    .view-toolbar {
        padding: 0.9rem;
    }

    .view-toolbar__meta h2,
    .view-toolbar--static h2 {
        font-size: 1.05rem !important;
        line-height: 1.35;
    }

    .view-toolbar__meta p,
    .view-toolbar--static p {
        font-size: 0.8rem !important;
        line-height: 1.55;
    }

    #dashboard-view .app-hero-card {
        padding: 1rem !important;
    }
}

/* =========================================
   Production Responsive Polish
   ========================================= */
.app-view-shell {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.app-view-shell > * {
    min-width: 0;
}

.admin-page #view-clubs #admin-club-list {
    margin-top: 0.55rem;
}

/* Admin Clubs: modern + colorful card skin (layout preserved) */
.admin-page #view-clubs #admin-club-list .admin-club-card {
    --club-accent: #3b82f6;
    --club-accent-2: #06b6d4;
    --club-accent-soft: rgba(59, 130, 246, 0.14);
    position: relative;
    border-radius: 1.1rem;
    border-color: rgba(203, 213, 225, 0.9) !important;
    background:
        linear-gradient(165deg, #ffffff 0%, #f8fbff 58%, #fdf7ff 100%);
    box-shadow:
        0 12px 24px rgba(15, 23, 42, 0.08),
        0 2px 8px rgba(15, 23, 42, 0.04);
    transform: translateY(0);
    transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
    isolation: isolate;
}

.admin-page #view-clubs #admin-club-list .admin-club-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: 1.1rem 1.1rem 0 0;
    background: linear-gradient(90deg, var(--club-accent) 0%, var(--club-accent-2) 100%);
    opacity: 0.95;
    z-index: 0;
}

.admin-page #view-clubs #admin-club-list .admin-club-card::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    top: -56px;
    right: -36px;
    border-radius: 999px;
    background: radial-gradient(circle, var(--club-accent-soft) 0%, rgba(255, 255, 255, 0) 72%);
    pointer-events: none;
    z-index: 0;
}

.admin-page #view-clubs #admin-club-list .admin-club-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--club-accent) 28%, #cbd5e1) !important;
    box-shadow:
        0 20px 34px rgba(15, 23, 42, 0.12),
        0 4px 12px rgba(15, 23, 42, 0.08);
}

.admin-page #view-clubs #admin-club-list .admin-club-card.is-fresh {
    --club-accent: #14b8a6;
    --club-accent-2: #3b82f6;
    --club-accent-soft: rgba(20, 184, 166, 0.15);
}

.admin-page #view-clubs #admin-club-list .admin-club-card.is-mid {
    --club-accent: #2563eb;
    --club-accent-2: #8b5cf6;
    --club-accent-soft: rgba(37, 99, 235, 0.14);
}

.admin-page #view-clubs #admin-club-list .admin-club-card.is-near-full {
    --club-accent: #f59e0b;
    --club-accent-2: #f97316;
    --club-accent-soft: rgba(245, 158, 11, 0.16);
}

.admin-page #view-clubs #admin-club-list .admin-club-card.is-full {
    --club-accent: #ef4444;
    --club-accent-2: #f97316;
    --club-accent-soft: rgba(239, 68, 68, 0.16);
}

.admin-page #view-clubs #admin-club-list .admin-club-card__body,
.admin-page #view-clubs #admin-club-list .admin-club-card__members-btn {
    position: relative;
    z-index: 1;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__index {
    background: linear-gradient(145deg, color-mix(in srgb, var(--club-accent) 18%, #ffffff) 0%, #eef2ff 100%) !important;
    color: color-mix(in srgb, var(--club-accent) 75%, #1e293b) !important;
    border: 1px solid color-mix(in srgb, var(--club-accent) 26%, #dbeafe);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.admin-page #view-clubs #admin-club-list .admin-club-card__title {
    color: #0f172a !important;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__status-pill {
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.admin-page #view-clubs #admin-club-list .admin-club-card__switch-track {
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.admin-page #view-clubs #admin-club-list .admin-club-card__status-text {
    letter-spacing: 0.01em;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.95rem;
    height: 1.95rem;
    border-radius: 0.62rem;
    border: 1px solid #dbe5f2;
    background: #f8fafc;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.05);
}

.admin-page #view-clubs #admin-club-list .admin-club-card__icon-btn--edit:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__icon-btn--delete:hover {
    border-color: #fecaca;
    background: #fff1f2;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__meta {
    color: #475569 !important;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__meta-item {
    padding: 0.22rem 0.36rem;
    border-radius: 0.62rem;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__meta-item:hover {
    border-color: #dbe5f2;
    background: rgba(248, 250, 252, 0.8);
}

.admin-page #view-clubs #admin-club-list .admin-club-card__meta-item svg {
    color: color-mix(in srgb, var(--club-accent) 68%, #475569);
}

.admin-page #view-clubs #admin-club-list .admin-club-card__progress {
    padding: 0.24rem 0.18rem 0 0.18rem;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__progress-meta {
    color: #475569;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__progress-track {
    height: 0.4rem !important;
    background: #e9eff7 !important;
    border: 1px solid rgba(203, 213, 225, 0.65);
}

.admin-page #view-clubs #admin-club-list .admin-club-card__progress-fill {
    background: linear-gradient(90deg, var(--club-accent) 0%, var(--club-accent-2) 100%) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.admin-page #view-clubs #admin-club-list .admin-club-card.is-full .admin-club-card__progress-fill {
    background: linear-gradient(90deg, #ef4444 0%, #fb7185 100%) !important;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__members-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    color: color-mix(in srgb, var(--club-accent) 72%, #4338ca) !important;
    background: linear-gradient(180deg, #f9fbff 0%, #f4f8ff 100%) !important;
    border-top-color: #dce7f5 !important;
    letter-spacing: 0.01em;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__members-btn::before {
    content: "\1F465";
    font-size: 0.86rem;
    line-height: 1;
    opacity: 0.85;
}

.admin-page #view-clubs #admin-club-list .admin-club-card__members-btn:hover {
    color: #1d4ed8 !important;
    background: linear-gradient(180deg, #f0f8ff 0%, #e9f4ff 100%) !important;
}

@media (max-width: 767px) {
    .admin-page #view-clubs #admin-club-list .admin-club-card {
        border-radius: 1rem;
    }

    .admin-page #view-clubs #admin-club-list .admin-club-card::after {
        width: 120px;
        height: 120px;
        top: -50px;
        right: -30px;
    }

    .admin-page #view-clubs #admin-club-list .admin-club-card__body {
        padding: 1rem !important;
    }

    .admin-page #view-clubs #admin-club-list .admin-club-card__icon-btn {
        width: 1.88rem;
        height: 1.88rem;
        border-radius: 0.58rem;
    }
}

.view-toolbar__actions button,
.view-toolbar__actions a,
.view-toolbar__actions input,
.view-toolbar__actions select {
    min-height: 44px;
}

.admin-page #teacher-list-cards {
    gap: 1rem;
}

.admin-page #teacher-list-cards.is-visible {
    display: grid !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .admin-page #teacher-list-cards.is-visible {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .admin-page .view-toolbar:not(.view-toolbar--static) {
        top: calc(var(--app-header-height) + 0.45rem);
    }

    .admin-page #view-clubs .view-toolbar {
        margin-bottom: 0;
    }

    .admin-page #view-clubs #admin-club-list {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin-top: 0.9rem;
    }

    .admin-page .admin-content,
    .teacher-modern-ui .admin-content {
        padding-bottom: calc(var(--bottom-nav-height) + var(--mobile-viewport-offset-bottom) + env(safe-area-inset-bottom) + 1.1rem) !important;
    }

    .student-main.app-mobile-content-shell {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important;
    }

    .admin-page .teacher-table-shell.is-hidden-mobile {
        display: none !important;
    }

    .admin-page #teacher-list-cards.is-visible {
        padding: 0.55rem 0.55rem 0.7rem;
        width: 100%;
        box-sizing: border-box;
    }

    .admin-page #teacher-pagination,
    .admin-page #admin-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .admin-page #teacher-pagination > div:last-child,
    .admin-page #admin-pagination > div:last-child {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
        width: 100%;
    }

    .admin-page #teacher-pagination button,
    .admin-page #admin-pagination button {
        width: 100%;
        min-height: 44px;
        border-radius: 14px;
    }

    .admin-page #view-students .app-card::before,
    .admin-page #view-places .app-card::before,
    .admin-page #teacher-panel-card.app-card::before,
    #dashboard-view .club-toolbar-shell.app-card::before {
        opacity: 0.1;
    }
}

.admin-page .admin-student-mobile-toggle {
    display: none;
}

.admin-page .admin-student-desktop-student-id {
    display: inline-flex;
    align-items: center;
}

.admin-page .admin-student-mobile-toggle-arrow svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

@media (max-width: 767px) {
    .admin-page .mobile-card-table tr {
        margin-bottom: 0.85rem;
        border-radius: 18px;
        box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    }

    .admin-page .mobile-card-table td {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        padding: 0.82rem 0.95rem !important;
    }

    .admin-page .mobile-card-table td::before {
        margin-right: 0;
    }

    .admin-page .mobile-card-table td > * {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        text-align: left;
    }

    .admin-page .mobile-card-table td[data-label="กิจกรรมที่จอง"] > *,
    .admin-page .mobile-card-table td[data-label="ชุมนุมที่รับผิดชอบ"] > *,
    .admin-page .mobile-card-table td[data-label="สถานที่"] > *,
    .admin-page .mobile-card-table td[data-label="ชื่อ-นามสกุล"] > *,
    .admin-page .mobile-card-table td[data-label="ชื่อครู"] > * {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .admin-page .mobile-card-table td[data-label="จัดการ"] > * {
        max-width: 100%;
    }

    .admin-page .mobile-card-table td[data-label="จัดการ"] .flex,
    .admin-page .mobile-card-table td[data-label="จัดการ"] .inline-flex {
        width: 100%;
        display: flex !important;
        flex-wrap: wrap;
        justify-content: stretch !important;
        gap: 0.55rem;
    }

    .admin-page .mobile-card-table td[data-label="จัดการ"] button,
    .admin-page .mobile-card-table td[data-label="จัดการ"] a {
        flex: 1 1 calc(50% - 0.35rem);
        min-height: 42px;
        border-radius: 14px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center !important;
    }

    .admin-page #view-places .mobile-card-table tr {
        margin-bottom: 0.6rem;
        border-radius: 14px;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    }

    .admin-page #view-places .mobile-card-table td {
        gap: 0.22rem;
        padding: 0.58rem 0.72rem !important;
        border-bottom: 1px dashed #e5e7eb;
    }

    .admin-page #view-places .mobile-card-table td::before {
        font-size: 0.58rem;
        letter-spacing: 0.03em;
    }

    .admin-page #view-places .mobile-card-table td[data-label="สถานะ"] > *,
    .admin-page #view-places .mobile-card-table td[data-label="ใช้งานในชุมนุม"] > * {
        display: inline-flex;
        width: auto;
        max-width: 100%;
    }

    .admin-page #view-places .mobile-card-table td[data-label="จัดการ"] .inline-flex {
        gap: 0.4rem;
    }

    .admin-page #view-places .mobile-card-table td[data-label="จัดการ"] button {
        min-height: 34px;
        padding: 0.38rem 0.55rem !important;
        border-radius: 11px !important;
        font-size: 0.72rem !important;
    }

    .admin-page #admin-recent-registrations-panel .mobile-card-table tr {
        margin-bottom: 0.48rem;
        border-radius: 12px;
        border: 1px solid #dbe3f2;
        border-left: 3px solid #8b5cf6;
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        box-shadow: 0 8px 18px rgba(30, 41, 59, 0.06);
    }

    .admin-page #admin-recent-registrations-panel .mobile-card-table td {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem;
        padding: 0.34rem 0.64rem !important;
    }

    .admin-page #admin-recent-registrations-panel .mobile-card-table td::before {
        font-size: 0.56rem;
        letter-spacing: 0.03em;
        color: #64748b;
        flex: 0 0 auto;
        padding-left: 1.1rem;
        background-size: 12px 12px;
    }

    .admin-page #admin-recent-registrations-panel .mobile-card-table td > * {
        width: auto;
        max-width: 68%;
        margin-left: auto;
        text-align: right;
    }

    .admin-page #admin-recent-registrations-panel .mobile-card-table td[data-label="ชุมนุม"] > * {
        max-width: 100%;
        white-space: normal !important;
        word-break: break-word;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-chip {
        min-height: 20px;
        padding: 0.1rem 0.45rem !important;
        border-radius: 999px !important;
        font-size: 0.66rem !important;
        line-height: 1.15 !important;
        letter-spacing: 0.01em;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-chip--index {
        min-width: 22px;
        justify-content: center;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-chip--time {
        background: #eef2ff !important;
        color: #3730a3 !important;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-chip--name {
        background: #f1f5f9 !important;
        color: #334155 !important;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-chip--club {
        background: #f5f3ff !important;
        color: #6d28d9 !important;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-summary-cell {
        padding: 0.42rem 0.58rem !important;
        border-bottom: 0 !important;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-summary-cell > * {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        text-align: left !important;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-summary-cell::before {
        display: none !important;
        content: none !important;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-card {
        width: 100%;
        border: 1px solid #dbeafe;
        border-radius: 12px;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        padding: 0.45rem 0.55rem;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem;
        margin-bottom: 0.28rem;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-index {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 30px;
        height: 20px;
        border-radius: 999px;
        background: #eef2ff;
        color: #4338ca;
        font-size: 0.62rem;
        font-weight: 700;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-time {
        display: inline-flex;
        align-items: center;
        height: 20px;
        border-radius: 999px;
        background: #f1f5f9;
        color: #334155;
        font-size: 0.62rem;
        font-weight: 700;
        padding: 0 0.45rem;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-name {
        margin: 0 0 0.3rem 0;
        font-size: 0.72rem;
        font-weight: 700;
        color: #1f2937;
        line-height: 1.25;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-chip-wrap {
        display: flex;
        flex-wrap: wrap;
        gap: 0.26rem;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-chip {
        display: inline-flex;
        align-items: center;
        max-width: 100%;
        min-height: 18px;
        border-radius: 999px;
        padding: 0.08rem 0.45rem;
        font-size: 0.62rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-chip--id {
        background: #eef2ff;
        color: #4338ca;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-chip--level {
        background: #e0f2fe;
        color: #075985;
    }

    .admin-page #admin-recent-registrations-panel .recent-reg-mobile-chip--club {
        background: #f5f3ff;
        color: #6d28d9;
    }

    .admin-page .mobile-card-table tr.admin-student-mobile-collapsible.is-expanded {
        border-color: #c7d2fe;
        box-shadow: 0 16px 32px rgba(79, 70, 229, 0.16);
    }

    .admin-page .mobile-card-table td.admin-student-mobile-summary-cell {
        display: block !important;
        padding: 0 !important;
        border-bottom: 0 !important;
        background: transparent;
    }

    .admin-page .mobile-card-table td.admin-student-mobile-summary-cell::before {
        display: none !important;
        content: none !important;
    }

    .admin-page .mobile-card-table td.admin-student-mobile-summary-cell > * {
        margin-left: 0;
        max-width: 100%;
        text-align: left;
    }

    .admin-page .admin-student-desktop-student-id {
        display: none;
    }

    .admin-page .admin-student-mobile-toggle {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #0f172a;
        padding: 12px 14px;
        text-align: left;
    }

    .admin-page .admin-student-mobile-toggle-top {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .admin-page .admin-student-mobile-toggle-index {
        display: inline-flex;
        align-items: center;
        min-height: 22px;
        padding: 0 8px;
        border-radius: 999px;
        border: 1px solid #cbd5e1;
        background: #f8fafc;
        color: #475569;
        font-size: 11px;
        font-weight: 700;
    }

    .admin-page .admin-student-mobile-toggle-arrow {
        width: 22px;
        height: 22px;
        border-radius: 999px;
        border: 1px solid #d8dffe;
        background: #eef2ff;
        color: #4f46e5;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-page .admin-student-mobile-toggle-name {
        width: 100%;
        font-size: 15px;
        font-weight: 700;
        color: #0f172a;
        line-height: 1.3;
    }

    .admin-page .admin-student-mobile-toggle-meta {
        width: 100%;
        font-size: 12px;
        color: #64748b;
        line-height: 1.3;
    }

    .admin-page .admin-student-mobile-toggle-main {
        width: 100%;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.62rem;
    }

    .admin-page .admin-student-mobile-toggle-copy {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.12rem;
    }

    .admin-page .admin-student-mobile-summary-badges {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.38rem;
    }

    .admin-page .admin-student-mobile-summary-badges .inline-flex {
        justify-content: center;
        text-align: center;
    }

    .admin-page .mobile-card-table tr.admin-student-mobile-collapsible.is-expanded td.admin-student-mobile-summary-cell {
        border-bottom: 1px dashed #e2e8f0 !important;
    }

    .admin-page .mobile-card-table tr.admin-student-mobile-collapsible.is-collapsed td:not(.admin-student-mobile-summary-cell) {
        display: none !important;
    }

    .admin-page .mobile-card-table tr.admin-student-mobile-collapsible.is-expanded td:not(.admin-student-mobile-summary-cell) {
        display: flex !important;
    }

    .admin-page .mobile-card-table tr.admin-student-mobile-collapsible.is-expanded .admin-student-mobile-toggle-arrow svg {
        transform: rotate(180deg);
    }

    .admin-page #teacher-list-cards.is-visible {
        grid-template-columns: 1fr;
        padding: 0.45rem 0.5rem 0.7rem;
    }

    .admin-page #teacher-list-cards.is-visible article {
        border-radius: 20px;
        width: 100%;
        max-width: 100%;
    }

    .admin-page .view-toolbar__actions > * {
        min-width: max-content;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions > * {
        min-width: 0 !important;
    }

    .admin-page #view-teachers .view-toolbar {
        display: block;
    }

    .admin-page #view-teachers .view-toolbar__meta {
        margin-bottom: 0.58rem;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions {
        display: grid !important;
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        width: 100%;
        gap: 0.36rem !important;
        overflow: visible !important;
        padding-bottom: 0 !important;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn {
        min-height: 38px;
        padding: 0 !important;
        gap: 0 !important;
        border-radius: 11px;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn__label {
        display: none !important;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn svg,
    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn img {
        width: 17px;
        height: 17px;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn--ghost {
        background: #f8fafc;
        color: #475569;
        border-color: #dbe2ec;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn--blue {
        background: #eff6ff;
        color: #1d4ed8;
        border-color: #bfdbfe;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn--sky {
        background: #ecfeff;
        color: #0369a1;
        border-color: #bae6fd;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn--emerald {
        background: #ecfdf5;
        color: #047857;
        border-color: #bbf7d0;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn--danger {
        background: #fff1f2;
        color: #dc2626;
        border-color: #fecdd3;
    }

    .admin-page #view-teachers .admin-teacher-toolbar-actions .admin-teacher-action-btn--primary {
        background: #eef2ff;
        color: #4338ca;
        border-color: #c7d2fe;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions,
    .admin-page #view-students .admin-student-toolbar-actions,
    .admin-page #view-places .admin-place-toolbar-actions {
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        width: 100%;
        gap: 0.36rem !important;
        overflow: visible !important;
        padding-bottom: 0 !important;
    }

    .admin-page #view-students .admin-student-toolbar-actions {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }

    .admin-page #view-clubs .view-toolbar,
    .admin-page #view-students .view-toolbar,
    .admin-page #view-places .view-toolbar {
        display: block;
    }

    .admin-page #view-clubs .view-toolbar__meta,
    .admin-page #view-students .view-toolbar__meta,
    .admin-page #view-places .view-toolbar__meta {
        margin-bottom: 0.58rem;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions > *,
    .admin-page #view-students .admin-student-toolbar-actions > *,
    .admin-page #view-places .admin-place-toolbar-actions > * {
        min-width: 0 !important;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn {
        min-height: 38px;
        padding: 0 !important;
        gap: 0 !important;
        border-radius: 11px;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn__label,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn__label,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn__label {
        display: none !important;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn svg,
    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn img,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn svg,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn img,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn svg,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn img {
        width: 17px;
        height: 17px;
    }

    .admin-page #view-places .admin-place-toolbar-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn--ghost,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn--ghost,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn--ghost {
        background: #f8fafc;
        color: #475569;
        border-color: #dbe2ec;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn--blue,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn--blue,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn--blue {
        background: #eff6ff;
        color: #1d4ed8;
        border-color: #bfdbfe;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn--sky,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn--sky,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn--sky {
        background: #ecfeff;
        color: #0369a1;
        border-color: #bae6fd;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn--emerald,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn--emerald,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn--emerald {
        background: #ecfdf5;
        color: #047857;
        border-color: #bbf7d0;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn--danger,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn--danger,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn--danger {
        background: #fff1f2;
        color: #dc2626;
        border-color: #fecdd3;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn--primary,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn--primary,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn--primary {
        background: #eef2ff;
        color: #4338ca;
        border-color: #c7d2fe;
    }

    .admin-page #view-clubs .admin-club-toolbar-actions .admin-teacher-action-btn--rose,
    .admin-page #view-students .admin-student-toolbar-actions .admin-teacher-action-btn--rose,
    .admin-page #view-places .admin-place-toolbar-actions .admin-teacher-action-btn--rose {
        background: #fff1f2;
        color: #be123c;
        border-color: #fecdd3;
    }

    #dashboard-view .club-toolbar-shell.app-card {
        padding: 0.72rem !important;
    }

    #dashboard-view .club-toolbar-shell > .flex {
        gap: 0.8rem !important;
    }

    #dashboard-view .club-toolbar-shell .relative.w-full.md\:w-72 input {
        min-height: 46px;
        border-radius: 18px;
    }

    #table-modal .club-modal-panel {
        width: min(100%, 32rem) !important;
        max-height: calc(100dvh - 1rem) !important;
    }
}

@media (max-width: 480px) {
    .admin-page .mobile-card-table td[data-label="จัดการ"] button,
    .admin-page .mobile-card-table td[data-label="จัดการ"] a {
        flex-basis: 100%;
    }

    .admin-page #teacher-pagination > div:last-child,
    .admin-page #admin-pagination > div:last-child {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Admin Teacher Cards + Club Form Modal
   ========================================= */
.admin-page .admin-teacher-card {
    border-radius: 18px;
    border: 1px solid #dbe5f4;
    background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.admin-page .admin-teacher-card__tone {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
}

.admin-page .admin-teacher-card__tone.is-has-club {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.admin-page .admin-teacher-card__tone.is-no-club {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.admin-page .admin-teacher-card__body {
    position: relative;
    padding: 0.78rem 0.82rem 0.84rem;
}

.admin-page .admin-teacher-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.55rem;
}

.admin-page .admin-teacher-card__title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.52rem;
    min-width: 0;
}

.admin-page .admin-teacher-card__index {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid #dbe4f8;
    background: #eef2ff;
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 auto;
}

.admin-page .admin-teacher-card__kicker {
    margin: 0;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
}

.admin-page .admin-teacher-card__name {
    margin: 2px 0 0;
    font-size: 16px;
    line-height: 1.2;
    color: #0f172a;
    font-weight: 700;
}

.admin-page .admin-teacher-card__status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.admin-page .admin-teacher-card__status.is-has-club {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #047857;
}

.admin-page .admin-teacher-card__status.is-no-club {
    background: #ffedd5;
    border-color: #fed7aa;
    color: #b45309;
}

.admin-page .admin-teacher-card__meta-grid {
    margin-top: 0.62rem;
    display: grid;
    gap: 0.5rem;
}

.admin-page .admin-teacher-card__meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.48rem;
    border: 1px solid #dde6f5;
    border-radius: 12px;
    padding: 0.5rem 0.58rem;
    background: #ffffff;
}

.admin-page .admin-teacher-card__meta-icon {
    width: 20px;
    height: 20px;
    border-radius: 8px;
    border: 1px solid #dbe4f8;
    color: #4f46e5;
    background: #eef2ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.admin-page .admin-teacher-card__meta-icon svg {
    width: 12px;
    height: 12px;
}

.admin-page .admin-teacher-card__meta-label {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.admin-page .admin-teacher-card__meta-value {
    margin: 2px 0 0;
    font-size: 14px;
    line-height: 1.22;
    font-weight: 700;
    color: #0f172a;
}

.admin-page .admin-teacher-card__meta-value.is-has-club {
    color: #047857;
}

.admin-page .admin-teacher-card__meta-value.is-no-club {
    color: #b45309;
}

.admin-page .admin-teacher-card__club {
    margin-top: 0.5rem;
    border: 1px solid #dbe5f7;
    border-radius: 12px;
    padding: 0.56rem 0.62rem;
    background: #f8fbff;
}

.admin-page .admin-teacher-card__club-head {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.18rem;
}

.admin-page .admin-teacher-card__club-head .admin-teacher-card__meta-icon {
    width: 18px;
    height: 18px;
}

.admin-page .admin-teacher-card__actions {
    margin-top: 0.62rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
}

.admin-page .admin-teacher-card-btn {
    min-height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.admin-page .admin-teacher-card-btn svg {
    width: 13px;
    height: 13px;
}

.admin-page .admin-teacher-card-btn--edit {
    color: #4338ca;
    background: #eef2ff;
    border-color: #dbe4ff;
}

.admin-page .admin-teacher-card-btn--edit:hover {
    background: #e0e7ff;
}

.admin-page .admin-teacher-card-btn--delete {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

.admin-page .admin-teacher-card-btn--delete:hover {
    background: #fee2e2;
}

@media (min-width: 768px) {
    .admin-page #admin-recent-registrations-panel h3 {
        font-size: 1.2rem;
    }

    .admin-page #admin-recent-registrations-meta,
    .admin-page #admin-recent-registrations-panel .text-xs {
        font-size: 0.9rem !important;
    }

    .admin-page #admin-recent-registrations-panel table thead th {
        font-size: 0.8rem;
        letter-spacing: 0.05em;
    }

    .admin-page #admin-recent-registrations-list td {
        font-size: 0.95rem;
    }

    .admin-page #admin-recent-registrations-list .recent-reg-chip {
        font-size: 0.82rem !important;
        min-height: 26px;
        padding: 0.2rem 0.62rem !important;
    }
}

#club-form-modal .admin-club-form-panel {
    width: min(calc(100vw - 1rem), 42rem) !important;
    max-height: calc(100dvh - 4.2rem) !important;
    border-radius: 18px !important;
    padding: 1rem !important;
}

#club-form-modal .admin-club-form-header {
    position: sticky;
    top: -1px;
    z-index: 4;
    background: #fff;
    padding-bottom: 0.55rem;
    margin-bottom: 0.62rem;
    border-bottom: 1px solid #e8eefb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

#club-form-modal .admin-club-form-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

#club-form-modal .admin-club-form-close-btn:hover {
    color: #0f172a;
    border-color: #cbd5e1;
    background: #f1f5f9;
}

#club-form-modal #club-form > .mt-6.flex.gap-3 {
    position: sticky;
    bottom: -1px;
    z-index: 4;
    background: #fff;
    margin-top: 0.7rem;
    padding-top: 0.68rem;
    border-top: 1px solid #e8eefb;
}

@media (max-width: 1023px) {
    #club-form-modal .admin-club-form-panel {
        width: min(calc(100vw - 0.7rem), 34rem) !important;
        max-height: calc(100dvh - 3.15rem) !important;
        border-radius: 16px !important;
        padding: 0.88rem !important;
    }
}

/* =========================================
   Admin System Settings Redesign
   ========================================= */
#view-system .view-toolbar--static {
    position: relative;
    overflow: hidden;
    border: 1px solid #dde5f7;
    border-radius: 20px;
    padding: 1rem 1.2rem;
    background:
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.14), transparent 56%),
        linear-gradient(135deg, #f9fbff 0%, #f3f7ff 100%);
}

#view-system .view-toolbar--static::after {
    content: "";
    position: absolute;
    inset: auto -20% -55% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.16) 0%, rgba(79, 70, 229, 0) 72%);
    pointer-events: none;
}

#view-system .view-toolbar--static h2 {
    color: #0f172a !important;
}

#view-system .view-toolbar--static p {
    max-width: 68ch;
    color: #475569 !important;
}

#view-system .system-settings-stack {
    display: grid;
    gap: 1rem;
}

#view-system .system-settings-stack > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0 !important;
}

#view-system .system-settings-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px !important;
    border: 1px solid #dbe3f4 !important;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#view-system .system-settings-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5 0%, #a855f7 100%);
    opacity: 0.85;
}

#view-system .system-settings-card:hover {
    transform: translateY(-2px);
    border-color: #c8d5f3 !important;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.11);
}

#view-system .system-settings-card > h3 {
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #ecf1fb;
    letter-spacing: 0.01em;
}

#view-system .system-settings-card > h3 svg {
    width: 1.2rem;
    height: 1.2rem;
    padding: 0.2rem;
    border-radius: 0.5rem;
    background: #eef2ff;
}

#view-system .system-settings-card--danger {
    border-color: #fecdd3 !important;
    background: linear-gradient(180deg, #fffafa 0%, #fff5f5 100%);
}

#view-system .system-settings-card--danger::before {
    background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}

#view-system .system-settings-card--danger > h3 {
    border-color: #fee2e2;
}

#view-system .system-settings-card--danger > h3 svg {
    background: #fee2e2;
}

#view-system .system-settings-card .bg-gray-50 {
    border: 1px solid #e7ecf8;
    background: linear-gradient(180deg, #f9fbff 0%, #f3f6ff 100%) !important;
}

#view-system .system-settings-card .rounded-lg,
#view-system .system-settings-card .rounded-xl {
    border-radius: 14px !important;
}

#view-system #schedule-info-display {
    border-radius: 14px !important;
    border-color: #cddaf6 !important;
    background: linear-gradient(180deg, #eff4ff 0%, #e7efff 100%) !important;
}

#view-system section {
    border-width: 1px !important;
    border-radius: 16px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#view-system section > .flex.items-center.gap-2,
#view-system section > .flex.items-center.justify-between.gap-2 {
    padding-bottom: 0.65rem;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.32);
    margin-bottom: 0.85rem !important;
}

#view-system input[type="text"],
#view-system input[type="number"],
#view-system input[type="datetime-local"],
#view-system select {
    border-radius: 12px !important;
    border-color: #d7dfef !important;
    background-color: #fff !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

#view-system input[type="text"]:focus,
#view-system input[type="number"]:focus,
#view-system input[type="datetime-local"]:focus,
#view-system select:focus {
    border-color: color-mix(in srgb, var(--site-primary-color, #4f46e5) 56%, #ffffff) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-primary-color, #4f46e5) 20%, transparent) !important;
}

#view-system input[type="color"] {
    width: 100%;
    height: 48px;
    padding: 0.32rem;
    border: 1px solid #d1dcf5;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 5px 12px rgba(37, 99, 235, 0.06);
}

#view-system input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

#view-system input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

#view-system input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 8px;
}

#view-system .system-settings-save-btn {
    min-height: 50px;
    border-radius: 14px !important;
    border: 1px solid rgba(79, 70, 229, 0.22);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.3);
    letter-spacing: 0.01em;
}

#view-system .system-settings-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 28px rgba(79, 70, 229, 0.34);
}

@media (min-width: 1024px) {
    #view-system .system-settings-stack {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 1.1rem;
    }

    #view-system .system-settings-card--status,
    #view-system .system-settings-card--schedule,
    #view-system .system-settings-card--cancel,
    #view-system .system-settings-card--club,
    #view-system .system-settings-card--levels {
        grid-column: span 6;
    }

    #view-system .system-settings-card--core,
    #view-system .system-settings-card--branding,
    #view-system .system-settings-card--theme-admin,
    #view-system .system-settings-card--theme-public,
    #view-system .system-settings-card--theme-card,
    #view-system .system-settings-card--term,
    #view-system .system-settings-card--danger {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    #view-system .view-toolbar--static {
        padding: 0.9rem 0.95rem;
        border-radius: 16px;
    }

    #view-system .system-settings-card {
        border-radius: 16px !important;
        padding: 1rem !important;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    }

    #view-system .system-settings-card > h3 {
        font-size: 0.97rem !important;
        margin-bottom: 0.8rem !important;
        padding-bottom: 0.6rem;
    }

    #view-system .system-settings-card .grid {
        gap: 0.62rem !important;
    }

    #view-system input[type="color"] {
        height: 44px;
    }

    #view-system .system-settings-save-btn {
        min-height: 48px;
        font-size: 0.93rem !important;
    }
}

/* =========================================
   Mobile Scroll Stability (Admin)
   ========================================= */
@media (max-width: 1023px) {
    .admin-page #admin-sidebar,
    .admin-page .admin-sidebar {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .admin-page #admin-mobile-bottom-nav.app-mobile-dock {
        display: grid !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 82 !important;
    }

    body.admin-page {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: auto;
        padding-bottom: 0 !important;
        scroll-padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px) + 0.8rem);
    }

    .admin-page .admin-layout {
        height: auto !important;
        min-height: calc(100vh - var(--app-header-height)) !important;
        min-height: calc(100dvh - var(--app-header-height)) !important;
        overflow: visible !important;
        padding-bottom: 0 !important;
    }

    .admin-page .admin-main {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    .admin-page .admin-content {
        overflow: visible !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: auto;
        min-height: auto !important;
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px) + 0.95rem) !important;
        scroll-padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px) + 1rem);
    }

    .admin-page .site-footer-shell {
        margin-top: 0 !important;
    }

    .admin-page .admin-footer {
        margin-top: 0 !important;
        padding: 0.72rem 1rem !important;
        margin-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--mobile-viewport-offset-bottom, 0px) + 0.4rem) !important;
        border-top: 1px solid rgba(148, 163, 184, 0.2);
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .admin-page .site-footer-line {
        white-space: normal;
        text-align: center;
        line-height: 1.35;
        font-size: clamp(10px, 2.7vw, 12px);
    }

    .admin-page .site-footer-link {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* =========================================
   Public Announcement
   ========================================= */
.public-announcement-card {
    position: relative;
    border: 1px solid #dbe7ff;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.public-announcement-stack {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

@media (min-width: 1280px) {
    .public-announcement-stack {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .public-announcement-stack .public-announcement-card {
        height: 100%;
    }

    .public-announcement-stack .public-announcement-image {
        max-height: none;
    }
}

.public-announcement-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, #ef4444 0%, #f97316 52%, #facc15 100%);
}

.public-announcement-head {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    padding: 1.2rem 1.25rem 0.75rem;
}

.public-announcement-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.75rem;
    background: #eff6ff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.public-announcement-title {
    margin: 0;
    color: #111827;
    font-size: clamp(1.1rem, 2.8vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.public-announcement-content {
    padding: 0 1.25rem 1rem;
    color: #111827;
    line-height: 1.78;
    font-size: clamp(0.98rem, 2vw, 1.05rem);
}

.public-announcement-content > *:first-child {
    margin-top: 0;
}

.public-announcement-content > *:last-child {
    margin-bottom: 0;
}

.public-announcement-content h3 {
    margin: 0.35rem 0 0.65rem;
    font-size: clamp(1.12rem, 2.5vw, 1.44rem);
    font-weight: 800;
    color: #0f766e;
}

.public-announcement-content h4 {
    margin: 0.3rem 0 0.6rem;
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    font-weight: 700;
    color: #0f172a;
}

.public-announcement-content p {
    margin: 0.4rem 0 0.6rem;
}

.public-announcement-content ul,
.public-announcement-content ol {
    margin: 0.25rem 0 0.9rem 1.4rem;
    padding: 0;
}

.public-announcement-content li {
    margin: 0.2rem 0;
}

.public-announcement-content blockquote {
    margin: 0.65rem 0;
    padding: 0.7rem 0.9rem;
    border-left: 4px solid #60a5fa;
    border-radius: 0.6rem;
    background: #eff6ff;
    color: #1e3a8a;
}

.public-announcement-content a {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.public-announcement-image-wrap {
    padding: 0 1.25rem 1.1rem;
}

.public-announcement-gallery {
    display: grid;
    gap: 0.65rem;
    width: min(70%, 980px);
    margin-inline: auto;
    --announcement-inline-slide-duration: 5200ms;
}

.public-announcement-image-button {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    border: 0;
    border-radius: 0.95rem;
    overflow: hidden;
    background: #e2e8f0;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.public-announcement-image-button:hover {
    transform: translateY(-1px);
}

.public-announcement-image-button::after {
    content: "คลิกเพื่อขยาย";
    position: absolute;
    right: 0.72rem;
    bottom: 0.72rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #e2e8f0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.public-announcement-image {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    border: 1px solid #dbeafe;
    display: block;
    object-fit: contain;
    object-position: center;
    max-height: none;
    background: #f8fafc;
}

.public-announcement-gallery.is-auto-slideshow .public-announcement-image {
    transition: opacity 0.28s ease, transform 0.42s ease;
}

.public-announcement-gallery.is-auto-slideshow .public-announcement-image.is-slide-changing {
    opacity: 0.55;
    transform: scale(1.015);
}

.public-announcement-image-badge {
    position: absolute;
    left: 0.72rem;
    bottom: 0.72rem;
    padding: 0.24rem 0.68rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(79, 70, 229, 0.95) 100%);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.public-announcement-thumb-row {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.14rem;
    scrollbar-width: thin;
}

.public-announcement-thumb-row::-webkit-scrollbar {
    height: 6px;
}

.public-announcement-thumb-row::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 999px;
}

.public-announcement-thumb {
    flex: 0 0 auto;
    width: 5.2rem;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 2px solid transparent;
    border-radius: 0.66rem;
    padding: 0;
    overflow: hidden;
    background: #e2e8f0;
    cursor: zoom-in;
    transition: all 0.2s ease;
}

.public-announcement-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.public-announcement-thumb:hover {
    transform: translateY(-1px);
    border-color: #93c5fd;
}

.public-announcement-thumb.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.public-announcement-inline-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.52rem;
    margin-top: -0.1rem;
}

.public-announcement-inline-nav {
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(148, 163, 184, 0.48);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #1e3a8a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.06rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.public-announcement-inline-nav:hover {
    background: #eff6ff;
    border-color: rgba(59, 130, 246, 0.58);
    transform: translateY(-1px);
}

.public-announcement-inline-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
}

.public-announcement-inline-dot {
    width: 0.48rem;
    height: 0.48rem;
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.55);
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.public-announcement-inline-dot:hover {
    transform: scale(1.12);
}

.public-announcement-inline-dot.is-active {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
}

.public-announcement-inline-progress {
    width: min(100%, 9.2rem);
    height: 0.24rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(203, 213, 225, 0.72);
}

.public-announcement-inline-progress-bar {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%);
}

.public-announcement-inline-progress-bar.is-running {
    animation: announcementInlineProgress var(--announcement-inline-slide-duration, 5200ms) linear forwards;
}

@keyframes announcementInlineProgress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

body.announcement-lightbox-open {
    overflow: hidden;
}

.public-announcement-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.8rem, 2.5vw, 2rem);
}

.public-announcement-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.public-announcement-lightbox-panel {
    position: relative;
    z-index: 1;
    width: min(1080px, 100%);
    max-height: min(92vh, 940px);
    border-radius: 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.9) 100%);
    color: #e2e8f0;
    padding: clamp(0.82rem, 2vw, 1.16rem);
    display: grid;
    gap: 0.66rem;
    box-shadow: 0 28px 75px rgba(2, 6, 23, 0.55);
    animation: announcementLightboxIn 0.22s ease;
}

.public-announcement-lightbox-close {
    position: absolute;
    top: 0.82rem;
    right: 0.82rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.public-announcement-lightbox-close:hover {
    background: rgba(30, 41, 59, 0.95);
    color: #ffffff;
}

.public-announcement-lightbox-close svg {
    width: 1rem;
    height: 1rem;
}

.public-announcement-lightbox-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.72rem;
    padding-right: 2.8rem;
}

.public-announcement-lightbox-title {
    margin: 0;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.3;
}

.public-announcement-lightbox-counter {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #93c5fd;
}

.public-announcement-lightbox-stage {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.64);
    min-height: min(62vh, 680px);
    display: grid;
    place-items: center;
}

.public-announcement-lightbox-image {
    width: 100%;
    height: min(70vh, 700px);
    display: block;
    object-fit: contain;
}

.public-announcement-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.72);
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.public-announcement-lightbox-nav:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.92);
    border-color: rgba(191, 219, 254, 0.95);
}

.public-announcement-lightbox-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.public-announcement-lightbox-nav svg {
    width: 1.1rem;
    height: 1.1rem;
}

.public-announcement-lightbox-nav.is-prev {
    left: 0.72rem;
}

.public-announcement-lightbox-nav.is-next {
    right: 0.72rem;
}

.public-announcement-lightbox-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.34rem;
    min-height: 0.9rem;
}

.public-announcement-lightbox-dot {
    width: 0.55rem;
    height: 0.55rem;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: rgba(148, 163, 184, 0.45);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.public-announcement-lightbox-dot:hover {
    transform: scale(1.1);
}

.public-announcement-lightbox-dot.is-active {
    background: #60a5fa;
}

.public-announcement-lightbox.is-single .public-announcement-lightbox-nav,
.public-announcement-lightbox.is-single .public-announcement-lightbox-dots {
    display: none;
}

@keyframes announcementLightboxIn {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 900px) {
    .public-announcement-gallery {
        width: min(85%, 860px);
    }

    .public-announcement-image {
        max-height: none;
    }

    .public-announcement-lightbox-panel {
        max-height: 94vh;
        padding: 0.72rem;
        gap: 0.58rem;
    }

    .public-announcement-lightbox-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
        padding-right: 2.5rem;
    }

    .public-announcement-lightbox-stage {
        min-height: min(54vh, 460px);
    }

    .public-announcement-lightbox-image {
        height: min(66vh, 560px);
    }

    .public-announcement-lightbox-nav {
        width: 2.4rem;
        height: 2.4rem;
    }
}

@media (max-width: 640px) {
    .public-announcement-gallery {
        width: 100%;
    }

    .public-announcement-image-wrap {
        padding: 0 1rem 0.96rem;
    }

    .public-announcement-image {
        max-height: none;
    }

    .public-announcement-image-button::after {
        font-size: 0.66rem;
        padding: 0.2rem 0.52rem;
    }

    .public-announcement-thumb {
        width: 4.1rem;
    }

    .public-announcement-lightbox-panel {
        border-radius: 0.9rem;
    }

    .public-announcement-lightbox-nav {
        width: 2.12rem;
        height: 2.12rem;
    }
}

.notice-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.24rem 0.85rem;
    font-size: 0.98em;
    font-weight: 700;
    color: #ffffff;
    background: #e11d74;
}

.notice-chip--pink {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d74 100%);
}

.notice-chip--blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.notice-chip--amber {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.notice-color-red {
    color: #dc2626;
    font-weight: 700;
}

.notice-color-blue {
    color: #1d4ed8;
    font-weight: 700;
}

.notice-color-teal {
    color: #0f766e;
    font-weight: 700;
}

.notice-color-orange {
    color: #ea580c;
    font-weight: 700;
}

.notice-lead {
    font-size: 1.06em;
    font-weight: 600;
}

/* =========================================
   Announcement Editor (Admin)
   ========================================= */
.announcement-item-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-height: 12rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.announcement-item-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.46rem;
    border: 1px solid #fbcfe8;
    background: #ffffff;
    color: #334155;
    border-radius: 999px;
    padding: 0.35rem 0.72rem;
    font-size: 0.75rem;
    line-height: 1;
    transition: all 0.16s ease;
}

.announcement-item-pill:hover {
    border-color: #f43f5e;
    color: #9f1239;
    transform: translateY(-1px);
}

.announcement-item-pill.is-active {
    border-color: #e11d48;
    background: linear-gradient(135deg, #ffe4ed 0%, #ffd7e8 100%);
    color: #9f1239;
    box-shadow: 0 6px 14px rgba(225, 29, 72, 0.18);
}

.announcement-item-pill__title {
    font-weight: 700;
    max-width: 12.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.announcement-item-pill__meta {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    padding: 0.2rem 0.46rem;
    font-size: 0.64rem;
    font-weight: 700;
    color: #475569;
}

.announcement-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.announcement-editor-toolbar button {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #334155;
    border-radius: 0.55rem;
    padding: 0.32rem 0.58rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.announcement-editor-toolbar button:hover {
    border-color: #fb7185;
    box-shadow: 0 6px 14px rgba(251, 113, 133, 0.2);
    transform: translateY(-1px);
}

.announcement-editor-surface {
    min-height: 230px;
    border: 1px solid #d1d5db;
    border-radius: 0.85rem;
    background: #ffffff;
    padding: 0.8rem 0.95rem;
    overflow-y: auto;
    line-height: 1.7;
    outline: none;
}

.announcement-editor-surface:focus {
    border-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
}

.announcement-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

#config-public-announcement-live-preview {
    margin: 0;
}


