/* assets/css/style.css */
:root {
  --green: #1D9E75; --green-l: #E1F5EE; --green-d: #0F6E56;
  --amber: #BA7517; --amber-l: #FAEEDA;
  --red:   #A32D2D; --red-l:   #FCEBEB;
  --blue:  #185FA5; --blue-l:  #E6F1FB;
  --border: rgba(0,0,0,0.09);
  --bg:    #F4F3F0;
  --r:     10px; --rl: 14px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: #1a1a1a; font-size: 15px; line-height: 1.5; min-height: 100vh; }

/* Layout */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; position: sticky; top: 0; z-index: 50; gap: 12px; }
.topbar .logo { font-size: 17px; font-weight: 600; text-decoration: none; color: #1a1a1a; display: flex; align-items: center; gap: 7px; }
.topbar nav { display: flex; gap: 4px; }
.nav-link { padding: 5px 11px; border-radius: 8px; font-size: 13px; font-weight: 500; text-decoration: none; color: #666; transition: all .12s; }
.nav-link:hover, .nav-link.active { background: var(--green-l); color: var(--green-d); }

.page { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem; }
.page.wide { max-width: 1060px; }

/* Cards */
.card { background: #fff; border-radius: var(--rl); border: 1px solid var(--border); padding: 1.25rem; margin-bottom: 1rem; }
.card-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: #999; margin-bottom: .875rem; }

/* Balance chip */
.balance-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--green-l); color: var(--green-d); border-radius: 99px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.balance-chip.low { background: var(--red-l); color: var(--red); }

/* Status banner */
.status-banner { border-radius: var(--r); padding: .7rem 1rem; margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 500; }
.status-banner.open      { background: var(--green-l); color: var(--green-d); }
.status-banner.ordered   { background: var(--amber-l); color: var(--amber); }
.status-banner.delivered { background: var(--blue-l);  color: var(--blue); }

/* Form */
.field { margin-bottom: .875rem; }
.field label { display: block; font-size: 13px; color: #666; font-weight: 500; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r);
  font-size: 14px; font-family: inherit; background: #fff; color: #1a1a1a; transition: border-color .15s; appearance: none;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,158,117,.1); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }

/* Menu chips */
.menu-category { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #bbb; margin: .875rem 0 .4rem; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: var(--r); border: 1px solid var(--border);
  cursor: pointer; background: #fafaf8; margin-bottom: 5px; transition: all .1s;
}
.menu-item:hover { border-color: var(--green); background: var(--green-l); }
.menu-item.selected { border-color: var(--green); background: var(--green-l); }
.menu-item .item-name { font-size: 14px; font-weight: 500; }
.menu-item .item-price { font-size: 13px; color: var(--green-d); font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--r); font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer; border: 1px solid transparent; transition: all .12s; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-d); }
.btn-ghost   { background: transparent; color: #555; border-color: var(--border); }
.btn-ghost:hover { background: #f5f5f3; }
.btn-danger  { background: var(--red-l); color: var(--red); border-color: #f7c1c1; }
.btn-amber   { background: var(--amber-l); color: var(--amber); border-color: #FAC775; }
.btn-blue    { background: var(--blue-l); color: var(--blue); border-color: #B5D4F4; }
.btn-full    { width: 100%; justify-content: center; }
.btn-sm      { padding: 5px 10px; font-size: 12px; }

/* Price bar */
.price-bar { display: flex; align-items: center; justify-content: space-between; padding: .7rem 0; border-top: 1px solid var(--border); margin-top: .7rem; }
.price-big { font-size: 22px; font-weight: 600; }
.price-label { font-size: 13px; color: #999; }

/* Order items */
.order-row { display: flex; align-items: flex-start; justify-content: space-between; padding: 9px 11px; background: #fafaf8; border-radius: var(--r); border: 1px solid var(--border); margin-bottom: 5px; }
.order-row:last-child { margin-bottom: 0; }
.order-name  { font-size: 14px; font-weight: 600; }
.order-sub   { font-size: 12px; color: #999; margin-top: 2px; }
.order-price { font-size: 14px; font-weight: 600; color: var(--green-d); white-space: nowrap; margin-left: 10px; }

/* Badges */
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.badge-open      { background: var(--green-l); color: var(--green-d); }
.badge-ordered   { background: var(--amber-l); color: var(--amber); }
.badge-delivered { background: var(--blue-l);  color: var(--blue); }
.badge-paid      { background: #EAF3DE; color: #3B6D11; }
.badge-unpaid    { background: var(--red-l);   color: var(--red); }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--rl); border: 1px solid var(--border); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #999; padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafaf8; }

/* Summary */
.sum-row   { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; color: #666; }
.sum-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 600; padding: 9px 0 0; border-top: 1px solid var(--border); margin-top: 5px; }

/* Toast */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(80px); background: #1a1a1a; color: #fff; padding: 9px 20px; border-radius: 99px; font-size: 14px; font-weight: 500; z-index: 9999; transition: transform .22s ease; white-space: nowrap; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* Auth screen */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--bg); }
.auth-card { background: #fff; border-radius: var(--rl); border: 1px solid var(--border); padding: 2rem; width: 100%; max-width: 340px; }

/* Spinner */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Section tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab { padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; color: #888; transition: all .12s; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.tab.active { color: var(--green-d); border-bottom-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Empty */
.empty { text-align: center; padding: 2rem 1rem; color: #bbb; font-size: 14px; }
.empty .icon { font-size: 32px; display: block; margin-bottom: .5rem; }

/* Shop-Tabs (Geschäft-Auswahl im Bestellformular) */
.shop-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--border);
}
.shop-tab {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: #f8f8f6;
  color: #666;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}
.shop-tab:hover { border-color: #bbb; background: #f0f0ec; }
.shop-tab.active { background: var(--green-l); border-color: var(--green); color: var(--green-d); }

/* Zutaten-Chips beim Bestellen */
.zutat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  background: #f8f8f6;
  color: #555;
  transition: all .12s;
}
.zutat-chip input { display: none; }
.zutat-chip:hover { border-color: #bbb; }
.zutat-chip.active { background: var(--green-l); border-color: var(--green); color: var(--green-d); font-weight: 500; }

/* Cart add-row alignment */
#add-cart-btn { height: 36px; align-self: flex-end; margin-bottom: 0; }

/* Checkbox */
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--green); }

@media (max-width: 540px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar nav .nav-link span { display: none; }
  .page { padding: 1rem .75rem; }
}
