/* ============================================
   PORTAL CSS — Корпорация «Электроника»
   Сохранён оригинальный дизайн
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* ===== LOGIN ===== */
.login-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
    z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-overlay.hidden { display: none; }

.login-modal {
    background: white; border-radius: 24px; padding: 48px;
    max-width: 450px; width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: loginSlideUp 0.6s ease;
}
@keyframes loginSlideUp { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }

.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: 20px; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; font-size: 36px; color: white;
    box-shadow: 0 10px 30px -10px rgba(37,99,235,0.5);
}
.login-header h1 { font-size: 24px; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.login-header p { color: var(--gray); font-size: 14px; }

.login-form-group { margin-bottom: 20px; }
.login-form-group label { display: block; font-weight: 600; color: var(--dark); margin-bottom: 8px; font-size: 14px; }
.login-form-group input {
    width: 100%; padding: 14px 18px; border: 2px solid var(--border);
    border-radius: 12px; font-size: 15px; transition: all 0.3s; font-family: inherit;
}
.login-form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
.login-form-group input.login-input-error { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(239,68,68,0.1); }

.login-btn-submit {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white; border: none; border-radius: 12px; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 10px; font-family: inherit;
}
.login-btn-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -5px rgba(37,99,235,0.4); }
.login-btn-submit:active { transform: translateY(0); }
.login-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-error-message {
    color: var(--danger); font-size: 13px; display: none; text-align: center;
    padding: 12px; background: #fef2f2; border-radius: 10px; margin-bottom: 16px;
}
.login-error-message.visible { display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-footer-text { text-align: center; margin-top: 24px; font-size: 12px; color: var(--gray); }

/* ===== USER BAR ===== */
.user-bar {
    position: fixed; top: 0; left: 300px; right: 0;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    padding: 12px 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex; justify-content: space-between; align-items: center; z-index: 999;
}
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.user-name { font-weight: 600; font-size: 14px; color: var(--dark); }
.user-store { font-size: 12px; color: var(--gray); }

.btn-user-logout {
    padding: 8px 16px; background: #f1f5f9; color: var(--gray); border: none;
    border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; gap: 8px; font-size: 13px; font-family: inherit;
}
.btn-user-logout:hover { background: #fee2e2; color: var(--danger); }

.portal-hidden { display: none !important; }

/* ===== LAYOUT ===== */
.container { display: flex; min-height: 100vh; }

.sidebar {
    width: 300px; background: white; box-shadow: var(--shadow-lg);
    position: fixed; height: 100vh; overflow-y: auto; z-index: 1000; transition: transform 0.3s;
}
.sidebar-header {
    padding: 24px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; text-align: center;
}
.sidebar-header h1 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.sidebar-header p { font-size: 13px; opacity: 0.9; }

.progress-container { padding: 20px 24px; background: #f1f5f9; border-bottom: 1px solid var(--border); }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.progress-bar { height: 10px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--secondary) 0%, #34d399 100%);
    border-radius: 10px; transition: width 0.5s ease; width: 0%;
}

.nav-menu { padding: 16px 0; }
.nav-category { padding: 8px 24px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--gray); letter-spacing: 0.5px; }
.nav-item {
    padding: 12px 24px; cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; gap: 12px; border-left: 3px solid transparent;
    font-size: 14px; color: var(--dark);
}
.nav-item:hover { background: #f8fafc; border-left-color: var(--primary); }
.nav-item.active { background: #eff6ff; border-left-color: var(--primary); color: var(--primary); font-weight: 600; }
.nav-item i { width: 20px; text-align: center; }
.nav-item.completed i { color: var(--secondary); }
.nav-item .nav-check { margin-left: auto; color: var(--secondary); font-size: 12px; }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; margin-left: 300px; padding: 32px; padding-top: 80px; }

.section { display: none; animation: fadeIn 0.4s; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.welcome-section {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white; padding: 40px; border-radius: 20px; margin-bottom: 32px; box-shadow: var(--shadow-lg);
}
.welcome-section h2 { font-size: 32px; margin-bottom: 12px; }
.welcome-section p { font-size: 16px; opacity: 0.9; max-width: 600px; }
.stats { display: flex; gap: 32px; margin-top: 24px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-value { font-size: 36px; font-weight: 700; }
.stat-label { font-size: 14px; opacity: 0.9; }

/* ===== CONTENT CARDS ===== */
.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 24px; margin-bottom: 32px; }
.card {
    background: white; border-radius: 16px; padding: 28px; box-shadow: var(--shadow); transition: all 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.card-icon {
    width: 56px; height: 56px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.card-icon.blue { background: #dbeafe; color: var(--primary); }
.card-icon.green { background: #d1fae5; color: var(--secondary); }
.card-icon.orange { background: #fef3c7; color: var(--accent); }
.card-icon.red { background: #fee2e2; color: var(--danger); }
.card-icon.purple { background: #e9d5ff; color: #9333ea; }

.card-title { font-size: 20px; font-weight: 700; color: var(--dark); }
.card-subtitle { font-size: 14px; color: var(--gray); margin-top: 4px; }
.card-content { color: var(--gray); line-height: 1.7; }
.card-content ul { list-style: none; margin-top: 12px; }
.card-content li { padding: 8px 0; padding-left: 24px; position: relative; }
.card-content li:before { content: "✓"; position: absolute; left: 0; color: var(--secondary); font-weight: 700; }

.link {
    color: var(--primary); text-decoration: none; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; transition: all 0.3s;
}
.link:hover { color: var(--primary-dark); text-decoration: underline; }

/* ===== LESSON ITEMS ===== */
.lesson-list { margin-top: 16px; }
.lesson-item {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    background: #f8fafc; border-radius: 10px; margin-bottom: 8px;
    cursor: pointer; transition: all 0.3s; border: 1px solid transparent;
}
.lesson-item:hover { background: #eff6ff; border-color: var(--primary); }
.lesson-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.lesson-icon.text { background: #dbeafe; color: var(--primary); }
.lesson-icon.video { background: #fee2e2; color: var(--danger); }
.lesson-icon.audio { background: #e9d5ff; color: #9333ea; }
.lesson-icon.pdf { background: #fef3c7; color: var(--accent); }
.lesson-icon.pptx { background: #fef3c7; color: #ea580c; }
.lesson-icon.link { background: #d1fae5; color: var(--secondary); }
.lesson-icon.image { background: #e0f2fe; color: #0284c7; }
.lesson-icon.animation { background: #fce7f3; color: #db2777; }
.lesson-title { font-weight: 600; font-size: 14px; }
.lesson-subtitle { font-size: 12px; color: var(--gray); }
.lesson-arrow { margin-left: auto; color: var(--gray); }

/* ===== LEARNING TIMER ===== */
.learning-timer-block { display: flex; align-items: center; gap: 10px; }
.active-timer {
    display: flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    padding: 8px 16px; border-radius: 10px;
    font-weight: 700; font-size: 16px; color: var(--primary);
    animation: timerPulse 2s ease-in-out infinite;
}
@keyframes timerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.2); }
    50% { box-shadow: 0 0 0 8px rgba(37,99,235,0); }
}
.completed-timer-info { display: flex; align-items: center; }
.timer-finished {
    display: flex; align-items: center; gap: 6px;
    color: var(--secondary); font-weight: 600; font-size: 14px;
    background: #d1fae5; padding: 6px 14px; border-radius: 8px;
}
.text-editor-toolbar {
    margin-bottom: 8px; display: flex; gap: 8px;
}
.text-editor-toolbar .btn { font-size: 12px; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ===== CHECKLIST ===== */
.checklist { margin-top: 16px; }
.checklist-item {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    background: #f8fafc; border-radius: 8px; margin-bottom: 8px;
    cursor: pointer; transition: all 0.3s;
}
.checklist-item:hover { background: #f1f5f9; }
.checklist-item.completed { background: #d1fae5; opacity: 0.8; }
.checkbox {
    width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px;
    display: flex; align-items: center; justify-content: center; transition: all 0.3s; flex-shrink: 0;
}
.checklist-item.completed .checkbox { background: var(--secondary); border-color: var(--secondary); color: white; }
.checklist-text { flex: 1; font-weight: 500; }
.checklist-item.completed .checklist-text { text-decoration: line-through; color: var(--gray); }

/* ===== ACHIEVEMENTS ===== */
.achievements { background: white; border-radius: 16px; padding: 28px; box-shadow: var(--shadow); margin-bottom: 32px; }
.achievements h3 { font-size: 22px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.badge {
    background: #f8fafc; border: 2px solid var(--border); border-radius: 12px;
    padding: 20px; text-align: center; transition: all 0.3s; opacity: 0.5;
}
.badge.unlocked {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: var(--accent); opacity: 1; transform: scale(1.05);
}
.badge-icon { font-size: 36px; margin-bottom: 8px; }
.badge-name { font-weight: 700; font-size: 13px; }

/* ===== SECTION HEADER ===== */
.section-header {
    background: white; padding: 24px 32px; border-radius: 16px; box-shadow: var(--shadow);
    margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center;
}
.section-header h2 { font-size: 28px; color: var(--dark); }
.section-actions { display: flex; gap: 12px; }

.btn {
    padding: 10px 20px; border: none; border-radius: 8px; font-weight: 600;
    cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-secondary { background: white; color: var(--dark); border: 2px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--secondary); color: white; }
.btn-success:hover { background: #059669; transform: translateY(-2px); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ===== TESTS ===== */
.test-card {
    background: white; border-radius: 16px; padding: 24px; box-shadow: var(--shadow);
    margin-bottom: 16px; border-left: 4px solid var(--primary);
}
.test-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.test-card-title { font-weight: 700; font-size: 18px; }
.test-meta { display: flex; gap: 16px; color: var(--gray); font-size: 13px; margin-bottom: 16px; }
.test-meta span { display: flex; align-items: center; gap: 6px; }
.test-badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.test-badge.passed { background: #d1fae5; color: #059669; }
.test-badge.failed { background: #fee2e2; color: var(--danger); }
.test-badge.not-taken { background: #f1f5f9; color: var(--gray); }

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.visible { display: flex; }
.modal {
    background: white; border-radius: 20px; max-width: 700px; width: 100%;
    max-height: 90vh; overflow-y: auto; animation: modalSlideUp 0.3s ease;
}
@keyframes modalSlideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.modal-header {
    padding: 24px 28px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; background: white; z-index: 1; border-radius: 20px 20px 0 0;
}
.modal-header h3 { font-size: 20px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--gray); padding: 4px 8px; }
.modal-close:hover { color: var(--dark); }
.modal-body { padding: 28px; }
.modal-footer { padding: 20px 28px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

/* Test Modal */
.test-modal { max-width: 800px; }
.test-timer { padding: 12px 28px; background: #fef3c7; color: #92400e; font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.question-block { margin-bottom: 24px; padding: 20px; background: #f8fafc; border-radius: 12px; }
.question-text { font-weight: 600; font-size: 16px; margin-bottom: 16px; }
.question-number { color: var(--primary); font-weight: 700; margin-right: 8px; }
.option-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 6px; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.option-item:hover { background: #eff6ff; }
.option-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.option-item label { cursor: pointer; flex: 1; }
.text-answer-input { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 10px; font-size: 15px; font-family: inherit; transition: all 0.3s; }
.text-answer-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }

/* Result Modal */
.test-result-modal { max-width: 500px; text-align: center; }
.result-score { font-size: 64px; font-weight: 700; margin: 20px 0; }
.result-score.passed { color: var(--secondary); }
.result-score.failed { color: var(--danger); }
.result-label { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.result-details { color: var(--gray); margin-bottom: 20px; }

/* Content Viewer */
.content-viewer-modal { max-width: 900px; }
.content-viewer-body iframe { width: 100%; min-height: 500px; border: none; border-radius: 10px; }
.content-viewer-body video, .content-viewer-body audio { width: 100%; border-radius: 10px; }
.content-viewer-body .text-content { line-height: 1.8; font-size: 15px; }
.content-viewer-body .text-content h1,.content-viewer-body .text-content h2,.content-viewer-body .text-content h3 { margin: 16px 0 8px; }
.content-viewer-body .text-content p { margin-bottom: 12px; }
.content-viewer-body .text-content ul,.content-viewer-body .text-content ol { padding-left: 24px; margin-bottom: 12px; }

/* Document lesson icon */
.lesson-icon.document { background: #dbeafe; color: #2563eb; }

/* Modal header actions (fullscreen + close) */
.modal-header-actions { display: flex; align-items: center; gap: 4px; }
.modal-fullscreen-btn {
    background: #f1f5f9; border: none; width: 36px; height: 36px; border-radius: 8px;
    cursor: pointer; font-size: 16px; color: var(--gray); transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.modal-fullscreen-btn:hover { background: #e2e8f0; color: var(--primary); }

/* Fullscreen content viewer */
.content-viewer-modal.fullscreen {
    max-width: 100%; width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; margin: 0;
    animation: none;
}
.content-viewer-modal.fullscreen .modal-header { border-radius: 0; }
.content-viewer-modal.fullscreen .content-viewer-body { height: calc(100vh - 80px); overflow-y: auto; }
.content-viewer-modal.fullscreen .content-viewer-body iframe { min-height: calc(100vh - 140px); }
.content-viewer-modal.fullscreen .content-viewer-body img { max-height: calc(100vh - 160px); object-fit: contain; }
.content-viewer-modal.fullscreen .content-viewer-body video { max-height: calc(100vh - 160px); }

/* ===== TRAINING PLAN ===== */
.training-plan-section {
    background: white; border-radius: 16px; padding: 28px; box-shadow: var(--shadow); margin-bottom: 32px;
}
.training-plan-section h3 {
    font-size: 22px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px;
}

.plan-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.plan-day-card {
    background: white; border-radius: 16px; padding: 24px;
    border: 2px solid var(--border); transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.plan-day-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }

.plan-day-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.plan-day-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px; flex-shrink: 0;
}
.plan-day-title { font-size: 17px; font-weight: 700; color: var(--dark); }
.plan-day-subtitle { font-size: 13px; color: var(--gray); margin-top: 2px; }

.plan-day-modules { display: flex; flex-direction: column; gap: 6px; }

.plan-module-link {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    border-radius: 8px; cursor: pointer; transition: all 0.2s;
    font-size: 14px; font-weight: 500; color: var(--dark);
}
.plan-module-link:hover { background: #f0f4ff; }
.plan-module-link.completed { color: var(--secondary); }
.plan-module-link.completed span { text-decoration: line-through; opacity: 0.7; }
.plan-module-link i { font-size: 12px; width: 16px; text-align: center; }

/* ===== DOWNLOAD BAR ===== */
.download-bar {
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
    display: flex; justify-content: center;
}
.btn-outline {
    background: white; color: var(--dark); border: 2px solid var(--border);
    padding: 8px 20px; border-radius: 8px; font-weight: 600;
    cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-family: inherit; text-decoration: none;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ===== FILE PREVIEW PLACEHOLDER ===== */
.file-preview-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; text-align: center;
}
.file-preview-placeholder i { font-size: 64px; color: #ea580c; margin-bottom: 16px; opacity: 0.6; }
.file-preview-placeholder p { color: var(--gray); margin-bottom: 20px; font-size: 15px; }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 99999; }
.toast {
    background: white; padding: 16px 24px; border-radius: 12px; box-shadow: var(--shadow-lg);
    margin-bottom: 10px; display: flex; align-items: center; gap: 12px; min-width: 300px;
    animation: toastSlide 0.4s ease; border-left: 4px solid var(--secondary);
}
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--primary); }
@keyframes toastSlide { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }

/* ===== FOOTER ===== */
.footer { text-align: center; padding: 32px; color: white; opacity: 0.8; font-size: 14px; }

/* ===== MOBILE MENU ===== */
.menu-toggle {
    display: none; position: fixed; top: 20px; left: 20px; z-index: 1001;
    background: white; border: none; width: 48px; height: 48px; border-radius: 12px;
    box-shadow: var(--shadow); cursor: pointer; font-size: 20px;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner { text-align: center; padding: 60px; color: var(--gray); }
.loading-spinner i { font-size: 40px; margin-bottom: 16px; animation: spin 1s linear infinite; display: block; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 100px 20px 20px; }
    .menu-toggle { display: flex; align-items: center; justify-content: center; }
    .content-grid { grid-template-columns: 1fr; }
    .user-bar { left: 0; padding: 12px 20px; }
    .welcome-section { padding: 28px; }
    .welcome-section h2 { font-size: 24px; }
    .stats { gap: 20px; }
    .stat-value { font-size: 28px; }
}

@media (max-width: 480px) {
    .login-modal { padding: 32px 24px; }
    .section-header { flex-direction: column; gap: 12px; text-align: center; }
    .section-header h2 { font-size: 22px; }
    .badge-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

/* ===== DEADLINE BADGE ===== */
.deadline-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin: 12px 0 4px;
}
.deadline-badge.ok {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.deadline-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}
.deadline-badge.overdue {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== NOTIFICATION BELL ===== */
.user-bar-actions { display: flex; align-items: center; gap: 12px; }
.notif-bell-wrapper { position: relative; }
.btn-notif-bell {
    background: #f1f5f9; border: none; width: 40px; height: 40px; border-radius: 10px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--gray); transition: all 0.3s; position: relative;
}
.btn-notif-bell:hover { background: #e2e8f0; color: var(--primary); }
.notif-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger); color: white; font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; padding: 0 4px;
    animation: notifPop 0.3s ease;
}
@keyframes notifPop { from { transform: scale(0); } to { transform: scale(1); } }

/* ===== NOTIFICATION DROPDOWN ===== */
.notif-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 8px;
    background: white; border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    width: 360px; max-height: 420px; display: none; z-index: 9999;
    overflow: hidden; border: 1px solid var(--border);
}
.notif-dropdown.visible { display: block; animation: notifSlide 0.2s ease; }
@keyframes notifSlide { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.notif-dropdown-header {
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.notif-dropdown-header h4 { font-size: 15px; font-weight: 700; }
.btn-notif-readall {
    background: none; border: none; color: var(--primary); font-size: 12px;
    font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-notif-readall:hover { text-decoration: underline; }
.notif-dropdown-body { max-height: 350px; overflow-y: auto; }
.notif-empty { text-align: center; padding: 40px 20px; color: var(--gray); }
.notif-empty i { font-size: 36px; margin-bottom: 8px; display: block; opacity: 0.3; }
.notif-empty p { font-size: 13px; }
.notif-item {
    display: flex; gap: 12px; padding: 14px 18px; cursor: pointer;
    transition: all 0.2s; border-bottom: 1px solid #f1f5f9; position: relative;
}
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #f0f9ff; }
.notif-item.read { opacity: 0.7; }
.notif-item-icon { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.notif-item-msg { font-size: 12px; color: var(--gray); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-time { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.notif-item-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }

/* ===== CERTIFICATE BANNER ===== */
.certificate-banner {
    display: flex; align-items: center; gap: 20px; padding: 24px 28px;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: 16px; margin-top: 20px; border: 2px solid #6ee7b7;
}
.certificate-banner-icon { font-size: 40px; flex-shrink: 0; }
.certificate-banner h4 { font-size: 16px; font-weight: 700; color: #065f46; margin-bottom: 4px; }
.certificate-banner p { font-size: 13px; color: #047857; }
.certificate-banner .btn { margin-left: auto; white-space: nowrap; flex-shrink: 0; }
