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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
}

.header h1 {
  font-size: 1.5rem;
  color: #fff;
}

.logout-btn {
  background: transparent;
  border: 1px solid #666;
  color: #aaa;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.logout-btn:hover {
  background: #333;
  color: #fff;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

.settings-btn {
  background: transparent;
  border: 1px solid #666;
  color: #aaa;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.settings-btn:hover {
  background: #333;
  color: #fff;
}

/* Login Page */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: #16213e;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #fff;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #aaa;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: #4a9eff;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: #4a9eff;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover {
  background: #3a8eef;
}

.submit-btn:disabled {
  background: #555;
  cursor: not-allowed;
}

.error-message {
  background: #ff4444;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

/* Dashboard Cards */
.card {
  background: #16213e;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1.1rem;
  color: #aaa;
  margin-bottom: 16px;
  font-weight: 500;
}

/* Time Display */
.time-display {
  margin-bottom: 20px;
}

.time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #333;
}

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

.time-label {
  color: #888;
}

.time-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

.time-value.total {
  color: #4a9eff;
  font-size: 1.4rem;
}

.time-bar {
  height: 8px;
  background: #333;
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.time-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a9eff, #8b5cf6);
  border-radius: 4px;
  transition: width 0.3s;
}

/* Session Button */
.session-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #4a9eff, #8b5cf6);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.session-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(74, 158, 255, 0.4);
}

.session-btn:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.session-btn.stop {
  background: linear-gradient(135deg, #ff4444, #ff6b6b);
}

.session-btn.stop:hover {
  box-shadow: 0 4px 20px rgba(255, 68, 68, 0.4);
}

/* Active Session */
.active-session {
  text-align: center;
  padding: 20px 0;
}

.countdown {
  font-size: 3rem;
  font-weight: 700;
  color: #4a9eff;
  margin: 20px 0;
  font-family: 'Menlo', 'Monaco', monospace;
}

.session-info {
  color: #888;
  margin-bottom: 20px;
}

/* History */
.history-list {
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #333;
}

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

.history-date {
  color: #888;
  font-size: 0.9rem;
}

.history-duration {
  color: #fff;
  font-weight: 500;
}

/* Week Summary */
.week-summary {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.day-box {
  text-align: center;
  padding: 10px 4px;
  background: #1a1a2e;
  border-radius: 8px;
}

.day-box.today {
  border: 2px solid #4a9eff;
}

.day-name {
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 4px;
}

.day-value {
  font-size: 0.85rem;
  color: #fff;
}

.day-value.none {
  color: #444;
}

/* Admin Styles */
.user-card {
  background: #1a1a2e;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

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

.user-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-badge.active {
  background: #22c55e33;
  color: #22c55e;
}

.status-badge.inactive {
  background: #66666633;
  color: #888;
}

.user-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  font-size: 0.9rem;
  color: #aaa;
}

.stat-value {
  color: #fff;
  font-weight: 500;
}

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

.quick-btn {
  flex: 1;
  padding: 10px;
  background: #333;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.quick-btn:hover {
  background: #444;
}

.quick-btn.add-time {
  background: #4a9eff33;
  color: #4a9eff;
}

.quick-btn.add-time:hover {
  background: #4a9eff44;
}

/* Activity Log */
.activity-log {
  max-height: 250px;
  overflow-y: auto;
}

.activity-item {
  padding: 10px 0;
  border-bottom: 1px solid #333;
  font-size: 0.9rem;
}

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

.activity-time {
  color: #666;
  font-size: 0.8rem;
}

.activity-text {
  color: #aaa;
}

.activity-text .user {
  color: #4a9eff;
  font-weight: 500;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #4a9eff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #16213e;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
}

.modal-content h2 {
  color: #fff;
  margin-bottom: 20px;
  text-align: center;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-secondary {
  flex: 1;
  padding: 12px;
  background: #333;
  border: none;
  border-radius: 8px;
  color: #aaa;
  font-size: 1rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #444;
  color: #fff;
}

.btn-primary {
  flex: 1;
  padding: 12px;
  background: #4a9eff;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: #3a8eef;
}

/* Responsive */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .card {
    padding: 16px;
  }

  .countdown {
    font-size: 2.5rem;
  }

  .week-summary {
    gap: 4px;
  }

  .day-box {
    padding: 8px 2px;
  }
}
