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

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f5f5f5;
  color: #252525;
  line-height: 1.55;
}

.dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
}

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

.dashboard-logo {
  font-size: 18px;
  font-weight: 700;
  color: #e94e1b;
  letter-spacing: 0.3px;
}

.dashboard-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #252525;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-wrap: wrap;
}

.filter-label {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  font-weight: 500;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-group label {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}

.filter-group input[type="date"] {
  padding: 7px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  color: #252525;
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group input[type="date"]:focus {
  border-color: #e94e1b;
  box-shadow: 0 0 0 3px rgba(233, 78, 27, 0.1);
  background: #fff;
}

.btn {
  padding: 8px 22px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #e94e1b;
  color: #fff;
}

.btn-primary:hover {
  background: #d44418;
}

.filter-info {
  font-size: 12px;
  color: #bbb;
  margin-left: auto;
}

.loading {
  text-align: center;
  padding: 60px 0;
  color: #bbb;
  font-size: 14px;
  font-weight: 500;
}

.error {
  background: #fff5f5;
  border: 1px solid #ffd4d4;
  color: #c0392b;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

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

.kpi-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-left: 4px solid transparent;
  transition: box-shadow 0.2s;
}

.kpi-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.kpi-open { border-left-color: #e94e1b; }
.kpi-won  { border-left-color: #2ecc71; }
.kpi-avg  { border-left-color: #f39c12; }

.kpi-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  font-weight: 600;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: #252525;
  letter-spacing: -0.3px;
}

.kpi-sub {
  font-size: 12px;
  color: #bbb;
  margin-top: 4px;
  font-weight: 500;
}

.section {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section h2 {
  font-size: 16px;
  font-weight: 600;
  color: #252525;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 11px 16px;
  background: #fafafa;
  color: #888;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #eeeeee;
  white-space: nowrap;
}

.data-table th.align-right {
  text-align: center;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  white-space: nowrap;
}

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

.data-table tbody tr:hover {
  background: #fdf8f5;
}

.data-table .amount-cell {
  font-weight: 600;
  text-align: center;
  color: #252525;
}

.data-table .count-cell {
  text-align: center;
}

.data-table .stage-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  background: #fef0e8;
  color: #e94e1b;
}

.stage-badge.won  { background: #eafaf1; color: #27ae60; }
.stage-badge.lose { background: #fdedec;  color: #c0392b; }

.deal-link {
  color: #e94e1b;
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s;
}

.deal-link:hover {
  text-decoration: underline;
  color: #c03910;
}

.empty-state {
  text-align: center;
  padding: 40px 0;
  color: #ccc;
  font-size: 13px;
  font-weight: 500;
}

@media (max-width: 700px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
