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

:root {
  --bg: #ffffff;
  --bg2: #f8f8f7;
  --bg3: #f1f0ee;
  --bg4: #e8e7e4;
  --text: #0a0a0a;
  --text2: #4a4a47;
  --text3: #8a8a85;
  --border: #e0deda;
  --border2: #c8c7c2;
  --accent: #0a0a0a;
  --accent2: #2a2a2a;
  --green: #166534;
  --green-bg: #f0fdf4;
  --red: #991b1b;
  --red-bg: #fef2f2;
  --amber: #92400e;
  --amber-bg: #fffbeb;
  --blue: #1e40af;
  --blue-bg: #eff6ff;
  --purple: #6b21a8;
  --purple-bg: #faf5ff;
  --radius: 10px;
  --radius-lg: 16px;
  --font: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.dark {
  --bg: #0f0f0e;
  --bg2: #181817;
  --bg3: #222220;
  --bg4: #2c2c29;
  --text: #f0efec;
  --text2: #b8b8b3;
  --text3: #686864;
  --border: #2c2c29;
  --border2: #3c3c38;
  --accent: #f0efec;
  --accent2: #d0d0cc;
  --green: #4ade80;
  --green-bg: rgba(74, 222, 128, 0.1);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.1);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.1);
  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, 0.1);
  --purple: #c084fc;
  --purple-bg: rgba(192, 132, 252, 0.1);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden
}

.sidebar {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s
}

.sidebar.collapsed { width: 56px }

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

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.logo-mark svg { width: 14px; height: 14px; fill: var(--bg) }

.logo-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0 }

.nav-section { padding: 4px 0 }

.nav-label {
  padding: 6px 12px 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  overflow: hidden
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  margin: 1px 8px;
  transition: background 0.15s;
  color: var(--text2);
  position: relative;
  white-space: nowrap
}

.nav-item:hover { background: var(--bg3); color: var(--text) }

.nav-item.active { background: var(--accent); color: var(--bg) }

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8 }

.nav-item.active svg { opacity: 1 }

.nav-text { font-size: 13px; font-weight: 400; overflow: hidden }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  line-height: 1.6
}

.nav-item.active .nav-badge { background: rgba(255,255,255,0.3); color: #fff }

.sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--border) }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer
}

.user-card:hover { background: var(--bg3) }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0
}

.user-info { overflow: hidden; flex: 1 }

.user-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.user-role { font-size: 10px; color: var(--text3); white-space: nowrap }

.main { flex: 1; overflow: hidden; display: flex; flex-direction: column }

.topbar {
  padding: 0 20px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  flex-shrink: 0
}

.topbar-title { font-size: 15px; font-weight: 500; flex: 1 }

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

.search-input {
  width: 100%;
  padding: 6px 10px 6px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border 0.15s;
  font-family: var(--font)
}

.search-input:focus { border-color: var(--border2) }

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3)
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: var(--font)
}

.btn-primary { background: var(--accent); color: var(--bg) }
.btn-primary:hover { opacity: 0.88 }

.btn-secondary {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border)
}
.btn-secondary:hover { background: var(--bg3) }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red)
}
.btn-danger:hover { opacity: 0.8 }

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

.btn-icon {
  padding: 7px;
  border-radius: 8px;
  background: transparent;
  color: var(--text2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s
}
.btn-icon:hover { background: var(--bg3); color: var(--text) }

.content { flex: 1; overflow-y: auto; padding: 20px }

.page { display: none }
.page.active { display: block }

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

.page-title { font-size: 20px; font-weight: 500; letter-spacing: -0.4px }
.page-subtitle { font-size: 13px; color: var(--text3); margin-top: 2px }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px
}

.stat-label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px
}

.stat-value {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -1px;
  font-family: var(--font-mono)
}

.stat-change {
  font-size: 11px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px
}

.stat-up { color: var(--green) }
.stat-down { color: var(--red) }

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

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow)
}

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

.card-title { font-size: 13px; font-weight: 500; color: var(--text) }

.card-body { padding: 20px }

.chart-wrap { position: relative; width: 100%; height: 220px }

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

th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border)
}

td {
  padding: 12px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: middle
}

tr:last-child td { border-bottom: none }
tr:hover td { background: var(--bg2) }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500
}

.badge-green { background: var(--green-bg); color: var(--green) }
.badge-red { background: var(--red-bg); color: var(--red) }
.badge-amber { background: var(--amber-bg); color: var(--amber) }
.badge-blue { background: var(--blue-bg); color: var(--blue) }
.badge-purple { background: var(--purple-bg); color: var(--purple) }
.badge-gray { background: var(--bg3); color: var(--text3) }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block
}

.pipeline {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 10px
}

.pipeline-col {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex: 0 0 250px;
  display: flex;
  flex-direction: column
}

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

.pipeline-label { font-size: 12px; font-weight: 500 }

.pipeline-count {
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg3);
  border-radius: 20px;
  padding: 2px 8px;
  color: var(--text3)
}

.pipeline-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
  flex: 1
}

.lead-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s
}

.lead-card:hover { border-color: var(--border2); box-shadow: var(--shadow) }

.lead-name { font-size: 13px; font-weight: 500; margin-bottom: 3px }
.lead-company { font-size: 11px; color: var(--text3) }
.lead-value { font-size: 11px; font-family: var(--font-mono); color: var(--text2); margin-top: 2px }

.lead-detail {
  font-size: 10px;
  color: var(--text3);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis
}

.lead-tags {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between
}

.lead-stage-select {
  font-size: 10px;
  padding: 2px 4px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text2);
  outline: none;
  cursor: pointer
}

.lead-followup {
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent
}

.lead-followup:hover { background: var(--bg3); border-color: var(--border) }

.lead-followup.has-date {
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 500
}

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

.modal-overlay.open { display: flex }

.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border)
}

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

.modal-title { font-size: 16px; font-weight: 500 }

.modal-body { padding: 20px 24px }

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

.form-group { margin-bottom: 16px }

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

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border 0.15s;
  font-family: var(--font)
}

.form-input:focus { border-color: var(--border2) }
.form-input::placeholder { color: var(--text3) }

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a8a85'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px
}

.tab {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text3);
  transition: all 0.15s;
  font-weight: 400;
  margin-bottom: -1px
}

.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500 }
.tab:hover:not(.active) { color: var(--text2) }

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center
}

.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text);
  font-size: 12px;
  outline: none;
  font-family: var(--font);
  cursor: pointer
}

.activity-feed { display: flex; flex-direction: column; gap: 0 }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border)
}

.activity-item:last-child { border-bottom: none }

.activity-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px
}

.activity-content { flex: 1 }
.activity-text { font-size: 13px; color: var(--text); line-height: 1.5 }
.activity-meta { font-size: 11px; color: var(--text3); margin-top: 2px }

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border)
}

.task-item:last-child { border-bottom: none }

.task-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border2);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s
}

.task-check.done { background: var(--accent); border-color: var(--accent) }

.task-check.done::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--bg);
  clip-path: polygon(20% 50%, 45% 75%, 80% 20%, 90% 30%, 45% 90%, 10% 60%)
}

.task-text { flex: 1; font-size: 13px }
.task-text.done { text-decoration: line-through; color: var(--text3) }
.task-due { font-size: 11px; color: var(--text3) }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text3) }
.empty-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.4 }
.empty-text { font-size: 13px }

.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  transform: translateY(60px);
  transition: transform 0.3s;
  box-shadow: var(--shadow-lg)
}

.notification.show { transform: translateY(0) }

.funnel { display: flex; flex-direction: column; gap: 4px }

.funnel-item { display: flex; align-items: center; gap: 10px }

.funnel-bar-wrap {
  flex: 1;
  background: var(--bg3);
  border-radius: 20px;
  height: 10px;
  overflow: hidden
}

.funnel-bar {
  height: 100%;
  border-radius: 20px;
  background: var(--accent);
  transition: width 0.6s
}

.funnel-label { font-size: 11px; color: var(--text3); width: 100px; text-align: right }
.funnel-val { font-size: 11px; font-family: var(--font-mono); width: 30px; text-align: right; color: var(--text2) }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-lg)
}

.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 24px }

.login-title { font-size: 22px; font-weight: 500; letter-spacing: -0.5px; margin-bottom: 4px }

.login-subtitle { font-size: 13px; color: var(--text3); margin-bottom: 24px }

.login-divider {
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  margin: 12px 0;
  position: relative
}

.login-divider::before,
.login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border)
}

.login-divider::before { left: 0 }
.login-divider::after { right: 0 }

.demo-btn {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s
}

.demo-btn:hover { background: var(--bg4) }

.tooltip-wrap { position: relative; display: inline-flex }

.tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent2);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50
}

.tooltip-wrap:hover .tooltip { opacity: 1 }

@media(max-width:900px) {
  .stats-grid { grid-template-columns: repeat(2,1fr) }
  .grid-2 { grid-template-columns: 1fr }
  .sidebar { width: 56px }
  .sidebar .nav-text,
  .sidebar .logo-text,
  .sidebar .user-info,
  .sidebar .nav-label,
  .sidebar .nav-badge { display: none }
}

@media(max-width:600px) {
  .stats-grid { grid-template-columns: 1fr 1fr }
}

/* Import Modal */
.import-drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--bg2);
  position: relative
}

.import-drop-zone:hover,
.import-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--bg3)
}

.import-drop-zone.drag-over { transform: scale(1.01) }

.import-drop-zone .drop-icon { font-size: 36px; margin-bottom: 8px; transition: transform 0.3s }
.import-drop-zone:hover .drop-icon { transform: translateY(-4px) }
.import-drop-zone .drop-title { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 4px }
.import-drop-zone .drop-subtitle { font-size: 12px; color: var(--text3) }
.import-drop-zone .drop-browse { color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 500 }
.import-drop-zone input[type=file] { display: none }

.import-file-info { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 12px }
.import-file-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0 }
.import-file-details { flex: 1; overflow: hidden }
.import-file-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.import-file-size { font-size: 11px; color: var(--text3) }
.import-file-remove { cursor: pointer; color: var(--text3); transition: color 0.15s }
.import-file-remove:hover { color: var(--red) }

.import-preview { margin-top: 16px; max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg) }
.import-preview table { font-size: 12px }
.import-preview th { position: sticky; top: 0; background: var(--bg2); z-index: 1; font-size: 10px; padding: 8px 10px }
.import-preview td { padding: 8px 10px; font-size: 12px }

.import-mapping { margin-top: 16px }
.import-mapping-title { font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 8px }
.import-mapping-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center }
.import-mapping-arrow { color: var(--text3); font-size: 12px; text-align: center }
.import-mapping select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg2); color: var(--text); font-size: 12px; font-family: var(--font) }

.import-stats { display: flex; gap: 12px; margin-top: 12px }
.import-stat { flex: 1; padding: 10px; border-radius: var(--radius); text-align: center }
.import-stat-val { font-size: 18px; font-weight: 600; font-family: var(--font-mono) }
.import-stat-label { font-size: 10px; color: var(--text3); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px }

.import-progress { width: 100%; height: 4px; background: var(--bg3); border-radius: 20px; overflow: hidden; margin-top: 12px }
.import-progress-bar { height: 100%; background: var(--accent); border-radius: 20px; transition: width 0.4s ease }

.import-step-indicator { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px }
.import-step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg3); transition: all 0.2s }
.import-step-dot.active { background: var(--accent); transform: scale(1.2) }
.import-step-dot.done { background: var(--green) }

/* Leads Table */
.leads-table-container { display: none; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); overflow-x: auto; }
.leads-table-container.active { display: block; }
.l-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.l-table th { text-align: left; padding: 12px 16px; background: var(--bg2); color: var(--text3); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; }
.l-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text2); }
.l-table tr:hover { background: var(--bg2); }

.view-toggle { display: flex; background: var(--bg2); padding: 4px; border-radius: 8px; gap: 4px; }
.view-toggle-btn { padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; border: none; background: transparent; color: var(--text3); transition: all 0.2s; }
.view-toggle-btn.active { background: var(--bg); color: var(--accent); box-shadow: var(--shadow); }

/* Calendar */
.calendar-wrapper { display: flex; gap: 24px; height: calc(100vh - 120px); }
.calendar-sidebar { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; gap: 24px; }
.mini-calendar { font-size: 12px; color: #3c4043; }
.mini-calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding: 0 8px; }
.mini-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-day-head { font-weight: 500; color: #70757a; padding: 4px 0; }
.mini-day { padding: 6px 0; cursor: pointer; border-radius: 50%; transition: background 0.2s; }
.mini-day:hover { background: #f1f3f4; }
.mini-day.active { background: #e8f0fe; color: #1a73e8; font-weight: 600; }
.mini-day.today { background: #1a73e8; color: #fff; font-weight: 600; }
.calendar-main { flex: 1; background: #fff; border: 1px solid #dadce0; border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.calendar-toolbar { padding: 12px 16px; border-bottom: 1px solid #dadce0; display: flex; justify-content: space-between; align-items: center; }
.calendar-day { background: #fff; min-height: 100px; padding: 4px; display: flex; flex-direction: column; gap: 2px; position: relative; transition: background 0.2s; }
.calendar-day:hover { background: #f8f9fa; }
.calendar-day.today .day-num { background: #1a73e8; color: #fff; }
.calendar-day.other-month { color: #70757a; background: #fff; opacity: 0.5; }
.calendar-event { padding: 2px 6px; border-radius: 4px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; display: flex; align-items: center; gap: 4px; margin: 1px 0; transition: box-shadow 0.2s; }
.calendar-event:hover { box-shadow: 0 1px 2px rgba(60,64,67,.3),0 1px 3px 1px rgba(60,64,67,.15); }
.event-meeting { background: #e8f0fe; color: #1a73e8; }
.event-task { background: #fef7e0; color: #f29900; }
.event-general { background: #e6f4ea; color: #1e8e3e; }

.calendar-sidebar-section { border-top: 1px solid #dadce0; padding-top: 16px; }
.section-title { font-size: 11px; font-weight: 600; color: #70757a; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.calendar-list-item { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; color: #3c4043; }
.calendar-list-item:hover { background: #f1f3f4; }
.calendar-checkbox { width: 16px; height: 16px; border-radius: 3px; border: 2px solid #1a73e8; background: #1a73e8; display: flex; align-items: center; justify-content: center; }
.calendar-checkbox::after { content: ''; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translateY(-1px); }

select, textarea { font-family: var(--font) }

.detail-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px }
.detail-tab { padding: 8px 14px; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text3); transition: all .15s; font-weight: 400; margin-bottom: -1px }
.detail-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500 }
.detail-tab:hover:not(.active) { color: var(--text2) }
.detail-panel { display: none }
.detail-panel.active { display: block }
.detail-section { background: var(--bg2); border-radius: var(--radius); padding: 12px; margin-bottom: 10px }
.detail-section-title { font-size: 11px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px }

.timeline-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px }
.timeline-item:last-child { border-bottom: none }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 4px }
.timeline-dot.green { background: var(--green) }
.timeline-dot.amber { background: var(--amber) }
.timeline-dot.red { background: var(--red) }
.timeline-dot.blue { background: var(--blue) }

.billing-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px }
.billing-row:last-child { border-bottom: none }

.query-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin-bottom: 8px }
.query-card:last-child { margin-bottom: 0 }

/* FullCalendar Overrides */
:root {
  --fc-border-color: #dadce0;
  --fc-daygrid-event-dot-width: 8px;
  --fc-today-bg-color: transparent;
}

#fullCalendar { font-family: var(--font); }
.fc-header-toolbar { padding: 8px 16px !important; margin-bottom: 0 !important; border-bottom: 1px solid #dadce0; }
.fc-toolbar-title { font-size: 20px !important; font-weight: 400 !important; color: #3c4043 !important; }
.fc-button { background: #fff !important; border: 1px solid #dadce0 !important; color: #3c4043 !important; text-transform: capitalize !important; font-weight: 500 !important; font-size: 14px !important; box-shadow: none !important; }
.fc-button:hover { background: #f1f3f4 !important; }
.fc-button-active { background: #e8f0fe !important; color: #1a73e8 !important; border-color: #d2e3fc !important; }
.fc-col-header-cell { padding: 8px 0 !important; font-size: 11px; font-weight: 500; color: #70757a; text-transform: uppercase; }
.fc-daygrid-day-number { padding: 4px !important; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; margin: 4px auto !important; font-size: 12px; font-weight: 500; border-radius: 50%; }
.fc-day-today .fc-daygrid-day-number { background: #1a73e8; color: #fff; }
.fc-event { border: none !important; padding: 2px 4px !important; margin: 1px 2px !important; font-size: 12px !important; border-radius: 4px !important; }
.event-meeting { background-color: #e8f0fe !important; color: #1a73e8 !important; border-left: 3px solid #1a73e8 !important; }
.event-task { background-color: #fef7e0 !important; color: #f29900 !important; border-left: 3px solid #f29900 !important; }
.event-general { background-color: #e6f4ea !important; color: #1e8e3e !important; border-left: 3px solid #1e8e3e !important; }
#eventModalHeader { cursor: grab; }
#eventModalHeader:active { cursor: grabbing; }
