/* ================================================
   Admin Tabs
   ================================================ */
.admin-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.9rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: 'Prompt', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.admin-tab-btn:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.admin-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--primary-light);
}

/* ================================================
   Dashboard Stats
   ================================================ */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.stat-card {
    background: var(--white-color);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-left: 4px solid var(--primary-color);
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.stat-card-icon {
    font-size: 1.6rem;
    color: var(--primary-color);
}

.stat-card-label {
    font-size: 0.8rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.stat-card-sub {
    font-size: 0.78rem;
    color: #aaa;
}

.stat-card.danger {
    border-left-color: var(--danger);
}

.stat-card.danger .stat-card-icon {
    color: var(--danger);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.warning .stat-card-icon {
    color: var(--warning);
}

.stat-card.success {
    border-left-color: var(--success);
}

.stat-card.success .stat-card-icon {
    color: var(--success);
}

/* ================================================
   Session Card
   ================================================ */
.session-card {
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    transition: box-shadow 0.2s;
}

.session-card:hover {
    box-shadow: var(--shadow);
}

.session-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.session-card-email {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color);
}

.session-card-meta {
    font-size: 0.8rem;
    color: #888;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.session-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.session-status-badge.active {
    background: #bfe8c8;
    color: #12573f;
}

.session-status-badge.inactive {
    background: #f0f0f0;
    color: #888;
}

/* ================================================
   Document Card
   ================================================ */
.doc-approval-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.doc-approval-badge.pending    { background: #eef3f2; color: #2d6a5a; }
.doc-approval-badge.in_review  { background: #ffe9b3; color: #705b12; }
.doc-approval-badge.approved   { background: #bfe8c8; color: #12573f; }
.doc-approval-badge.rejected   { background: #ffcccc; color: #cc0000; }
.doc-approval-badge.cancelled  { background: #f0f0f0; color: #888; }

/* ================================================
   Flow Steps List
   ================================================ */
.flow-steps-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.flow-step-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.84rem;
    color: #555;
    padding: 0.35rem 0.7rem;
    background: var(--primary-light);
    border-radius: 6px;
}

.flow-step-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ================================================
   Inline Tag for roles
   ================================================ */
.role-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid rgba(65,130,110,0.2);
    white-space: nowrap;
}

.role-tag.admin-role {
    background: #fff3e0;
    color: #e65100;
    border-color: rgba(230,81,0,0.2);
}

/* ================================================
   Checkbox Select Component
   ================================================ */
.checkbox-select {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--white-color);
    transition: border-color 0.2s;
}

.checkbox-select:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(65, 130, 110, 0.12);
}

.checkbox-select-empty {
    font-size: 0.84rem;
    color: #bbb;
    text-align: center;
    padding: 0.5rem 0;
    font-style: italic;
}

/* Individual checkbox item row */
.checkbox-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.checkbox-select-item:hover {
    background: var(--primary-light);
}

.checkbox-select-item.is-checked {
    background: var(--primary-light);
}

/* Hide native checkbox, replace with custom box */
.checkbox-select-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-select-box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    font-size: 0.68rem;
    color: transparent;
}

.checkbox-select-item.is-checked .checkbox-select-box {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.checkbox-select-label {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-color);
    font-weight: 500;
    line-height: 1.3;
}

.checkbox-select-label .checkbox-select-sub {
    display: block;
    font-size: 0.76rem;
    color: #aaa;
    font-weight: 400;
    margin-top: 1px;
}

/* Badge inside label (e.g. Admin tag) */
.checkbox-select-badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid rgba(230, 81, 0, 0.2);
    white-space: nowrap;
}

.checkbox-select-badge.default {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: rgba(65, 130, 110, 0.2);
}

/* Scrollbar styling */
.checkbox-select::-webkit-scrollbar {
    width: 5px;
}

.checkbox-select::-webkit-scrollbar-track {
    background: transparent;
}

.checkbox-select::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 999px;
}

.checkbox-select::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* ================================================
   Pagination Toolbar
   ================================================ */
.pagination-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 0 0.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.pagination-summary {
    font-size: 0.82rem;
    color: #888;
    font-weight: 500;
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--white-color);
    color: var(--text-color);
    font-family: 'Prompt', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    line-height: 1;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(65, 130, 110, 0.35);
    cursor: default;
    pointer-events: none;
}

.pagination-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    background: #f5f5f5;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 34px;
    font-size: 0.84rem;
    color: #aaa;
    font-weight: 700;
    letter-spacing: 0.05em;
    user-select: none;
}

/* Page size selector */
.pagination-page-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #888;
    white-space: nowrap;
}

.pagination-size-select {
    height: 32px;
    padding: 0 28px 0 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--white-color);
    font-family: 'Prompt', sans-serif;
    font-size: 0.82rem;
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23888' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s;
}

.pagination-size-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ================================================
   Responsive extras
   ================================================ */
@media (max-width: 640px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .session-card {
        flex-direction: column;
        align-items: stretch;
    }

    .session-card .btn {
        width: 100%;
        justify-content: center;
    }

    .pagination-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-controls {
        justify-content: center;
    }

    .pagination-summary,
    .pagination-page-size {
        justify-content: center;
        display: flex;
    }
}

@media (max-width: 400px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
}