/* ==============================================
   新媒体管理系统 — Design System v5
   Modern · Professional · Clean
   ============================================== */

/* ==============================================
   1. DESIGN TOKENS
   ============================================== */
:root {
  /* Brand */
  --primary: #5B5FE8;
  --primary-dark: #4A4FD6;
  --primary-darker: #393DC7;
  --primary-light: #F0F1FF;
  --primary-soft: #F7F8FF;
  --primary-gradient: linear-gradient(135deg, #7C7FEF, #5B5FE8);

  /* Accent */
  --accent-teal: #0D9488;
  --accent-teal-light: #CCFBF1;
  --accent-amber: #DC2626;
  --accent-amber-light: #FEF3C7;
  --accent-rose: #E11D48;
  --accent-rose-light: #FFE4E6;
  --accent-sky: #0284C7;
  --accent-sky-light: #E0F2FE;
  --accent-emerald: #059669;
  --accent-emerald-light: #D1FAE5;

  /* Semantic */
  --success: #059669;
  --success-light: #D1FAE5;
  --success-bg: #ECFDF5;
  --warning: #DC2626;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --info: #0284C7;
  --info-light: #E0F2FE;

  /* Sidebar */
  --bg-sidebar: #0F172A;
  --bg-sidebar-hover: rgba(255,255,255,0.06);
  --bg-sidebar-active: var(--primary);
  --sidebar-width: 220px;
  --sidebar-collapsed: 52px;
  --text-sidebar: rgba(148,163,184,0.65);
  --text-sidebar-hover: #CBD5E1;
  --text-sidebar-active: #FFFFFF;
  --sidebar-border: rgba(255,255,255,0.06);

  /* Content */
  --bg-app: #F1F5F9;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-subtle: #F1F5F9;

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-placeholder: #CBD5E1;

  /* Borders */
  --border-color: #CBD5E1;
  --border-light: #E2E8F0;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-2xl: 18px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);

  /* Transitions */
  --transition-fast: .15s cubic-bezier(.4,0,.2,1);
  --transition-normal: .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: .3s cubic-bezier(.4,0,.2,1);

  /* Font */
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* ==============================================
   2. RESET & BASE
   ============================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==============================================
   3. LAYOUT: SIDEBAR
   ============================================== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 1030;
  transition: transform var(--transition-normal), width var(--transition-normal);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  display: flex; align-items: center; gap: .65rem;
  padding: 1.15rem 1.2rem;
  color: #fff !important; text-decoration: none;
  font-weight: 700; font-size: .92rem;
  border-bottom: 1px solid var(--sidebar-border);
  letter-spacing: -.01em;
}

.brand-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  font-size: 1rem; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(91,95,232,.3);
}

.brand-text { font-size: .88rem; white-space: nowrap; }

.sidebar-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: .5rem .65rem;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }

/* ========== SIDEBAR: 3-Level Navigation (Redesigned) ========== */

/* L1: Section header */
.nav-section {
  font-size: .95rem; font-weight: 700; letter-spacing: .02em;
  color: #F1F5F9; padding: .6rem .8rem;
  cursor: pointer; display: flex; align-items: center; gap: .5rem;
  user-select: none; margin: .3rem .5rem .1rem; border-radius: 5px;
  transition: all .15s;
}
.nav-section:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-section i:first-child { font-size: 1rem; opacity: .75; }
.nav-section .collapse-arrow { font-size: .55rem; transition: transform .2s; margin-left: auto; opacity: .3; }
.nav-section.collapsed .collapse-arrow { transform: rotate(-90deg); }
.nav-section.collapsed + ul { display: none; }

/* L1: Accent dots */
.nav-section::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  margin-left: .3rem; flex-shrink: 0;
}
.section-hr::after { background: #F59E0B; }
.section-pm::after { background: #3B82F6; }
.section-cm::after { background: #10B981; }
.section-ov::after { background: #6366F1; }

/* L2: Sub-group header — clickable */
.nav-sub-label {
  font-size: .88rem; font-weight: 600; letter-spacing: .02em;
  color: #A0AEC0; padding: .4rem .8rem .4rem 1.5rem; margin: .05rem 0;
  cursor: pointer; display: flex; align-items: center; gap: .4rem;
  user-select: none; transition: all .12s; border-radius: 3px;
}
.nav-sub-label:hover { color: #CBD5E1; }
.nav-sub-label::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #64748B; flex-shrink: 0;
}
.nav-sub-label .collapse-arrow { font-size: .45rem; margin-left: auto; opacity: .4; transition: transform .2s; }
.nav-sub-label.collapsed .collapse-arrow { transform: rotate(-90deg); }
.nav-sub-label.collapsed + ul { display: none; }
.nav-sub-group { list-style: none; padding: 0; margin: 0; }

/* L3: Nav links */
.sidebar .nav { list-style: none; padding: 0; margin: 0 0 .15rem; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .8rem; color: #94A3B8; text-decoration: none;
  border-radius: 4px; font-size: .9rem; font-weight: 450;
  transition: all .12s; margin: 0 .3rem;
}
.sidebar .nav-link i { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; opacity: .45; }
.sidebar .nav-link:hover { color: #E2E8F0; background: rgba(255,255,255,.05); }
.sidebar .nav-link:hover i { opacity: .8; }
.sidebar .nav-link.active { color: #fff; background: rgba(99,102,241,.2); font-weight: 600; }
.sidebar .nav-link.active i { opacity: 1; color: #A5B4FC; }

/* L3: Standard — same indent as nested */
.sidebar .nav-link.l3 {
  font-size: .88rem; padding: .4rem .8rem .4rem 2.2rem;
  color: #6B7280; margin: 0 .3rem;
}
.sidebar .nav-link.l3:hover { color: #CBD5E1; }
.sidebar .nav-link.l3.active { color: #E2E8F0; background: rgba(99,102,241,.1); }
.sidebar .nav-link.l3 i { font-size: .88rem; }

/* L3: Nested under L2 */
.sidebar .nav-link.ps-4 {
  font-size: .82rem; padding: .38rem .8rem .38rem 2.2rem;
  color: #6B7280; margin: 0 .3rem;
}
.sidebar .nav-link.ps-4:hover { color: #CBD5E1; }
.sidebar .nav-link.ps-4.active { color: #E2E8F0; background: rgba(99,102,241,.1); }
.sidebar .nav-link.ps-4 i { font-size: .85rem; }

.sidebar .nav-link.active {
  background: rgba(91,95,232,0.15);
  border-left-color: var(--primary);
  color: #fff; font-weight: 600;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: none;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: .55rem .65rem; border-top: 1px solid var(--sidebar-border);
}
.user-info {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .6rem; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-sidebar);
  transition: all var(--transition-fast); cursor: pointer;
}
.user-info:hover { background: var(--bg-sidebar-hover); color: var(--text-sidebar-hover); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .75rem; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(91,95,232,.3);
}
.user-name { font-size: .78rem; font-weight: 600; color: #D1D5DB; line-height: 1.2; }
.user-role-badge { font-size: .62rem; color: var(--text-sidebar); }

/* Sidebar mobile overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.5); z-index: 1025;
  opacity: 0; transition: opacity var(--transition-normal);
}

/* ==============================================
   4. LAYOUT: MAIN CONTENT
   ============================================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left var(--transition-normal);
  width: calc(100% - var(--sidebar-width));
  max-width: none;
}

/* Top Header */
.top-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.5rem;
  background: rgba(255,255,255,.85);
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow var(--transition-normal);
}
.top-header.scrolled { box-shadow: 0 1px 8px rgba(0,0,0,.06); }
.top-header h5 { font-weight: 700; font-size: .92rem; color: var(--text-primary); letter-spacing: -.01em; margin: 0; }
.header-date {
  font-size: .73rem; color: var(--text-muted);
  background: var(--bg-subtle); padding: .3rem .7rem;
  border-radius: 20px; font-weight: 500;
  display: flex; align-items: center; gap: .35rem;
}

/* Hamburger */
.hamburger-toggle {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: none; background: transparent;
  cursor: pointer; font-size: 1.25rem; color: var(--text-secondary);
  border-radius: var(--radius-sm); margin-right: .5rem;
  transition: all var(--transition-fast);
}
.hamburger-toggle:hover { background: var(--bg-subtle); color: var(--text-primary); }

/* Page Content */
.page-content { padding: .5rem 0 1rem; flex: 1; width: 100%; }

/* Wider layout for progress board */
.progress-board { font-size: .92rem; width: 100%; table-layout: fixed; }
.progress-board thead th {
  background: #1E293B; color: #fff; font-weight: 600;
  font-size: .85rem; padding: .5rem .4rem;
}
.progress-board thead th:first-child { border-radius: 6px 0 0 0; }
.progress-board thead th:last-child { border-radius: 0 6px 0 0; }
.progress-board tbody td { font-size: .9rem; padding: .4rem .4rem; }
.progress-board tbody tr:nth-child(even) { background: #F8FAFC; }
.progress-board tbody tr:nth-child(odd) { background: #fff; }
.progress-board tbody tr:hover { background: #EEF2FF; }
.stage-cell { border-left: 3px solid var(--border-light); }
.stage-cell .form-select { font-size: .85rem !important; }
.stage-cell .badge { font-size: .8rem !important; }
.stage-cell .small { font-size: .82rem !important; }
.stage-cell .btn-xs { font-size: .75rem !important; }
.stage-cell a.small { font-size: .8rem !important; }

/* Page Header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .8rem; flex-wrap: wrap; gap: .5rem;
}
.page-header h4 {
  font-weight: 800; font-size: 1.25rem; color: var(--text-primary);
  display: flex; align-items: center; gap: .5rem; margin: 0;
  letter-spacing: -.02em;
}
.page-header h4 i { color: var(--primary); font-size: 1.2rem; }
.page-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }

/* ==============================================
   5. CARDS
   ============================================== */
/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-left: 0; margin-right: 0;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
  border-left: 4px solid var(--primary);
}
.stat-card::after {
  content: '';
  position: absolute; right: -8px; bottom: -8px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary-light);
  opacity: .35; pointer-events: none;
  transition: all var(--transition-normal);
}
.stat-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-color);
  transform: translateY(-2px);
}
.stat-card:hover::after { opacity: .5; transform: scale(1.1); }

.stat-card.card-accent.primary { border-left-color: var(--primary); }
.stat-card.card-accent.primary::after { background: var(--primary-light); }
.stat-card.card-accent.success { border-left-color: var(--success); }
.stat-card.card-accent.success::after { background: var(--success-light); }
.stat-card.card-accent.warning { border-left-color: var(--warning); }
.stat-card.card-accent.warning::after { background: var(--warning-light); }
.stat-card.card-accent.info { border-left-color: var(--info); }
.stat-card.card-accent.info::after { background: var(--info-light); }
.stat-card.card-accent.danger { border-left-color: var(--danger); }
.stat-card.card-accent.danger::after { background: var(--danger-light); }

.stat-card .card-body { padding: 1rem 1.15rem; position: relative; z-index: 1; }
.stat-card .stat-label {
  font-size: .73rem; color: var(--text-secondary);
  margin-bottom: .35rem; font-weight: 500;
  display: flex; align-items: center; gap: .3rem;
}
.stat-card .stat-label i { color: var(--primary); font-size: .78rem; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); line-height: 1.15; }

/* Stat Icon */
.stat-icon-wrapper {
  width: 42px; height: 42px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; position: relative; z-index: 1;
}
.stat-icon-wrapper.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon-wrapper.green { background: var(--success-light); color: var(--success); }
.stat-icon-wrapper.amber { background: var(--warning-light); color: var(--warning); }
.stat-icon-wrapper.cyan { background: var(--info-light); color: var(--info); }
.stat-icon-wrapper.rose { background: var(--danger-light); color: var(--danger); }

/* Metric Box */
.metric-box {
  background: var(--bg-subtle); border-radius: var(--radius-md);
  padding: .8rem .7rem; transition: all var(--transition-fast);
  border: 1px solid transparent;
}
.metric-box:hover {
  background: var(--primary-light); border-color: rgba(91,95,232,.15);
  transform: translateY(-1px);
}
.metric-value { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.metric-label { font-size: .68rem; color: var(--text-secondary); margin-top: .3rem; font-weight: 500; }

/* App Cards */
.app-card {
  background: var(--bg-card);
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border-light);
  margin-left: 0; margin-right: 0;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  overflow: hidden;
  margin-bottom: .3rem;
}
.app-card:hover { box-shadow: var(--shadow-md); }

.app-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .5rem; border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}
.app-card-header h6 {
  font-weight: 700; font-size: .9rem; margin: 0;
  display: flex; align-items: center; gap: .5rem;
  color: var(--text-primary);
}
.app-card-header h6 i { color: var(--primary); font-size: .9rem; }

.app-card-body { padding: .5rem .7rem; }
.app-card-body.p-0 { padding: 0; }

/* Card Accent top bar */
.card-accent { position: relative; }
.card-accent::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  z-index: 1;
}
.card-accent.primary::before { background: var(--primary-gradient); }
.card-accent.success::before { background: linear-gradient(90deg, #059669, #047857); }
.card-accent.warning::before { background: linear-gradient(90deg, #DC2626, #B45309); }
.card-accent.info::before { background: linear-gradient(90deg, #0284C7, #0369A1); }
.card-accent.danger::before { background: linear-gradient(90deg, #DC2626, #B91C1C); }

/* ==============================================
   6. TABLES
   ============================================== */
.table-wrap, .table-responsive { overflow-x: auto; width: 100%; }

.data-table, .table.data-table {
  width: 100% !important; border-collapse: collapse; max-width: none; border-spacing: 0;
}
.data-table thead th {
  background: var(--bg-subtle); padding: .6rem .85rem;
  font-size: .84rem; font-weight: 600;
  letter-spacing: .01em; color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap; text-align: left;
}
.data-table tbody td {
  padding: .6rem .85rem; border-bottom: 1px solid var(--border-light);
  vertical-align: middle; font-size: .92rem;
}
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover td { background: #EEF2FF; }
.data-table tbody tr:nth-child(even) td { background: rgba(241,245,249,0.5); }
.data-table tbody tr:nth-child(even):hover td { background: #EEF2FF; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Compact table */
.table-compact thead th { padding: .4rem .55rem; font-size: .82rem; }
.table-compact tbody td { padding: .35rem .55rem; font-size: .88rem; }

/* Row styles */
.row-lead { font-weight: 600; color: var(--text-primary); }
.row-actions { display: flex; gap: .3rem; justify-content: flex-end; align-items: center; }

/* ==============================================
   7. BUTTONS
   ============================================== */
.btn {
  font-weight: 600; font-size: .85rem;
  padding: .45rem .9rem; border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: .3rem;
}

.btn-primary {
  background: var(--primary-gradient); border-color: var(--primary); color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark); border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(91,95,232,.3);
}

.btn-outline-primary { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.btn-sm { font-size: .73rem; padding: .3rem .65rem; border-radius: var(--radius-xs); }
.btn-lg { font-size: .88rem; padding: .55rem 1.2rem; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #047857; border-color: #047857; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover { background: #B45309; border-color: #B45309; }
.btn-info { background: var(--info); border-color: var(--info); color: #fff; }
.btn-info:hover { background: #0369A1; border-color: #0369A1; }

.btn-outline-secondary { border-color: var(--border-color); color: var(--text-secondary); background: transparent; }
.btn-outline-secondary:hover { background: var(--bg-subtle); border-color: var(--text-muted); color: var(--text-primary); }
.btn-outline-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.btn-outline-success { border-color: var(--success); color: var(--success); background: transparent; }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-outline-warning { border-color: var(--warning); color: var(--warning); background: transparent; }
.btn-outline-warning:hover { background: var(--warning); color: #fff; }
.btn-outline-info { border-color: var(--info); color: var(--info); background: transparent; }
.btn-outline-info:hover { background: var(--info); color: #fff; }

/* Ghost button */
.btn-ghost {
  background: transparent; border-color: transparent; color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-ghost-primary { color: var(--primary); }
.btn-ghost-primary:hover { background: var(--primary-light); color: var(--primary-dark); }

/* Icon-only button */
.btn-icon-only {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.btn-icon-only.btn-sm { width: 26px; height: 26px; }

/* Button group */
.btn-group .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* XS button for tiny actions */
.btn-xs {
  font-size: .64rem; padding: .15rem .4rem; border-radius: 3px;
}

/* ==============================================
   8. FORMS
   ============================================== */
.form-control, .form-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: .9rem;
  padding: .5rem .75rem; transition: all var(--transition-fast);
  color: var(--text-primary); background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,95,232,.08);
  outline: none;
}
.form-control::placeholder { color: var(--text-placeholder); }
.form-label { font-size: .82rem; font-weight: 600; color: var(--text-primary); margin-bottom: .2rem; }
.form-text { font-size: .7rem; color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-control-sm { font-size: .75rem; padding: .38rem .55rem; }
.form-select-sm { font-size: .75rem; padding: .38rem 2rem .38rem .55rem; }

.input-group-text {
  background: var(--bg-subtle); border: 1px solid var(--border-color);
  font-size: .85rem; color: var(--text-secondary);
}

/* Form sections */
.form-section {
  margin-bottom: 1.25rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section-title {
  font-size: .82rem; font-weight: 700; color: var(--primary-dark);
  margin-bottom: .8rem; display: flex; align-items: center; gap: .4rem;
}
.form-section-title i { color: var(--primary); }

/* Section divider */
.section-divider {
  border: none; border-top: 1px solid var(--border-light);
  margin: .5rem 0 1rem;
}

/* ==============================================
   9. ALERTS
   ============================================== */
.alert {
  border: none; border-radius: var(--radius-md);
  font-size: .85rem; padding: .7rem 1.05rem; font-weight: 500;
}
.alert-success { background: var(--success-bg); color: #065F46; border-left: 3px solid var(--success); }
.alert-danger { background: var(--danger-light); color: #991B1B; border-left: 3px solid var(--danger); }
.alert-warning { background: #FFFBEB; color: #92400E; border-left: 3px solid var(--warning); }
.alert-info { background: #F0F9FF; color: #075985; border-left: 3px solid var(--info); }

/* ==============================================
   10. BADGES
   ============================================== */
.badge {
  font-weight: 600; font-size: .68rem; padding: .22rem .6rem;
  border-radius: 20px; display: inline-flex; align-items: center; gap: .25rem;
}
.badge-xs { font-size: .75rem; padding: .2rem .5rem; }
.badge-sm { font-size: .64rem; padding: .15rem .45rem; }
.badge-soft-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-soft-success { background: var(--success-light); color: #065F46; }
.badge-soft-warning { background: var(--warning-light); color: #92400E; }
.badge-soft-danger { background: var(--danger-light); color: #991B1B; }
.badge-soft-info { background: var(--info-light); color: #075985; }

/* Status badges */
.status-pending { background: #F1F5F9; color: #475569; }
.status-reviewing { background: var(--warning-light); color: #92400E; }
.status-approved { background: var(--success-light); color: #065F46; }
.status-rejected { background: var(--danger-light); color: #991B1B; }
.status-done { background: var(--primary-light); color: var(--primary-dark); }

/* Type badges */
.type-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: 20px; font-size: .7rem; font-weight: 600;
}
.type-badge.video { background: var(--primary-light); color: var(--primary); }
.type-badge.graphic { background: var(--info-light); color: var(--info); }

/* ==============================================
   11. MODALS
   ============================================== */
.modal-content {
  border: none; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); overflow: hidden;
}
.modal-header {
  background: var(--bg-card); border-bottom: 1px solid var(--border-light);
  padding: .95rem 1.2rem;
}
.modal-header .modal-title { font-weight: 700; font-size: .95rem; color: var(--text-primary); }
.modal-body { padding: 1.2rem; }
.modal-footer {
  border-top: 1px solid var(--border-light); padding: .8rem 1.2rem;
  background: var(--bg-card-hover);
}

/* ==============================================
   12. PROGRESS BARS
   ============================================== */
.progress {
  background: var(--border-light); border-radius: 10px; overflow: hidden;
  height: 6px;
}
.progress-sm { height: 4px; }
.progress-bar { border-radius: 10px; font-size: .6rem; font-weight: 600; }

/* ==============================================
   13. BREADCRUMB
   ============================================== */
.breadcrumb {
  display: flex; flex-wrap: wrap; padding: 0; margin: 0 0 1rem;
  list-style: none; font-size: .78rem;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: '/'; color: var(--text-muted); padding: 0 .4rem;
}
.breadcrumb-item a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }

/* ==============================================
   14. TIMELINE
   ============================================== */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 1.15rem; top: 0; bottom: 0;
  width: 2px; background: var(--border-light);
}
.timeline-item { position: relative; margin-bottom: 1rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
  position: absolute; left: -2.5rem; top: .5rem;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .65rem; z-index: 1;
}
.timeline-marker.blue { background: var(--primary); }
.timeline-marker.green { background: var(--success); }
.timeline-marker.amber { background: var(--warning); }
.timeline-marker.rose { background: var(--danger); }
.timeline-content {
  background: var(--bg-subtle); border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-left: 0; margin-right: 0; padding: .85rem 1rem;
}

/* ==============================================
   15. WORKFLOW PILLS
   ============================================== */
.workflow-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .55rem; border-radius: 20px; font-weight: 600; font-size: .73rem;
}
.workflow-pill.step1 { background: var(--accent-sky-light); color: var(--accent-sky); }
.workflow-pill.step2 { background: var(--success-light); color: var(--success); }
.workflow-pill.step3 { background: var(--warning-light); color: var(--warning); }
.workflow-pill.step4 { background: var(--accent-rose-light); color: var(--accent-rose); }
.workflow-pill-step {
  width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 50%; color: #fff; font-size: .62rem; flex-shrink: 0;
}
.workflow-pill.step1 .workflow-pill-step { background: var(--accent-sky); }
.workflow-pill.step2 .workflow-pill-step { background: var(--success); }
.workflow-pill.step3 .workflow-pill-step { background: var(--warning); }
.workflow-pill.step4 .workflow-pill-step { background: var(--accent-rose); }

.workflow-chevron { color: var(--text-muted); font-size: .7rem; }

/* ==============================================
   16. QUICK ACTIONS
   ============================================== */
.quick-action-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .85rem;
  background: var(--bg-subtle); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text-primary);
  text-decoration: none; font-size: .77rem; font-weight: 500;
  transition: all var(--transition-fast);
}
.quick-action-btn i { color: var(--primary); font-size: .85rem; }
.quick-action-btn:hover {
  background: var(--primary-light); border-color: var(--primary);
  color: var(--primary-dark); transform: translateY(-1px);
}

/* ==============================================
   17. EMPTY STATE
   ============================================== */
.empty-state {
  text-align: center; padding: 3rem 1.5rem; color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .6rem; opacity: .2; }
.empty-state p { margin: 0; font-size: .82rem; }

/* ==============================================
   18. SCORE DISPLAYS (Performance)
   ============================================== */
.score-display { font-weight: 700; font-size: .85rem; }
.score-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; font-weight: 800; font-size: .85rem;
}
.score-circle.high { background: var(--success-light); color: var(--success); }
.score-circle.medium { background: var(--warning-light); color: var(--warning); }
.score-circle.low { background: var(--danger-light); color: var(--danger); }

/* ==============================================
   19. WEIGHT INDICATOR
   ============================================== */
.weight-indicator {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: 20px; font-size: .72rem; font-weight: 600;
}
.weight-ok { background: var(--success-light); color: var(--success); }
.weight-over { background: var(--warning-light); color: #92400E; }

/* ==============================================
   20. PERFORMANCE INDICATOR BADGES
   ============================================== */
.indicator-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .45rem; border-radius: 20px; font-size: .7rem; font-weight: 600;
}
.indicator-badge.result { background: var(--primary-light); color: var(--primary); }
.indicator-badge.process { background: var(--info-light); color: var(--info); }

/* ==============================================
   21. YEAR TABLE (Events legacy)
   ============================================== */
.year-table-card { margin-bottom: 1.5rem; }
.year-table-wrap {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .85rem;
}
.year-month-block {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-xs); transition: all var(--transition-fast);
}
.year-month-block:hover { box-shadow: var(--shadow-sm); border-color: var(--border-color); }
.year-month-head {
  background: var(--bg-subtle); padding: .5rem .85rem;
  font-weight: 700; font-size: .85rem; color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.year-month-body { padding: .4rem; }

/* ==============================================
   22. EVENTS PAGE (extracted from inline)
   ============================================== */
.ev-wrap { max-width: 100%; }
.ev-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .7rem; flex-wrap: wrap; gap: .5rem;
}
.ev-top h4 { font-weight: 700; font-size: 1rem; color: var(--text-primary); margin: 0; }
.ev-top-r { display: flex; align-items: center; gap: .5rem; }
.ev-nav {
  display: flex; gap: .15rem; flex-wrap: wrap; margin-bottom: .8rem;
}
.ev-nav a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 26px; border-radius: 4px;
  font-size: .68rem; font-weight: 600;
  color: var(--text-secondary); text-decoration: none;
  border: 1px solid transparent; transition: all .15s;
}
.ev-nav a:hover {
  background: var(--bg-subtle); border-color: var(--border-light);
  color: var(--text-primary);
}
.ev-card {
  border: 1px solid var(--border-light);
  margin-left: 0; margin-right: 0; border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: 1rem;
  background: var(--bg-card); box-shadow: var(--shadow-xs);
}
.ev-head {
  display: flex; align-items: center; gap: .45rem;
  padding: .5rem .75rem; color: #fff; font-weight: 700; font-size: .85rem;
}
.ev-head .ev-qtag {
  font-size: .55rem; padding: .04rem .35rem; border-radius: 3px;
  background: rgba(255,255,255,.22); font-weight: 600;
}
.ev-head .ev-cnt { font-size: .62rem; opacity: .85; }
.ev-head .ev-add {
  margin-left: auto; font-size: .65rem; font-weight: 500;
  color: rgba(255,255,255,.9); text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .15rem;
  padding: .15rem .4rem; border-radius: 4px; transition: background .15s;
}
.ev-head .ev-add:hover { color: #fff; background: rgba(255,255,255,.15); }

/* Events main table */
.ev-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ev-tbl thead th {
  font-size: .75rem; font-weight: 600; color: var(--text-secondary);
  padding: .5rem .5rem; text-align: left;
  background: var(--bg-subtle); border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}
.ev-tbl thead th.th-cb { width: 32px; text-align: center; }
.ev-tbl thead th.th-day { width: 56px; text-align: center; color: var(--primary); }
.ev-tbl thead th.th-kw { width: 18%; color: #1E40AF; }
.ev-tbl thead th.th-act { width: 25%; color: #DC2626; }
.ev-tbl thead th.th-pt { width: 90px; text-align: center; color: #059669; }
.ev-tbl thead th.th-pb { width: 105px; text-align: center; color: #0D9488; }
.ev-tbl thead th.th-note { width: 14%; color: #7C3AED; }
.ev-tbl thead th.th-op { width: 60px; text-align: center; }
.ev-tbl tbody td {
  padding: .35rem .5rem; border-bottom: 1px solid var(--border-light);
  font-size: .82rem; vertical-align: middle;
}
.ev-tbl tbody tr { transition: background .1s; }
.ev-tbl tbody tr:nth-child(even) { background: #F8FAFC; }
.ev-tbl tbody tr:hover { background: #EEF2FF; }
.ev-tbl tbody tr.er-sep td { border-bottom: 1.5px solid var(--border-color); }
.ev-tbl td.td-cb { text-align: center; vertical-align: middle; }
.ev-cb { display: block; margin: 0 auto; }
.ev-tbl td.td-day { text-align: center; }
.ev-tbl td.td-pt { text-align: center; }
.ev-tbl td.td-pb { text-align: center; }
.ev-tbl td.td-op { text-align: center; white-space: nowrap; }
.ev-tbl td.td-pb select, .ev-tbl td.td-pt select {
  font-size: .75rem; border: 1px solid transparent;
  border-radius: 4px; padding: .1rem .15rem;
  background: transparent; color: var(--text-primary);
  outline: none; width: 100%; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  text-align: center; text-align-last: center;
  padding-right: 12px;
  background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e\");
  background-repeat: no-repeat; background-position: right 0 center; background-size: 10px;
}
.ev-tbl td.td-pb select:hover, .ev-tbl td.td-pt select:hover {
  border-color: var(--border-color); background: var(--bg-card);
}
.ev-tbl td.td-pb select:focus, .ev-tbl td.td-pt select:focus {
  border-color: var(--primary); background: var(--primary-light);
}
.ev-tbl td.td-pt select {
  color: #059669;
}
.ev-tbl td.td-pt select.sel-set {
  border-color: transparent; background: transparent; color: #059669; font-weight: 600;
}
.ev-tbl td.td-pb select {
  color: #0D9488;
}
.ev-tbl td.td-pb select.sel-set {
  border-color: transparent; background: transparent; color: #0D9488; font-weight: 600;
}

/* Plain/borderless select for assigned state */
select.sel-plain {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
select.sel-plain:focus {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}
.ev-tbl td.td-pb select option, .ev-tbl td.td-pt select option {
  background: #fff; color: var(--text-primary);
}

/* Editable cells */
.ed-d {
  font-weight: 700; color: var(--primary); cursor: pointer;
  padding: 1px 3px; border-radius: 3px; display: inline-block;
}
.ed-d:hover { background: var(--primary-light); }
.ed-d.ed-d-empty { color: var(--text-muted); font-weight: 400; }
.ed-k {
  font-weight: 600; color: #1E40AF; cursor: pointer;
  padding: 1px 3px; border-radius: 3px; display: inline-block; max-width: 100%;
}
.ed-k:hover { background: #DBEAFE; color: #1E3A8A; }
.ed-a {
  color: #DC2626; cursor: pointer;
  padding: 1px 3px; border-radius: 3px; display: inline-block; max-width: 100%;
}
.ed-a:hover { background: #FEE2E2; color: #B91C1C; }
.ed-n {
  color: #7C3AED; font-size: .67rem; cursor: pointer;
  padding: 1px 3px; border-radius: 3px; display: inline-block; max-width: 100%;
}
.ed-n:hover { background: #F3E8FF; color: #6D28D9; }
.ed-n-placeholder { opacity: .3; }

/* Event checkboxes */
.ev-cb { width: 14px; height: 14px; cursor: pointer; accent-color: var(--primary); }

/* Inline icon buttons */
.i-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: none; border-radius: 3px;
  background: transparent; cursor: pointer;
  font-size: .85rem; color: var(--text-muted); padding: 0; flex-shrink: 0;
  transition: all var(--transition-fast);
}
.i-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.i-btn.del:hover { color: var(--danger); background: var(--danger-light); }
.i-btn.add { color: var(--primary); font-size: .78rem; }
.i-btn.add:hover { background: var(--primary-light); }

/* Inline form row */
.if-row {
  display: none; align-items: center; gap: .35rem;
  flex-wrap: nowrap;
}
.if-row.show { display: flex; }
.if-row input, .if-row select {
  border: 1px solid var(--primary); border-radius: 4px;
  padding: .25rem .35rem; font-size: .73rem; outline: none;
  background: #fff; color: var(--text-primary);
}
.if-row select { border-color: var(--border-color); }
.if-row .if-s {
  font-size: .73rem; padding: .25rem .55rem; border-radius: 4px;
  border: 1px solid var(--primary); background: var(--primary);
  color: #fff; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.if-row .if-c {
  font-size: .73rem; padding: .25rem .55rem; border-radius: 4px;
  border: 1px solid var(--border-color); background: transparent;
  color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}

/* Batch bar */
.bbar {
  display: none; align-items: center; gap: .45rem;
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--danger);
  border-radius: 20px; padding: .4rem 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  z-index: 999;
}
.bbar.show { display: flex; }

/* Editable inline inputs (JS-created) */
.ed-inline-input {
  border: 1px solid var(--primary) !important;
  border-radius: 4px !important;
  padding: .08rem .2rem !important;
  font-size: .7rem !important;
  outline: none !important;
  font-family: var(--font-sans);
}
.ed-inline-input.day-input {
  width: 44px; text-align: center; font-weight: 700;
}

/* ==============================================
   23. HANDBOOK PAGE
   ============================================== */
.handbook-toc { }
.toc-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-radius: var(--radius-sm);
  color: var(--text-primary); text-decoration: none;
  font-size: .83rem; transition: all var(--transition-fast);
  border: 1px solid transparent;
}
.toc-link:hover {
  background: var(--primary-light); color: var(--primary-dark);
  border-color: var(--primary);
}
.toc-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-gradient); color: #fff;
  font-size: .68rem; font-weight: 700; flex-shrink: 0;
}

.hb-subtitle {
  font-size: .92rem; font-weight: 700; color: var(--primary-dark);
  margin: 1.25rem 0 .65rem; padding-bottom: .45rem;
  border-bottom: 2px solid var(--primary-light);
}
.hb-subtitle:first-child { margin-top: 0; }

.hb-card {
  background: var(--bg-subtle); border-radius: var(--radius-sm);
  padding: .95rem; border: 1px solid var(--border-light); height: 100%;
  transition: all var(--transition-fast);
}
.hb-card:hover { border-color: var(--border-color); box-shadow: var(--shadow-sm); }
.hb-card-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  color: #fff; font-size: 1.1rem;
}
.hb-card-title {
  font-weight: 600; font-size: .83rem; margin-bottom: .4rem;
  color: var(--text-primary);
}
.hb-card-text { font-size: .78rem; color: var(--text-secondary); margin: 0; line-height: 1.55; }

.hb-list { list-style: none; padding: 0; margin: 0; }
.hb-list li {
  position: relative; padding-left: 1.1rem; margin-bottom: .3rem;
  font-size: .85rem; color: var(--text-secondary); line-height: 1.55;
}
.hb-list li::before {
  content: ''; position: absolute; left: 0; top: .55em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}

.hb-note {
  background: var(--primary-light); border-left: 3px solid var(--primary);
  padding: .6rem .8rem; border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: .78rem; color: var(--text-secondary); line-height: 1.6;
}

.formula-box {
  background: var(--bg-subtle); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: .75rem .95rem;
  font-family: var(--font-mono); font-size: .85rem;
  color: var(--primary-dark); line-height: 1.8;
}

/* Accordion */
.accordion-hb {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); overflow: hidden;
}
.accordion-hb-item { border-bottom: 1px solid var(--border-light); }
.accordion-hb-item:last-child { border-bottom: none; }
.accordion-hb-trigger {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .8rem .95rem; border: none; background: var(--bg-card);
  cursor: pointer; text-align: left; font-size: .85rem; font-weight: 600;
  color: var(--text-primary); transition: background var(--transition-fast);
}
.accordion-hb-trigger:hover { background: var(--bg-subtle); }
.accordion-hb-icon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-size: .85rem; flex-shrink: 0;
}
.accordion-hb-title { flex: 1; }
.accordion-hb-arrow {
  font-size: .75rem; color: var(--text-muted);
  transition: transform var(--transition-fast);
}
.accordion-hb-item.open .accordion-hb-arrow { transform: rotate(180deg); }
.accordion-hb-content {
  display: none; padding: 0 .95rem .95rem 3.2rem;
}
.accordion-hb-item.open .accordion-hb-content { display: block; }

/* Process Steps */
.process-steps { display: flex; flex-direction: column; gap: .65rem; }
.process-step {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .6rem .75rem; background: var(--bg-subtle);
  border-radius: var(--radius-sm); border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}
.process-step:hover { border-color: var(--border-color); }
.process-step-num {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-gradient); color: #fff;
  font-size: .73rem; font-weight: 700; flex-shrink: 0;
}
.process-step-body { flex: 1; }
.process-step-body .fw-bold { font-size: .85rem; margin-bottom: .15rem; }
.process-step-body small { display: block; line-height: 1.5; color: var(--text-secondary); }

/* ==============================================
   24. LOGIN PAGE
   ============================================== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 35%, #0F172A 75%);
  position: relative; overflow: hidden; padding: 1rem;
}
.login-page::before {
  content: ''; position: absolute; top: -30%; left: -10%;
  width: 70%; height: 70%;
  background: radial-gradient(ellipse, rgba(91,95,232,.1) 0%, transparent 70%);
  pointer-events: none;
}
.login-page::after {
  content: ''; position: absolute; bottom: -25%; right: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(ellipse, rgba(13,148,136,.06) 0%, transparent 70%);
  pointer-events: none;
}
.login-card {
  width: 100%; max-width: 410px;
  background: #fff; border-radius: var(--radius-2xl);
  box-shadow: 0 24px 48px rgba(0,0,0,.25);
  padding: 2.5rem 2.25rem; position: relative; z-index: 2;
}
.login-icon {
  width: 54px; height: 54px; margin: 0 auto 1.25rem;
  background: var(--primary-gradient); border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
  box-shadow: 0 12px 28px rgba(91,95,232,.3);
}
.login-card h3 { font-weight: 800; font-size: 1.25rem; color: var(--text-primary); letter-spacing: -.01em; }
.login-card p { font-size: .78rem; color: var(--text-muted); }
.login-card .form-control { padding: .55rem .85rem; font-size: .85rem; }
.login-card .btn-primary { font-size: .88rem; font-weight: 600; padding: .55rem; }

.default-accounts {
  background: var(--bg-subtle); padding: .55rem .8rem;
  border-radius: var(--radius-sm); font-size: .7rem;
  color: var(--text-secondary); line-height: 1.6;
  border: 1px solid var(--border-light);
  margin-left: 0; margin-right: 0;
}
.default-accounts strong { color: var(--primary); }

/* Password toggle */
.password-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.05rem; padding: 2px 5px;
  z-index: 5;
}
.password-toggle:hover { color: var(--text-secondary); }

/* ==============================================
   25. BACK TO TOP
   ============================================== */
.back-to-top {
  position: fixed; bottom: 28px; right: 28px; z-index: 999;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem;
  opacity: 0; transform: translateY(12px);
  transition: all var(--transition-normal);
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--primary); color: #fff;
  border-color: var(--primary); box-shadow: var(--shadow-lg);
}

/* ==============================================
   26. PLATFORM BADGES
   ============================================== */
.platform-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: 20px;
  font-size: .85rem; font-weight: 600;
}
.platform-badge.douyin { background: #FEE2E2; color: #DC2626; }
.platform-badge.xiaohongshu { background: #FEE2E2; color: #E11D48; }
.platform-badge.video_channel { background: #D1FAE5; color: #059669; }
.platform-badge.wechat_public { background: #D1FAE5; color: #047857; }

/* ==============================================
   27. TAB FILTERS
   ============================================== */
.tab-filters { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ==============================================
   28. ANIMATIONS
   ============================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.animate-in { animation: fadeInUp .4s ease both; }
.animate-in-d1 { animation-delay: .03s; }
.animate-in-d2 { animation-delay: .06s; }
.animate-in-d3 { animation-delay: .09s; }
.animate-in-d4 { animation-delay: .12s; }

/* ==============================================
   29. UTILITY CLASSES
   ============================================== */
.bg-soft-primary { background: var(--primary-light); color: var(--primary-dark); }
.bg-soft-warning { background: var(--warning-light); color: #92400E; }
.bg-soft-info { background: var(--info-light); color: var(--info); }
.bg-soft-success { background: var(--success-light); color: #065F46; }
.bg-soft-danger { background: var(--danger-light); color: #991B1B; }

/* Quarter colors for event headers */
.ev-head-q1 { background: var(--accent-sky); }
.ev-head-q2 { background: var(--success); }
.ev-head-q3 { background: var(--warning); }
.ev-head-q4 { background: var(--accent-rose); }

/* ==============================================
   30. RESPONSIVE
   ============================================== */
@media (max-width: 1024px) {
  .year-table-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Collapsed sidebar */
  .sidebar {
    width: var(--sidebar-collapsed);
    overflow: visible;
  }
  .sidebar:hover {
    width: var(--sidebar-width);
    box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  .brand-text, .user-name, .user-role-badge, .nav-section,
  .sidebar .nav-link span { display: none; }
  .sidebar:hover .brand-text,
  .sidebar:hover .user-name,
  .sidebar:hover .user-role-badge,
  .sidebar:hover .nav-section,
  .sidebar:hover .sidebar .nav-link span { display: inline; }
  .sidebar .nav-link {
  font-size: .82rem;
    justify-content: center; padding: .5rem;
    border-left: none !important;
  }
  .sidebar:hover .nav-link {
    justify-content: flex-start; padding: .5rem .75rem;
  }
  .sidebar .nav-link.active { border-radius: var(--radius-sm); }
  .sidebar:hover .nav-link.active { border-radius: 0 var(--radius-sm) var(--radius-sm) 0); }
  .main-wrapper { margin-left: var(--sidebar-collapsed); }
  .page-content { padding: 1rem; }
  .top-header { padding: .65rem 1rem; }

  /* Events table: hide project type & publish type columns */
  .ev-tbl thead th.th-pt, .ev-tbl tbody td.td-pt,
  .ev-tbl thead th.th-pb, .ev-tbl tbody td.td-pb,
  .ev-tbl thead th.th-note, .ev-tbl tbody td.td-note { display: none; }

  /* Login card */
  .login-card { padding: 2rem 1.5rem; }
}

@media (max-width: 576px) {
  /* Full hide sidebar on mobile, use overlay */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1030;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .sidebar .nav-link {
  font-size: .82rem; justify-content: flex-start; padding: .5rem .75rem; }
  .sidebar .brand-text, .sidebar .user-name, .sidebar .user-role-badge,
  .sidebar .nav-section, .sidebar .nav-link span { display: inline; }
  .sidebar .nav-link.active {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: 3px solid var(--primary) !important;
  }

  .sidebar-overlay.active { display: block; opacity: 1; }

  .main-wrapper { margin-left: 0; }

  .hamburger-toggle { display: flex; }

  .top-header { padding: .55rem .75rem; }
  .top-header h5 { font-size: .82rem; }
  .header-date { font-size: .7rem; padding: .2rem .5rem; }

  .page-content { padding: .75rem; }
  .page-header h4 { font-size: .95rem; }
  .stat-card .stat-value { font-size: 1.35rem; }
  .stat-icon-wrapper { width: 34px; height: 34px; font-size: 1rem; }

  /* Two-col stat cards */
  .row.g-3 .col-md-3 { width: 50%; }

  /* Events mobile */
  .ev-tbl thead th.th-pt, .ev-tbl tbody td.td-pt,
  .ev-tbl thead th.th-pb, .ev-tbl tbody td.td-pb { display: none; }
}

/* Screenshot paste area */
.screenshot-paste-area:hover { border-color: var(--primary) !important; background: var(--primary-light) !important; }
.screenshot-paste-area:focus { border-color: var(--primary) !important; outline: none; box-shadow: 0 0 0 2px rgba(91,95,232,.15); }

/* Ideas table */
.ideas-table tbody td { font-size: 1rem; padding: .55rem .6rem; }
.ideas-table .badge-soft-primary { font-size: .85rem !important; padding: .25rem .6rem !important; }
.ideas-table thead th { font-size: .95rem; font-weight: 600; padding: .5rem .5rem; }
.ideas-table tbody tr:nth-child(even) { background: #F8FAFC; }
.ideas-table tbody tr:nth-child(odd) { background: #fff; }
.ideas-table tbody tr:hover { background: #EEF2FF; }

