:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: light;
  color: #213547;
  background-color: #ffffff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 100vh;
  overflow-y: auto;
}

#root {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.dashboard-container {
  /* Remove all constraints - using inline styles instead */
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.input {
  width: 100%;
  padding: 0.6em 1.2em;
  border-radius: 8px;
  border: 1px solid #646cff;
  background-color: transparent;
  color: inherit;
  font-size: 1em;
  margin-bottom: 1rem;
}

.input:focus {
  outline: none;
  border-color: #535bf2;
}

.password-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle-button {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #666;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.password-toggle-button:hover {
  color: #333;
}

.password-input {
  padding-right: 3rem !important;
}

.error {
  color: #ff4444;
  margin-bottom: 1rem;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #f9f9f9;
  cursor: pointer;
  transition: border-color 0.25s;
}

.logout-button {
  width: auto;
}

button:hover {
  border-color: #646cff;
}

button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

.search-container {
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.search-input:focus {
  outline: none;
  border-color: #646cff;
  box-shadow: 0 0 0 2px rgba(100, 108, 255, 0.1);
}

.table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
  cursor: pointer;
}

th.sortable:hover {
  background-color: #e9ecef;
}

tr:hover {
  background-color: #f5f5f5;
}

.user-link {
  background: none;
  border: none;
  padding: 0;
  color: #0066cc;
  text-decoration: underline;
  cursor: pointer;
}

.user-link:hover {
  color: #0052a3;
}

.user-details {
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.chart-container {
  width: 100%;
  margin: 2rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: #666;
}

.stat-card p {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.daily-data-table {
  margin-top: 2rem;
}

.daily-data-table h3 {
  margin-bottom: 1rem;
}

.daily-data-table table {
  width: 100%;
  border-collapse: collapse;
}

.daily-data-table th,
.daily-data-table td {
  padding: 0.75rem;
  text-align: right;
}

.daily-data-table th:first-child,
.daily-data-table td:first-child {
  text-align: left;
}

.daily-data-table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab.active {
  background: #646cff;
  color: white;
  border-color: #646cff;
}

.user-selector {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-select-label {
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
  min-width: 120px;
}

.user-select {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-select:hover {
  border-color: #646cff;
}

.user-select:focus {
  outline: none;
  border-color: #646cff;
  box-shadow: 0 0 0 2px rgba(100, 108, 255, 0.1);
}

.selected-row {
  background-color: #e8f4ff;
}

.selected-row:hover {
  background-color: #d8ecff;
}

.meal-details {
  margin-top: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.meal-details h3 {
  margin-bottom: 1.5rem;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content button {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
}

.dropdown-content button:hover {
  background-color: #f1f1f1;
}

.view-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.view-button {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-button.active {
  background: #646cff;
  color: white;
  border-color: #646cff;
}

.device-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.device-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.device-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.device-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.device-card-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

.device-status {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}

.device-status.physical {
  background: #dcfce7;
  color: #166534;
}

.device-status.virtual {
  background: #dbeafe;
  color: #1e40af;
}

.device-card-content {
  color: #666;
}

.device-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

.info-row .label {
  font-weight: 500;
  color: #333;
}

.info-row .value {
  color: #666;
}

.weight-goals-summary {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.weight-goals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.weight-goals-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.weight-goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.weight-goal-card {
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.2s ease;
}

.weight-goal-card:hover {
  transform: translateY(-2px);
}

.weight-goal-card h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #666;
}

.weight-goal-card p {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

.weight-goal-card.start {
  background: #dbeafe;
  color: #1e40af;
}

.weight-goal-card.goal {
  background: #dcfce7;
  color: #166534;
}

.weight-goal-card.current {
  background: #fee2e2;
  color: #991b1b;
}

.weight-goal-card.current.lost {
  background: #dcfce7;
  color: #166534;
}

.weight-goals-actions {
  margin-top: 1rem;
  text-align: right;
}

.weight-goal-card input {
  width: 100%;
  padding: 0.5rem;
  font-size: 1.5rem;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
}

.modern-login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #79B6BB;
  padding: 2rem 1rem;
  gap: 1.5rem;
}

.modern-login-header {
  text-align: center;
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 480px;
}

.modern-login-icon {
  display: none;
}

.modern-login-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modern-login-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem 2.5rem 2rem 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .modern-login-card {
    padding: 2rem 1.5rem 1.5rem 1.5rem;
  }

  .modern-login-header {
    padding: 1.5rem;
  }
}