/* ============================================================
   BÁO MỚI ĐÂY — Upgraded Stylesheet
   Version 2.0 | Refined Editorial Theme
   ============================================================ */

/* Reset and Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --primary-color: #0052cc;
    --primary-hover: #0047b3;
    --primary-light: #e8f0fe;
    --secondary-color: #253858;

    /* Semantic Colors */
    --success-color: #10b981;
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --danger-color: #ef4444;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --warning-color: #f59e0b;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --info-bg: #dbeafe;
    --info-text: #1e40af;

    /* Neutrals */
    --dark-color: #0f172a;
    --dark-secondary: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-color: #334155;
    --text-light: #64748b;
    --text-muted: #94a3b8;

    /* Surface */
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --page-bg: #f1f5f9;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-focus: 0 0 0 3px rgba(0,82,204,0.2);

    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    /* Typography */
    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: 'Georgia', 'Times New Roman', serif;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-color);
    background-color: var(--page-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow var(--transition-base);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0;
    gap: 2rem;
}

/* Logo */
.logo h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary-color);
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo a::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

/* Navigation */
.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.nav-menu a.active {
    color: var(--primary-color);
    background: var(--primary-light);
    font-weight: 600;
}

/* Mobile toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: var(--light-color);
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--dark-color);
    border-radius: 2px;
    transition: all var(--transition-base);
    display: block;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-menu li a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    margin-left: 2rem;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-dropdown-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-color);
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-light);
    transition: transform var(--transition-fast);
}

.user-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 1000;
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--page-bg);
    border-bottom: 1px solid var(--border-color);
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.user-details .user-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.user-details .user-role {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.user-dropdown-menu li.divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.user-dropdown-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.user-dropdown-menu li a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

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

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

/* ============================================================
   FLASH MESSAGES
   ============================================================ */

.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1001;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash-message {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-left: 3px solid var(--success-color);
}

.flash-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-left: 3px solid var(--danger-color);
}

.flash-info {
    background: var(--info-bg);
    color: var(--info-text);
    border-left: 3px solid var(--primary-color);
}

.close-flash {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    line-height: 1;
    padding: 2px;
    flex-shrink: 0;
    transition: opacity var(--transition-fast);
}

.close-flash:hover { opacity: 1; }

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

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
    min-height: calc(100vh - 200px);
    padding: 2.5rem 0;
}

/* ============================================================
   BREAKING NEWS
   ============================================================ */

.breaking-news {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: #ffffff;
    padding: 0.75rem 0;
    position: relative;
    overflow: hidden;
}

.breaking-news::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.05) 10px,
        rgba(255,255,255,0.05) 20px
    );
    pointer-events: none;
}

.breaking-news-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.breaking-label {
    background: rgba(0,0,0,0.3);
    color: #ffffff;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { background: rgba(0,0,0,0.3); }
    50% { background: rgba(0,0,0,0.5); }
}

.breaking-ticker {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2rem;
    overflow: hidden;
}

.breaking-item {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
    line-height: 1.4;
}

.breaking-item:hover {
    opacity: 0.8;
}

/* ============================================================
   MAIN GRID LAYOUT
   ============================================================ */

.main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin: 2rem 0;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ============================================================
   FEATURED SECTION
   ============================================================ */

.featured-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.featured-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
}

.featured-image {
    position: relative;
    overflow: hidden;
    min-height: 280px;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-image:hover img {
    transform: scale(1.05);
}

.featured-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 0.75rem 0;
    letter-spacing: -0.02em;
}

.featured-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.featured-title a:hover {
    color: var(--primary-color);
}

.featured-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.featured-sub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.featured-sub-item {
    padding: 1.25rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.featured-sub-item:last-child {
    border-right: none;
}

.featured-sub-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.featured-sub-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-sub-image:hover img {
    transform: scale(1.05);
}

.featured-sub-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.featured-sub-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.featured-sub-title a:hover {
    color: var(--primary-color);
}

/* ============================================================
   CATEGORY NEWS SECTION
   ============================================================ */

.category-news-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--page-bg);
}

.section-header .section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-color);
}

.view-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.view-more:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.category-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.category-news-item {
    padding: 1.25rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-news-item:last-child {
    border-right: none;
}

.category-news-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.category-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-news-image:hover img {
    transform: scale(1.05);
}

.category-news-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.category-news-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.category-news-title a:hover {
    color: var(--primary-color);
}

.category-news-excerpt {
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ============================================================
   SIDBAR COMPONENTS
   ============================================================ */

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.most-viewed-section,
.sidebar-categories {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.most-viewed-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.most-viewed-item {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.most-viewed-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.most-viewed-item .number {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.most-viewed-content {
    flex: 1;
}

.most-viewed-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.25rem;
}

.most-viewed-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.most-viewed-title a:hover {
    color: var(--primary-color);
}

.sidebar-categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.85rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-category-item:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.category-count {
    background: var(--page-bg);
    color: var(--text-light);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

/* ============================================================
   LATEST NEWS SECTION
   ============================================================ */

.latest-news-section {
    margin-top: 2.5rem;
}

.latest-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.latest-news-item {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.latest-news-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.latest-news-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.latest-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.latest-news-item:hover .latest-news-image img {
    transform: scale(1.05);
}

.latest-news-content {
    padding: 1.25rem;
}

.latest-news-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0.5rem 0;
}

.latest-news-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.latest-news-title a:hover {
    color: var(--primary-color);
}

.latest-news-excerpt {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

/* ============================================================
   RELATED ARTICLES
   ============================================================ */

.related-articles-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-top: 2rem;
}

.related-articles-section .section-title {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    text-align: center;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-article-item {
    background: var(--page-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.related-article-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.related-article-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.related-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article-item:hover .related-article-image img {
    transform: scale(1.05);
}

.related-article-content {
    padding: 1rem;
}

.related-article-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0.5rem 0;
}

.related-article-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.related-article-title a:hover {
    color: var(--primary-color);
}

.related-article-excerpt {
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ============================================================
   HERO SECTION (Updated)
   ============================================================ */

.hero-section {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-light) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
}

.hero-section h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero-section h2 span {
    color: var(--primary-color);
}

.hero-section p {
    font-size: 0.95rem;
    color: var(--text-light);
    max-width: 540px;
    margin-bottom: 1rem;
}

/* ============================================================
   SEARCH SECTION
   ============================================================ */

.search-section {
    margin: 1.5rem 0 2rem;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 200px 200px auto;
    gap: 10px;
    align-items: center;
}

.search-form input,
.search-form select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-color);
    background: var(--surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
}

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

.inline-form {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.input-sm {
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-width: 200px;
    font-size: 0.875rem;
    font-family: var(--font-body);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-sm:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
}

/* ============================================================
   CATEGORIES SECTION
   ============================================================ */

.categories-section {
    margin: 2.5rem 0;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 40px; height: 3px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border-color);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.category-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-card h3 {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.category-card p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ============================================================
   ARTICLES SECTION
   ============================================================ */

.articles-section {
    margin: 2.5rem 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Article Card */
.article-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: var(--page-bg);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.category-badge {
    display: inline-block;
    background: var(--primary-color);
    color: #ffffff;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.article-title {
    margin: 0 0 0.75rem;
    flex: 1;
}

.article-title a {
    text-decoration: none;
    color: var(--dark-color);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -0.01em;
    transition: color var(--transition-fast);

    /* Clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;

    /* Clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 0.875rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
   ARTICLE DETAIL
   ============================================================ */

.article-detail {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    max-width: 860px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--dark-color);
    margin: 1rem 0;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.article-author {
    color: var(--text-light);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.article-image-large {
    width: 100%;
    margin: 2rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.article-image-large img {
    width: 100%;
    height: auto;
    display: block;
}

.article-body {
    line-height: 1.85;
    font-size: 1.05rem;
}

.article-summary {
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    border-left: 4px solid var(--primary-color);
}

.article-summary h2 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.article-content-text {
    font-size: 1.05rem;
    margin-top: 1.5rem;
    color: var(--text-color);
}

.article-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.65rem 1.35rem;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-color);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--light-color);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 0;
}

.auth-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 430px;
}

.auth-card h2 {
    margin-bottom: 1.75rem;
    text-align: center;
    color: var(--dark-color);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-form {
    margin-bottom: 1.5rem;
}

/* ============================================================
   FORMS
   ============================================================ */

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

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dark-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-color);
    background: var(--surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

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

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.auth-links {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-container {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.article-form {
    max-width: 800px;
}

.image-preview {
    margin-top: 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 420px;
    background: var(--page-bg);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.no-articles {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

/* ============================================================
   DASHBOARD HOME
   ============================================================ */

.dashboard-home {
    background: var(--page-bg);
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-color);
    margin: 0 0 0.5rem 0;
}

.header-content p {
    font-size: 1rem;
    color: var(--text-light);
    margin: 0;
}

.header-time {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard-row {
    width: 100%;
}

/* Statistics Cards Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pending-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.users-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.articles-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.views-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.my-articles-icon {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.published-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-action {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.stat-action:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend.positive {
    color: var(--success-color);
}

.stat-trend.negative {
    color: var(--danger-color);
}

/* Analytics Section */
.analytics-row {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.analytics-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.analytics-section .section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.time-filter select {
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 0.9rem;
    min-width: 120px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-card {
    background: var(--page-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Quick Actions Section */
.actions-row {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.quick-actions h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0 0 2rem 0;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--page-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-color);
    transition: all var(--transition-base);
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-card.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    border: none;
}

.action-card.primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #1d4ed8);
    color: #ffffff;
}

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.action-card:hover .action-icon {
    transform: scale(1.1);
}

.action-card.primary .action-icon {
    background: rgba(255, 255, 255, 0.2);
}

.action-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.action-content p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.8;
}

.action-form {
    margin: 0;
    padding: 0;
    border: none;
}

.action-form button {
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

/* ============================================================
   DASHBOARD (Legacy)
   ============================================================ */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.stat-card h3 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
}

.stat-card p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.dashboard-articles {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   TABLE
   ============================================================ */

.articles-table {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    background: var(--page-bg);
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--light-color);
}

tbody tr:last-child td {
    border-bottom: none;
}

.actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-role {
    background: var(--dark-color);
    color: #f1f5f9;
}

.badge-status { text-transform: capitalize; }
.badge-draft    { background: #e2e8f0; color: #334155; }
.badge-pending  { background: var(--info-bg); color: var(--info-text); }
.badge-approved { background: var(--success-bg); color: var(--success-text); }
.badge-published{ background: var(--success-bg); color: var(--success-text); }
.badge-rejected { background: var(--danger-bg); color: var(--danger-text); }
.badge-archived { background: #f1f5f9; color: var(--text-light); }

.small-muted {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ============================================================
   COMMENTS
   ============================================================ */

.comments-section {
    margin-top: 2.5rem;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.comments-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-body);
    resize: vertical;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
}

.comments-list {
    margin-top: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.comment-item {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--page-bg);
    border: 1px solid var(--border-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--dark-secondary);
}

.comment-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.comment-body {
    color: var(--text-color);
    line-height: 1.55;
    font-size: 0.925rem;
}

.comment-preview {
    max-width: 320px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================================================
   MISC
   ============================================================ */

.back-link {
    margin-top: 2rem;
}

.category-header {
    margin-bottom: 2rem;
}

.category-description {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    background: var(--dark-color);
    color: #cbd5e1;
    padding: 3rem 0 1.25rem;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.footer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-section a:hover { color: #ffffff; }

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: #64748b;
    font-size: 0.875rem;
}

/* ============================================================
   UTILITY — Scroll to top button
   ============================================================ */

.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: background var(--transition-fast), transform var(--transition-fast);
    z-index: 999;
}

.scroll-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.scroll-top.visible { display: flex; }

/* ============================================================
   RESPONSIVE — Tablet (≤ 1024px)
   ============================================================ */

@media (max-width: 1024px) {
    .search-form {
        grid-template-columns: 1fr 180px 160px auto;
        gap: 8px;
    }
    
    .main-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sidebar {
        order: -1;
    }
    
    .featured-main {
        grid-template-columns: 1fr;
    }
    
    .featured-sub {
        grid-template-columns: 1fr;
    }
    
    .category-news-grid {
        grid-template-columns: 1fr;
    }
    
    .category-news-item {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .category-news-item:last-child {
        border-bottom: none;
    }
    
    .featured-sub-item {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .featured-sub-item:last-child {
        border-bottom: none;
    }
}

/* ============================================================
   PROFILE DASHBOARD
   ============================================================ */

.profile-dashboard {
    background: var(--page-bg);
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================================
   PROFILE SIDEBAR (Cột trái)
   ============================================================ */

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Profile Card */
.profile-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.profile-avatar {
    margin-bottom: 1.5rem;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.profile-badge {
    display: inline-block;
    background: var(--primary-color);
    color: #ffffff;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Stats Card */
.stats-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stats-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 1rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* Password Card */
.password-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.password-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 1.5rem 0;
}

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

.password-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.password-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
}

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

/* ============================================================
   PROFILE CONTENT (Cột phải)
   ============================================================ */

.profile-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.content-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
}

/* Articles List */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.article-card {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--page-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.article-image {
    width: 200px;
    height: 150px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--border-color);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--light-color);
}

.article-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
}

.article-category {
    color: var(--primary-color);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.article-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.article-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.article-date,
.article-views {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.article-date svg,
.article-views svg {
    flex-shrink: 0;
}

.article-status {
    display: flex;
    align-items: center;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-published {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-pending {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.status-draft {
    background: var(--page-bg);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.status-rejected {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* ============================================================
   ANALYTICS DASHBOARD
   ============================================================ */

.analytics-dashboard {
    background: var(--page-bg);
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-color);
    margin: 0;
}

.date-filter {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.date-filter select {
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 0.9rem;
    min-width: 150px;
}

/* Statistics Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.articles-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.published-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.users-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.views-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.chart-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-refresh-btn {
    min-width: 32px;
    padding: 0 0.5rem;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.chart-refresh-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Activity Section */
.activity-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

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

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

/* Activity Table */
.activity-table {
    overflow-x: auto;
}

.activity-table table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table th {
    text-align: left;
    padding: 0.75rem;
    background: var(--page-bg);
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85rem;
}

.activity-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.activity-table tr:hover {
    background: var(--page-bg);
}

.type-badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.article {
    background: var(--primary-bg);
    color: var(--primary-color);
}

.type-badge.user {
    background: var(--success-bg);
    color: var(--success-color);
}

.type-badge.comment {
    background: var(--warning-bg);
    color: var(--warning-color);
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: var(--success-bg);
    color: var(--success-color);
}

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

.status-badge.pending {
    background: var(--warning-bg);
    color: var(--warning-color);
}

.status-badge.error {
    background: var(--danger-bg);
    color: var(--danger-color);
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 768px)
   ============================================================ */

@media (max-width: 768px) {
    .container { padding: 0 16px; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--surface);
        padding: 1rem;
        box-shadow: var(--shadow-md);
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu ul {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
    }

    .nav-menu ul li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        width: 100%;
    }

    .mobile-menu-toggle { display: flex; }

    .hero-section { padding: 2.5rem 0 2rem; }
    .hero-section h2 { font-size: 1.85rem; }
    .hero-section p { font-size: 0.95rem; }

    .articles-grid { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }

    .search-form {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .input-sm { min-width: 0; width: 100%; }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-detail {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.6rem;
    }

    .articles-table {
        font-size: 0.825rem;
    }

    table { display: block; overflow-x: auto; }

    .form-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn { width: 100%; }

    .auth-card { padding: 1.75rem; }

    .footer { padding: 2.5rem 0 1rem; }
    .footer-content { grid-template-columns: 1fr 1fr; }

    /* Profile Dashboard Responsive */
    .profile-dashboard {
        padding: 1rem 0;
    }

    .profile-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .profile-sidebar {
        order: 2;
    }

    .profile-content {
        order: 1;
        padding: 1.5rem;
    }

    .profile-card {
        padding: 1.5rem;
    }

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

    .profile-name {
        font-size: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-divider {
        display: none;
    }

    .stat-item {
        text-align: center;
        padding: 1rem;
        background: var(--page-bg);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .content-title {
        font-size: 1.25rem;
    }

    .article-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .article-image {
        width: 100%;
        height: 200px;
    }

    .article-content {
        gap: 0.75rem;
    }

    .article-title {
        font-size: 1rem;
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .article-status {
        margin-top: 0.5rem;
    }

    .empty-state {
        padding: 3rem 1rem;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .empty-state h3 {
        font-size: 1.25rem;
    }

    /* Analytics Dashboard Responsive */
    .analytics-dashboard {
        padding: 1rem 0;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .date-filter {
        width: 100%;
        justify-content: space-between;
    }

    .date-filter select {
        flex: 1;
        min-width: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stat-change {
        font-size: 0.7rem;
        justify-content: center;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .chart-card {
        padding: 1rem;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .chart-header h3 {
        font-size: 1rem;
    }

    .chart-container {
        height: 250px;
    }

    .activity-section {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header h3 {
        font-size: 1.1rem;
    }

    .filter-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .tab-btn {
        flex: 1;
        text-align: center;
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }

    .activity-table {
        font-size: 0.8rem;
    }

    .activity-table th,
    .activity-table td {
        padding: 0.5rem;
    }

    .type-badge,
    .status-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }

    /* Dashboard Home Responsive */
    .dashboard-home {
        padding: 1rem 0;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .header-content p {
        font-size: 0.9rem;
    }

    .header-time {
        font-size: 0.8rem;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stat-action {
        font-size: 0.7rem;
    }

    .stat-trend {
        font-size: 0.7rem;
        justify-content: center;
    }

    .analytics-row {
        padding: 1rem;
    }

    .analytics-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .analytics-section .section-header h2 {
        font-size: 1.2rem;
    }

    .time-filter select {
        min-width: 100px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chart-card {
        padding: 1rem;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .chart-header h3 {
        font-size: 1rem;
    }

    .chart-container {
        height: 250px;
    }

    .actions-row {
        padding: 1rem;
    }

    .quick-actions h2 {
        font-size: 1.2rem;
    }

    .actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .action-card {
        padding: 1rem;
    }

    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .action-content h3 {
        font-size: 1rem;
    }

    .action-content p {
        font-size: 0.8rem;
    }

    /* Navigation Responsive */
    .nav-menu {
        gap: 1rem;
    }

    .nav-menu ul {
        gap: 1rem;
    }

    .dropdown-menu {
        min-width: 180px;
    }

    .user-dropdown {
        margin-left: 1rem;
    }

    .user-dropdown-toggle {
        padding: 0.4rem;
        gap: 0.5rem;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .user-name {
        display: none;
    }

    .user-dropdown-menu {
        min-width: 220px;
    }

    .user-avatar-large {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .categories-grid { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; }
    .article-actions { flex-direction: column; }
}
