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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 20px;
}

header {
  background: var(--primary);
  color: white;
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(37,99,235,0.3);
}

header h1 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: white;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn.active {
  background: white;
  color: var(--primary);
}

main {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.filters, .stats-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

select, input {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--card);
  flex: 1;
  min-width: 0;
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.summary {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.summary-item {
  display: flex;
  flex-direction: column;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
}

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

.entry-date {
  font-weight: 600;
  font-size: 0.95rem;
}

.entry-duration {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.entry-times {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.entry-description {
  color: var(--text-light);
  font-size: 0.85rem;
  font-style: italic;
}

.entry-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

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

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-edit {
  background: #f59e0b;
  color: white;
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.8rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-light);
}

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

.preview {
  background: #f0f9ff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  text-align: center;
  font-weight: 500;
  color: var(--primary);
}

.form-actions {
  display: flex;
  gap: 12px;
}

.form-actions .btn {
  flex: 1;
}

.stats-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stats-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.stats-card h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-light);
}

.stats-total {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 8px;
}

.stats-detail {
  display: flex;
  justify-content: space-around;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.stats-detail-item {
  text-align: center;
}

.stats-detail-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.stats-detail-label {
  font-size: 0.75rem;
  color: var(--text-light);
}

.day-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.day-row:last-child {
  border-bottom: none;
}

.day-name {
  font-weight: 500;
}

.day-hours {
  font-weight: 600;
  color: var(--primary);
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

@media (max-width: 360px) {
  .summary {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}
