/* Local Plus Jakarta Sans Font (Offline-First, No CDN) */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('./fonts/PlusJakartaSans-Variable-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('./fonts/PlusJakartaSans-Variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-white: #FFFFFF;
  --card-grey: #F4F5F7;
  --text-dark: #1B1B1F;
  --mango-orange: #FF6A00;
  --highlight-yellow: #FFD60A;
  --border-subtle: #DCdfe4;
  --radius: 16px;
  --touch-min: 48px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg-white);
  color: var(--text-dark);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100%;
}

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  padding: 16px 16px 112px;
  background-color: var(--bg-white);
}

/* Header & Navigation */
.app-header {
  margin-bottom: 16px;
}

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

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}

.today-date {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--radius);
  background-color: var(--card-grey);
  color: var(--text-dark);
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--text-dark);
}

.status-pill.offline {
  background-color: var(--highlight-yellow);
}

.main-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.nav-tab {
  min-height: var(--touch-min);
  padding: 8px 6px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background-color: var(--card-grey);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.nav-tab.active {
  background-color: var(--text-dark);
  color: var(--bg-white);
}

/* Screens */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Toast Banner */
.toast-banner {
  background-color: var(--highlight-yellow);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.update-banner {
  background-color: var(--highlight-yellow);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.update-banner-text {
  font-size: 0.95rem;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Day's Total Highlight Banner (#FFD60A) */
.summary-banner {
  background-color: var(--highlight-yellow);
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.summary-primary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--text-dark);
}

.summary-label {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-total-amount {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.summary-Metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-box {
  background-color: var(--bg-white);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 1.05rem;
  font-weight: 800;
}

/* Buttons (All >= 48px tall, 16px corners, no gradients) */
button,
.btn,
.filter-btn,
.stepper-btn {
  min-height: var(--touch-min);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  text-decoration: none;
}

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

.btn-primary:active {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--card-grey);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
}

.btn-highlight {
  background-color: var(--highlight-yellow);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  font-size: 0.88rem;
  padding: 8px 14px;
}

.btn-install {
  background-color: var(--mango-orange);
  color: var(--bg-white);
  font-size: 0.85rem;
  padding: 8px 12px;
}

.cta-row {
  margin-bottom: 16px;
}

/* Filter Bar */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  background-color: var(--card-grey);
  color: var(--text-dark);
  font-size: 0.86rem;
  padding: 8px 6px;
  border: 2px solid transparent;
}

.filter-btn.active {
  background-color: var(--highlight-yellow);
  color: var(--text-dark);
  border-color: var(--text-dark);
}

/* Cards (#F4F5F7, 16px radius) */
.card,
.order-card,
.pickle-card,
.price-card {
  background-color: var(--card-grey);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 12px;
}

.helper-text {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dark);
}

/* Order Cards */
.order-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.order-customer-name {
  font-size: 1.15rem;
  font-weight: 800;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.88rem;
  font-weight: 600;
}

.phone-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 8px 14px;
  background-color: var(--bg-white);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}

.order-total-pill {
  background-color: var(--highlight-yellow);
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 1.15rem;
  font-weight: 800;
  white-space: nowrap;
}

.order-items-list {
  list-style: none;
  background-color: var(--bg-white);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 1px solid var(--card-grey);
}

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

.order-badges-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.state-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  background-color: var(--bg-white);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
}

.state-badge.active {
  background-color: var(--highlight-yellow);
}

.order-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toggle-status-btn {
  background-color: var(--bg-white);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
  font-size: 0.9rem;
  padding: 10px 12px;
}

.toggle-status-btn.is-done {
  background-color: var(--highlight-yellow);
  color: var(--text-dark);
}

.empty-state {
  background-color: var(--card-grey);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
}

/* Forms & Inputs */
.field-group {
  margin-bottom: 14px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.text-input {
  width: 100%;
  min-height: var(--touch-min);
  padding: 12px 14px;
  border: 2px solid var(--text-dark);
  border-radius: var(--radius);
  background-color: var(--bg-white);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
}

.text-input:focus {
  outline: 3px solid var(--mango-orange);
  outline-offset: 1px;
}

/* Pickle Selector Cards (250g & 500g rows) */
.pickle-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.jar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-white);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 2px solid transparent;
}

.jar-row:last-child {
  margin-bottom: 0;
}

.jar-row.selected {
  border-color: var(--mango-orange);
  background-color: var(--highlight-yellow);
}

.jar-info {
  display: flex;
  flex-direction: column;
}

.jar-size-label {
  font-size: 0.98rem;
  font-weight: 800;
}

.jar-price-label {
  font-size: 0.88rem;
  font-weight: 700;
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0;
  background-color: var(--card-grey);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
  font-size: 1.35rem;
  font-weight: 800;
}

.stepper-btn.stepper-plus {
  background-color: var(--mango-orange);
  color: var(--bg-white);
  border-color: var(--mango-orange);
}

.jar-qty-value {
  min-width: 28px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
}

/* Sticky Bottom Order Bar */
.sticky-order-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 540px;
  margin: 0 auto;
  background-color: var(--bg-white);
  border-top: 2px solid var(--text-dark);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
}

.order-bar-total {
  background-color: var(--highlight-yellow);
  border-radius: var(--radius);
  padding: 8px 14px;
  flex: 1;
}

.order-bar-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
}

.order-bar-amount {
  font-size: 1.35rem;
  font-weight: 800;
}

/* Price Editor */
.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* Backup Screen */
.backup-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.backup-stats {
  display: flex;
  justify-content: space-between;
  background-color: var(--bg-white);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
}

.confirm-box {
  background-color: var(--bg-white);
  border: 2px solid var(--text-dark);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 4px;
}

.confirm-warning-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-dark);
}
