/**
 * Hurug.mn - Мэдээний сайтын CSS
 * Modern, Professional News Website Styles
 */

/* ============================================
   CSS Variables & Root Styles
   ============================================ */
:root {
    /* Colors - Black & White Theme */
    --primary-color: #000000;
    --primary-dark: #000000;
    --primary-light: #333333;
    --secondary-color: #000000;
    --accent-color: #666666;
    
    /* Neutral Colors */
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --text-light: #999999;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e5e5e5;
    --bg-dark: #000000;
    
    /* Border Colors */
    --border-color: #cccccc;
    --border-light: #e5e5e5;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --container-max: 1280px;
    --container-padding: 1rem;
    
    /* Typography */
    --font-primary: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ============================================
   Top Bar
   ============================================ */
.top-bar {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #333333 100%);
    color: #fff;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.top-bar-right {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* ============================================
   Header
   ============================================ */
.main-header {
    background: var(--bg-primary);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 210px;
    width: auto;
    object-fit: contain;
}

.logo-subtext {
    margin-top: 0.45rem;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.1;
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-search {
    flex: 1;
    max-width: 400px;
}

.search-form {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
}

.search-form:focus-within {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.search-btn:hover {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* ============================================
   Navigation
   ============================================ */
.main-nav {
    background: var(--bg-primary);
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 70px;
    z-index: 99;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: block;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    white-space: nowrap;
    position: relative;
    transition: all var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--secondary-color);
    transition: width var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after,
.nav-link:hover::after {
    width: 100%;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    min-height: calc(100vh - 400px);
    padding: 2rem 0;
}

/* ============================================
   News Cards
   ============================================ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.news-card-image {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.news-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.375rem 0.75rem;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card-video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    transition: all var(--transition-fast);
}

.news-card:hover .news-card-video-badge {
    background: var(--secondary-color);
    transform: translate(-50%, -50%) scale(1.1);
}

.news-card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-fast);
}

.news-card:hover .news-card-title {
    color: var(--primary-color);
}

.news-card-summary {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
    flex: 1;
}

.news-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.news-card-date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.news-card-views {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Featured News */
.featured-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.featured-main {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg-dark);
    min-height: 450px;
}

.featured-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.featured-main-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: #fff;
}

.featured-main-category {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--secondary-color);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.featured-main-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.featured-main-meta {
    font-size: 0.875rem;
    opacity: 0.8;
}

.featured-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.featured-small {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-dark);
    flex: 1;
    min-height: 140px;
}

.featured-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.featured-small-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
}

.featured-small-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   News Detail Page
   ============================================ */
.news-detail {
    max-width: 900px;
    margin: 0 auto;
}

.news-detail-header {
    margin-bottom: 2rem;
}

.news-detail-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.news-detail-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.news-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.news-detail-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-detail-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 2rem;
    background: var(--bg-tertiary);
}

.news-detail-image img {
    width: 100%;
    height: auto;
}

.news-detail-video {
    margin-bottom: 2rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg-dark);
}

.news-detail-video video {
    width: 100%;
    display: block;
}

.news-detail-content {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.news-detail-content p {
    margin-bottom: 1.5rem;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.news-detail-content h2,
.news-detail-content h3 {
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.news-detail-content img {
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

/* Share Buttons */
.share-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.share-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
}

.share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 1.125rem;
    transition: all var(--transition-fast);
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.facebook { background: #333333; }
.share-btn.twitter { background: #666666; }
.share-btn.linkedin { background: #000000; }
.share-btn.copy { background: var(--text-muted); }

/* Related News */
.related-section {
    margin-top: 3rem;
}

/* ============================================
   Sidebar
   ============================================ */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 140px;
}

.sidebar-widget {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.popular-news-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.popular-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-news-item:first-child {
    padding-top: 0;
}

.popular-news-image {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.popular-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-news-content {
    flex: 1;
}

.popular-news-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-fast);
}

.popular-news-item:hover .popular-news-title {
    color: var(--primary-color);
}

.popular-news-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Categories Widget */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.category-item:hover {
    background: var(--primary-color);
    color: #fff;
}

.category-count {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ============================================
   Footer
   ============================================ */
.main-footer {
    background: var(--bg-dark);
    color: #fff;
    margin-top: 3rem;
}

.footer-top {
    padding: 3rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-about p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.footer-col h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #fff;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: var(--text-light);
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 0.5rem;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
}

.footer-contact i {
    width: 20px;
    color: var(--primary-light);
}

.footer-bottom {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer-credit {
    margin-top: 0.5rem;
}

.footer-credit a {
    color: var(--primary-light);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.footer-credit a:hover {
    color: #fff;
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background: #e5e5e5;
    color: #000000;
    border: 1px solid #cccccc;
}

.alert-error {
    background: #e5e5e5;
    color: #000000;
    border: 1px solid #cccccc;
}

.alert-warning {
    background: #e5e5e5;
    color: #000000;
    border: 1px solid #cccccc;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* ============================================
   Search Page
   ============================================ */
.search-header {
    margin-bottom: 2rem;
}

.search-header h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.search-header p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.search-query {
    color: var(--primary-color);
    font-weight: 600;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
}

.no-results i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.no-results h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-muted);
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-link {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination-link:hover,
.pagination-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ============================================
   Admin Styles
   ============================================ */
.admin-container {
    min-height: 100vh;
    display: flex;
}

.admin-sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: #fff;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1001;
    transition: transform var(--transition-normal);
}

.admin-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.admin-sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 1.125rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.admin-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.25rem;
}

.admin-subtitle {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Admin Mobile Top Bar */
.admin-mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.admin-menu-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.admin-menu-toggle:hover {
    background: var(--primary-color);
    color: #fff;
}

.admin-mobile-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
}

.admin-mobile-add {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 1.125rem;
    transition: all var(--transition-fast);
}

.admin-mobile-add:hover {
    background: var(--primary-dark);
}

/* Admin Overlay */
.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.admin-overlay.open {
    opacity: 1;
    visibility: visible;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-light);
    transition: all var(--transition-fast);
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-nav-link i {
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    background: var(--bg-secondary);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user-name {
    font-weight: 600;
}

/* Admin Cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-card-icon.blue { background: #e5e5e5; color: var(--primary-color); }
.stat-card-icon.green { background: #e5e5e5; color: #000000; }
.stat-card-icon.yellow { background: #e5e5e5; color: #000000; }
.stat-card-icon.red { background: #e5e5e5; color: #000000; }

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Admin Table */
.admin-table-wrapper {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-table-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    background: var(--bg-tertiary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--bg-secondary);
}

.table-image {
    width: 60px;
    height: 45px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-tertiary);
}

.table-title {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-action.edit {
    background: #e5e5e5;
    color: var(--primary-color);
}

.btn-action.delete {
    background: #e5e5e5;
    color: #000000;
}

.btn-action:hover {
    transform: translateY(-2px);
}

/* Touch-friendly on mobile */
@media (max-width: 768px) {
    .btn-action {
        width: 40px;
        height: 40px;
    }
}

/* Forms */
.admin-form-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-textarea {
    min-height: 200px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.file-upload-icon {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.file-upload-text {
    color: var(--text-secondary);
}

.file-upload-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.preview-image {
    max-width: 300px;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.preview-video {
    max-width: 400px;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: #000000;
    color: #fff;
}

.btn-danger:hover {
    background: #333333;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-text {
    font-weight: 500;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    padding: 2rem;
}

.login-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.login-logo-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-btn {
    width: 100%;
    margin-top: 0.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer a {
    color: var(--primary-color);
    font-weight: 500;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
}

.status-badge.published {
    background: #e5e5e5;
    color: #000000;
}

.status-badge.draft {
    background: #cccccc;
    color: #000000;
}

/* Categories Layout */
.categories-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .categories-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-main {
        min-height: 350px;
    }
    
    .featured-sidebar {
        flex-direction: row;
    }
    
    /* Admin responsive - tablet & mobile */
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
        padding: 1.5rem;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-sidebar-close {
        display: flex;
    }
    
    .admin-mobile-topbar {
        display: flex;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 0;
    }
    
    .admin-main > *:not(.admin-mobile-topbar):not(.alert) {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .admin-header {
        padding-top: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .admin-title {
        font-size: 1.375rem;
    }
    
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0 !important;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    /* Admin table responsive */
    .admin-table-wrapper {
        margin: 0 -1rem;
        border-radius: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table {
        min-width: 700px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.75rem 1rem;
        white-space: nowrap;
    }
    
    .table-title {
        max-width: 200px;
    }
    
    /* Admin form responsive */
    .admin-form-card {
        margin: 0 -1rem;
        border-radius: 0;
        padding: 1.25rem 1rem;
    }
    
    .form-actions {
        flex-wrap: wrap;
    }
    
    .form-actions .btn {
        flex: 1;
        min-width: 140px;
    }
    
    body.admin-menu-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
    }
    
    .main-header {
        padding: 0.5rem 0;
    }
    
    .header-content {
        align-items: center;
        gap: 0.75rem;
    }
    
    .logo img {
        height: 140px;
    }
    
    .logo-subtext {
        font-size: 2rem;
        margin-top: 0.25rem;
    }
    
    .top-bar {
        display: none;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-search {
        order: 3;
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 0.35rem;
    }
    
    .mobile-menu-toggle {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-primary);
        padding: 2rem 0;
        box-shadow: var(--shadow-xl);
        transition: left var(--transition-normal);
        z-index: 1000;
    }
    
    .main-nav.open {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-link {
        padding: 0.875rem 1.5rem;
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-link::after {
        display: none;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-sidebar {
        flex-direction: column;
    }
    
    .news-detail-title {
        font-size: 1.5rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Admin mobile improvements */
    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .admin-user {
        display: none;
    }
    
    .admin-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .admin-table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .admin-table-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* File upload mobile */
    .file-upload {
        padding: 1.5rem 1rem;
    }
    
    .file-upload-icon {
        font-size: 2rem;
    }
    
    .preview-image,
    .preview-video {
        max-width: 100%;
    }
    
    /* Form textarea smaller on mobile */
    .form-textarea {
        min-height: 150px;
    }
    
    /* Filter form mobile */
    .admin-form-card form {
        flex-direction: column;
    }
    
    .admin-form-card form .form-input,
    .admin-form-card form .form-select {
        max-width: 100% !important;
        width: 100%;
    }
    
    .admin-form-card form .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .news-card-content {
        padding: 1rem;
    }
    
    .news-detail-content {
        padding: 1.25rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    /* Admin extra small screens */
    .admin-title {
        font-size: 1.25rem;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .stat-card-icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .stat-card-value {
        font-size: 1.25rem;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-action {
        width: 32px;
        height: 32px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    
    .pagination-link {
        min-width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
}

/* ============================================
   Placeholder Image
   ============================================ */
.placeholder-image {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--border-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 2rem;
}

/* ============================================
   Animations
   ============================================ */
@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 {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Overlay for mobile menu */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 999;
}

.nav-overlay.open {
    opacity: 1;
    visibility: visible;
}
/* =========================
   ADMIN – Responsive Fixes
   Append this to the END of style.css
   ========================= */

body.admin-page {
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout */
.admin-container {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 280px;
  flex: 0 0 280px;
}

.admin-main {
  flex: 1 1 auto;
  min-width: 0; /* table overflow fix */
}

/* Tables: always scroll on small screens */
.admin-table-wrapper,
.admin-table {
  width: 100%;
}

.admin-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  min-width: 900px; /* admin table багана олон бол заавал scroll */
}

/* Images in table */
.table-image {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
}

/* Forms / filters row wrap */
.admin-filters,
.admin-table-header {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-filters .form-input,
.admin-filters select,
.admin-filters .btn {
  max-width: 100%;
}

/* Mobile topbar default hidden (desktop) */
.admin-mobile-topbar {
  display: none;
}

/* Overlay for mobile sidebar */
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9998;
}

/* =========================
   Breakpoints
   ========================= */

/* <= 1024px: tighter spacing */
@media (max-width: 1024px) {
  .admin-sidebar { width: 260px; flex-basis: 260px; }
  .admin-main { padding: 18px; }
}

/* <= 768px: sidebar becomes off-canvas */
@media (max-width: 768px) {
  .admin-container { display: block; }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 86%;
    max-width: 320px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    z-index: 9999;
  }

  /* When menu opened (JS adds .open) */
  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-overlay.show {
    display: block;
  }

  .admin-main {
    padding: 14px;
  }

  .admin-mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 12px;
    background: #fff;
    border-bottom: 1px solid #eee;
  }

  /* Hide desktop header if you have one */
  .admin-header {
    display: none;
  }

  /* Filters stack */
  .admin-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-table {
    min-width: 820px; /* still scroll */
  }
}

/* <= 480px: extra compact */
@media (max-width: 480px) {
  .admin-sidebar { width: 92%; }
  .table-image { width: 46px; height: 46px; }
}
/* =========================
   Admin table responsive
========================= */

/* Wrapper: жижиг дэлгэц дээр x-scroll */
.table-responsive{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table base */
.admin-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px; /* desktop дээр баганууд шахагдахгүй */
}

/* Tablet (<= 1024): хүснэгтийг хэвээр үлдээнэ, scroll ашиглана */
@media (max-width: 1024px){
  .admin-table{ min-width: 780px; }
}

/* Phone (<= 640): хүснэгтийг card layout болгоно */
@media (max-width: 640px){
  .admin-table{ 
    min-width: 0;
    border-spacing: 0;
  }

  .admin-table thead{
    display: none; /* header-ийг утас дээр нуух */
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td{
    display: block;
    width: 100%;
  }

  .admin-table tr{
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
  }

  .admin-table td{
    padding: 10px 0;
    border: 0;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
  }

  .admin-table td::before{
    content: attr(data-label);
    font-weight: 700;
    opacity: .7;
    flex: 0 0 88px;     /* label-ийн өргөн */
  }

  .admin-table td > *{
    max-width: calc(100% - 98px);
  }

  /* зурагны багана жижигхэн */
  .admin-table td[data-label="Зураг"] img{
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
  }

  /* Үйлдэл (товчнууд) нэг мөрөнд */
  .admin-table td[data-label="Үйлдэл"]{
    justify-content: flex-end;
  }
  .admin-table td[data-label="Үйлдэл"]::before{
    display:none;
  }
}
/* ===========================
   Admin table → Mobile cards
   =========================== */
.table-responsive{
  width:100%;
  overflow-x:auto;
}

.admin-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

.table-image{
  width:44px;
  height:44px;
  object-fit:cover;
  border-radius:10px;
  border:1px solid #eee;
  background:#fafafa;
}

.placeholder-image{
  display:flex;
  align-items:center;
  justify-content:center;
  color:#666;
}

.table-title-wrap{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.table-title{
  font-weight:700;
  line-height:1.25;
  word-break:break-word;
}

.table-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  background:#f3f4f6;
  color:#111;
}

.chip-featured{ background:#fff7ed; }
.chip-video{ background:#eef2ff; }

.table-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
}

.btn-action{
  width:40px;
  height:40px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#f3f4f6;
  color:#111;
  text-decoration:none;
}

.btn-action.view{ background:#d1fae5; color:#065f46; }
.btn-action.edit{ background:#e5e7eb; color:#111827; }
.btn-action.delete{ background:#fee2e2; color:#991b1b; }

/* ✅ Mobile: хүснэгтийг card layout болгоно */
@media (max-width: 768px){
  .admin-header{
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }

  .admin-header .btn{
    width:100%;
    justify-content:center;
  }

  /* thead нуух */
  .admin-table--stack thead{
    display:none;
  }

  /* мөр бүр card */
  .admin-table--stack,
  .admin-table--stack tbody,
  .admin-table--stack tr{
    display:block;
    width:100%;
  }

  .admin-table--stack tr{
    background:#fff;
    border:1px solid #eee;
    border-radius:16px;
    padding:12px;
    margin-bottom:12px;
    box-shadow:0 2px 12px rgba(0,0,0,0.03);
  }

  /* td бүрийг grid болгож label + value эмхэлнэ */
  .admin-table--stack td{
    display:grid;
    grid-template-columns: 110px 1fr;
    gap:10px;
    padding:10px 0;
    border-bottom:1px solid #f1f1f1;
    align-items:center;
  }

  .admin-table--stack td:last-child{
    border-bottom:none;
    padding-bottom:0;
  }

  .admin-table--stack td::before{
    content: attr(data-label);
    font-size:12px;
    color:#6b7280;
    font-weight:600;
  }

  /* Гарчиг мөрийг 2 багананд дүүргэнэ */
  .admin-table--stack td[data-label="Гарчиг"]{
    grid-template-columns: 1fr;
  }
  .admin-table--stack td[data-label="Гарчиг"]::before{
    content:"";
    display:none;
  }

  /* Зураг мөр: жижиг болгож зүүн талд */
  .admin-table--stack td[data-label="Зураг"]{
    grid-template-columns: 110px 1fr;
  }

  /* Үйлдэл мөр: доор төвлөрүүлнэ */
  .admin-table--stack td[data-label="Үйлдэл"]{
    grid-template-columns: 1fr;
  }
  .admin-table--stack td[data-label="Үйлдэл"]::before{
    display:none;
  }
  .admin-table--stack td[data-label="Үйлдэл"] .table-actions{
    justify-content:flex-start;
  }

  .status-badge{
    justify-self:start;
  }
}
/* Admin responsive table -> card layout */
@media (max-width: 768px) {
  .table-responsive { overflow: visible; }

  .admin-table--stack thead { display: none; }

  .admin-table--stack,
  .admin-table--stack tbody,
  .admin-table--stack tr,
  .admin-table--stack td { display: block; width: 100%; }

  .admin-table--stack tr {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    padding: 12px;
    margin: 12px 0;
  }

  .admin-table--stack td {
    border: 0 !important;
    padding: 10px 0 !important;
  }

  /* label + value row */
  .admin-table--stack td[data-label]{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .admin-table--stack td[data-label]::before{
    content: attr(data-label);
    font-weight: 700;
    font-size: 12px;
    color: rgba(0,0,0,.55);
    flex: 0 0 30%;
    max-width: 30%;
    padding-top: 2px;
  }

  .admin-table--stack td[data-label] > *{
    flex: 1;
    min-width: 0;
    text-align: right;
  }

  /* Image row centered */
  .admin-table--stack td[data-label="Зураг"]{
    justify-content: center;
  }
  .admin-table--stack td[data-label="Зураг"]::before{
    display:none;
  }

  .admin-table--stack .table-image{
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
  }
  .admin-table--stack .placeholder-image{
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin: 0 auto;
  }

  /* Title becomes left aligned and nicer */
  .admin-table--stack td[data-label="Гарчиг"]{
    display:block;
  }
  .admin-table--stack td[data-label="Гарчиг"]::before{ display:none; }
  .admin-table--stack .table-title-wrap{
    text-align: left;
  }
  .admin-table--stack .table-title{
    display:block;
    font-weight: 800;
    font-size: 16px;
    line-height: 1.25;
    margin-bottom: 6px;
    word-break: break-word;
  }
  .admin-table--stack .table-meta{
    display:flex;
    gap:8px;
    flex-wrap: wrap;
  }
  .admin-table--stack .meta-chip{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,.06);
  }

  /* Status centered */
  .admin-table--stack td[data-label="Төлөв"] > *{
    text-align: right;
  }

  /* Actions: 3 button in one row */
  .admin-table--stack td[data-label="Үйлдэл"]{
    padding-top: 12px !important;
  }
  .admin-table--stack td[data-label="Үйлдэл"]::before{ display:none; }
  .admin-table--stack .table-actions{
    display:flex;
    justify-content: flex-end;
    gap:10px;
  }
  .admin-table--stack .btn-action{
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
}
.news-byline a{ color:#2563eb; text-decoration:none; }
.news-byline a:hover{ text-decoration:underline; }
/* ===== Admin table mobile card view ===== */
@media (max-width: 768px){
  .table-responsive{ overflow: visible; }

  .admin-table thead{ display:none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td{
    display:block;
    width:100%;
  }

  .admin-table tr{
    background:#fff;
    border:1px solid #eee;
    border-radius:14px;
    padding:12px;
    margin-bottom:12px;
  }

  .admin-table td{
    border:none !important;
    padding:10px 0 !important;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
  }

  .admin-table td::before{
    content: attr(data-label);
    font-weight:700;
    color:#666;
    flex:0 0 34%;
    max-width:34%;
  }

  .admin-table td[data-label="Гарчиг"]{
    align-items:flex-start;
  }

  .admin-table td[data-label="Гарчиг"]::before{
    margin-top:2px;
  }

  .table-title{
    font-weight:800;
    line-height:1.25;
    max-width:100%;
    word-break:break-word;
    text-align:right;
  }

  .table-sub{
    font-size:12px;
    color:#777;
    margin-top:4px;
    text-align:right;
  }

  .table-image{ width:44px; height:44px; border-radius:10px; object-fit:cover; }
  .placeholder-image{ width:44px; height:44px; border-radius:10px; }

  .table-actions{
    width:100%;
    display:flex;
    justify-content:flex-end;
    gap:10px;
  }
}
/* ---- Admin filters responsive ---- */
.admin-filters { padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.admin-filter-row { display:flex; gap:1rem; align-items:center; flex-wrap:wrap; }
.admin-filter-row .form-input { max-width:260px; }
.admin-filter-row .form-select { max-width:220px; }

/* ---- Responsive table wrapper ---- */
.table-responsive { width:100%; overflow-x:auto; }

/* Title + small meta inside title column */
.table-title-wrap { display:flex; flex-direction:column; gap:.35rem; }
.table-submeta { display:flex; gap:.75rem; flex-wrap:wrap; font-size:.85rem; color: var(--text-muted); }
.table-submeta .submeta-item { display:inline-flex; gap:.4rem; align-items:center; }

/* =========================
   MOBILE CARD MODE
   ========================= */
@media (max-width: 768px) {
  .table-responsive { overflow: visible; }

  table.admin-table--responsive,
  table.admin-table--responsive thead,
  table.admin-table--responsive tbody,
  table.admin-table--responsive th,
  table.admin-table--responsive td,
  table.admin-table--responsive tr {
    display: block;
    width: 100%;
  }

  table.admin-table--responsive thead {
    display: none; /* header нуух */
  }

  table.admin-table--responsive tbody tr {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    margin: 12px 0;
    box-shadow: 0 1px 8px rgba(0,0,0,.04);
  }

  table.admin-table--responsive td {
    border: 0 !important;
    padding: 10px 6px !important;
  }

  /* First row: image + title look like header */
  table.admin-table--responsive td[data-label="Зураг"] {
    padding-top: 6px !important;
  }

  .table-image {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
  }

  /* Make each field as "label : value" */
  table.admin-table--responsive td[data-label] {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    align-items: start;
  }

  table.admin-table--responsive td[data-label]::before {
    content: attr(data-label);
    font-weight: 700;
    color: #111827;
    font-size: 12px;
    opacity: .75;
    padding-top: 2px;
  }

  /* Гарчиг хэсгийг илүү том, уншигдахуйц */
  table.admin-table--responsive td[data-label="Гарчиг"] .table-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Status + actions align nicely */
  table.admin-table--responsive td[data-label="Төлөв"] {
    grid-template-columns: 110px 1fr;
  }

  table.admin-table--responsive td[data-label="Үйлдэл"] {
    grid-template-columns: 110px 1fr;
  }

  .table-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .btn-action {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
}
/* ===== Admin responsive switch ===== */
.admin-desktop-only { display: block; }
.admin-mobile-only  { display: none; }

@media (max-width: 768px){
  .admin-desktop-only { display: none !important; }
  .admin-mobile-only  { display: block !important; }
}

/* ===== Mobile list design (admin news) ===== */
.admin-empty{
  background:#fff;
  border:1px solid #eee;
  border-radius:14px;
  padding:14px;
  text-align:center;
}

.admin-news-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.admin-news-row{
  background:#fff;
  border:1px solid #eee;
  border-radius:16px;
  padding:12px;
  display:flex;
  gap:12px;
  align-items:flex-start;
}

.admin-news-thumb{
  width:56px;
  height:56px;
  flex:0 0 56px;
  border-radius:14px;
  overflow:hidden;
  background:#f3f4f6;
  display:flex;
  align-items:center;
  justify-content:center;
}

.admin-news-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.thumb-placeholder{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#9ca3af;
  font-size:18px;
}

.admin-news-info{
  flex:1;
  min-width:0;
}

.admin-news-title{
  font-weight:800;
  font-size:15px;
  line-height:1.25;
  color:#111827;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.admin-news-meta{
  margin-top:6px;
  font-size:12.5px;
  color:#6b7280;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}

.admin-news-meta .dot{ opacity:.6; }

.admin-news-bottom{
  margin-top:8px;
}

.pill-featured{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  background:#fff7ed;
  color:#9a3412;
  border:1px solid #fed7aa;
  display:inline-flex;
  gap:6px;
  align-items:center;
}

/* actions right side */
.admin-news-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-left:6px;
  flex:0 0 auto;
}

/* unify action buttons */
.btn-action{
  width:38px;
  height:38px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  color:#111827;
}

.btn-action.view{
  background:#dcfce7;
  border-color:#bbf7d0;
  color:#166534;
}
.btn-action.delete{
  background:#fee2e2;
  border-color:#fecaca;
  color:#b91c1c;
}

/* status badge in mobile */
.status-badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}
.status-badge.published{
  background:#e5e7eb;
  color:#111827;
}
.status-badge.draft{
  background:#fff7ed;
  color:#9a3412;
}
/* ---- Responsive switch ---- */
.admin-desktop-only { display: block; }
.admin-mobile-only { display: none; }

@media (max-width: 900px){
  .admin-desktop-only { display: none; }
  .admin-mobile-only { display: block; }
}

/* ---- Filter bar ---- */
.admin-filter-card { padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.admin-filter-form { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.admin-filter-form .form-input { max-width: 280px; }
.admin-filter-form .form-select { max-width: 220px; }

/* ---- Desktop title/meta chips ---- */
.table-title-wrap { display: flex; flex-direction: column; gap: .35rem; }
.table-meta { display:flex; gap:.4rem; flex-wrap: wrap; }
.chip{
  display:inline-flex; align-items:center; gap:.35rem;
  padding:.15rem .5rem; border-radius:999px;
  font-size:.75rem; background:#f1f3f5; color:#111;
}
.chip-featured{ background:#fff3bf; }
.chip-video{ background:#e7f5ff; }
.chip-source{ background:#e6fcf5; }

/* ---- Mobile cards ---- */
.admin-news-list { display:flex; flex-direction:column; gap:.75rem; }
.admin-news-card{
  background:#fff; border:1px solid #eee; border-radius:14px;
  padding: .85rem; display:flex; justify-content:space-between; gap:.75rem;
}
.admin-news-left{ display:flex; gap:.75rem; min-width:0; }
.admin-news-thumb{
  width:56px; height:56px; border-radius:12px; overflow:hidden;
  background:#f1f3f5; flex:0 0 auto; display:grid; place-items:center;
}
.admin-news-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.thumb-placeholder i{ font-size:18px; opacity:.6; }

.admin-news-info{ min-width:0; display:flex; flex-direction:column; gap:.35rem; }
.admin-news-title{
  font-weight:700; line-height:1.25;
  overflow:hidden; text-overflow:ellipsis; display:-webkit-box;
  -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.admin-news-meta{ display:flex; gap:.5rem; flex-wrap:wrap; font-size:.82rem; opacity:.8; }
.admin-news-meta .dot{ opacity:.5; }

.admin-news-badges{ display:flex; gap:.4rem; flex-wrap:wrap; margin-top:.15rem; }

.admin-news-actions{
  display:flex; flex-direction:column; gap:.5rem; align-items:flex-end;
  flex:0 0 auto;
}
.admin-news-actions .btn-action{ width:40px; height:40px; display:grid; place-items:center; }

/* ---- Fix: table image size ---- */
.table-image { width:56px; height:56px; object-fit:cover; border-radius:12px; }
