/* Admin shell — pinned sidebar + independent scroll regions */
html,
body,
#app {
    height: 100%;
}

.admin-shell {
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

.admin-sidebar {
    max-height: 100vh;
    max-height: 100dvh;
}

.admin-sidebar__nav {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.admin-main__content {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Admin shell — mobile-first sidebar layout */
.admin-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-nav-btn:hover {
    background-color: #f3f4f6;
}

.admin-nav-btn--active {
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.admin-nav-btn--approve.admin-nav-btn--active { background-color: #2563eb; }
.admin-nav-btn--exchange.admin-nav-btn--active { background-color: #16a34a; }
.admin-nav-btn--items.admin-nav-btn--active { background-color: #ea580c; }
.admin-nav-btn--report.admin-nav-btn--active { background-color: #9333ea; }
.admin-nav-btn--event.admin-nav-btn--active { background-color: #0d9488; }
.admin-nav-btn--jobs.admin-nav-btn--active { background-color: #475569; }

.admin-nav-sub {
    margin: 0.125rem 0 0.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid #e5e7eb;
    margin-left: 1.25rem;
}

.admin-nav-sub-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-nav-sub-btn:hover {
    background-color: #f3f4f6;
}

.admin-nav-sub-btn--active {
    background-color: #ccfbf1;
    color: #0f766e;
}

.admin-nav-sub-btn--report-active {
    background-color: #f3e8ff;
    color: #7e22ce;
}

.archive-page-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    background-color: #f3f4f6;
    color: #374151;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.archive-page-arrow:hover:not(:disabled) {
    background-color: #e5e7eb;
}

.archive-page-arrow--disabled,
.archive-page-arrow:disabled {
    background-color: #f9fafb;
    color: #d1d5db;
    cursor: not-allowed;
}

.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table-wrap table {
    width: 100%;
}

.admin-table-wrap--scroll table {
    min-width: 640px;
}

@media (max-width: 767px) {
    .admin-card-actions {
        flex-direction: column;
        align-items: stretch !important;
    }

    .admin-card-actions > * {
        width: 100%;
    }
}

/* 封存名册预览弹窗 */
.archive-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.55);
}

.archive-modal {
    display: flex;
    flex-direction: column;
    width: min(96vw, 72rem);
    max-height: min(92vh, 56rem);
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.archive-modal__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.archive-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.archive-modal__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0;
    background: #fff;
}

@media (max-width: 640px) {
    .archive-modal-backdrop {
        padding: 0;
        align-items: stretch;
    }

    .archive-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .archive-modal__actions {
        width: 100%;
    }

    .archive-modal__actions button {
        flex: 1;
    }
}

.archive-preview-rownum {
    width: 3rem;
    min-width: 3rem;
    text-align: center;
    color: #6b7280;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 5;
}

.archive-modal__body thead .archive-preview-rownum {
    background: #f3f4f6;
    z-index: 11;
}

.archive-modal__body tbody tr:not(.bg-yellow-50) .archive-preview-rownum {
    background: #fff;
}

.archive-modal__body tbody tr.bg-yellow-50 .archive-preview-rownum {
    background: #fefce8;
}

.archive-modal__body tbody tr:hover:not(.bg-yellow-50) .archive-preview-rownum {
    background: #f9fafb;
}

/* 兑换签收签名弹窗 */
.signature-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.55);
}

.signature-modal {
    width: min(96vw, 28rem);
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    padding: 1.25rem;
}

.signature-modal__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.signature-modal__sub {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

.signature-modal__hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.signature-modal__canvas {
    display: block;
    width: 100%;
    height: 11rem;
    margin-top: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: crosshair;
}

.signature-modal__error {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #dc2626;
}

.signature-modal__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.signature-modal__btn {
    flex: 1;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.signature-modal__btn--ghost {
    background: #f3f4f6;
    color: #374151;
}

.signature-modal__btn--ghost:hover {
    background: #e5e7eb;
}

.signature-modal__btn--primary {
    background: #16a34a;
    color: #fff;
}

.signature-modal__btn--primary:hover:not(:disabled) {
    background: #15803d;
}

.signature-modal__btn--primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .signature-modal-backdrop {
        padding: 0.75rem;
    }

    .signature-modal__actions {
        flex-direction: column;
    }
}
