/* ========================================
   Star Excellent Academy - Admin Dashboard
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --sidebar-w: 260px;
    --header-h: 60px;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #f59e0b;
    --navy: #0a1628;
    --navy-light: #1a365d;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 0.75rem;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1,
h2,
h3,
h4,
h5 {
    font-family: 'Poppins', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
}

.login-card {
    background: var(--surface);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-card .login-logo {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.login-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.login-card .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.login-card label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.login-card input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.login-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-card .btn-login {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.login-card .btn-login:hover {
    background: var(--primary-hover);
}

.login-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: none;
}

/* ---- Admin Layout ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-header .logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-header .logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
}

.sidebar-header .logo-text span {
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-link.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    border: none;
    transition: all 0.2s;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.admin-header .page-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.admin-header .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-header .user-info i {
    color: var(--primary);
}

.mobile-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text);
}

.page-content {
    padding: 1.5rem;
    flex: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-sidebar-toggle {
        display: block;
    }
}

/* ---- Dashboard Stats ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-card-icon.blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.stat-card-icon.gold {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card-info {
    flex: 1;
}

.stat-card-number {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Data Table ---- */
.table-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.table-header h3 {
    font-size: 1rem;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-add:hover {
    background: var(--primary-hover);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(37, 99, 235, 0.02);
}

.table-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.table-photo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-edit:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-delete:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.table-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.empty-field-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.4rem;
    padding: 0.25rem 0.65rem;
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.empty-field-badge i {
    font-size: 0.7rem;
}

.table-responsive {
    overflow-x: auto;
}

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: 1rem;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-body textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.btn-cancel {
    padding: 0.6rem 1.25rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-save {
    padding: 0.6rem 1.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-save:hover {
    background: var(--primary-hover);
}

/* ---- Confirm Dialog ---- */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    align-items: center;
    justify-content: center;
}

.confirm-overlay.active {
    display: flex;
}

.confirm-dialog {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.confirm-dialog .icon {
    font-size: 2.5rem;
    color: var(--danger);
    margin-bottom: 1rem;
}

.confirm-dialog h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.confirm-dialog p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.btn-confirm-delete {
    padding: 0.6rem 1.25rem;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---- Content Editor ---- */
.content-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-item {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}

.content-item label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.content-item input,
.content-item textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.content-item textarea {
    min-height: 80px;
    resize: vertical;
}

.content-item .btn-save-content {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---- Toast ---- */
.admin-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    color: #fff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.admin-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.admin-toast.success {
    background: var(--success);
}

.admin-toast.error {
    background: var(--danger);
}

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.quick-action:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.quick-action i {
    color: var(--primary);
    font-size: 1.1rem;
}

/* ---- Forgot Password ---- */
.forgot-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.forgot-link:hover {
    color: var(--primary-hover);
    transform: translateX(2px);
}

.forgot-form {
    text-align: left;
    animation: fadeSlideUp 0.35s ease;
}

.forgot-step h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.forgot-step h3 i {
    color: var(--primary);
}

.forgot-question {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(245, 158, 11, 0.06));
    border-left: 3px solid var(--primary);
    padding: 0.875rem 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 1rem;
}

.forgot-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.forgot-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-forgot-back,
.btn-forgot-next {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-forgot-back {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-forgot-back:hover {
    background: var(--border);
    color: var(--text);
}

.btn-forgot-next {
    background: var(--primary);
    color: #fff;
    flex: 1;
    justify-content: center;
}

.btn-forgot-next:hover {
    background: var(--primary-hover);
}

.btn-forgot-next:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.forgot-success {
    text-align: center;
    animation: fadeSlideUp 0.35s ease;
}

.forgot-success-icon {
    font-size: 3.5rem;
    color: var(--success);
    margin-bottom: 1rem;
    animation: popIn 0.4s ease;
}

.forgot-success h3 {
    justify-content: center;
    color: var(--success);
}

.forgot-success p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---- Security Setup Modal ---- */
.security-setup-modal .modal {
    max-width: 480px;
}

.security-setup-modal .modal-body .hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.security-setup-modal .form-group {
    margin-bottom: 1rem;
}

.security-setup-modal label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.security-setup-modal input,
.security-setup-modal select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
}

.security-setup-modal input:focus,
.security-setup-modal select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#security-setup-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: none;
}

/* Security settings card on dashboard */
.security-card {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.security-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--accent);
    flex-shrink: 0;
}

.security-card-info {
    flex: 1;
}

.security-card-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.security-card-info p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.security-card .btn-security {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--navy);
    border: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.security-card .btn-security:hover {
    background: #fbbf24;
    transform: translateY(-1px);
}

/* ---- File Upload Widget ---- */
.upload-widget {
    position: relative;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--bg);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.04);
}

.upload-area i {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
    transition: color 0.2s;
}

.upload-area:hover i {
    color: var(--primary);
}

.upload-area p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.upload-area p span {
    color: var(--primary);
    font-weight: 600;
}

.upload-area .upload-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 0.25rem;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-preview {
    display: none;
    margin-top: 0.75rem;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
}

.upload-preview.has-image {
    display: block;
}

.upload-preview img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    display: block;
}

.upload-preview .remove-image {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.2s;
}

.upload-preview .remove-image:hover {
    background: var(--danger);
}

.upload-error {
    color: var(--danger);
    font-size: 0.78rem;
    margin-top: 0.4rem;
    display: none;
    align-items: center;
    gap: 0.3rem;
}

.upload-error.show {
    display: flex;
}

.upload-progress {
    display: none;
    margin-top: 0.5rem;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--primary);
}

.upload-progress.show {
    display: flex;
}

.upload-progress i {
    font-size: 0.85rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Image Lightbox ---- */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
    animation: lightboxFadeIn 0.25s ease;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    animation: lightboxZoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Clickable table images */
.table-photo[data-lightbox],
.upload-preview img[data-lightbox] {
    cursor: zoom-in;
    transition: transform 0.2s, box-shadow 0.2s;
}

.table-photo[data-lightbox]:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}