/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-sidebar: #141620;
  --border: #2a2d3a;
  --text: #e4e6eb;
  --text-muted: #8b8fa3;
  --primary: #4f8ff7;
  --primary-hover: #3d7de5;
  --green: #22c55e;
  --red: #ef4444;
  --purple: #a855f7;
  --yellow: #eab308;
  --blue: #3b82f6;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.brand-icon { font-size: 28px; }
.brand-text { font-weight: 700; font-size: 18px; }

.sidebar-nav {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: all 0.15s;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-nav li a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sidebar-nav li a.active { background: rgba(79,143,247,0.15); color: var(--primary); }
.sidebar-nav li a i { font-size: 18px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-badge { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.logout-link { color: var(--text-muted); font-size: 18px; }
.logout-link:hover { color: var(--red); }

/* === MAIN === */
main.with-sidebar { margin-left: 240px; padding: 32px; min-height: 100vh; }
main.full-width { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

/* === LOGIN === */
.login-body { background: linear-gradient(135deg, #0f1117 0%, #1a1d27 50%, #141620 100%); }
.login-container {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-brand { text-align: center; margin-bottom: 32px; }
.brand-icon-lg { font-size: 48px; display: block; margin-bottom: 12px; }
.login-brand h1 { font-size: 24px; font-weight: 700; }
.subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-muted); }
.login-form input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.login-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,143,247,0.15); }

/* === PAGE HEADER === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-actions { display: flex; gap: 8px; }
.back-link { font-size: 13px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.back-link:hover { color: var(--primary); }

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.bg-blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.bg-green { background: rgba(34,197,94,0.15); color: var(--green); }
.bg-purple { background: rgba(168,85,247,0.15); color: var(--purple); }

.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.card-header h2 { font-size: 16px; font-weight: 600; }

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.card-stack { display: flex; flex-direction: column; gap: 16px; }

/* === TABLE === */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 16px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: rgba(255,255,255,0.02); }
.table th a { color: var(--text-muted); }
.table th a:hover { color: var(--primary); }
.table-footer { padding: 12px 16px; font-size: 13px; }

.lead-link { font-weight: 500; }

/* === BADGES === */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-new { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-contacted { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-qualified { background: rgba(168,85,247,0.15); color: var(--purple); }
.badge-proposal { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-closed-won { background: rgba(34,197,94,0.25); color: #4ade80; }
.badge-closed-lost { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-source { background: rgba(255,255,255,0.08); color: var(--text-muted); }

/* === FILTER BAR === */
.filter-bar {
  padding: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.input-search, .input-select, .input-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 12px;
}

.input-search { flex: 1; min-width: 200px; }
.input-select { min-width: 140px; }
.input-textarea { width: 100%; resize: vertical; min-height: 80px; }
.input-search:focus, .input-select:focus, .input-textarea:focus { outline: none; border-color: var(--primary); }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.15s;
}

.btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 14px; margin-top: 8px; }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* === DETAIL === */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.detail-table { padding: 4px 0; }
.detail-row {
  display: flex;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 140px; flex-shrink: 0; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.detail-value { font-size: 14px; }

.status-form { padding: 16px; display: flex; gap: 8px; align-items: center; }
.status-form .input-select { flex: 1; }

form:has(.input-textarea) { padding: 16px; }

/* === ACTIVITY === */
.activity-feed { list-style: none; padding: 16px 20px; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
}

/* === EMPTY STATE === */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state i { font-size: 36px; margin-bottom: 12px; display: block; }

/* === ALERT === */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

/* === UTILITIES === */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }

/* === CONTENT REVIEW === */
.review-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.article-preview {
  padding: 32px;
  font-size: 16px;
  line-height: 1.8;
  color: #d1d5db;
  overflow-x: hidden;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-preview * {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.article-preview ul, .article-preview ol {
  padding-left: 20px;
  margin-left: 0;
}

.review-content-card {
  overflow: hidden;
  max-width: 100%;
}

.article-preview h2 { font-size: 22px; font-weight: 700; margin: 32px 0 12px 0; color: var(--text); }
.article-preview h3 { font-size: 18px; font-weight: 600; margin: 24px 0 8px 0; color: var(--text); }
.article-preview p { margin-bottom: 16px; }
.article-preview ul, .article-preview ol { margin: 0 0 16px 24px; }
.article-preview li { margin-bottom: 8px; }
.article-preview strong { color: var(--text); }
.article-preview a { color: var(--primary); }
.article-preview hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.btn-approve { background: var(--green); border-color: var(--green); color: #fff; }
.btn-approve:hover { background: #16a34a; color: #fff; }
.btn-deny { background: var(--red); border-color: var(--red); color: #fff; }
.btn-deny:hover { background: #dc2626; color: #fff; }
.btn-modify { background: var(--yellow); border-color: var(--yellow); color: #000; }
.btn-modify:hover { background: #ca8a04; color: #000; }

.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.modifications-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }

.review-sidebar { display: flex; flex-direction: column; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar .brand-text, .sidebar-nav li a span, .sidebar-footer .user-badge span { display: none; }
  .sidebar-nav li a { justify-content: center; padding: 12px; }
  main.with-sidebar { margin-left: 60px; padding: 12px; }
  .content-grid, .detail-grid, .review-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .input-search { min-width: 100%; }
  .page-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .article-preview { padding: 16px; font-size: 14px; line-height: 1.7; overflow-wrap: break-word; word-wrap: break-word; }
  .article-preview h2 { font-size: 18px; }
  .article-preview h3 { font-size: 16px; }
  .review-content-card { overflow-x: hidden; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 10px; }
}
