/* ── BASE ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f4f7f4;
  color: #1a2e1a;
  margin: 0;
  padding: 0 0 60px 0;
}

/* ── PAGE HEADER ─────────────────────────────────────────────── */
.labels-page-header {
  background: #fff;
  border-bottom: 3px solid #90EE90;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row;
}

.header-logo img {
  width: 200px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.header-logo span {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a2e1a;
  letter-spacing: -0.3px;
}

/* ── HEADER ACTIONS ──────────────────────────────────────────── */
.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ── MAIN LAYOUT ─────────────────────────────────────────────── */
.page-body {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ── ORDERS SECTION ──────────────────────────────────────────── */
#auto-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.column {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  border-top: 4px solid #90EE90;
  max-height: 340px;
  overflow-y: auto;
}

.column h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #eee;
}

.order-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #eee;
  margin-bottom: 0.5rem;
  background: #fafcfa;
  transition: background 0.15s;
}

.order-card:hover { background: #f0f9f0; }

.order-card span {
  font-weight: 600;
  font-size: 0.92rem;
  color: #1a2e1a;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
button {
  padding: 0.6rem 1.3rem;
  background: #90EE90;
  color: #1a2e1a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

button:hover {
  background: #7cd17c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

button:active { transform: translateY(0); }

button.btn-ghost {
  background: #f0f0f0;
  color: #444;
}

button.btn-ghost:hover { background: #e0e0e0; }

/* ── MANUAL FORM ─────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
}

.form-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a2e1a;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #90EE90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section {
  margin-bottom: 1.25rem;
}

.section h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: #888;
  margin-bottom: 0.6rem;
}

label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

select, input[type="number"] {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s;
  margin: 0;
}

select:focus, input[type="number"]:focus {
  border-color: #90EE90;
  outline: none;
  box-shadow: 0 0 0 3px rgba(144,238,144,0.25);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #40916c;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #eee;
}

/* ── LABEL PREVIEW ───────────────────────────────────────────── */
#label-output-wrapper {
  max-width: 1100px;
  margin: 0 auto 2rem auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
}

#result {
  background: #fff;
  margin-top: 0;
  border: 2px dashed #90EE90;
  border-radius: 10px;
  padding: 10px;
  width: 2in;
  height: 3.1in;
  box-sizing: border-box;
}

/* ── NEW MENU ITEMS MODAL ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s;
}

.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 2rem;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #1a2e1a;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #90EE90;
}

.modal-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #999;
  margin: 1rem 0 0.5rem 0;
}

.new-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #eee;
  margin-bottom: 0.4rem;
  background: #fafcfa;
  cursor: pointer;
  transition: all 0.15s;
}

.new-item-row:hover {
  background: #e8f5e9;
  border-color: #90EE90;
}

.new-item-row .item-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.new-item-row .item-section {
  font-size: 0.78rem;
  color: #888;
  background: #f0f0f0;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* Nutrition entry form inside modal */
.nutrition-form-group {
  margin-bottom: 1rem;
}

.nutrition-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 0.35rem;
}

.nutrition-form-group input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.nutrition-form-group input:focus {
  border-color: #90EE90;
  outline: none;
}

.nutrition-form-group input[readonly] {
  background: #f5f5f5;
  color: #666;
}

/* ── HIDDEN PRINT AREA ───────────────────────────────────────── */
#print-area { display: none; }

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── PRINT ───────────────────────────────────────────────────── */
@page { size: 2in 3.1in; margin: 0; }

@media print {
  html, body {
    width: 2in;
    height: 3.1in;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  body * { visibility: hidden; }

  #print-area.active {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 2in;
  }

  #print-area.active * { visibility: visible; }

  #result.manual-print,
  #result.manual-print * { visibility: visible; }

  #result.manual-print {
    position: fixed;
    top: 0;
    left: 0;
    width: 2in;
    height: 3.1in;
    padding: 0.1in;
    margin: 0;
    border: none;
    box-sizing: border-box;
  }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 700px) {
  #auto-section { grid-template-columns: 1fr; }
  .page-body { padding: 0 1rem; }
}