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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  line-height: 1.5;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #1a1a1a;
  color: white;
  padding: 0;
}

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

header h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.header-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

#status {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

#status.online::before {
  background: #4caf50;
}

#status.offline::before {
  background: #ff9800;
}

main {
  flex: 1;
  padding: 20px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 80px;
}

#auth-section {
  background: white;
  padding: 32px 24px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  margin-top: 24px;
}

#auth-form,
#confirm-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#auth-form input,
#confirm-form input {
  padding: 14px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 16px;
  background: white;
}

#auth-form input:focus,
#confirm-form input:focus {
  outline: none;
  border-color: #1a1a1a;
}

#auth-form button,
#confirm-form button {
  padding: 12px 24px;
  background: #1a1a1a;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
}

#auth-form button:hover,
#confirm-form button:hover {
  background: #000;
}

#signup-btn {
  background: white !important;
  color: #1a1a1a !important;
  border: 1px solid #d0d0d0 !important;
}

#signup-btn:hover {
  border-color: #1a1a1a !important;
  background: white !important;
}

#costs-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.costs-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.btn-primary {
  padding: 12px 24px;
  background: #1a1a1a;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
}

.btn-primary:hover {
  background: #000;
}

.btn-secondary {
  padding: 12px 24px;
  background: white;
  color: #1a1a1a;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

#logout-btn {
  padding: 12px 24px;
  background: white;
  color: #1a1a1a;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
}

#logout-btn:hover {
  border-color: #1a1a1a;
}

#cost-form {
  background: white;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

#cost-form input {
  padding: 12px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  font-family: 'IBM Plex Sans', sans-serif;
}

#cost-form input:focus {
  outline: none;
  border-color: #1a1a1a;
}

.amount-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.form-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-actions button {
  flex: 1;
}

#costs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#costs-list li {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 12px;
}

.cost-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.cost-desc {
  font-weight: 500;
  color: #1a1a1a;
  font-size: 18px;
  padding-right: 60px;
}

.cost-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.cost-date {
  font-size: 12px;
  color: #666;
}

.cost-amount {
  font-weight: 600;
  font-size: 24px;
}

.cost-amount.positive {
  color: #24a148 !important;
}

.cost-amount.negative {
  color: #da1e28 !important;
}

.cost-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  color: #525252;
  transition: color 0.1s;
}

.btn-icon:hover {
  color: #0f62fe;
}

#costs-list li span:first-child {
  font-weight: 400;
  color: #1a1a1a;
  font-size: 16px;
}

#costs-list li span:last-child {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 18px;
}

#install-btn {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
}

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
}

.nav-item {
  flex: 1;
  padding: 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
}

.nav-item.active {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

#settings-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-item {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.settings-item label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-item #user-email {
  font-size: 16px;
  color: #1a1a1a;
}

main {
  padding-bottom: 80px;
}
