/* Admin Container */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Event picker (header): same translucent-white treatment as
   .header-profile-btn so it reads as part of the same header chrome. */
.event-picker-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 5px 12px;
}

.event-picker-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.event-picker {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: none;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    max-width: 220px;
}

.event-picker:focus {
    outline: 2px solid #fff;
    outline-offset: 1px;
}

.header-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 5px 14px 5px 5px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

.header-profile-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}

.header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-user {
    font-size: 0.9rem;
    opacity: 0.9;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
}

.login-box h2 {
    color: #333;
    margin-bottom: 10px;
}

.login-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.login-help {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

.login-help strong {
    color: #667eea;
}

.btn-block {
    width: 100%;
}

/* ── Login Help Links ─────────────────────────── */
.login-help-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #eee;
}

button.login-help-link {
    background: none;
    border: none;
    outline: none;
    color: #667eea;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.15s;
}

button.login-help-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.login-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    margin-bottom: 14px;
    display: none;
    line-height: 1.4;
}

.login-message.success {
    display: block;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.login-message.error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Main Content */
.main-content {
    padding: 0;
}

/* Tabs */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 30px;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-button:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-icon {
    font-size: 1.2rem;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.tab-header h2 {
    color: #333;
    font-size: 1.5rem;
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

/* Events List */
.events-list {
    display: grid;
    gap: 20px;
}

.event-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.event-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.event-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.event-code {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.event-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.event-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.btn-icon {
    padding: 8px 16px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Feedback List */
.feedback-list {
    display: grid;
    gap: 15px;
}

.feedback-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.feedback-event {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.feedback-date {
    color: #999;
    font-size: 0.85rem;
}

.feedback-ratings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.rating-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rating-label {
    font-size: 0.85rem;
    color: #666;
}

.rating-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.rating-stars {
    color: #ffc107;
}

.feedback-comments {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.feedback-comments-label {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
    display: block;
}

.feedback-comments-text {
    color: #333;
    line-height: 1.6;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.stat-card.clickable {
    cursor: pointer;
    transition: all 0.3s ease, transform 0.2s ease;
}

.stat-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.2);
}

.stat-card.clickable:active {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Chart Section */
.chart-section {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.chart-section h3 {
    color: #333;
    margin-bottom: 20px;
}

.chart-container {
    min-height: 200px;
}

.depth-bar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.depth-label {
    min-width: 120px;
    font-weight: 600;
    color: #333;
}

.depth-bar-container {
    flex: 1;
    background: #f0f0f0;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.depth-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Modal */
.modal,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h3 {
    color: #333;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal form {
    padding: 25px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Event Details */
.event-details {
    padding: 25px;
}

.detail-section {
    margin-bottom: 30px;
}

.detail-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.detail-value {
    color: #333;
    font-size: 1rem;
}

.qr-code-section {
    text-align: center;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 8px;
}

.qr-code-section canvas {
    margin: 20px auto;
    display: block;
}

.url-display {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid #e0e5ff;
    margin: 20px 0;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #667eea;
}

.qr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.1rem;
}

/* === Analytics Enhancements === */
.performers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.performer-item {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.performer-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.performer-info {
    flex: 1;
}

.performer-name {
    font-weight: 600;
    color: #24292e;
    margin-bottom: 4px;
}

.performer-speaker {
    font-size: 0.85rem;
    color: #586069;
}

.performer-stats {
    display: flex;
    align-items: center;
    gap: 15px;
}

.performer-rating {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0366d6;
}

.performer-count {
    font-size: 0.85rem;
    color: #586069;
}

.chart-container canvas {
    max-height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .tabs {
        padding: 0 15px;
        overflow-x: auto;
    }

    .tab-button {
        padding: 12px 15px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .tab-content {
        padding: 20px 15px;
    }

    .tab-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .event-card-header {
        flex-direction: column;
        gap: 10px;
    }

    .event-meta {
        flex-direction: column;
        gap: 8px;
    }

    .event-actions {
        flex-direction: column;
    }

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

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

    .filters {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }
}

/* ══════════════════════════════════════════════
   USER MANAGEMENT — Refined Command Center
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Role Badges (used globally) ──────────────── */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 1px 2px;
    border: 1px solid transparent;
}

.role-badge-globaladmin { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.role-badge-useradmin { background: #faf5ff; color: #6b21a8; border-color: #e9d5ff; }
.role-badge-modulemanager { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.role-badge-eventcreator { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.role-badge-feedbackmanager { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.role-badge-feedbackviewer { background: #f8fafc; color: #475569; border-color: #cbd5e1; }
.role-badge-protected {
    background: linear-gradient(135deg, #fef2f2, #fff1f2);
    color: #991b1b;
    border-color: #fecaca;
    font-size: 0.65rem;
}

.admin-roles {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-left: 8px;
    flex-wrap: wrap;
}

/* ── User Management Panel ────────────────────── */
.um-panel {
    font-family: 'DM Sans', sans-serif;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.um-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 16px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.um-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

.um-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 2px 0 0;
    font-weight: 500;
}

.um-btn-create {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.um-btn-create:hover {
    background: #4338ca;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

/* ── Toolbar ──────────────────────────────────── */
.um-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 28px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.um-search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.um-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    width: 16px;
    height: 16px;
}

input[type="text"].um-search {
    width: 100%;
    padding: 9px 12px 9px 42px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: #334155;
    background: #f8fafc;
    transition: all 0.2s;
}

input[type="text"].um-search:focus {
    outline: none;
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.um-search::placeholder { color: #94a3b8; }

.um-filter-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.um-pill {
    padding: 6px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.um-pill:hover { border-color: #cbd5e1; background: #f1f5f9; }

.um-pill.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

/* ── People Cards Grid ─────────────────────────── */
.um-cards-grid {
    padding: 20px 28px 28px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

/* ── Individual Person Card ───────────────────── */
.umc-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.umc-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.06);
}

.umc-inactive {
    opacity: 0.55;
    background: #fafafa;
}

.umc-inactive:hover { opacity: 0.8; }

/* Top row: identity + last seen */
.umc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.umc-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.umc-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.umc-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.umc-email {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 1px;
}

.umc-protected-badge {
    display: inline-block;
    padding: 1px 8px;
    background: linear-gradient(135deg, #fef2f2, #fff1f2);
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.umc-inactive-badge {
    display: inline-block;
    padding: 1px 8px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.umc-seen {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

/* Permissions section */
.umc-perms-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
}

.umc-perms-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 8px;
}

.umc-perms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.umc-perm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    transition: all 0.15s;
}

.umc-perm:hover {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.umc-perm-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.umc-no-perms {
    font-size: 0.8rem;
    color: #cbd5e1;
    font-style: italic;
    padding: 2px 0;
}

/* Action bar */
.umc-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}

.umc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.umc-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.umc-btn svg { flex-shrink: 0; }

.umc-btn-danger {
    color: #dc2626;
    border-color: #fecaca;
}

.umc-btn-danger:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

/* Empty state */
.um-empty {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.um-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.um-empty p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: #94a3b8;
}

.um-loading {
    text-align: center;
    padding: 48px;
    color: #94a3b8;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* ── User Modal (Redesigned) ──────────────────── */
.um-modal {
    max-width: 560px;
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.04);
}

.um-modal form {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    padding: 0;
}

.um-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 28px 16px;
    background: linear-gradient(to bottom, #f8fafc, #fff);
    border-bottom: 1px solid #f1f5f9;
}

.um-modal-header h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.um-modal-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

.um-modal-body {
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.um-fieldset {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px 18px;
    margin: 0;
}

.um-fieldset legend {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    padding: 0 8px;
    margin-left: -4px;
}

.um-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.um-modal-body .form-group {
    margin-bottom: 12px;
}

.um-modal-body .form-group:last-child {
    margin-bottom: 0;
}

.um-modal-body label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    display: block;
    margin-bottom: 5px;
}

.um-modal-body input[type="text"],
.um-modal-body input[type="email"],
.um-modal-body input[type="password"] {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.2s;
    box-sizing: border-box;
}

.um-modal-body input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

/* ── Roles Grid in Modal ──────────────────────── */
.um-roles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.um-roles-grid label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
}

.um-roles-grid label:hover {
    border-color: #c7d2fe;
    background: #faf5ff;
}

.um-roles-grid label:has(input:checked) {
    border-color: #4f46e5;
    background: #eef2ff;
}

.um-roles-grid input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #4f46e5;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.um-role-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.um-role-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: #1e293b;
}

.um-role-desc {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 400;
    line-height: 1.3;
}

/* ── Account Status Toggle ─────────────────────── */
.um-status-toggle {
    display: flex;
    gap: 8px;
}

.um-status-opt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
    justify-content: center;
}

.um-status-opt:hover { background: #f8fafc; }

.um-status-opt.selected-active {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #16a34a;
}

.um-status-opt.selected-inactive {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

.um-status-dot-green {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    flex-shrink: 0;
}

.um-status-dot-red {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
    flex-shrink: 0;
}

.um-status-help {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 8px 0 0;
}

/* ── Modal Footer ─────────────────────────────── */
.um-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 28px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.um-btn-cancel {
    padding: 9px 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.um-btn-cancel:hover { background: #f1f5f9; }

.um-btn-submit {
    padding: 9px 24px;
    border: none;
    border-radius: 8px;
    background: #4f46e5;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.um-btn-submit:hover {
    background: #4338ca;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

/* ── Temp Password Display ───────────────────── */
.temp-pw-copy-wrap {
    display: flex;
    align-items: stretch;
    border: 2px solid #86efac;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 0 14px;
    background: #f0fdf4;
}

.temp-password-display {
    flex: 1;
    padding: 14px 18px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.05rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 1px;
    color: #166534;
    user-select: all;
    cursor: text;
    background: transparent;
    border: none;
    word-break: break-all;
}

.temp-pw-copy-btn {
    padding: 14px 20px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-left: 2px solid #86efac;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.temp-pw-copy-btn:hover { background: #15803d; }
.temp-pw-copy-btn.copied { background: #064e3b; }

.warning-text {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #c2410c;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 14px;
    background: #fff7ed;
    border-radius: 8px;
    border-left: 3px solid #f97316;
    margin: 8px 0;
}

/* ── Avatar on User Cards ─────────────────────── */
.umc-avatar-img {
    overflow: hidden;
    padding: 0;
    background: none !important;
}

.umc-avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Avatar Upload in Modal ───────────────────── */
.um-avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.um-avatar-preview {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.um-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.um-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.um-avatar-upload-btn {
    cursor: pointer;
}

/* ── Creating User Overlay ─────────────────────── */
.um-creating-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px;
    backdrop-filter: blur(2px);
}

.um-creating-spinner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.um-creating-spinner .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: um-spin 0.7s linear infinite;
}

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

.um-creating-spinner p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4f46e5;
    margin: 0;
}

/* ── Auto-Generate Password ────────────────────── */
.um-autogen-pw {
    margin-bottom: 14px;
}

.um-autogen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.um-autogen-header > label:first-child {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0 !important;
}

.um-autogen-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #64748b;
    cursor: pointer;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}

.um-autogen-toggle input {
    width: 14px;
    height: 14px;
    accent-color: #4f46e5;
}

.um-autogen-display {
    display: flex;
    align-items: center;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.um-autogen-display code {
    flex: 1;
    padding: 11px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 500;
    color: #166534;
    letter-spacing: 0.5px;
    user-select: all;
}

.um-autogen-refresh {
    padding: 10px 14px;
    background: none;
    border: none;
    border-left: 1.5px solid #86efac;
    font-size: 1.2rem;
    color: #16a34a;
    cursor: pointer;
    transition: background 0.15s;
}

.um-autogen-refresh:hover {
    background: #dcfce7;
}

.um-notify-section {
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.um-notify-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600 !important;
    color: #334155;
    cursor: pointer;
    margin-bottom: 4px !important;
}

.um-notify-toggle input {
    width: 15px;
    height: 15px;
    accent-color: #4f46e5;
}

/* ── User Created Email Preview ───────────────── */
.uc-email-preview {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #334155;
    margin: 12px 0;
    max-height: 350px;
    overflow-y: auto;
}

.uc-email-preview h4 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #0f172a;
}

.uc-email-preview .uc-field {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.uc-email-preview .uc-field-label {
    font-weight: 600;
    color: #64748b;
    min-width: 100px;
    flex-shrink: 0;
}

.uc-email-preview .uc-field-value {
    color: #0f172a;
    font-weight: 500;
}

.uc-email-preview .uc-pw-value {
    font-family: 'JetBrains Mono', monospace;
    background: #f0fdf4;
    padding: 2px 8px;
    border-radius: 4px;
    color: #166534;
    letter-spacing: 0.5px;
}

.uc-email-preview .uc-roles-list {
    margin: 8px 0;
    padding-left: 18px;
}

.uc-email-preview .uc-roles-list li {
    margin-bottom: 4px;
}

.uc-email-preview hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 14px 0;
}

.uc-email-sent {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #166534;
    font-weight: 500;
    margin-bottom: 12px;
}

.uc-email-fallback {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #9a3412;
    font-weight: 500;
    margin-bottom: 12px;
}

/* ══════════════════════════════════════════════
   AUDIT LOG
   ══════════════════════════════════════════════ */
.al-panel {
    font-family: 'DM Sans', sans-serif;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.al-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 16px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.al-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

.al-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

.al-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.al-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.al-select, .al-date {
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: #334155;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s;
}

.al-select:focus, .al-date:focus {
    outline: none;
    border-color: #4f46e5;
}

.al-date { width: 130px; }

.al-table-wrap {
    overflow-x: auto;
}

.al-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
}

.al-table thead {
    background: #f8fafc;
}

.al-table th {
    padding: 10px 16px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.al-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #334155;
}

.al-table tbody tr {
    background: #fff;
    transition: background 0.1s;
}

.al-table tbody tr:hover { background: #f8fafc; }

/* Questions tab (feedback question-set admin) -- reuses .al-table for the
   list and .import-btn for its actions, matching this file's established
   palette (#e2e8f0 borders, #64748b/#94a3b8 text, #f8fafc fills, #667eea/
   #4f46e5 accent) rather than introducing a new one. */
.questions-notice {
    margin: 4px 0 16px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
}

.questions-notice strong { color: #4f46e5; }

.questions-notice.questions-notice-info {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #64748b;
}

.questions-table td {
    vertical-align: middle;
}

.questions-table input[type="text"],
.questions-table input[type="number"],
.questions-table select {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.84rem;
    font-family: 'DM Sans', sans-serif;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
}

.questions-table input[type="text"]:focus,
.questions-table input[type="number"]:focus,
.questions-table select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.questions-table input[type="number"] { text-align: center; }

.questions-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.questions-table td.questions-required-cell,
.questions-table td.questions-retire-cell {
    text-align: center;
}

.questions-table tr.questions-row-retiring {
    opacity: 0.45;
    text-decoration: line-through;
}

.al-time {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
}

.al-time-relative {
    display: block;
    font-size: 0.7rem;
    color: #94a3b8;
}

.al-user {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.al-action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.al-action-login         { background: #eff6ff; color: #1e40af; }
.al-action-create        { background: #f0fdf4; color: #166534; }
.al-action-update        { background: #fffbeb; color: #92400e; }
.al-action-delete        { background: #fef2f2; color: #991b1b; }
.al-action-assign_role   { background: #faf5ff; color: #6b21a8; }
.al-action-remove_role   { background: #fdf2f8; color: #9d174d; }
.al-action-grant_access  { background: #ecfdf5; color: #065f46; }
.al-action-revoke_access { background: #fff1f2; color: #9f1239; }
.al-action-change_password, .al-action-reset_password { background: #f0f9ff; color: #0369a1; }
.al-action-default       { background: #f1f5f9; color: #475569; }

.al-resource {
    font-size: 0.78rem;
    color: #64748b;
}

.al-resource-type {
    font-weight: 600;
    color: #475569;
}

.al-summary {
    max-width: 350px;
    line-height: 1.4;
}

.al-ip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Clickable rows */
.al-row-clickable {
    cursor: pointer;
    transition: background 0.1s;
}

.al-row-clickable:hover {
    background: #eef2ff !important;
}

.al-row-expanded {
    background: #f0f4ff !important;
    border-left: 3px solid #4f46e5;
}

/* Detail expansion panel */
.al-detail-row-container td {
    padding: 0 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.al-detail-panel {
    background: linear-gradient(to bottom, #f8fafc, #fff);
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
}

.al-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.al-detail-section h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.al-detail-row {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    font-size: 0.82rem;
}

.al-detail-key {
    font-weight: 600;
    color: #64748b;
    min-width: 100px;
    flex-shrink: 0;
}

.al-detail-val {
    color: #1e293b;
    word-break: break-all;
}

.al-detail-empty {
    color: #cbd5e1;
    font-style: italic;
    font-size: 0.82rem;
}

.al-raw-details {
    margin-top: 16px;
}

.al-raw-details summary {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 0;
}

.al-raw-details summary:hover { color: #64748b; }

.al-raw-details pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 14px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    overflow-x: auto;
    margin-top: 8px;
    line-height: 1.5;
}

.al-loading {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Pagination */
.al-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 28px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.82rem;
    color: #64748b;
}

.al-page-info {
    font-weight: 500;
}

.al-page-buttons {
    display: flex;
    gap: 4px;
}

.al-page-btn {
    padding: 6px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.al-page-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #cbd5e1; }
.al-page-btn:disabled { opacity: 0.4; cursor: default; }
.al-page-btn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* ══════════════════════════════════════════════
   REPORTS
   Follows the same panel/header/table language as the audit log (.al-*)
   above -- reuses .al-search-wrap, .al-select, .al-table, .al-loading
   directly and adds .rp-* only for what's genuinely new: stat tiles, the
   per-question rollup cards, and the score-severity colouring.
   ══════════════════════════════════════════════ */
.rp-panel {
    font-family: 'DM Sans', sans-serif;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.rp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 16px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    gap: 16px;
    flex-wrap: wrap;
}

.rp-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

.rp-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

.rp-subtitle strong { color: #475569; }

.rp-summary {
    padding: 20px 28px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.rp-stat-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.rp-stat-tile {
    flex: 1;
    min-width: 140px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
}

.rp-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.rp-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-top: 2px;
}

.rp-questions-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin: 0 0 10px;
}

.rp-question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.rp-question-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
    position: relative;
}

.rp-question-card.rp-question-worst {
    border-color: #fca5a5;
    background: #fef2f2;
}

.rp-question-worst-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #991b1b;
    background: #fee2e2;
    border-radius: 4px;
    padding: 2px 6px;
    margin-bottom: 6px;
}

.rp-question-text {
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.35;
    margin-bottom: 8px;
    min-height: 2.7em;
}

.rp-question-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.rp-question-avg {
    font-size: 1.15rem;
    font-weight: 700;
}

.rp-question-n {
    font-size: 0.72rem;
    color: #94a3b8;
}

.rp-bar-track {
    height: 5px;
    border-radius: 3px;
    background: #e2e8f0;
    margin-top: 8px;
    overflow: hidden;
}

.rp-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.rp-sessions-header {
    padding: 18px 28px 0;
    background: #fff;
}

.rp-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.rp-section-subtitle {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

.rp-table-wrap {
    overflow-x: auto;
}

.rp-table th[title] { cursor: help; }

.rp-table td.rp-title-cell {
    max-width: 320px;
    white-space: normal;
    font-weight: 600;
    color: #1e293b;
}

.rp-table td.rp-num-cell, .rp-table th.rp-num-cell { text-align: right; }

.rp-score {
    display: inline-block;
    min-width: 34px;
    padding: 2px 6px;
    border-radius: 5px;
    font-weight: 700;
    text-align: center;
}

.rp-score-good { background: #f0fdf4; color: #166534; }
.rp-score-warn { background: #fffbeb; color: #92400e; }
.rp-score-bad  { background: #fef2f2; color: #991b1b; }
.rp-score-none { background: #f1f5f9; color: #94a3b8; font-weight: 500; }

.rp-overall-cell { font-weight: 700; }

/* Comments table (reuses .rp-table/.al-table/.al-pagination above --
   only the comment text and meta columns need their own rules). */
.rp-table td.rp-comment-cell {
    max-width: 420px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #334155;
}

.rp-table td.rp-comment-meta {
    white-space: nowrap;
    color: #94a3b8;
    font-size: 0.82rem;
}

/* ── Event Access Modal ────────────────────────── */
.ea-global-notice {
    text-align: center;
    padding: 40px 30px;
}

.ea-global-icon {
    font-size: 2.5rem;
    color: #4f46e5;
    margin-bottom: 12px;
}

.ea-global-notice h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.ea-global-notice p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    max-width: 380px;
    margin: 0 auto;
}

.ea-search-wrap {
    padding: 0 20px 12px;
}

.ea-search {
    width: 100%;
    padding: 9px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    background: #f8fafc;
    box-sizing: border-box;
}

.ea-search:focus {
    outline: none;
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.ea-section {
    padding: 0 20px 16px;
}

.ea-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.ea-section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
}

.ea-granted-title { color: #16a34a; }

.ea-count {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
}

.ea-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ea-select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.ea-select-all-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #4f46e5;
    cursor: pointer;
}

.ea-section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ea-bulk-btn {
    padding: 5px 14px !important;
    font-size: 0.73rem !important;
}

.ea-bulk-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.ea-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 7px;
    background: #fff;
    border: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.ea-item:hover { background: #f8fafc; }

.ea-item-granted {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.ea-item-granted:hover { background: #ecfdf5; }

.ea-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.ea-check-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #4f46e5;
    cursor: pointer;
    flex-shrink: 0;
}

.ea-item-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.ea-item-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ea-item-code {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
    flex-shrink: 0;
}

.ea-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.ea-btn-add {
    color: #16a34a;
    border-color: #bbf7d0;
}

.ea-btn-add:hover {
    background: #f0fdf4;
    border-color: #4ade80;
}

.ea-btn-remove {
    color: #dc2626;
    border-color: #fecaca;
}

.ea-btn-remove:hover {
    background: #fef2f2;
    border-color: #f87171;
}

.ea-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.ea-empty {
    font-size: 0.82rem;
    color: #94a3b8;
    font-style: italic;
    padding: 12px 0;
    text-align: center;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .um-header { flex-direction: column; gap: 12px; align-items: stretch; }
    .um-toolbar { flex-direction: column; }
    .um-filter-pills { overflow-x: auto; }
    .um-cards-grid { grid-template-columns: 1fr; padding: 16px; }
    .um-field-row { grid-template-columns: 1fr; }
    .um-roles-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Speakers Tab Styles
   ============================================ */

.speaker-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.speaker-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.speaker-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
    overflow: hidden;
}

.speaker-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.speaker-info {
    flex: 1;
    min-width: 0;
}

.speaker-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.speaker-bio {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.speaker-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #888;
}

.speaker-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: flex-start;
}

.speaker-checkbox {
    margin-right: 5px;
}

/* ============================================
   Templates Tab Styles
   ============================================ */

.template-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    cursor: default;
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.template-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.template-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.template-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
}

.template-modules-preview {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 12px;
}

.template-modules-preview h5 {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 6px;
}

.template-modules-preview ol {
    margin: 0;
    padding-left: 20px;
    color: #666;
    font-size: 0.85rem;
}

.template-modules-preview li {
    padding: 2px 0;
}

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

/* Template Module List Builder (in modal) */
.template-modules-list {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    min-height: 60px;
    max-height: 300px;
    overflow-y: auto;
}

.template-module-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}

.template-module-item:last-child {
    border-bottom: none;
}

.template-module-order {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.template-module-name {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
}

.template-module-actions {
    display: flex;
    gap: 4px;
}

.template-module-actions button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #666;
}

.template-module-actions button:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

/* Event Picker & Template Selection Lists */
.event-picker-list .event-picker-item,
.template-selection-list .template-selection-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.event-picker-list .event-picker-item:hover,
.template-selection-list .template-selection-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
    box-shadow: 0 2px 8px rgba(102,126,234,0.15);
}

.event-picker-item .event-picker-name,
.template-selection-item .template-selection-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.event-picker-item .event-picker-meta,
.template-selection-item .template-selection-meta {
    font-size: 0.85rem;
    color: #888;
}

/* Event From Template: Module + Speaker Assignment */
.template-event-module-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}

.template-event-module-row:last-child {
    border-bottom: none;
}

.template-event-module-order {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.template-event-module-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.template-event-module-speaker {
    flex: 1;
}

.template-event-module-speaker select {
    width: 100%;
}

.template-module-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.template-bulk-assign {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #f7f7fb;
    border: 1px solid #e5e7f0;
    border-radius: 6px;
}

.template-bulk-assign label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
    margin-right: 4px;
}

.template-bulk-assign select {
    flex: 1 1 200px;
    min-width: 160px;
    padding: 6px 8px;
}

.template-bulk-assign button {
    flex-shrink: 0;
}

/* ==========================================================================
   Sessions tab, pagination and shared empty states
   --------------------------------------------------------------------------
   These carry no styling of their own until now; the markup shipped ahead of
   the stylesheet. Values are taken from the conventions already in this file
   rather than introducing a new scale: #e2e8f0 borders, #64748b / #94a3b8
   text, #f8fafc fills, #667eea / #4f46e5 accent.
   ========================================================================== */

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

.toolbar input[type="search"] {
    flex: 1 1 240px;
    min-width: 0;
}

.toolbar input[type="search"],
.toolbar input[type="date"],
.toolbar select {
    padding: 10px 14px;
    font-size: 0.9375rem;
    color: #333;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.toolbar input[type="search"]:focus,
.toolbar input[type="date"]:focus,
.toolbar select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* One session. Title leads; type, time and speakers are supporting detail. */
.session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.session-row:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.session-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Allows long conference titles to ellipsis rather than shove the
       QR button off the row. */
    min-width: 0;
}

.session-main strong {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.session-meta {
    font-size: 0.875rem;
    color: #64748b;
}

/* One CSNA26 session genuinely has no speakers; don't reserve a line for it. */
.session-speakers:empty {
    display: none;
}

/* A third of these sessions are co-presented, so this line is often long. */
.session-speakers {
    font-size: 0.875rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-button {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4f46e5;
    background: #fff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.qr-button:hover {
    color: #fff;
    background: #4f46e5;
    border-color: #4f46e5;
}

.qr-button:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.session-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

/* Session created through the admin UI (IsManual = 1) rather than import --
   see database-init-v3.sql / session-crud.js. */
.session-manual-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #4f46e5;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    vertical-align: middle;
}

.session-edit-button,
.session-deactivate-button {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.session-edit-button {
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.session-edit-button:hover {
    color: #333;
    background: #f8fafc;
    border-color: #94a3b8;
}

.session-deactivate-button {
    color: #dc3545;
    border: 1px solid #f1c0c6;
}

.session-deactivate-button:hover {
    color: #fff;
    background: #dc3545;
    border-color: #dc3545;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.pagination button:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.pagination button:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

#sessionsPageInfo {
    font-size: 0.875rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

/* Shared by the Sessions list and the Reports panels. An empty state should
   read as a statement of fact, not an error. */
.empty {
    padding: 32px 20px;
    margin: 0;
    text-align: center;
    font-size: 0.9375rem;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
}

.rp-sessions-section {
    margin-top: 28px;
}

@media (max-width: 640px) {
    .session-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .qr-button {
        align-self: stretch;
        text-align: center;
    }

    .session-actions {
        align-self: stretch;
    }

    .session-actions .qr-button,
    .session-actions .session-edit-button,
    .session-actions .session-deactivate-button {
        flex: 1;
    }

    .session-speakers {
        white-space: normal;
    }

    .toolbar input[type="search"] {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .session-row,
    .qr-button,
    .session-edit-button,
    .session-deactivate-button,
    .pagination button,
    .toolbar input,
    .toolbar select {
        transition: none;
    }
}

/* ── Import sessions panel ─────────────────────────────────────────────
   Same palette as the rest of this section (#e2e8f0 borders, #64748b /
   #94a3b8 text, #f8fafc fills, #667eea / #4f46e5 accent), with the
   error/warning/success tones reused from .login-message.error and
   .warning-text elsewhere in this file rather than introducing new ones.
   ========================================================================== */

.import-panel {
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.import-panel > summary {
    padding: 14px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-panel > summary::-webkit-details-marker {
    display: none;
}

.import-panel > summary::before {
    content: '▸';
    color: #94a3b8;
    transition: transform 0.15s ease;
}

.import-panel[open] > summary::before {
    transform: rotate(90deg);
}

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

.import-panel-body {
    padding: 20px;
}

.import-help {
    margin: 0 0 14px;
    font-size: 0.875rem;
    color: #64748b;
}

.import-upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.import-upload-row input[type="file"] {
    flex: 1 1 260px;
    font-size: 0.875rem;
    color: #64748b;
}

.import-btn {
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.import-btn-primary {
    color: #fff;
    background: #4f46e5;
    border: 1px solid #4f46e5;
}

.import-btn-primary:hover:not(:disabled) {
    background: #4338ca;
    border-color: #4338ca;
}

.import-btn-primary:disabled {
    background: #c7d2fe;
    border-color: #c7d2fe;
    cursor: not-allowed;
}

.import-btn-secondary {
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.import-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.import-status {
    margin-top: 12px;
    font-size: 0.875rem;
    color: #64748b;
}

.import-status.import-status-error {
    color: #991b1b;
}

.import-preview {
    margin-top: 18px;
}

.import-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.import-count {
    flex: 1 1 110px;
    padding: 12px 14px;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.import-count-num {
    display: block;
    font-size: 1.375rem;
    font-weight: 700;
    color: #333;
    font-variant-numeric: tabular-nums;
}

.import-count-label {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* The one number most likely to indicate a wrong or partial file -- called
   out on its own so it can't be skimmed past in the count row above. */
.import-count-warn {
    background: #fff7ed;
    border-color: #fdba74;
}

.import-count-warn .import-count-num {
    color: #c2410c;
}

.import-deactivate-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #c2410c;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 14px;
    background: #fff7ed;
    border-radius: 8px;
    border-left: 3px solid #f97316;
    margin-bottom: 14px;
}

.import-errors,
.import-warnings {
    margin-bottom: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.8125rem;
}

.import-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.import-warnings {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.import-errors h4,
.import-warnings h4 {
    margin: 0 0 6px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.import-errors ul,
.import-warnings ul {
    margin: 0;
    padding-left: 18px;
}

.import-errors li,
.import-warnings li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.import-applied {
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    font-size: 0.875rem;
}

.import-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .import-upload-row {
        flex-direction: column;
        align-items: stretch;
    }

    .import-actions {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .import-panel > summary::before,
    .import-btn {
        transition: none;
    }
}
