/* ============================================
   短视频运营工作台 - 全局样式
   ============================================ */

/* ===== CSS Variables ===== */
:root {
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #4f6ef7;
  --sidebar-text: #cbd5e1;
  --sidebar-text-active: #ffffff;

  --main-bg: #f1f5f9;
  --card-bg: #ffffff;

  --primary: #4f6ef7;
  --primary-light: #e8edfe;
  --primary-dark: #3b5bdb;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #06b6d4;
  --info-light: #cffafe;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --border: #e2e8f0;
  --border-dark: #cbd5e1;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);

  --sidebar-width: 240px;
  --topbar-height: 64px;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--main-bg);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

/* ===== Layout ===== */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-logo {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-icon { font-size: 22px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}

.nav-icon { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; font-size: 14px; }

.nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,0.25);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-export, .btn-import {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--sidebar-text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all 0.15s ease;
}

.btn-export:hover, .btn-import:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Topbar ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar-left { display: flex; flex-direction: column; gap: 2px; }
.page-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 12px; color: var(--text-muted); }

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

.current-date {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Content Area ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ===== Buttons ===== */
.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-sm { padding: 7px 14px; font-size: 13px; }

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-dark);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-danger:hover { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all 0.15s ease;
}

.btn-ghost:hover { background: var(--main-bg); color: var(--text-primary); }

.btn-success {
  background: var(--success);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 20px; }

/* ===== Stat Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-light); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.orange { background: var(--warning-light); }
.stat-icon.purple { background: var(--purple-light); }
.stat-icon.cyan { background: var(--info-light); }
.stat-icon.red { background: var(--danger-light); }

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-extra { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== Dashboard Grid ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-full {
  grid-column: 1 / -1;
}

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
}

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

table.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--main-bg);
}

table.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--main-bg); }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-blue { background: var(--primary-light); color: var(--primary-dark); }
.badge-green { background: var(--success-light); color: #065f46; }
.badge-orange { background: var(--warning-light); color: #92400e; }
.badge-red { background: var(--danger-light); color: #991b1b; }
.badge-purple { background: var(--purple-light); color: #5b21b6; }
.badge-cyan { background: var(--info-light); color: #155e75; }
.badge-gray { background: #f1f5f9; color: var(--text-secondary); }
.badge-yellow { background: #fef3c7; color: #92400e; }

/* ===== Digital Human & AI Points ===== */
.dh-stat { font-size: 13px; color: var(--text-secondary); }
.dh-stat b { color: var(--primary); font-weight: 600; }

.dh-section {
  background: var(--main-bg);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}

.dh-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--card-bg);
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}

.dh-info-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-radius: 10px;
  margin-bottom: 16px;
}

.dh-info-item {
  flex: 1;
  text-align: center;
  padding: 12px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.dh-info-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

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

.dh-info-unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.dh-no-dh {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 15px;
  color: var(--text-secondary);
  background: var(--main-bg);
  border-radius: 10px;
  margin-bottom: 16px;
}

.ai-points-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.ai-summary-card {
  padding: 14px;
  background: var(--card-bg);
  border-radius: 10px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.ai-summary-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.ai-summary-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.ai-summary-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.ai-points-timeline {
  max-height: 400px;
  overflow-y: auto;
}

.ai-point-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.ai-point-item:last-child { border-bottom: none; }

.ai-point-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.dot-green { background: var(--success); box-shadow: 0 0 4px rgba(16,185,129,0.3); }
.dot-red { background: var(--danger); box-shadow: 0 0 4px rgba(239,68,68,0.3); }

.ai-point-content {
  flex: 1;
  min-width: 0;
}

.ai-point-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-point-date {
  font-size: 13px;
  color: var(--text-muted);
}

.ai-point-amount {
  font-size: 15px;
  font-weight: 700;
}

.ai-point-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== Benchmark Accounts ===== */
.benchmark-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.benchmark-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.benchmark-account-card {
  background: var(--main-bg);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--primary);
}

.benchmark-account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.benchmark-account-name {
  font-weight: 600;
  font-size: 15px;
  margin-right: 8px;
}

.benchmark-video-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 6px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.benchmark-video-row.analyzed {
  border-left-color: var(--success);
}

.benchmark-video-row:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.benchmark-video-info {
  flex: 1;
  min-width: 0;
}

.benchmark-video-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.benchmark-video-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.benchmark-video-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 12px;
}

.tag-mini {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  margin-left: 4px;
}

.benchmark-analysis-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  padding: 6px 8px;
  background: var(--success-light);
  border-radius: 6px;
  line-height: 1.5;
}

.benchmark-modal-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.benchmark-manage-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}

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

.benchmark-video-list {
  max-height: 500px;
  overflow-y: auto;
}

.benchmark-video-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--main-bg);
  border-left: 3px solid transparent;
}

.benchmark-video-item.analyzed {
  border-left-color: var(--success);
}

.video-analysis-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, #ede9fe 100%);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.video-analysis-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.video-analysis-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.video-analysis-tags {
  margin-top: 8px;
}

/* ===== Progress Bars ===== */
.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-fill.green { background: var(--success); }
.progress-fill.blue { background: var(--primary); }
.progress-fill.orange { background: var(--warning); }
.progress-fill.red { background: var(--danger); }

.progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
  outline: none;
}

.form-textarea { resize: vertical; min-height: 80px; }

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

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

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

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

.modal.modal-lg { max-width: 760px; }
.modal.modal-xl { max-width: 960px; }

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

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 17px; font-weight: 700; }

.modal-close {
  background: transparent;
  font-size: 22px;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.modal-close:hover { background: var(--main-bg); color: var(--text-primary); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== Task List ===== */
.task-list { display: flex; flex-direction: column; gap: 8px; }

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.task-item:hover { border-color: var(--border-dark); box-shadow: var(--shadow-sm); }

.task-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-dark);
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.task-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.task-checkbox.checked::after {
  content: '✓';
  font-size: 13px;
  font-weight: 700;
}

.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.task-item.completed .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-meta { display: flex; gap: 8px; margin-top: 4px; }

.task-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s ease; }
.task-item:hover .task-actions { opacity: 1; }

.task-action-btn {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.task-action-btn:hover { background: var(--main-bg); color: var(--text-primary); }
.task-action-btn.danger:hover { color: var(--danger); }

/* ===== Video Cards ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.video-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.15s ease;
}

.video-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-dark); }

.video-thumb {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: rgba(255,255,255,0.6);
  position: relative;
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-info { padding: 14px; }
.video-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-author { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.video-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }
.video-stat { display: flex; align-items: center; gap: 3px; }

/* ===== Account Cards ===== */
.account-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.account-card:hover { box-shadow: var(--shadow-md); }

.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.account-info { flex: 1; min-width: 0; }
.account-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.account-bio { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.account-stats { display: flex; gap: 16px; }

.account-stat-value { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.account-stat-label { font-size: 11px; color: var(--text-muted); }

/* ===== IP Cards ===== */
.ip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.ip-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.15s ease;
}

.ip-card:hover { box-shadow: var(--shadow-md); }

.ip-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ip-name { font-size: 16px; font-weight: 700; }
.ip-category { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.ip-stage-track {
  display: flex;
  gap: 4px;
  margin: 16px 0;
}

.ip-stage-dot {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}

.ip-stage-dot.active { background: var(--primary); }
.ip-stage-dot.current { background: var(--warning); animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.ip-stages-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ip-metrics { display: flex; gap: 16px; margin-bottom: 12px; }
.ip-metric { flex: 1; }
.ip-metric-value { font-size: 18px; font-weight: 700; }
.ip-metric-label { font-size: 11px; color: var(--text-muted); }

/* ===== Customer Cards ===== */
.customer-list { display: flex; flex-direction: column; gap: 12px; }

.customer-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.customer-item:hover { box-shadow: var(--shadow-md); }

.customer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.customer-info { flex: 1; min-width: 0; }
.customer-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.customer-meta { font-size: 12px; color: var(--text-muted); }

.customer-actions { display: flex; gap: 8px; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-text { font-size: 14px; margin-bottom: 16px; }

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.search-bar .form-input { flex: 1; }

/* ===== Filter Tabs ===== */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.filter-tab {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ===== Chart Container ===== */
.chart-container {
  position: relative;
  height: 240px;
  padding: 16px;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

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

/* ===== Milestone Timeline ===== */
.milestone-list { display: flex; flex-direction: column; gap: 0; }

.milestone-item {
  display: flex;
  gap: 12px;
  padding-bottom: 20px;
  position: relative;
}

.milestone-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.milestone-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-dark);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  z-index: 1;
}

.milestone-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.milestone-dot.current {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
}

.milestone-content { flex: 1; }
.milestone-title { font-size: 14px; font-weight: 500; }
.milestone-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== IP Update Timeline ===== */
.update-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 360px;
  overflow-y: auto;
  padding-left: 4px;
}

.update-timeline-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}

.update-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.update-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--card-bg);
  flex-shrink: 0;
  margin-top: 3px;
  z-index: 1;
}

.update-timeline-dot.latest {
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.update-timeline-content {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--main-bg);
  border-radius: 8px;
}

/* ===== Quote Module ===== */
.quote-card {
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quote-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.quote-card.signed {
  border-left: 3px solid var(--success);
  background: var(--success-light);
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 13px;
}

.quote-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--main-bg);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 2px solid var(--border);
}

.quote-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.quote-table tbody tr:hover {
  background: var(--main-bg);
}

.quote-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.quote-item-row .form-input {
  padding: 6px 10px;
  font-size: 13px;
}

.quote-summary {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--main-bg);
  border-radius: 8px;
}

.quote-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
}

.quote-summary-row.total {
  border-top: 2px solid var(--border);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 16px;
  font-weight: 700;
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-yellow { color: #d97706; }
.text-sm { font-size: 13px; }
.text-lg { font-size: 16px; }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo .logo-text { display: none; }
  .nav-label { display: none; }
  .sidebar-footer { display: none; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
}
