:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --danger-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    --dark-gradient: linear-gradient(135deg, #434343 0%, #000000 100%);
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #009322;
    --info-color: #4facfe;
    --warning-color: #fda085; /*#38ef7d*/
    --danger-color: #ff6b6b;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --bg-badge-teal: blueviolet;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 6px 10px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12), 0 10px 20px rgba(0, 0, 0, 0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --content-max-width: 1200px;
}

.container {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

    .container.admin-container {
        max-width: 90%;
    }

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
    height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background: var(--bg-light);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

header {
    flex-shrink: 0;
}

main {
    flex: 1 0 auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

.navbar {
    background: var(--primary-gradient) !important;
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-md);
    border: none;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.msg-nav-list {
    margin-top: 30px;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    margin-top: 0.5rem;
    animation: dropdownFade 0.2s ease;
}

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

.dropdown-item {
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-light);
}

.dropdown-item i {
    width: 1.25rem;
    margin-right: 0.5rem;
}

.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--bg-card);
    transition: all var(--transition-normal);
    overflow: hidden;
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header.bg-primary {
    background: var(--primary-gradient) !important;
    color: #fff;
    border: none;
}

.card-header.bg-success {
    background: var(--success-gradient) !important;
    color: #fff;
    border: none;
}

.card-header.bg-info {
    background: var(--info-gradient) !important;
    color: #fff;
    border: none;
}

.card-header.bg-warning {
    background: var(--warning-gradient) !important;
    color: #fff;
    border: none;
}

.card-header.bg-danger {
    background: var(--danger-gradient) !important;
    color: #fff;
    border: none;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.btn {
    border-radius: var(--radius-md);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background: var(--primary-gradient);
}

.btn-success {
    background: var(--success-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.5);
    background: var(--success-gradient);
}

.btn-info {
    background: var(--info-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.5);
    background: var(--info-gradient);
}

.btn-danger {
    background: var(--danger-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    background: var(--danger-gradient);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--text-secondary);
    color: #fff;
    border-color: var(--text-secondary);
}

.btn-outline-success {
    border: 2px solid var(--success-color);
    color: var(--success-color);
    background: transparent;
}

.btn-outline-success:hover {
    background: var(--success-gradient);
    color: #fff;
    border-color: transparent;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: var(--bg-card);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1rem;
}

.list-group {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    transition: all var(--transition-fast);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item-action:hover {
    background: var(--bg-light);
    transform: translateX(4px);
}

.list-group-item-warning {
    background: linear-gradient(135deg, rgba(253, 160, 133, 0.15) 0%, rgba(246, 211, 101, 0.15) 100%);
    border-left: 4px solid var(--warning-color);
}

.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.badge.bg-danger {
    background: var(--danger-gradient) !important;
}

.badge.bg-success {
    background: var(--success-gradient) !important;
}

.badge.bg-info {
    background: var(--info-gradient) !important;
}

.badge.bg-teal {
    background: var(--bg-badge-teal) !important;
}

.badge.bg-warning {
    background: var(--warning-gradient) !important;
    color: #fff !important;
}

.badge.bg-secondary {
    background: var(--warning-gradient) !important;
    color: #fff !important;
}

    .badge.bg-purple {
        background: var(--warning-gradient) !important;
        color: #fff !important;
    }

.badge.bg-light {
    background: var(--bg-light) !important;
    color: var(--text-primary) !important;
}

.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.alert-info {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.15) 100%);
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

.alert-success {
    background: linear-gradient(135deg, rgba(17, 153, 142, 0.15) 0%, rgba(56, 239, 125, 0.15) 100%);
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(238, 90, 36, 0.15) 100%);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

footer.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-top: auto;
    flex-shrink: 0;
}

footer.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer.footer a {
    color: var(--primary-color);
    font-weight: 500;
}

.hero-section {
    background: var(--primary-gradient);
    color: #fff;
    padding: 4rem 2rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.feature-card i {
    font-size: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.feature-card h4 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.message-item {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.message-item:hover {
    background: var(--bg-light);
}

.message-item.unread {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-left: 4px solid var(--primary-color);
}

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

.message-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.message-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sidebar-card {
    position: relative;
}

.sidebar-menu {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sidebar-menu .list-group-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
}

.sidebar-menu .list-group-item i {
    width: 1.25rem;
    text-align: center;
    color: var(--primary-color);
}

.sidebar-menu .list-group-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary-color);
}

.sidebar-menu .list-group-item.active {
    background: var(--primary-gradient);
    color: #fff;
}

.sidebar-menu .list-group-item.active i {
    color: #fff;
}

.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    max-width: 450px;
    width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.auth-card .card-header {
    padding: 2rem;
    text-align: center;
}

.auth-card .card-header h3 {
    margin: 0;
    font-weight: 700;
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.api-section {
    margin-bottom: 2rem;
}

.api-section h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-card {
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
}

.api-card .card-header {
    padding: 0.85rem 1.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.api-card .card-header h5 {
    margin: 0;
    font-weight: 600;
}

pre {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

pre code {
    color: inherit;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 700;
    background: var(--danger-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.error-page h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 5rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.user-avatar-lg {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

.message-content {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-icon.primary {
    background: var(--primary-gradient);
}

.stat-icon.success {
    background: var(--success-gradient);
}

.stat-icon.info {
    background: var(--info-gradient);
}

.stat-icon.warning {
    background: var(--warning-gradient);
}

.stat-info h5 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nav-area-part-bar {
    width:100%;
    min-height: 30px;
}

.sidebar-nav-header {
    padding: 1rem 1.25rem;
}

.sidebar-nav-icon {
    font-size: 1.5rem;
    opacity: 0.9;
}

.btn-close-dark {
    filter: none;
    opacity: 0.5;
}

.btn-close-dark:hover {
    opacity: 0.8;
}

.filter-bar {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.filter-row {
    display: flex;
    align-items: flex-start;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.filter-row:last-of-type {
    border-bottom: none;
}

.filter-label {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding-top: 4px;
    margin-right: 12px;
    white-space: nowrap;
}

.filter-label i {
    color: var(--primary-color);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.82rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    user-select: none;
}

.filter-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-tag.active {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
}

.filter-tag.active .filter-tag-count {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.filter-tag-count {
    font-size: 0.7rem;
    background: var(--bg-light);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.filter-active-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-bottom: 1px solid var(--border-color);
}

.filter-active-label {
    font-size: 0.82rem;
    color: var(--primary-color);
    font-weight: 500;
    white-space: nowrap;
}

.filter-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    background: var(--primary-gradient);
    color: #fff;
    transition: all var(--transition-fast);
}

.filter-active-tag:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.filter-clear-btn {
    margin-left: auto;
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

.recipients-display {
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.recipient-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recipient-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.recipient-chip.read {
    border-color: #a5d6a7;
    background: #f1f8e9;
}

.recipient-chip.unread {
    border-color: #e0e0e0;
    background: #fafafa;
}

.recipient-chip-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.recipient-chip.read .recipient-chip-avatar {
    background: linear-gradient(135deg, #43a047, #66bb6a);
}

.recipient-chip-name {
    font-weight: 500;
    font-size: 0.88rem;
    min-width: 40px;
}

.recipient-chip-status {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-size: 0.75rem;
}

footer.footer.text-muted {
    position: static;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.4s ease forwards;
}

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

.pulse {
    animation: pulse 2s infinite;
}

.mustread-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 29999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    animation: mustread-overlay-in 0.3s ease;
}

@keyframes mustread-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mustread-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    animation: mustread-backdrop-in 0.35s ease;
}

@keyframes mustread-backdrop-in {
    from { background: rgba(0,0,0,0); }
    to { background: rgba(0,0,0,0.45); }
}

.mustread-card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 640px;
    width: 92%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12), 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden;
    animation: mustread-card-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

@keyframes mustread-card-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.mustread-color-strip {
    position: absolute;
    top: 0; left: 0;
    width: 6px;
    height: 100%;
    z-index: 1;
}

.mustread-color-strip.urgent { background: #e74c3c; }
.mustread-color-strip.important { background: #e67e22; }
.mustread-color-strip.normal { background: #3498db; }

.mustread-header {
    padding: 20px 28px 16px 34px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafbfc;
    position: relative;
    z-index: 2;
}

.mustread-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mustread-header-title h4 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.mustread-priority-icon {
    flex-shrink: 0;
    font-size: 1.3rem;
}

.mustread-priority-icon.urgent { color: #e74c3c; }
.mustread-priority-icon.important { color: #e67e22; }
.mustread-priority-icon.normal { color: #3498db; }

.mustread-header-meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
}

.mustread-header .mustread-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.mustread-priority-badge.urgent {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.mustread-priority-badge.important {
    background: #fef3e2;
    color: #d35400;
    border: 1px solid #fad8a8;
}

.mustread-priority-badge.normal {
    background: #e8f4fd;
    color: #2980b9;
    border: 1px solid #bee5eb;
}

.mustread-header-sender {
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mustread-header-time {
    color: #95a5a6;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mustread-content {
    padding: 24px 28px 24px 34px;
    overflow-y: auto;
    flex: 1;
    background: #fafbfc;
    font-size: 16px;
    line-height: 1.8;
    color: #2c3e50;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
    letter-spacing: 0.3px;
    scroll-behavior: smooth;
}

.mustread-content p {
    margin-bottom: 8px;
}

.mustread-content::-webkit-scrollbar {
    width: 6px;
}

.mustread-content::-webkit-scrollbar-track {
    background: transparent;
}

.mustread-content::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 3px;
}

.mustread-content::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.mustread-footer {
    padding: 18px 28px 18px 34px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    background: #fff;
    position: relative;
    z-index: 2;
}

.mustread-progress-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.mustread-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s;
}

.mustread-progress-dot.active {
    background: #3498db;
}

.mustread-progress-dot.done {
    background: #27ae60;
}

.mustread-progress-text {
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 14px;
}

.mustread-countdown-bar {
    height: 3px;
    background: #ecf0f1;
    border-radius: 2px;
    margin-bottom: 14px;
    overflow: hidden;
}

.mustread-countdown-fill {
    height: 100%;
    background: linear-gradient(135deg, #3498db, #1abc9c);
    border-radius: 2px;
    transition: width 1s linear;
}

.mustread-read-hint {
    font-size: 13px;
    color: #95a5a6;
    margin-bottom: 10px;
}

.mustread-btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.mustread-btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mustread-btn:active {
    transform: scale(0.97);
}

.mustread-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.mustread-btn-confirm {
    background: linear-gradient(135deg, #3498db, #27ae60);
    color: #fff;
    min-width: 200px;
}

.mustread-btn-confirm:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.mustread-btn-confirm:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
}

.mustread-btn-reply {
    background: #fff;
    color: #3498db;
    border: 1.5px dashed #3498db;
    padding: 10px 24px;
}

.mustread-btn-reply:hover {
    background: rgba(52, 152, 219, 0.05);
}

.mustread-btn-submit {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #27ae60, #1abc9c);
    color: #fff;
    cursor: pointer;
}

.mustread-btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.mustread-btn-submit:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.mustread-reply-section {
    margin-bottom: 14px;
    text-align: left;
}

.mustread-reply-textarea {
    width: 100%;
    min-height: 90px;
    padding: 12px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mustread-reply-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.mustread-reply-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

.mustread-btn-cancel {
    padding: 8px 20px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #888;
    cursor: pointer;
}

.mustread-btn-cancel:hover {
    background: #f5f5f5;
}

.mustread-btn-send {
    padding: 8px 20px;
    font-size: 13px;
    border: none;
    border-radius: 20px;
    background: #3498db;
    color: #fff;
    cursor: pointer;
}

.mustread-btn-send:hover:not(:disabled) {
    background: #2980b9;
}

.mustread-btn-send:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.mustread-attachments {
    margin-top: 20px;
    padding: 14px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eef0f2;
}

.mustread-attachments-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    margin-bottom: 10px;
}

.mustread-attachment-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.mustread-attachment-images img {
    max-width: 180px;
    max-height: 130px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.2s;
}

.mustread-attachment-images img:hover {
    transform: scale(1.03);
}

.mustread-attachment-file {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 6px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.mustread-attachment-file:hover {
    background: #eef1f3;
}

.mustread-attachment-file-icon {
    margin-right: 10px;
    flex-shrink: 0;
    color: #888;
}

.mustread-attachment-file-info {
    flex: 1;
    min-width: 0;
}

.mustread-attachment-file-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mustread-attachment-file-size {
    font-size: 11px;
    color: #999;
}

.mustread-attachment-file-dl {
    margin-left: 10px;
    color: #bbb;
}

.mustread-deadline {
    margin-top: 20px;
    padding: 12px 16px;
    background: #f0f7ff;
    border-radius: 10px;
    color: #2980b9;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid #3498db;
}

.mustread-learning-progress {
    margin-top: 20px;
    padding: 18px;
    background: #f1f8e9;
    border-radius: 12px;
    border-left: 4px solid #66bb6a;
}

.mustread-learning-progress-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #388e3c;
    margin-bottom: 14px;
}

.mustread-learning-progress-grid {
    display: grid;
    gap: 12px;
}

.mustread-learning-progress-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.mustread-learning-progress-select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

.mustread-learning-progress-select:focus {
    outline: none;
    border-color: #66bb6a;
}

.mustread-learning-progress-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    min-height: 70px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.mustread-image-preview {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 39999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.9);
    cursor: pointer;
}

.mustread-image-preview img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

.mustread-image-preview-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mustread-image-preview-close:hover {
    background: rgba(255,255,255,0.25);
}

@keyframes mustread-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mustread-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mustread-spin 0.8s linear infinite;
    vertical-align: middle;
}

.mustread-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #27ae60;
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: mustread-toast-in 0.3s ease;
}

@keyframes mustread-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
        border-radius: var(--radius-lg);
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .card {
        border-radius: var(--radius-md);
    }
    
    .auth-card {
        margin: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
    
    .sidebar-card {
        position: relative;
        top: 0;
        margin-bottom: 1rem;
    }

    .recipient-chip {
        padding: 4px 8px;
    }

    .recipient-chip-name {
        font-size: 0.78rem;
    }

    .recipient-chip-status {
        font-size: 0.68rem;
    }

    .recipients-display {
        max-width: 180px;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

::selection {
    background: var(--primary-color);
    color: #fff;
}

.receiver-selector {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    overflow: hidden;
}

.receiver-selected-display {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--theme-primary-bg, #e6f7ff);
    border-bottom: 2px solid var(--primary-color);
}

.receiver-selected-display .selected-user-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
}

.receiver-selected-display .selected-user-info i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.receiver-selected-display .selected-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.receiver-selected-display .selected-type {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.receiver-selected-display .btn-change {
    padding: 6px 12px;
    margin-right: 8px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.receiver-selected-display .btn-change:hover {
    background: var(--primary-color);
    color: #fff;
}

.receiver-selected-display .btn-clear {
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.receiver-selected-display .btn-clear:hover {
    background: var(--danger-color);
    color: #fff;
}

.receiver-selector-panel {
    transition: all 0.3s ease;
    overflow: hidden;
}

.receiver-selector-panel.collapsed {
    max-height: 0;
    border-top: none;
}

.receiver-selector-panel:not(.collapsed) {
    max-height: 500px;
}

.selector-toggle-btns {
    display: flex;
    padding: 10px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
}

.toggle-btn {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.toggle-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.selector-content {
    max-height: 350px;
    overflow-y: auto;
    padding: 12px;
}

.tab-content {
    display: none;
}

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

.category-block,
.grade-block,
.class-block {
    margin-bottom: 6px;
}

.category-title,
.grade-title,
.class-title {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.category-title:hover,
.grade-title:hover,
.class-title:hover {
    background: var(--theme-primary-bg, #e6f7ff);
}

.category-title i,
.grade-title i,
.class-title i {
    color: var(--text-muted);
    margin-right: 8px;
    transition: transform var(--transition-fast);
    font-size: 0.8rem;
}

.category-title i.fa-chevron-down,
.grade-title i.fa-chevron-down,
.class-title i.fa-chevron-down {
    color: var(--primary-color);
}

.category-list,
.grade-list,
.class-list {
    margin-left: 16px;
    margin-top: 4px;
    padding-left: 12px;
    border-left: 2px solid var(--border-color);
    display: none;
}

.user-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin: 3px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    background: #fff;
}

.user-option:hover {
    background: var(--bg-light);
    border-color: var(--border-color);
}

.user-option.selected {
    background: var(--theme-primary-bg, #e6f7ff);
    border-color: var(--primary-color);
}

.user-option.selected .user-name {
    color: var(--primary-color);
    font-weight: 600;
}

.user-option .user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-option .user-class {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 8px;
}

.user-option i {
    color: transparent;
    font-size: 0.95rem;
}

.user-option.selected i {
    color: var(--primary-color);
}
