/* ============================================
   HAN-VIET PORTAL - ADMIN CMS STYLES
   ============================================ */

/* Admin Layout */
.admin-body { background: #F1F5F9; font-family: 'Be Vietnam Pro', sans-serif; }
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar { width: 240px; background: #1E293B; color: white; flex-shrink: 0; display: flex; flex-direction: column; position: fixed; left: 0; top: 0; height: 100vh; overflow-y: auto; z-index: 200; transition: width 0.2s ease; }
.admin-sidebar.collapsed { width: 60px; }
.admin-sidebar.collapsed .sidebar-link span,
.admin-sidebar.collapsed .sidebar-logo span { display: none; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo { display: flex; align-items: center; gap: 0.6rem; color: white; font-size: 0.95rem; font-weight: 700; text-decoration: none; }
.sidebar-logo img { border-radius: 4px; }
.sidebar-toggle { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 1rem; padding: 4px; }
.sidebar-nav { flex: 1; padding: 0.75rem 0.5rem; display: flex; flex-direction: column; gap: 0.15rem; }
.sidebar-link { display: flex; align-items: center; gap: 0.7rem; padding: 9px 12px; border-radius: 8px; color: rgba(255,255,255,0.7); font-size: 0.87rem; font-weight: 500; text-decoration: none; transition: all 0.15s; }
.sidebar-link i { font-size: 0.9rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-link.active { background: #DC2626; color: white; }
.sidebar-footer { padding: 0.75rem 0.5rem; border-top: 1px solid rgba(255,255,255,0.1); }

/* Main Content */
.admin-main { margin-left: 240px; display: flex; flex-direction: column; min-height: 100vh; }
.admin-header { background: white; border-bottom: 1px solid #E2E8F0; padding: 0.75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.admin-header-left { display: flex; align-items: center; gap: 1rem; }
.admin-page-title { font-size: 1.1rem; font-weight: 700; color: #1E293B; }
.mobile-sidebar-toggle { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #64748B; }
.admin-user-info { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: #64748B; background: #F1F5F9; padding: 6px 12px; border-radius: 20px; }
.admin-content { padding: 1.5rem; flex: 1; }

/* Dashboard Stats */
.dashboard-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: white; border-radius: 12px; padding: 1.2rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid #E2E8F0; }
.stat-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.stat-card-number { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.stat-card-label { font-size: 0.75rem; color: #64748B; margin-top: 2px; }
.stat-blue .stat-card-icon { background: #DBEAFE; color: #2563EB; }
.stat-green .stat-card-icon { background: #DCFCE7; color: #16A34A; }
.stat-yellow .stat-card-icon { background: #FEF3C7; color: #D97706; }
.stat-purple .stat-card-icon { background: #F3E8FF; color: #9333EA; }
.stat-orange .stat-card-icon { background: #FFEDD5; color: #EA580C; }
.stat-teal .stat-card-icon { background: #CCFBF1; color: #0D9488; }

/* Dashboard Grid */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.dashboard-panel { background: white; border-radius: 12px; border: 1px solid #E2E8F0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow: hidden; }
.dashboard-panel-sm { /* same */ }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid #F1F5F9; background: #FAFAFA; }
.panel-header h2 { font-size: 0.92rem; font-weight: 700; color: #1E293B; display: flex; align-items: center; gap: 0.5rem; }
.panel-header h2 i { color: #64748B; }
.panel-body { padding: 1rem; }
.panel-header-sm { padding: 0.75rem 1rem; font-size: 0.85rem; font-weight: 700; color: #1E293B; border-bottom: 1px solid #F1F5F9; display: flex; align-items: center; gap: 0.4rem; background: #FAFAFA; }
.panel-body-sm { padding: 0.75rem; }

/* Status Bar */
.status-bar-item { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #F8FAFC; }
.status-bar-item:last-child { border-bottom: none; }
.status-bar-count strong { font-size: 1rem; font-weight: 700; }

/* Quick Actions */
.quick-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.quick-action-btn { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem; border-radius: 8px; background: #F8FAFC; color: #334155; font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: all 0.15s; border: 1px solid transparent; }
.quick-action-btn:hover { background: #EFF6FF; color: #2563EB; border-color: #BFDBFE; }
.quick-action-btn i { font-size: 0.9rem; color: #2563EB; }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.admin-table th { text-align: left; padding: 0.6rem 0.75rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #64748B; background: #F8FAFC; border-bottom: 2px solid #E2E8F0; white-space: nowrap; }
.admin-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid #F1F5F9; color: #374151; vertical-align: middle; }
.admin-table tbody tr:hover { background: #F8FAFC; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.row-legal td { background: #FFF8F0; }
.empty-row { text-align: center; padding: 3rem 1rem; color: #94A3B8; font-size: 0.9rem; }
.empty-row i { display: block; font-size: 2rem; margin-bottom: 0.5rem; }
.table-link { color: #1E293B; font-weight: 600; text-decoration: none; }
.table-link:hover { color: #DC2626; }
.table-subtext { font-size: 0.78rem; color: #94A3B8; margin-top: 2px; }
.table-responsive { overflow-x: auto; }
.table-count { font-size: 0.82rem; color: #94A3B8; padding: 0.5rem 0; text-align: right; }

/* Toolbar */
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: 0.75rem; }
.toolbar-right { display: flex; align-items: center; gap: 0.75rem; }
.toolbar-search { display: flex; align-items: center; gap: 0.3rem; }
.admin-search-input { padding: 6px 12px; border: 1.5px solid #E2E8F0; border-radius: 6px; font-size: 0.85rem; outline: none; transition: border-color 0.15s; }
.admin-search-input:focus { border-color: #DC2626; }
.toolbar-info { font-size: 0.85rem; color: #64748B; }

/* Buttons */
.btn-sm { display: inline-flex; align-items: center; gap: 0.4rem; padding: 6px 14px; border-radius: 6px; font-size: 0.83rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.15s; border: none; }
.btn-primary { background: #DC2626; color: white; border: 1.5px solid #DC2626; }
.btn-primary:hover { background: #B91C1C; border-color: #B91C1C; color: white; }
.btn-outline { background: transparent; color: #374151; border: 1.5px solid #D1D5DB; }
.btn-outline:hover { border-color: #DC2626; color: #DC2626; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; color: #64748B; font-size: 0.82rem; text-decoration: none; transition: all 0.15s; border: 1px solid #E2E8F0; background: white; cursor: pointer; }
.btn-icon:hover { background: #EFF6FF; color: #2563EB; border-color: #BFDBFE; }
.btn-success:hover { background: #DCFCE7; color: #16A34A; border-color: #86EFAC; }
.btn-warning:hover { background: #FEF3C7; color: #D97706; border-color: #FCD34D; }
.btn-publish:hover { background: #DCFCE7; color: #16A34A; border-color: #86EFAC; }
.btn-action:hover { background: #EFF6FF; color: #2563EB; border-color: #BFDBFE; }
.action-buttons { display: flex; gap: 0.3rem; }

/* Status Tabs */
.status-tabs { display: flex; gap: 0.3rem; overflow-x: auto; margin-bottom: 1rem; flex-wrap: wrap; }
.status-tab { padding: 6px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 500; color: #64748B; background: white; border: 1.5px solid #E2E8F0; text-decoration: none; transition: all 0.15s; white-space: nowrap; }
.status-tab:hover { border-color: #DC2626; color: #DC2626; }
.status-tab.active { background: #DC2626; color: white; border-color: #DC2626; }

/* Article Editor */
.editor-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; }
.editor-main .panel-body { background: white; border-radius: 12px; border: 1px solid #E2E8F0; padding: 1.5rem; }
.editor-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.editor-panel { background: white; border: 1px solid #E2E8F0; border-radius: 12px; overflow: hidden; }
.panel-header-sm { padding: 0.7rem 1rem; font-size: 0.82rem; font-weight: 700; color: #374151; border-bottom: 1px solid #F1F5F9; background: #FAFAFA; display: flex; align-items: center; gap: 0.4rem; }
.panel-body-sm { padding: 1rem; }
.editor-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.editor-toolbar { display: flex; gap: 0.3rem; flex-wrap: wrap; padding: 0.5rem; background: #F8FAFC; border: 1.5px solid #E2E8F0; border-bottom: none; border-radius: 8px 8px 0 0; }
.editor-toolbar button { padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; color: #374151; background: white; border: 1px solid #E2E8F0; cursor: pointer; transition: all 0.15s; }
.editor-toolbar button:hover { background: #EFF6FF; color: #2563EB; }
.editor-textarea { min-height: 400px; border-radius: 0 0 8px 8px; font-family: 'Courier New', monospace; font-size: 0.9rem; resize: vertical; }
.editor-preview { border: 1.5px solid #E2E8F0; border-radius: 0 0 8px 8px; padding: 1.5rem; background: white; min-height: 400px; line-height: 1.8; font-size: 0.95rem; }
.preview-content h1, .preview-content h2, .preview-content h3 { color: #1E293B; margin: 1rem 0 0.5rem; }
.preview-content p { margin-bottom: 0.75rem; }
.preview-content li { margin-bottom: 0.25rem; }
.preview-content blockquote { border-left: 4px solid #DC2626; padding: 0.5rem 1rem; background: #FEE2E2; margin: 1rem 0; }

/* SEO Score */
.seo-score { margin-top: 0.75rem; }
.seo-score-label { font-size: 0.78rem; color: #64748B; margin-bottom: 0.3rem; }
.seo-score-bar { height: 6px; background: #E2E8F0; border-radius: 3px; overflow: hidden; }
.seo-score-fill { height: 100%; background: linear-gradient(to right, #DC2626, #F59E0B, #22C55E); border-radius: 3px; transition: width 0.3s ease; }

/* Status History */
.history-item { padding: 0.6rem 0; border-bottom: 1px solid #F1F5F9; }
.history-item:last-child { border-bottom: none; }
.history-badges { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; margin-bottom: 0.2rem; }
.history-reason { font-size: 0.78rem; color: #64748B; margin: 0.2rem 0; }
.history-time { font-size: 0.72rem; color: #94A3B8; }

/* Form Controls */
.form-check-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.87rem; cursor: pointer; }
.form-check-label input { width: 16px; height: 16px; accent-color: #DC2626; }

/* Article List */
.article-title-cell { display: flex; flex-direction: column; gap: 0.2rem; }
.article-slug { color: #94A3B8; font-size: 0.72rem; font-family: monospace; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 0.3rem; padding: 1rem; flex-wrap: wrap; }
.page-btn { display: flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 6px; border: 1.5px solid #E2E8F0; color: #64748B; font-size: 0.85rem; text-decoration: none; transition: all 0.15s; background: white; }
.page-btn:hover { border-color: #DC2626; color: #DC2626; }
.page-btn.active { background: #DC2626; color: white; border-color: #DC2626; }
.page-info { margin-left: 0.5rem; font-size: 0.8rem; color: #94A3B8; }

/* User Cell */
.user-cell { display: flex; align-items: center; gap: 0.7rem; }
.user-avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: #EFF6FF; display: flex; align-items: center; justify-content: center; color: #2563EB; font-size: 0.9rem; flex-shrink: 0; }
.role-badge { padding: 2px 8px; border-radius: 4px; font-size: 0.72rem; font-weight: 600; }
.role-super_admin { background: #FEE2E2; color: #DC2626; }
.role-admin { background: #DBEAFE; color: #2563EB; }
.role-editor { background: #D1FAE5; color: #065F46; }
.role-reviewer { background: #F3E8FF; color: #9333EA; }
.role-contributor { background: #FEF3C7; color: #92400E; }

/* Action Code */
.action-code { background: #F1F5F9; padding: 2px 6px; border-radius: 4px; font-size: 0.78rem; color: #475569; }

/* Media Grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.media-item { border: 1px solid #E2E8F0; border-radius: 8px; overflow: hidden; }
.media-preview { height: 100px; background: #F8FAFC; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-icon { font-size: 2rem; color: #94A3B8; }
.media-info { padding: 0.5rem; }
.media-info p { font-size: 0.75rem; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-info small { font-size: 0.7rem; color: #94A3B8; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.settings-section { background: white; border-radius: 12px; padding: 1.5rem; border: 1px solid #E2E8F0; }
.settings-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: #1E293B; display: flex; align-items: center; gap: 0.5rem; }
.settings-note { font-size: 0.85rem; color: #64748B; display: flex; align-items: flex-start; gap: 0.4rem; background: #F8FAFC; padding: 0.75rem; border-radius: 6px; }
.settings-note i { flex-shrink: 0; margin-top: 2px; }

/* Empty State */
.empty-state { text-align: center; padding: 3rem 1rem; color: #94A3B8; }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.empty-state a { margin-top: 1rem; display: inline-block; }
.alert-error { background: #FEE2E2; color: #DC2626; padding: 1rem; border-radius: 8px; display: flex; align-items: center; gap: 0.5rem; }

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-stats { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { grid-row: 1; }
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .mobile-sidebar-toggle { display: flex; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
