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

:root {
  --primary: #1B8A6B;
  --primary-light: #25A880;
  --primary-dark: #146B53;
  --primary-bg: #E8F5F0;
  --accent: #6CC24A;
  --accent-light: #E8F5E0;
  --text: #1A2E35;
  --text-secondary: #5A7A84;
  --bg: #F5F9F7;
  --white: #FFFFFF;
  --border: #D4E5DE;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  padding-top: var(--safe-top);
  padding-bottom: 72px;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HEADER ===== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 480px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo img {
  height: 40px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.city-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
  font-family: inherit;
}

.city-selector:hover {
  background: var(--primary-bg);
}

.city-selector svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
}

.btn-login {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-bg);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-login:hover {
  background: #C8EAD8;
}

.btn-login:active {
  transform: scale(0.96);
}

/* ===== FORM COMPONENTS ===== */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

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

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

select.form-input {
  font-size: 16px;
}

.form-input:focus {
  border-color: var(--primary);
  background: var(--white);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

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

.btn-order {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}

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

.btn-order:active {
  transform: scale(0.98);
}

.btn-order:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

fieldset.form-card {
  border: none;
}

legend.form-label {
  width: 100%;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

.footer .container {
  max-width: 480px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== UTILITY ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== PAGE HEADER WITH BACK BUTTON ===== */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}

.page-header .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
}

.page-header .back-btn:hover {
  background: var(--primary-bg);
}

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

/* ===== CARD COMPONENT ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.card:last-child {
  margin-bottom: 0;
}

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-new {
  background: var(--accent-light);
  color: #3D7A2A;
}

.badge-active {
  background: var(--primary-bg);
  color: var(--primary-dark);
}

.badge-done {
  background: #E8E8E8;
  color: #5A5A5A;
}

.badge-pending {
  background: #FFF3E0;
  color: #E65100;
}

/* ===== LIST ITEMS ===== */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.list-item:hover {
  box-shadow: var(--shadow-md);
}

.list-item:last-child {
  margin-bottom: 0;
}

/* ===== TAB NAVIGATION ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-item {
  flex-shrink: 0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.tab-item:hover {
  color: var(--primary);
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

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

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 280px;
  line-height: 1.5;
}

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== AVATAR ===== */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

/* ===== BOTTOM NAVIGATION BAR ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 0;
  padding-bottom: calc(4px + var(--safe-bottom));
  z-index: 200;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 64px;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.nav-item .icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item .icon svg {
  width: 22px;
  height: 22px;
}

.nav-item:hover {
  color: var(--primary);
}

.nav-item:active {
  color: var(--primary);
  transform: scale(0.92);
}

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

/* ===== RESPONSIVE: 481px+ ===== */
@media (min-width: 481px) {
  .container {
    padding: 0 24px;
  }
}

/* ===== RESPONSIVE: 768px+ ===== */
@media (min-width: 768px) {
  .container {
    max-width: 680px;
  }

  .header .container {
    max-width: 680px;
  }

  .footer .container {
    max-width: 680px;
  }

  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }

  .form-card {
    padding: 24px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  body {
    padding-bottom: 0;
  }

  .bottom-nav {
    display: none;
  }
}

/* ===== RESPONSIVE: 1024px+ ===== */
@media (min-width: 1024px) {
  .container {
    max-width: 1100px;
    padding: 0 40px;
  }

  .header .container {
    max-width: 1100px;
    padding: 0 40px;
  }

  .header {
    padding: 12px 0;
  }

  .logo img {
    height: 48px;
  }

  .form-card {
    padding: 24px;
    margin-bottom: 16px;
  }

  .footer .container {
    max-width: 1100px;
    padding: 0 40px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .stat-value {
    font-size: 32px;
  }
}

/* ===== RESPONSIVE: 1280px+ ===== */
@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }

  .header .container {
    max-width: 1200px;
  }

  .footer .container {
    max-width: 1200px;
  }
}
