:root {
  --primary: #4CAF50;
  --primary-dark: #388E3C;
  --secondary: #2196F3;
  --danger: #f44336;
  --warning: #FF9800;
  --success: #4CAF50;
  --text: #212121;
  --text-light: #757575;
  --bg: #f5f5f5;
  --white: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 90px;
}

/* Header */
.header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 16px;
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.user-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-selector select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  cursor: pointer;
  min-width: 120px;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

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

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

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  min-height: 36px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  background: var(--white);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.category-btn {
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.category-btn .icon {
  font-size: 32px;
}

.category-btn .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.category-btn.positive {
  border-color: var(--success);
}

.category-btn.negative {
  border-color: var(--danger);
}

.category-btn:hover,
.category-btn.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.category-btn.positive:hover,
.category-btn.positive.active {
  background: #E8F5E9;
  border-color: var(--success);
}

.category-btn.negative:hover,
.category-btn.negative.active {
  background: #FFEBEE;
  border-color: var(--danger);
}

/* Slider */
.slider-container {
  margin: 24px 0;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-light);
}

.slider-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
}

.slider-actual {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

.slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  margin-bottom: 8px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
  padding: 0 12px;
}

/* Activity List */
.activity-list {
  margin-top: 16px;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
}

.activity-icon {
  font-size: 24px;
  margin-right: 12px;
}

.activity-info {
  flex: 1;
}

.activity-name {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.activity-details {
  font-size: 14px;
  color: var(--text-light);
}

.activity-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  border-radius: 6px;
  transition: background 0.2s;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--border);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--white);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card.positive {
  border-left: 4px solid var(--success);
}

.stat-card.negative {
  border-left: 4px solid var(--danger);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-value.positive {
  color: var(--success);
}

.stat-value.negative {
  color: var(--danger);
}

.stat-label {
  font-size: 14px;
  color: var(--text-light);
}

.stat-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 12px 0;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 12px;
  transition: all 0.2s;
  min-width: 60px;
  position: relative;
}

.nav-item .icon {
  font-size: 24px;
  margin-bottom: 4px;
  transition: transform 0.2s;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.nav-item.active .icon {
  transform: scale(1.1);
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-box {
  background: var(--white);
  padding: 32px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.login-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 32px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

.empty-state .icon {
  font-size: 64px;
  opacity: 0.3;
  margin-bottom: 16px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  width: 32px;
  height: 32px;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.alert-error {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #EF9A9A;
}

/* Responsive */
@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Date Picker */
input[type="date"] {
  position: relative;
  cursor: pointer;
}

/* Color Picker */
input[type="color"] {
  width: 60px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* Miss/Hit Cards */
.miss-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.miss-card {
  background: var(--white);
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.miss-card.negative-type {
  border-left: 4px solid var(--danger);
}

.miss-card.positive-type {
  border-left: 4px solid var(--success);
}

.miss-card-icon {
  font-size: 28px;
}

.miss-card-info {
  flex: 1;
}

.miss-card-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.miss-card-count {
  font-size: 20px;
  font-weight: 700;
}

.miss-card-count.negative {
  color: var(--danger);
}

.miss-card-count.positive {
  color: var(--success);
}

/* Settings Page Sections */
.settings-section {
  background: var(--white);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.settings-section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

