/* ============================================
   WSHT MINING ADMIN - Main Stylesheet
   Palette: Deep Blue #0A1628 / #0D1B33 / #162544
            Gold #D4AF37 / #F5C94C
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary-dark: #0A1628;
  --primary-mid: #0D1B33;
  --primary-light: #162544;
  --gold: #D4AF37;
  --gold-light: #F5C94C;
  --text-dark: #0A1628;
  --text-mid: #1A2740;
  --text-light: #3A4764;
  --text-muted: #7a8699;
  --bg-white: #FFFFFF;
  --bg-gray: #F5F7FA;
  --border: #e6eaf0;
  --border-light: #eef1f6;
  --danger: #e74c3c;
  --danger-bg: #fef2f2;
  --success: #27ae60;
  --success-bg: #f0fdf4;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.04);
  --shadow: 0 4px 16px rgba(10, 22, 40, 0.07);
  --shadow-lg: 0 8px 30px rgba(10, 22, 40, 0.1);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

html, body {
  font-family: 'Inter', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--bg-gray);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-mid); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }

/* ============================================
   Sidebar
   ============================================ */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0c1a30 0%, #0a1628 40%, #0d1b33 100%);
  color: #c8d1e0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.25); border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.4); }

/* Logo */
.sidebar-logo {
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  flex-shrink: 0;
}
.sidebar-logo .logo-emblem {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--gold), #e8c84a);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}
.sidebar-logo h1 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}
.sidebar-logo span {
  font-size: 10px;
  color: #5a6a85;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
}

.sidebar-nav .nav-section {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: #4a5a78;
  padding: 16px 14px 6px;
  margin-top: 4px;
}
.sidebar-nav .nav-section:first-child {
  margin-top: 0;
}
.sidebar-nav .nav-section i {
  font-size: 11px;
  color: var(--gold);
  opacity: 0.5;
}
.sidebar-nav .nav-section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06), transparent);
  margin-left: 8px;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #8896b0;
  border-radius: 10px;
  margin-bottom: 1px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .25s ease;
  cursor: pointer;
  position: relative;
}

.sidebar-nav .nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--gold);
  opacity: 0.6;
  transition: all .25s ease;
  flex-shrink: 0;
}

.sidebar-nav .nav-item span {
  transition: all .25s ease;
}

.sidebar-nav .nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e8edf5;
}
.sidebar-nav .nav-item:hover i {
  opacity: 0.9;
  transform: translateX(2px);
}
.sidebar-nav .nav-item:hover span {
  transform: translateX(2px);
}

.sidebar-nav .nav-item.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0.03) 100%);
  color: var(--gold-light);
  box-shadow: inset 0 1px 0 rgba(212, 175, 55, 0.08);
}
.sidebar-nav .nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(180deg, var(--gold), var(--gold-light));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}
.sidebar-nav .nav-item.active i {
  opacity: 1;
  color: var(--gold-light);
}

/* Submenu */
.sidebar-nav .nav-item.has-submenu {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 0;
}
.sidebar-nav .nav-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  transition: all .25s ease;
  position: relative;
}
.sidebar-nav .nav-item-main:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e8edf5;
}
.sidebar-nav .nav-item-main:hover i:first-child {
  opacity: 0.9;
  transform: translateX(2px);
}
.sidebar-nav .nav-item-main i:first-child {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--gold);
  opacity: 0.6;
  transition: all .25s ease;
  flex-shrink: 0;
}
.sidebar-nav .nav-item-main .submenu-toggle {
  margin-left: auto;
  font-size: 10px;
  transition: all .3s ease;
  color: #5a6a85;
  opacity: 0.6;
}
.sidebar-nav .nav-item.has-submenu.active .nav-item-main {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0.03) 100%);
  color: var(--gold-light);
}
.sidebar-nav .nav-item.has-submenu.active .nav-item-main::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(180deg, var(--gold), var(--gold-light));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}
.sidebar-nav .nav-item.has-submenu.active .submenu-toggle {
  transform: rotate(180deg);
  color: var(--gold-light);
  opacity: 1;
}
.sidebar-nav .submenu {
  display: none;
  padding: 2px 0 6px 8px;
}
.sidebar-nav .nav-item.has-submenu.active .submenu {
  display: block;
}
.sidebar-nav .submenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 36px;
  color: #6a7a98;
  font-size: 12.5px;
  font-weight: 400;
  transition: all .2s ease;
  border-radius: 8px;
  position: relative;
}
.sidebar-nav .submenu-item::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.04);
}
.sidebar-nav .submenu-item:last-child::before {
  bottom: 50%;
}
.sidebar-nav .submenu-item i {
  font-size: 4px;
  color: var(--gold);
  opacity: 0.4;
  width: auto;
  transition: all .2s ease;
}
.sidebar-nav .submenu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #d0d8e8;
}
.sidebar-nav .submenu-item:hover i {
  opacity: 0.8;
}
.sidebar-nav .submenu-item.active {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.06);
}
.sidebar-nav .submenu-item.active i {
  opacity: 1;
  color: var(--gold-light);
  font-size: 8px;
}

/* Sidebar User */
.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.12);
}

.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-info .name {
  color: #e8edf5;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar-user .user-info .role {
  color: #5a6a85;
  font-size: 10.5px;
  letter-spacing: 0.3px;
}

.sidebar-user .logout-btn {
  color: #5a6a85;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all .2s;
  flex-shrink: 0;
}

.sidebar-user .logout-btn i {
  font-size: 15px;
}

.sidebar-user .logout-btn:hover {
  background: rgba(231, 76, 60, 0.15);
  color: #ff6b6b;
}

/* ============================================
   Main Content / Topbar
   ============================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-mid);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .current { color: var(--primary-dark); font-weight: 600; }
.breadcrumb .separator { color: #c4ccd8; font-size: 12px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .2s;
}

.topbar-user:hover { background: var(--bg-gray); }

.topbar-user .avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.topbar-user .avatar-sm i { font-size: 12px; color: var(--primary-dark); }

.topbar-user .user-name { color: var(--text-mid); font-size: 13px; font-weight: 500; }
.topbar-user i { color: var(--gold); }

/* ============================================
   Content Wrapper / Cards
   ============================================ */
.content {
  padding: 28px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  transition: box-shadow .2s ease;
}
.card:hover {
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ============================================
   Dashboard Stats Cards
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.stat-card .icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(245, 201, 76, 0.1));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 14px;
  transition: all .3s ease;
}

.stat-card:hover .icon {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--primary-dark);
}

.stat-card .label {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}

.stat-card .trend {
  margin-top: 10px;
  font-size: 12px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.stat-icon-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light)) !important;
  color: #fff !important;
}
.stat-unread-badge {
  font-size: 13px;
  color: #c47a1a;
  margin-left: 8px;
  vertical-align: middle;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.4;
}

.btn i { font-size: 13px; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #e2c34a);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
  color: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

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

.btn-secondary:hover {
  border-color: var(--text-mid);
  background: var(--bg-gray);
}

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

.btn-danger:hover {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

.btn-sm i { font-size: 11px; }

.btn-block { display: flex; width: 100%; }

/* ============================================
   Tables
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-white);
}

.data-table thead th {
  padding: 11px 16px;
  text-align: left;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  background: var(--primary-dark);
  border-bottom: none;
}

.data-table thead th:first-child {
  border-radius: 0;
}

.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-mid);
  font-size: 13px;
  vertical-align: middle;
}

.data-table tbody tr {
  background: var(--bg-white);
  transition: background .12s ease;
}

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

.data-table tbody tr:hover {
  background: rgba(212, 175, 55, 0.04);
}

.data-table .actions {
  white-space: nowrap;
  display: flex;
  gap: 5px;
}

.data-table .actions .btn { padding: 5px 9px; font-size: 11px; }

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

/* ============================================
   Forms
   ============================================ */
.admin-form {
  max-width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-group .hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-dark);
  background: var(--bg-white);
  transition: border-color .2s, box-shadow .15s;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #b0bccd;
}

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

.form-textarea.large { min-height: 300px; font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%233A4764' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}

/* Checkbox & Radio */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

.checkbox-group label {
  font-size: 13px;
  font-weight: 400;
  margin: 0;
  color: var(--text-mid);
  cursor: pointer;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  transition: .3s;
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
}

.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-mid);
  cursor: pointer;
}

/* Permissions Matrix */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px;
  background: var(--bg-gray);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  cursor: pointer;
  transition: all .2s;
}

.permission-item:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.04);
}

.permission-item.checked {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.permission-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}

.permission-item .perm-icon {
  font-size: 16px;
  color: var(--gold);
  flex-shrink: 0;
}

.permission-item .perm-name {
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 500;
}

.permission-item .perm-key {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

/* Section selector grid */
.section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.section-item {
  padding: 12px 14px;
  background: var(--bg-gray);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all .2s;
}

.section-item:hover { border-color: var(--gold); }

.section-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

/* ============================================
   Badges / Tags
   ============================================ */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-success { background: var(--success-bg, rgba(39, 174, 96, 0.12)); color: var(--success); }
.badge-danger { background: var(--danger-bg, rgba(231, 76, 60, 0.12)); color: var(--danger); }
.badge-warning { background: var(--warning-bg, rgba(243, 156, 18, 0.12)); color: var(--warning); }
.badge-info { background: var(--info-bg, rgba(37, 99, 235, 0.1)); color: var(--info); }
.badge-gold { background: rgba(212, 175, 55, 0.12); color: var(--gold); }
.badge-dark { background: var(--primary-dark); color: var(--gold-light); }
.badge-muted { background: var(--bg-gray); color: var(--text-muted); }

/* ============================================
   Flash Messages / Toasts
   ============================================ */
.flash-messages {
  margin-bottom: 20px;
}

.flash-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  position: relative;
  animation: slideDown .25s ease;
}

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

.flash-message.success {
  background: var(--success-bg, #f0fdf4);
  color: #166534;
  border-left: 3px solid var(--success);
}

.flash-message.error {
  background: var(--danger-bg, #fef2f2);
  color: #991b1b;
  border-left: 3px solid var(--danger);
}

.flash-message.warning {
  background: var(--warning-bg, #fffbeb);
  color: #92400e;
  border-left: 3px solid var(--warning);
}

.flash-message.info {
  background: var(--info-bg, #eff6ff);
  color: #1e40af;
  border-left: 3px solid var(--info);
}

.flash-message i { font-size: 16px; }

.flash-message .flash-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.4;
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
  border-radius: 4px;
  transition: opacity .15s;
}

.flash-message .flash-close:hover { opacity: 0.8; }

/* Toast notification (JS driven) */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.12);
  border-left: 3px solid var(--info);
  animation: slideInRight .25s ease;
  font-size: 13.5px;
  color: var(--text-dark);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast .toast-icon { font-size: 16px; flex-shrink: 0; }

/* ============================================
   Search / Toolbar
   ============================================ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 14px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-box input {
  width: 100%;
  padding: 9px 13px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .15s;
  background: var(--bg-white);
}

.search-box input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.search-box i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.toolbar-filters {
  display: flex;
  gap: 10px;
  flex: 1;
  max-width: 380px;
}

.toolbar-filters select {
  flex: 1;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-white);
  color: var(--text-mid);
  transition: border-color .2s;
}

.toolbar-filters select:focus {
  outline: none;
  border-color: var(--gold);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ============================================
   Recent Activity
   ============================================ */
.recent-activity {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.activity-list {
  list-style: none;
}

.activity-list li {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.activity-list li:last-child { border-bottom: none; }

.activity-list .act-icon {
  width: 36px;
  height: 36px;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.activity-list .act-content { flex: 1; }

.activity-list .act-title {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.activity-list .act-meta {
  color: var(--text-muted);
  font-size: 12px;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-gray);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
  text-decoration: none;
}

.quick-action:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.06);
  color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quick-action i {
  font-size: 22px;
  color: var(--gold);
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  border-radius: 50%;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-circle {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--primary-dark);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
}

.login-logo h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 1px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.login-card .form-group label {
  font-size: 13px;
}

.login-card .form-input {
  padding: 12px 16px;
  font-size: 14px;
}

.login-btn {
  width: 100%;
  padding: 13px;
  margin-top: 12px;
  font-size: 15px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 12px;
}

.login-footer a { color: var(--gold); font-weight: 600; }
.login-footer a:hover { color: var(--primary-dark); }

/* ============================================
   Modal / Confirm Dialog
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(10, 22, 40, 0.15);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-icon {
  width: 40px;
  height: 40px;
  background: var(--danger-bg, rgba(231, 76, 60, 0.12));
  color: var(--danger);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-body {
  color: var(--text-mid);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions .btn { min-width: 90px; }

/* ============================================
   Pagination
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-mid);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--border-light);
  transition: all .15s ease;
}

.pagination a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.pagination .current {
  background: var(--primary-dark);
  color: var(--gold-light);
  border-color: var(--primary-dark);
  font-weight: 600;
}

/* ============================================
   Utility
   ============================================ */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-gold { color: var(--gold) !important; }
.text-muted { color: var(--text-muted) !important; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  color: var(--gold);
  opacity: 0.4;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.empty-state p { font-size: 13px; }

/* Form section heading */
.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 32px 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
}
.form-section-title i { color: var(--gold); font-size: 18px; }
.form-section-title:first-child { margin-top: 0; }

/* Form action bar */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  margin-top: 24px;
}

/* Inline info box */
.info-box {
  background: #f7f9fc;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-left: 3px solid var(--gold);
  font-size: 13px;
  color: #556;
  line-height: 1.7;
}
.info-box strong { color: #334; }
.info-box a { color: var(--gold); font-weight: 600; }
.info-box a:hover { color: var(--primary-dark); }

/* Badge inline in form */
.badge-inline {
  background: #eee;
  color: #555;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* ============================================
   Article list thumbnails & pagination wrapper
   ============================================ */
.list-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.list-thumb-placeholder {
  width: 60px;
  height: 60px;
  background: #f1f5f9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 20px;
}

.pagination-wrapper {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}
.pagination .disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: #d0d5dd;
  font-size: 13px;
  border: 1px solid var(--border-light);
  opacity: 0.5;
}
.pagination .ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================
   Section / Category selector (Article form)
   ============================================ */
.section-selector {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-gray);
  padding: 14px;
}
.section-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.section-option { cursor: pointer; display: block; }
.section-option input[type="radio"] { display: none; }
.section-option-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  transition: all .2s ease;
  position: relative;
}
.section-option:hover .section-option-inner {
  border-color: rgba(212, 175, 55, 0.4);
  background: #fffdf5;
}
.section-option.section-selected .section-option-inner {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fffdf5 0%, #fff9e6 100%);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}
.section-option-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff9e6 0%, #fff4d6 100%);
  border-radius: 10px;
  color: var(--gold);
  font-size: 20px;
  flex-shrink: 0;
  transition: all .2s ease;
}
.section-option.section-selected .section-option-icon {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--primary-dark);
}
.section-option-info { flex: 1; min-width: 0; }
.section-option-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
}
.section-option-cn {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.section-option-check {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  opacity: 0;
  transform: scale(0.8);
  transition: all .2s ease;
  flex-shrink: 0;
}
.section-option.section-selected .section-option-check {
  opacity: 1;
  transform: scale(1);
}

/* Category selector */
.cat-selector {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-gray);
  padding: 14px;
}
.cat-selector-search {
  position: relative;
  margin-bottom: 12px;
}
.cat-selector-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.cat-selector-search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
  transition: border-color .2s;
}
.cat-selector-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.cat-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.cat-selector-grid::-webkit-scrollbar { width: 6px; }
.cat-selector-grid::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.cat-selector-grid::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.cat-selector-grid::-webkit-scrollbar-thumb:hover { background: #aaa; }
.cat-option { cursor: pointer; display: block; }
.cat-option input[type="radio"] { display: none; }
.cat-option-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  transition: all .2s ease;
  position: relative;
}
.cat-option:hover .cat-option-inner {
  border-color: rgba(212, 175, 55, 0.4);
  background: #fffdf5;
}
.cat-option.cat-selected .cat-option-inner {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fffdf5 0%, #fff9e6 100%);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}
.cat-option-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff9e6 0%, #fff4d6 100%);
  border-radius: 10px;
  color: var(--gold);
  font-size: 16px;
  flex-shrink: 0;
  transition: all .2s ease;
}
.cat-option.cat-selected .cat-option-icon {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--primary-dark);
}
.cat-option-info { flex: 1; min-width: 0; }
.cat-option-name { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.cat-option-cn { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cat-option-check {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  opacity: 0;
  transform: scale(0.8);
  transition: all .2s ease;
  flex-shrink: 0;
}
.cat-option.cat-selected .cat-option-check { opacity: 1; transform: scale(1); }
.cat-selector-empty {
  display: none;
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}
.cat-selector-empty i { font-size: 32px; margin-bottom: 8px; opacity: 0.4; }

/* ============================================
   Image upload
   ============================================ */
.image-upload-wrapper.compact {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.image-preview {
  width: 140px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--bg-gray);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-placeholder {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
}
.image-placeholder i { font-size: 24px; opacity: 0.4; display: block; margin-bottom: 6px; }
.image-placeholder span { font-size: 11px; }
.image-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--primary-dark);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  border: none;
  font-family: inherit;
  justify-content: center;
}
.upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}
.upload-btn.small { padding: 8px 14px; font-size: 12px; }
.hidden-file-input { display: none; }
.text-path-input { padding: 8px 12px; font-size: 12px; }

/* ============================================
   RTE (Rich Text Editor)
   ============================================ */
.rte-container {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.rte-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-gray);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 6px;
}
.rte-toolbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.rte-toolbar-right { display: flex; gap: 4px; }
.rte-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-mid);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.rte-btn:hover {
  background: #fff;
  border-color: var(--border);
  color: var(--text-dark);
}
.rte-btn i { font-size: 13px; }
.rte-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.rte-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.rte-mode-btn.active {
  background: var(--primary-dark);
  color: var(--gold-light);
  border-color: var(--primary-dark);
}
.rte-content {
  min-height: 420px;
  max-height: 600px;
  overflow-y: auto;
  padding: 20px 24px;
  line-height: 1.8;
  font-size: 15px;
}
.rte-content[contenteditable="true"]:focus { outline: none; }
.rte-content.rte-visual { display: block; }
.rte-content.rte-html {
  display: none;
  width: 100%;
  border: none;
  resize: vertical;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  color: var(--text-dark);
  background: #1e1e2e;
  color: #cdd6f4;
  tab-size: 2;
}
.rte-content[data-mode="html"] { display: block; }
.rte-content[data-mode="visual"] { display: block; }

/* ============================================
   Activity message list refinements
   ============================================ */
.activity-msg-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.activity-msg-item:last-child { border-bottom: none; }
.act-icon-unread {
  background: var(--gold) !important;
  color: #fff !important;
}
.act-title-link { color: inherit; text-decoration: none; }
.act-title-link:hover { color: var(--gold); }
.act-title-company {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 12px;
}
.act-new-badge {
  float: right;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.act-subject {
  font-size: 13px;
  color: var(--text-mid);
  margin: 4px 0 2px;
  font-weight: 500;
}
.act-preview {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.card-action-link {
  float: right;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
}
.card-action-link:hover { color: var(--primary-dark); }

/* ============================================
   Page header
   ============================================ */
.page-header {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title i { color: var(--gold); font-size: 20px; }

/* ============================================
   Login page refinements
   ============================================ */
.login-card {
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}
.login-btn { position: relative; overflow: hidden; }

/* ============================================
   Misc refinements
   ============================================ */
.topbar {
  background: linear-gradient(180deg, #fff 0%, #fafbfd 100%);
  box-shadow: 0 1px 3px rgba(10, 22, 40, 0.04);
}

.breadcrumb i { color: var(--gold); font-size: 13px; }

.form-group label i { color: var(--gold); margin-right: 4px; font-size: 13px; }

/* Permission matrix refinements */
.permissions-grid { border: 1px solid var(--border-light); }
.permission-item { transition: all .2s ease; }

.sidebar-user .logout-btn i { font-size: 16px; }

/* ============================================
   Section & Category filter tabs
   ============================================ */
.section-filter-tabs {
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-white);
  overflow: hidden;
}
.section-filter-tabs-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--primary-dark);
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.section-filter-tabs-header i { font-size: 13px; }
.section-filter-tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-gray);
}
.section-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
  line-height: 1.3;
}
.section-tab:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.section-tab.active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  font-weight: 600;
}
.section-tab i { font-size: 13px; }
.section-tab .section-tab-cn {
  font-size: 11px;
  opacity: 0.65;
  margin-left: 1px;
}
.section-tab.active .section-tab-cn { opacity: 0.75; }
.section-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 1px;
}
.section-tab.active .section-tab-count {
  background: rgba(255, 255, 255, 0.15);
  color: var(--gold-light);
}

.cat-filter-tabs {
  margin-bottom: 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-white);
  overflow: hidden;
}
.cat-filter-tabs-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--primary-mid);
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.cat-filter-tabs-header i { font-size: 13px; }
.cat-filter-tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-gray);
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
  line-height: 1.3;
}
.cat-tab:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.cat-tab.active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  font-weight: 600;
}
.cat-tab.hide { display: none !important; }
.cat-tab i { font-size: 12px; }
.cat-tab .cat-tab-cn {
  font-size: 10px;
  opacity: 0.65;
  margin-left: 1px;
}
.cat-tab.active .cat-tab-cn { opacity: 0.75; }
.cat-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 15px;
  padding: 0 5px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 1px;
}
.cat-tab.active .cat-tab-count {
  background: rgba(255, 255, 255, 0.15);
  color: var(--gold-light);
}

/* ============================================
   Responsive
   ============================================ */
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
}

.backdrop.active { display: block; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .permissions-grid { grid-template-columns: repeat(2, 1fr); }
  .section-grid { grid-template-columns: repeat(2, 1fr); }
  .recent-activity { grid-template-columns: 1fr; }
  .section-selector-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s ease;
    width: 260px;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .sidebar-toggle { display: block; }

  .topbar { padding: 0 16px; }

  .content { padding: 16px; }

  .card { padding: 18px; border-radius: var(--radius); }

  .form-row { grid-template-columns: 1fr; gap: 14px; }

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

  .permissions-grid,
  .section-grid { grid-template-columns: 1fr; }

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

  .page-title { font-size: 18px; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-actions { justify-content: flex-end; }
  .search-box, .toolbar-filters { max-width: none; }

  .topbar-user .user-name { display: none; }

  .data-table thead th,
  .data-table tbody td { padding: 10px 12px; font-size: 12px; }

  .login-card { padding: 28px 20px; }

  .section-selector-grid { grid-template-columns: 1fr; }
  .cat-selector-grid { grid-template-columns: 1fr; }
  .image-upload-wrapper.compact { flex-direction: column; }
  .image-preview { width: 100%; height: 140px; }
  .section-filter-tabs-list { gap: 6px; }
  .section-tab { padding: 6px 12px; font-size: 12px; }
  .cat-tab { padding: 5px 10px; font-size: 11px; }
}

@media (max-width: 480px) {
  .stat-card { padding: 18px; }
  .stat-card .value { font-size: 22px; }
  .data-table { font-size: 12px; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .quick-actions { grid-template-columns: 1fr; }
  .rte-toolbar { flex-direction: column; }
  .rte-toolbar-right { width: 100%; justify-content: flex-end; }
}
