/* Admin panel styles - embedded in index.html */
#adminPanelEmbed .admin-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2E2E7A 0%, #1a1a4d 100%);
    padding: 2rem;
}
#adminPanelEmbed .admin-dashboard {
    display: none;
    padding: 2rem;
    background: #f8f9fa;
    min-height: 100vh;
}
#adminPanelEmbed .admin-dashboard.active { display: block; }
#adminPanelEmbed .admin-header {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    gap: 1rem;
}
#adminPanelEmbed .admin-header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.75rem;
    color: #2E2E7A;
    margin: 0;
}
#adminPanelEmbed .admin-sync-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
#adminPanelEmbed .admin-sync-badge.sync-ok { background: #d4edda; color: #155724; }
#adminPanelEmbed .admin-sync-badge.sync-fail { background: #f8d7da; color: #721c24; }
#adminPanelEmbed .admin-sync-badge.sync-pending { background: #fff3cd; color: #856404; }
#adminPanelEmbed .admin-header-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
#adminPanelEmbed .admin-tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
#adminPanelEmbed .admin-tab {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s;
}
#adminPanelEmbed .admin-tab.active { background: #7B5EA7; color: white; }
#adminPanelEmbed .admin-tab:hover:not(.active) { border-color: #7B5EA7; color: #7B5EA7; }
#adminPanelEmbed .admin-tab-content { display: none; }
#adminPanelEmbed .admin-tab-content.active { display: block; }
#adminPanelEmbed .admin-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
#adminPanelEmbed .admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 0.5rem;
}
#adminPanelEmbed .admin-card-title { font-size: 1.125rem; font-weight: 600; color: #2E2E7A; margin: 0; }
#adminPanelEmbed .admin-card-meta { color: #6c757d; font-size: 0.875rem; margin-top: 0.25rem; }
#adminPanelEmbed .admin-card-status {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
#adminPanelEmbed .admin-card-status.pending { background: #fff3cd; color: #856404; }
#adminPanelEmbed .admin-card-status.completed { background: #d4edda; color: #155724; }
#adminPanelEmbed .admin-card-status.deleted { background: #f8d7da; color: #721c24; }
#adminPanelEmbed .admin-card-body { margin-bottom: 1rem; }
#adminPanelEmbed .admin-card-link { margin-top: 0.5rem; font-size: 0.875rem; }
#adminPanelEmbed .admin-card-link a { color: #2E2E7A; text-decoration: underline; }
#adminPanelEmbed .admin-card-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}
#adminPanelEmbed .admin-card-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
#adminPanelEmbed .admin-card-info-item { display: flex; flex-direction: column; }
#adminPanelEmbed .admin-card-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.25rem;
}
#adminPanelEmbed .admin-card-info-value { color: #212529; word-break: break-word; }
#adminPanelEmbed .admin-card-message {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #7B5EA7;
}
#adminPanelEmbed .admin-card-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
#adminPanelEmbed .admin-btn {
    padding: 1rem 2rem;
    background: #7B5EA7;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
#adminPanelEmbed .admin-btn:hover {
    background: #9B7EC7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 94, 167, 0.3);
}
#adminPanelEmbed .admin-btn-small {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
#adminPanelEmbed .admin-btn-complete { background: #28a745; color: white; }
#adminPanelEmbed .admin-btn-complete:hover { background: #218838; }
#adminPanelEmbed .admin-btn-delete { background: #dc3545; color: white; }
#adminPanelEmbed .admin-btn-delete:hover { background: #c82333; }
#adminPanelEmbed .admin-btn-secondary { background: #6c757d; color: white; }
#adminPanelEmbed .admin-btn-secondary:hover { background: #5a6268; }
#adminPanelEmbed .admin-btn-outline { background: transparent; color: #7B5EA7; border: 2px solid #7B5EA7; }
#adminPanelEmbed .admin-btn-outline:hover { background: #7B5EA7; color: white; }
#adminPanelEmbed .admin-empty-state { text-align: center; padding: 4rem 2rem; color: #6c757d; }
#adminPanelEmbed .admin-empty-state .emoji { font-size: 4rem; margin-bottom: 1rem; }
#adminPanelEmbed .admin-empty-state h3 { color: #2E2E7A; margin-bottom: 0.5rem; }
#adminPanelEmbed .admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
#adminPanelEmbed .admin-stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
#adminPanelEmbed .admin-stat-number { font-family: 'Bebas Neue', sans-serif; font-size: 2.5rem; color: #7B5EA7; }
#adminPanelEmbed .admin-stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
#adminPanelEmbed .admin-add-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
#adminPanelEmbed .admin-add-section h3 { margin-bottom: 1rem; color: #2E2E7A; font-size: 1rem; }
#adminPanelEmbed .admin-form { display: flex; flex-direction: column; gap: 1.5rem; }
#adminPanelEmbed .admin-form-group { display: flex; flex-direction: column; gap: 0.5rem; }
#adminPanelEmbed .admin-form-group label {
    font-weight: 600;
    color: #2E2E7A;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
#adminPanelEmbed .admin-form-group input,
#adminPanelEmbed .admin-form-group textarea {
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}
#adminPanelEmbed .admin-form-group input[type="file"] {
    cursor: pointer;
    min-height: 44px;
}
#adminPanelEmbed .admin-form-hint { display: block; font-size: 0.75rem; color: #6c757d; margin-top: 0.25rem; }
#adminPanelEmbed .admin-form-group input:focus,
#adminPanelEmbed .admin-form-group textarea:focus {
    outline: none;
    border-color: #7B5EA7;
    box-shadow: 0 0 0 3px rgba(123, 94, 167, 0.1);
}
#adminPanelEmbed .admin-form-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}
#adminPanelEmbed .admin-form-inline .admin-form-group { margin: 0; }
#adminPanelEmbed .admin-form-inline .admin-form-group:has(textarea),
#adminPanelEmbed .admin-form-inline .admin-form-group.admin-form-group-wide { grid-column: 1 / -1; }
#adminPanelEmbed .admin-form-inline .admin-btn { align-self: end; }
#adminPanelEmbed .admin-form-checkbox label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
#adminPanelEmbed .admin-form-checkbox input { width: auto; }
#adminPanelEmbed .admin-settings-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}
#adminPanelEmbed .admin-settings-section h4 { color: #2E2E7A; margin-bottom: 1rem; font-size: 0.9rem; }
#adminPanelEmbed .admin-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
#adminPanelEmbed .admin-settings-section-compact {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}
#adminPanelEmbed .admin-skill-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
#adminPanelEmbed .admin-skill-section-header h4 { margin: 0; }
#adminPanelEmbed .admin-skill-list {
    min-height: 44px;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}
#adminPanelEmbed .admin-skill-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
#adminPanelEmbed .admin-skill-row .admin-skill-name {
    flex: 1;
    min-width: 0;
}
#adminPanelEmbed .admin-skill-marks { display: flex; gap: 0.25rem; }
#adminPanelEmbed .admin-skill-mark-btn {
    width: 32px; height: 32px; padding: 0;
    border: 2px solid #dee2e6; border-radius: 6px;
    background: #fff; font-size: 1rem; cursor: pointer; color: #6c757d; line-height: 1;
}
#adminPanelEmbed .admin-skill-mark-btn:hover { border-color: #7B5EA7; color: #7B5EA7; }
#adminPanelEmbed .admin-skill-mark-btn.admin-skill-mark-active {
    background: #7B5EA7; border-color: #7B5EA7; color: #fff;
}
#adminPanelEmbed .admin-skill-mark-hint { font-size: 0.8rem; color: #6c757d; }
#adminPanelEmbed .admin-skill-row .admin-skill-points {
    width: 80px;
}
#adminPanelEmbed .admin-skill-row input {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}
#adminPanelEmbed .admin-skill-row input:focus {
    outline: none;
    border-color: #7B5EA7;
}
#adminPanelEmbed .admin-skill-empty-hint {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
}
#adminPanelEmbed .admin-preset-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}
#adminPanelEmbed .admin-preset-load {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
#adminPanelEmbed .admin-preset-load select {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
}
#adminPanelEmbed select.admin-form-group,
#adminPanelEmbed .admin-form-group select {
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}
#adminPanelEmbed .admin-photos-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
#adminPanelEmbed .admin-photos-toolbar .admin-form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
#adminPanelEmbed .admin-photos-toolbar .admin-form-group-inline label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2E2E7A;
}
#adminPanelEmbed .admin-photos-toolbar input[type="date"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}
#adminPanelEmbed .admin-load-more {
    text-align: center;
    margin-top: 1.5rem;
}
@media (max-width: 768px) {
    #adminPanelEmbed .admin-header { flex-direction: column; align-items: flex-start; }
    #adminPanelEmbed .admin-card-info { grid-template-columns: 1fr; }
}
/* Crop modal - fixed position, outside #adminPanelEmbed for z-index */
.crop-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.crop-modal-overlay.active { display: flex; }
.crop-modal {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.crop-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.crop-modal-header h3 { margin: 0; color: #2E2E7A; font-size: 1.1rem; }
.crop-modal-body { padding: 1rem; max-height: 70vh; min-height: 300px; }
.crop-modal-body img { max-width: 100%; max-height: 60vh; display: block; }
.crop-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}
.crop-modal-footer .admin-btn { margin: 0; }

/* Admin student history modal */
.admin-student-history-modal {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.admin-student-history-modal.active {
    display: flex !important;
}
.admin-student-history-modal-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}
.admin-student-history-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 2;
    background: white;
}
.admin-student-history-modal-title {
    margin: 0;
    color: #2E2E7A;
    font-size: 1.25rem;
    flex: 1;
}
.admin-student-history-modal-close {
    flex-shrink: 0;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    padding: 0.25rem;
}
.admin-student-history-modal-close:hover { color: #2E2E7A; }
.admin-student-history-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.admin-student-history-item-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #f8f9fa;
}
.admin-student-history-item-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #2E2E7A;
    text-align: left;
}
.admin-student-history-item-toggle:hover { background: #e9ecef; }
.admin-student-history-item-header-row .admin-student-history-item-actions {
    flex-shrink: 0;
    margin: 0;
    padding: 0.5rem 0.75rem;
}
.admin-student-history-item-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
}
.admin-student-history-item:not(.admin-student-history-item-collapsed) .admin-student-history-item-arrow {
    transform: rotate(90deg);
}
.admin-student-history-item-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.admin-student-history-item:not(.admin-student-history-item-collapsed) .admin-student-history-item-body {
    max-height: 600px;
}
.admin-student-history-item-body {
    padding: 0 1rem 1rem;
}
.admin-student-history-item-meta { font-size: 0.875rem; color: #6c757d; margin-bottom: 0.5rem; padding-top: 0.5rem; }
.admin-student-history-item-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; }
#adminPanelEmbed .admin-test-results-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}
#adminPanelEmbed .admin-test-results-search {
    flex: 1;
    min-width: 180px;
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}
#adminPanelEmbed .admin-test-results-search:focus {
    outline: none;
    border-color: #7B5EA7;
}
#adminPanelEmbed .admin-test-results-level-filter {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 160px;
}
.admin-student-history-modal-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
}
