.history-page {
  max-width: 900px;
  margin: 0 auto;
}

.history-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
}

.history-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.history-user-row label {
  font-size: 14px;
  color: var(--text-secondary);
}

.history-user-row select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--card-bg);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236B7280' d='M1 3l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.history-user-row select:focus {
  border-color: var(--primary);
}

.date-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.date-picker-row select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--card-bg);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236B7280' d='M1 3l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.date-picker-row select:focus {
  border-color: var(--primary);
}

.date-picker-row span {
  font-size: 14px;
  color: var(--text-secondary);
}

.chart-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.chart-container canvas {
  width: 100% !important;
}

.no-records {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 20px;
  font-size: 15px;
}

.history-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.records-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.records-section h3 {
  font-size: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.record-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--bg);
  gap: 16px;
  transition: background 0.15s;
}

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

.record-item:hover {
  background: #FAFAFA;
}

.record-type-badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
  font-weight: 500;
}

.record-type-badge.productive {
  background: #E8F5E9;
  color: #2E7D32;
}

.record-type-badge.other {
  background: #E3F2FD;
  color: #1565C0;
}

.record-time {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.record-desc {
  flex: 1;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s;
  min-width: 0;
}

.record-desc:hover {
  border-color: var(--border);
  background: var(--bg);
}

.record-desc.readonly {
  cursor: default;
}

.record-desc.readonly:hover {
  border-color: transparent;
  background: transparent;
}

.record-desc-input {
  flex: 1;
  font-size: 14px;
  padding: 4px 8px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  outline: none;
  font-family: var(--font);
  min-width: 0;
}

.record-duration {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Chart legend custom */
.chart-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 12px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.chart-legend-item.interruption {
  color: #6E1A1A;
}

.chart-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.history-page .stat-value.interruption {
  color: #8B1E1E;
}
