/* ============================================
   CSS VARIABLES & RESET
   ============================================ */
 /* ============================================
   CSS VARIABLES & RESET
   Bảng màu đồng bộ với Cổng TTĐT Trường THCS-THPT Trần Trường Sinh
   Primary: Navy đậm #1e3a8a | Accent: Vàng đồng #d97706
   ============================================ */
:root {
    /* === PRIMARY — Xanh dương Navy đậm (màu chủ đạo nhà trường) === */
    --primary: #1e3a8a;
    --primary-dark: #172554;
    --primary-light: #3b82f6;
    --primary-bg: #dbeafe;

    /* === ACCENT — Vàng đồng / Cam đất (điểm nhấn thương hiệu) === */
    --accent: #d97706;
    --accent-dark: #b45309;
    --accent-light: #f59e0b;
    --accent-bg: #fef3c7;

    /* === Trạng thái hệ thống (giữ nguyên để tương thích) === */
    --secondary: #64748b;
    --success: #22c55e;
    --success-bg: #dcfce7;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #8b5cf6;
    --info-bg: #ede9fe;

    /* === Thang độ xám (giữ nguyên) === */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;

    /* === Shadow & Radius === */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* === Layout === */
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
    --topbar-height: 76px; /* Tăng từ 64px → 76px để chứa logo 2 dòng tên trường */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* === Brand Gradient (dùng cho header/sidebar-brand) === */
    --brand-gradient: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
    --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    color: var(--gray-600);
    font-weight: 500;
}

/* ============================================
   LAYOUT
   ============================================ */
#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 28px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--gray-900);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.user-details span:first-child {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition);
    width: 100%;
    justify-content: center;
}

.btn-logout:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}

.btn-toggle-sidebar {
    display: none;
    background: none;
    font-size: 20px;
    color: var(--gray-600);
    padding: 4px;
}

.top-bar h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    flex: 1;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-date {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}

/* Page Container */
.page-container {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    color: var(--gray-400);
    font-size: 11px;
    font-weight: 500;
    transition: color var(--transition);
    min-width: 56px;
}

.mobile-nav-item i {
    font-size: 22px;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item span {
    font-size: 10px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-body {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.login-brand h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.login-brand p {
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 2px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.login-form label i {
    margin-right: 8px;
    color: var(--gray-400);
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border-color var(--transition);
    background: var(--gray-50);
}

.login-form input:focus {
    border-color: var(--primary);
    background: var(--white);
}

.password-wrapper {
    position: relative;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--gray-400);
    font-size: 18px;
    padding: 4px;
}

.btn-toggle-password:hover {
    color: var(--gray-600);
}

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: var(--primary-dark);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--gray-400);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.login-divider span {
    padding: 0 16px;
}

.btn-google-login {
    width: 100%;
    padding: 14px;
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-google-login:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.btn-google-login i {
    color: #ea4335;
    font-size: 20px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
}

.login-version {
    font-size: 11px;
    margin-top: 2px;
    color: var(--gray-300);
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
    width: 100%;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--gray-900);
    color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    font-size: 14px;
}

.toast.success {
    background: var(--success);
}
.toast.error {
    background: var(--danger);
}
.toast.warning {
    background: var(--warning);
    color: var(--gray-900);
}
.toast.info {
    background: var(--info);
}

.toast i {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    word-break: break-word;
}

.toast-close {
    background: none;
    color: rgba(255,255,255,0.6);
    font-size: 18px;
    padding: 0 4px;
    flex-shrink: 0;
}

.toast-close:hover {
    color: white;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   MODAL
   ============================================ */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-container.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    font-size: 24px;
    color: var(--gray-400);
    padding: 4px;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================
   DASHBOARD PAGE
   ============================================ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-card.draft { border-left-color: var(--warning); }
.stat-card.discussion { border-left-color: var(--primary); }
.stat-card.concluded { border-left-color: var(--info); }
.stat-card.closed { border-left-color: var(--success); }

.dashboard-recent {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.section-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.section-body {
    padding: 16px 20px;
}

/* ============================================
   MEETINGS LIST
   ============================================ */
.meetings-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.meetings-toolbar .search-box {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    transition: border-color var(--transition);
}

.meetings-toolbar .search-box:focus-within {
    border-color: var(--primary);
}

.meetings-toolbar .search-box input {
    padding: 10px 12px;
    border: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
}

.meetings-toolbar .search-box i {
    color: var(--gray-400);
}

.btn-primary {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background var(--transition);
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background var(--transition);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    padding: 8px 16px;
    background: transparent;
    color: var(--gray-600);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition);
}

.btn-outline:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.meeting-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 12px;
    transition: box-shadow var(--transition);
    cursor: pointer;
}

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

.meeting-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.meeting-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.meeting-card-code {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.meeting-card-body {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--gray-600);
    font-size: 14px;
}

.meeting-card-body span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meeting-card-footer {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.draft {
    background: var(--warning-bg);
    color: #b45309;
}

.status-badge.discussion {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.status-badge.concluded {
    background: var(--info-bg);
    color: #6d28d9;
}

.status-badge.confirmation {
    background: #f3e8ff;
    color: #7c3aed;
}

.status-badge.closed {
    background: var(--success-bg);
    color: #15803d;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.draft { background: var(--warning); }
.status-dot.discussion { background: var(--primary); }
.status-dot.concluded { background: var(--info); }
.status-dot.confirmation { background: #7c3aed; }
.status-dot.closed { background: var(--success); }

/* ============================================
   MEETING DETAIL
   ============================================ */
.meeting-detail-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.meeting-detail-title {
    font-size: 20px;
    font-weight: 700;
}

.meeting-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--gray-600);
}

.meeting-detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   MEETING TABS — Pills nổi bật, hiện đại
   ============================================ */
.meeting-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 8px 0 6px 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
}

.meeting-tabs::-webkit-scrollbar {
    height: 5px;
}

.meeting-tabs::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.meeting-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.meeting-tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    color: var(--gray-600);
    background: #ffffff;
    border: 2px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.04);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.meeting-tab .tab-icon {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.3s ease;
    display: inline-block;
}

.meeting-tab .tab-label {
    letter-spacing: 0.2px;
}

/* === HOVER === */
.meeting-tab:hover {
    color: var(--primary);
    border-color: var(--primary-light);
    background: #eff6ff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.15);
}

.meeting-tab:hover .tab-icon {
    transform: scale(1.2);
}

/* === ACTIVE === */
.meeting-tab.active {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
    color: #ffffff;
    border-color: #1e3a8a;
    box-shadow: 0 10px 24px rgba(30, 58, 138, 0.4);
    transform: translateY(-3px);
}

.meeting-tab.active .tab-icon {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
    transform: scale(1.2);
}

/* Dải vàng đồng accent dưới tab active */
.meeting-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fbbf24 0%, #d97706 100%);
    border-radius: 0 0 14px 14px;
}

/* Hiệu ứng click */
.meeting-tab:active {
    transform: translateY(-1px) scale(0.98);
    transition: transform 0.1s;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .meeting-tabs {
        gap: 8px;
        padding: 4px 0;
        margin-bottom: 16px;
    }

    .meeting-tab {
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 12px;
        gap: 6px;
        box-shadow: 0 1px 3px rgba(30, 58, 138, 0.06);
    }

    .meeting-tab .tab-icon {
        font-size: 15px;
    }

    .meeting-tab:hover,
    .meeting-tab.active {
        transform: translateY(-2px);
    }

    .meeting-tab.active::after {
        border-radius: 0 0 12px 12px;
    }
}

@media (max-width: 480px) {
    .meeting-tab {
        padding: 8px 12px;
        font-size: 12px;
        gap: 4px;
    }

    .meeting-tab .tab-icon {
        font-size: 14px;
    }
}

.meeting-tab:hover {
    color: var(--gray-800);
}

.meeting-tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.meeting-content-panel {
    display: none;
}

.meeting-content-panel.active {
    display: block;
}

/* ============================================
   DISCUSSION THREAD
   ============================================ */
.discussion-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.discussion-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--gray-300);
}

.discussion-item.reply {
    margin-left: 40px;
    border-left-color: var(--primary-light);
}

.discussion-item .discussion-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
}

.discussion-item .discussion-author .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary);
}

.discussion-item .discussion-time {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 400;
    margin-left: 4px;
}

.discussion-item .discussion-content {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.discussion-item .discussion-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.discussion-item .discussion-attachments .attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: background var(--transition);
}

.discussion-item .discussion-attachments .attachment:hover {
    background: var(--gray-200);
}

.discussion-item .discussion-attachments .attachment img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.discussion-item .discussion-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.discussion-item .discussion-reply-count {
    margin-top: 10px;
    font-size: 13px;
    color: var(--gray-500);
    cursor: pointer;
    font-weight: 500;
}

.discussion-item .discussion-reply-count:hover {
    color: var(--primary);
}

.discussion-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 16px;
}
/* === Ô nhập thảo luận — MỞ RỘNG + AUTO-RESIZE === */
.discussion-form textarea {
    width: 100%;
    min-height: 140px;
    max-height: 500px;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    line-height: 1.7;
    font-family: inherit;
    resize: vertical;
    overflow-y: auto;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.discussion-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
    outline: none;
}

.discussion-form textarea::placeholder {
    color: var(--gray-400);
    font-style: italic;
}

/* Nút gửi ở dưới ô nhập */
.discussion-form .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
}

/* Responsive: giảm chiều cao trên mobile */
@media (max-width: 768px) {
    .discussion-form textarea {
        min-height: 120px;
        font-size: 14px;
        padding: 12px 14px;
    }
}

.discussion-form textarea:focus {
    border-color: var(--primary);
}

.discussion-form .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
}

.discussion-form .file-input-wrapper {
    position: relative;
    display: inline-block;
}

.discussion-form .file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.discussion-form .file-input-wrapper .btn-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    transition: background var(--transition);
}

.discussion-form .file-input-wrapper .btn-file:hover {
    background: var(--gray-200);
}

.discussion-form .file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.discussion-form .file-preview .file-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-bg);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--primary-dark);
}

.discussion-form .file-preview .file-chip .remove-file {
    background: none;
    color: var(--gray-400);
    font-size: 14px;
    padding: 0 2px;
}

.discussion-form .file-preview .file-chip .remove-file:hover {
    color: var(--danger);
}

/* ============================================
   CONCLUSION
   ============================================ */
.conclusion-box {
    background: var(--info-bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    border-left: 4px solid var(--info);
    margin: 12px 0;
}

.conclusion-box .conclusion-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--info);
}

.conclusion-box .conclusion-content {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-800);
}

.conclusion-box .conclusion-meta {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 6px;
}

/* ============================================
   TASKS
   ============================================ */
.task-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    border-left: 4px solid var(--gray-300);
}

.task-card.pending { border-left-color: var(--warning); }
.task-card.confirmed { border-left-color: var(--primary); }
.task-card.completed { border-left-color: var(--success); }

.task-card .task-title {
    font-weight: 600;
    font-size: 15px;
}

.task-card .task-meta {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.task-card .task-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-help {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ============================================
   CONFIRMATION
   ============================================ */
.confirmation-status {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0;
}

.confirmation-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: var(--gray-100);
    color: var(--gray-500);
}

.confirmation-item.done {
    background: var(--success-bg);
    color: #15803d;
}

.confirmation-item.done i {
    color: var(--success);
}

/* ============================================
   ACTIVITY LOG
   ============================================ */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    font-size: 14px;
}

.activity-item .activity-time {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
    min-width: 70px;
    padding-top: 1px;
}

.activity-item .activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}

.activity-item .activity-icon.created { background: var(--primary-bg); color: var(--primary); }
.activity-item .activity-icon.updated { background: var(--warning-bg); color: #b45309; }
.activity-item .activity-icon.concluded { background: var(--info-bg); color: var(--info); }
.activity-item .activity-icon.confirmed { background: var(--success-bg); color: var(--success); }
.activity-item .activity-icon.closed { background: var(--danger-bg); color: var(--danger); }

.activity-item .activity-text {
    flex: 1;
}

.activity-item .activity-text strong {
    color: var(--gray-800);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 14px;
}

/* ============================================
   RESPONSIVE OVERRIDES (see responsive.css)
   ============================================ */
/* ============================================
   CHANGE PASSWORD BUTTON
   ============================================ */
.btn-change-password {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition);
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.btn-change-password:hover {
    background: #dbeafe;
    border-color: var(--primary-light);
}

.btn-change-password i {
    font-size: 15px;
}
/* ============================================
   SCHOOL BRANDING — Header Logo & Footer Slogan
   Trường THCS-THPT Trần Trường Sinh
   ============================================ */

/* === Top Bar: Logo + School Name === */
.top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 3px solid var(--accent);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(30, 58, 138, 0.06);
}

.top-bar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 16px;
    border-right: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.top-bar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 50%;
    background: #ffffff;
    padding: 2px;
    border: 1px solid var(--gray-200);
}

.top-bar-school {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    max-width: 380px;
}

.school-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.school-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-dark);
    letter-spacing: 0.2px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Page title (đặt giữa header) */
.top-bar-page-title {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    padding: 0 12px;
    border-left: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nút toggle sidebar: hover màu navy */
.btn-toggle-sidebar:hover {
    color: var(--primary);
}

/* === Sidebar Brand — đổi sang màu Navy của trường === */
.sidebar-brand {
    background: var(--brand-gradient);
    border-bottom: none;
    padding: 20px 24px;
}

.sidebar-brand .brand-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.sidebar-brand .brand-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.sidebar-brand .brand-subtitle {
    color: #fbbf24;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Nav active: nhấn mạnh bằng accent amber */
.sidebar-nav .nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

/* === App Footer — Slogan nhà trường === */
.app-footer {
    margin-left: var(--sidebar-width);
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #e2e8f0;
    padding: 20px 24px;
    text-align: center;
    border-top: 4px solid var(--accent);
    margin-top: auto;
}

.app-footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.app-footer .slogan {
    font-size: 16px;
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.app-footer .footer-school {
    font-size: 13px;
    color: #cbd5e1;
    font-weight: 500;
    margin-bottom: 4px;
}

.app-footer .footer-copyright {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

/* === Responsive: ẩn bớt trên mobile === */
@media (max-width: 1024px) {
    .app-footer {
        margin-left: 0;
        padding-bottom: 90px; /* Chừa chỗ cho bottom nav */
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0 12px;
        gap: 8px;
    }

    .top-bar-brand {
        padding-right: 8px;
        border-right: none;
        gap: 8px;
    }

    .top-bar-logo {
        width: 40px;
        height: 40px;
    }

    .top-bar-school {
        max-width: 220px;
    }

    .school-name {
        font-size: 12px;
    }

    .school-subtitle {
        font-size: 10px;
    }

    .top-bar-page-title {
        font-size: 15px;
        padding: 0 4px;
    }
}

@media (max-width: 480px) {
    .top-bar-logo {
        width: 36px;
        height: 36px;
    }

    .top-bar-school {
        max-width: 160px;
    }

    .school-name {
        font-size: 11px;
    }

    .school-subtitle {
        display: none; /* Ẩn subtitle trên màn hình rất nhỏ */
    }

    .top-bar-page-title {
        font-size: 13px;
    }

    .app-footer .slogan {
        font-size: 13px;
        letter-spacing: 1px;
    }

    .app-footer .footer-school {
        font-size: 11px;
    }
}
/* ============================================
   MEETING ACTION PANEL
   ============================================ */
.meeting-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.meeting-action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    filter: brightness(1.05);
}

.meeting-action-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.meeting-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.meeting-action-btn i {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .meeting-action-btn {
        font-size: 14px;
        padding: 12px 18px;
        gap: 10px;
        min-height: 52px;
    }
}
/* ============================================
   WELCOME MODAL — Hướng dẫn chào mừng theo vai trò
   ============================================ */

.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: welcomeFadeIn 0.3s ease;
}

.welcome-overlay.active {
    display: flex;
}

@keyframes welcomeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.welcome-modal {
    background: #ffffff;
    border-radius: 20px;
    max-width: 780px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    animation: welcomeSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes welcomeSlideUp {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Header gradient theo vai trò */
.welcome-header {
    padding: 28px 28px 22px 28px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
    color: #ffffff;
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
}

.welcome-header.teacher {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.welcome-header.leader {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
}

.welcome-header.admin {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.welcome-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fbbf24 0%, #d97706 100%);
}

.welcome-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.welcome-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.welcome-emoji {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 8px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.welcome-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px 0;
    letter-spacing: 0.3px;
}

.welcome-subtitle {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.95;
    margin: 0;
    line-height: 1.5;
}

/* Body */
.welcome-body {
    padding: 28px;
}

.welcome-greeting {
    font-size: 15px;
    color: #334155;
    line-height: 1.7;
    margin-bottom: 24px;
    text-align: center;
    padding: 14px 18px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #fbbf24;
}

.welcome-greeting strong {
    color: #1e3a8a;
    font-weight: 700;
}

/* Tiêu đề section */
.welcome-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-section-title i {
    color: #d97706;
    font-size: 14px;
}

/* Danh sách các bước */
.welcome-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.welcome-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    transition: all 0.25s;
    position: relative;
}

.welcome-step:hover {
    transform: translateX(4px);
    border-color: #fbbf24;
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.12);
}

.welcome-step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.step-1 .welcome-step-number { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.step-2 .welcome-step-number { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.step-3 .welcome-step-number { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.step-4 .welcome-step-number { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }

.welcome-step-content {
    flex: 1;
    min-width: 0;
}

.welcome-step-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.welcome-step-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.welcome-step-desc {
    font-size: 14px;
    color: #475569;
    line-height: 1.65;
}

.welcome-step-desc strong {
    color: #1e3a8a;
    font-weight: 600;
}

/* Ghi chú thêm */
.welcome-note {
    margin-top: 22px;
    padding: 14px 18px;
    background: #fef3c7;
    border-radius: 12px;
    border-left: 4px solid #d97706;
    font-size: 14px;
    color: #92400e;
    line-height: 1.65;
}

.welcome-note i {
    color: #d97706;
    margin-right: 6px;
}

/* Footer */
.welcome-footer {
    padding: 20px 28px 26px 28px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
    border-radius: 0 0 20px 20px;
}

.welcome-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
}

.welcome-btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.35);
}

.welcome-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.45);
}

.welcome-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.welcome-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Responsive */
@media (max-width: 640px) {
    .welcome-modal {
        border-radius: 16px;
    }
    .welcome-header {
        padding: 22px 20px 18px 20px;
    }
    .welcome-emoji {
        font-size: 44px;
    }
    .welcome-title {
        font-size: 20px;
    }
    .welcome-subtitle {
        font-size: 13px;
    }
    .welcome-body {
        padding: 20px;
    }
    .welcome-greeting {
        font-size: 14px;
        padding: 12px 14px;
    }
    .welcome-step {
        padding: 14px;
        gap: 12px;
    }
    .welcome-step-number {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .welcome-step-title {
        font-size: 15px;
    }
    .welcome-step-desc {
        font-size: 13px;
    }
    .welcome-footer {
        padding: 16px 20px 20px 20px;
        flex-direction: column;
    }
    .welcome-btn {
        width: 100%;
        min-width: unset;
    }
}
/* ============================================
   DISCUSSION ACCORDION — Thảo luận trong từng nội dung
   ============================================ */

.discussion-accordion {
    margin-top: 16px;
    padding-top: 0;
    border-top: 2px dashed var(--gray-200);
    display: none;
}

.discussion-accordion.open {
    display: block;
    padding-top: 16px;
    animation: accordionSlideDown 0.35s ease;
}

@keyframes accordionSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.discussion-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.discussion-accordion-header i {
    color: var(--accent);
    margin-right: 6px;
}

.discussion-accordion-body {
    padding: 4px 0 0 0;
}

.discussion-accordion-body .empty-state {
    padding: 24px 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.discussion-accordion-body .discussion-loading {
    text-align: center;
    padding: 24px;
    color: var(--gray-500);
    font-size: 13px;
}

.discussion-accordion-body .discussion-loading .loader {
    width: 32px;
    height: 32px;
    border-width: 3px;
    margin: 0 auto 8px auto;
}

/* Nút toggle thảo luận */
.discussion-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    border: 1.5px solid transparent;
    font-family: inherit;
    background: var(--gray-100);
    color: var(--gray-600);
    position: relative;
}

.discussion-toggle-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

.discussion-toggle-btn.open {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.discussion-toggle-btn .count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 11px;
    font-weight: 800;
    color: inherit;
}

.discussion-toggle-btn.open .count-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.discussion-toggle-btn .toggle-icon {
    transition: transform 0.3s;
    font-size: 11px;
}

.discussion-toggle-btn.open .toggle-icon {
    transform: rotate(180deg);
}

/* Action row trong content card */
.content-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
}

/* Responsive */
@media (max-width: 768px) {
    .discussion-accordion-header {
        font-size: 13px;
        padding: 10px 12px;
    }
    .discussion-toggle-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    .content-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .content-actions .discussion-toggle-btn,
    .content-actions .btn-primary,
    .content-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
/* Nút Mời thảo luận nổi bật */
.discussion-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    font-family: inherit;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.discussion-toggle-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.38);
    color: #ffffff;
}

/* Khi đang mở accordion */
.discussion-toggle-btn.open {
    background: linear-gradient(135deg, #059669 0%, #047857 100%); /* Đổi sang màu xanh ngọc chốt mở */
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Huy hiệu số lượng ý kiến */
.discussion-toggle-btn .count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 11.5px;
    font-weight: 800;
    color: #ffffff;
}

.discussion-toggle-btn .toggle-icon {
    transition: transform 0.3s;
    font-size: 11px;
}

.discussion-toggle-btn.open .toggle-icon {
    transform: rotate(180deg);
}
/* ============================================
   QUILL EDITOR — IMAGE STYLING
   Ảnh chèn vào editor tự co giãn, không tràn khung
   ============================================ */

/* Editor container */
.ql-editor {
    min-height: 150px;
    font-size: 15px;
    line-height: 1.7;
    font-family: inherit;
}

/* Ảnh trong editor — tự động co giãn */
.ql-editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.ql-editor img:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Ảnh trong chế độ xem (không phải editor) — khi render rich content */
.rich-text-content img,
.discussion-content img,
.conclusion-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.rich-text-content img:hover,
.discussion-content img:hover,
.conclusion-content img:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Responsive cho ảnh trên mobile */
@media (max-width: 768px) {
    .ql-editor img,
    .rich-text-content img,
    .discussion-content img,
    .conclusion-content img {
        border-radius: 6px;
        margin: 8px 0;
    }
}
/* ============================================
   IMAGE RESIZE OVERLAY — Tùy chỉnh hiển thị
   ============================================ */

/* Viền xanh quanh ảnh đang chọn */
.ql-editor img.ql-image-selected,
.ql-editor .image-resize-selected {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Badge hiển thị kích thước */
.ql-editor .image-resize-display {
    background: #1e293b !important;
    color: #ffffff !important;
    font-size: 11px !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-family: monospace !important;
    font-weight: 600 !important;
}

/* Trên mobile: ô vuông to hơn để dễ chạm */
@media (max-width: 768px) {
    .ql-editor .image-resize-handle {
        width: 18px !important;
        height: 18px !important;
    }
}
/* ============================================
   QUILL EDITOR — DRAG & DROP VISUAL FEEDBACK
   ============================================ */

.ql-editor.ql-drag-over,
.ql-container.ql-drag-over,
.ql-editor.ql-drag-over::after {
    background: #eff6ff !important;
}

.ql-editor.ql-drag-over {
    outline: 3px dashed #2563eb;
    outline-offset: -6px;
    border-radius: 8px;
}

.ql-editor.ql-drag-over::before {
    content: '📸 Thả ảnh vào đây để tải lên';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(37, 99, 235, 0.95);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    animation: dragPulse 1.2s ease-in-out infinite;
}

@keyframes dragPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}