* { box-sizing: border-box; }
        body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f2f5; color: #1c1e21; margin: 0; padding: 0; }
        
        /* Responsive container styling */
        header, footer, .fdiv, .email-error, .main-layout { width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; }
        
        header { background: #2373F4; color: #fff; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-radius: 0; }
        @media(min-width: 768px) {
            header { border-radius: 8px; margin-top: 15px; padding: 15px 30px; }
        }
        header a { color: #fff; text-decoration: none; font-weight: bold; }
        header .nav-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
        header .nav-links a { font-size: 0.9em; text-decoration: underline; cursor: pointer; }

        .fdiv { background: #fff; color: #000; padding: 15px 20px; text-align: center; border-radius: 0; margin-bottom: 15px; box-shadow: 0 -1px 3px rgba(0,0,0,0.05); }
        @media(min-width: 768px) {
            .fdiv { border-radius: 8px; margin-bottom: 25px; }
        }

        .email-error { border-radius: 8px; background: pink; color: red; padding: 10px 20px; text-align: center; margin-top: 5px; }
        
        /* Main Layout Grid with Mobile Collapse */
        .main-layout { margin: 15px auto; display: grid; grid-template-columns: 1fr; gap: 15px; padding: 0 10px; }
        @media(min-width: 900px) {
            .main-layout { grid-template-columns: 260px 1fr; gap: 20px; padding: 0 15px; margin: 25px auto; }
        }

        .sidebar, .content { background: #fff; padding: 15px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); word-break: break-word; }
        @media(min-width: 768px) {
            .sidebar, .content { padding: 20px; }
        }

        .badge { font-size: 11px; padding: 3px 7px; border-radius: 12px; font-weight: bold; text-transform: uppercase; display: inline-block; }
        .badge-super_admin { background: #722ed1; color: #fff; }
        .badge-admin { background: #f5222d; color: #fff; }
        .badge-mod { background: #fa8c16; color: #fff; }
        .badge-user { background: #8c8c8c; color: #fff; }
        .badge-pinned { background: #1890ff; color: #fff; margin-right: 5px; }
        .badge-locked { background: #595959; color: #fff; margin-right: 5px; }
        .badge-suspended { background: #ff4d4f; color: #fff; }
        .badge-unverified { background: #faad14; color: #fff; }
        .badge-count { background: #e4e6eb; color: #050505; margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
        
        .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #eee; flex-shrink: 0; }
        @media(min-width: 768px) {
            .avatar { width: 48px; height: 48px; }
        }
        .avatar-large { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; background: #eee; flex-shrink: 0; }
        @media(min-width: 768px) {
            .avatar-large { width: 90px; height: 90px; }
        }

        .card { background: #fff; border: 1px solid #e8e8e8; padding: 12px; border-radius: 6px; margin-bottom: 12px; display: flex; gap: 10px; align-items: flex-start; }
        @media(min-width: 768px) {
            .card { padding: 15px; gap: 15px; align-items: center; }
        }

        .topic-details { flex-grow: 1; min-width: 0; }
        .meta { font-size: 0.8em; color: #65676b; margin-top: 5px; }
        @media(min-width: 768px) {
            .meta { font-size: 0.85em; }
        }
        
        .actions a { font-size: 0.8em; margin-right: 10px; color: #1877f2; text-decoration: none; }
        .actions a.danger { color: #f5222d; }
        
        form { margin-top: 15px; }
        input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="file"], select, textarea { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; /* Prevents auto-zoom on mobile safari */ }
        button { background: #1877f2; color: #fff; border: none; padding: 10px 16px; border-radius: 4px; cursor: pointer; font-weight: bold; width: 100%; }
        @media(min-width: 768px) {
            button { width: auto; }
        }
        
        .alert { background: #e6f7ff; border: 1px solid #91d5ff; padding: 10px; border-radius: 4px; margin-bottom: 15px; font-size: 0.9em; }
        .alert-danger { background: #fff1f0; border-color: #ffa39e; color: #cf1322; }
        
        .nav-list { list-style: none; padding: 0; margin: 0; }
        .nav-list li { margin-bottom: 8px; }
        .nav-list a { color: #333; text-decoration: none; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 4px; }
        .nav-list a:hover, .nav-list a.active { background: #e7f3ff; color: #1877f2; font-weight: bold; }
        
        /* Responsive Table wrapper for small screens */
        .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 15px; }
        .table { width: 100%; border-collapse: collapse; min-width: 600px; }
        .table th, .table td { border: 1px solid #eee; padding: 8px; text-align: left; font-size: 0.9em; }
        
        .profile-header { display: flex; flex-direction: column; gap: 15px; align-items: center; text-align: center; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
        @media(min-width: 600px) {
            .profile-header { flex-direction: row; align-items: center; text-align: left; gap: 20px; }
        }
        
        .register-container { display: none; }
        .auth-switch-btn { color: #1877f2; font-size: 0.85em; text-decoration: none; cursor: pointer; display: inline-block; margin-top: 8px; }
        .auth-switch-btn:hover { text-decoration: underline; }
        .resend-link-under-login { font-size: 0.82em; color: #d97706; font-weight: bold; text-decoration: none; cursor: pointer; display: block; margin-top: 8px; text-align: center; background: #fffbe6; padding: 8px; border: 1px dashed #ffe58f; border-radius: 4px; }
        .resend-link-under-login:hover { background: #fff1b8; }

        .pagination { display: flex; gap: 6px; margin: 20px 0; align-items: center; justify-content: center; flex-wrap: wrap; }
        .pagination a, .pagination span { padding: 6px 12px; text-decoration: none; border: 1px solid #ccc; border-radius: 4px; color: #1877f2; font-size: 0.9em; font-weight: bold; }
        .pagination span.active { background: #1877f2; color: #fff; border-color: #1877f2; }
        .pagination a:hover { background: #e7f3ff; }

        .modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 1000; justify-content: center; align-items: center; padding: 15px; }
        .modal-card { background: #fff; padding: 20px; border-radius: 8px; width: 100%; max-width: 480px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); position: relative; animation: modalFadeIn 0.2s ease-out; max-height: 90vh; overflow-y: auto; }
        @media(min-width: 768px) {
            .modal-card { padding: 25px; }
        }
        .modal-close { position: absolute; top: 12px; right: 15px; font-size: 22px; cursor: pointer; color: #888; line-height: 1; }
        .modal-close:hover { color: #000; }
        @keyframes modalFadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }