@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&display=swap');

.wgp-root {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: #f8fafc;
  min-height: 100dvh;
  color: #0f172a;
}

.wgp-login-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #fff7ed 0%, #f8fafc 45%, #f1f5f9 100%);
}

#wgp-login.hidden,
.wgp-login-screen.hidden {
  display: none !important;
}

.wgp-login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 28px;
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  border: 1px solid #e2e8f0;
}

.wgp-logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #ea580c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}

.wgp-login-title {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 6px;
}

.wgp-login-sub {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin: 0 0 20px;
}

.wgp-field {
  margin-bottom: 12px;
}

.wgp-field label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.wgp-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  font-size: 16px;
  font-weight: 700;
  outline: none;
}

.wgp-field input:focus {
  border-color: #ea580c;
}

.wgp-pin {
  text-align: center;
  letter-spacing: 0.35em;
}

.wgp-btn-login {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.wgp-btn-login:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wgp-login-msg {
  min-height: 18px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
  text-align: center;
}

.wgp-login-loading {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(248, 250, 252, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.wgp-login-loading.hidden {
  display: none;
}

.wgp-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #ea580c;
  border-radius: 50%;
  animation: wgp-spin 0.8s linear infinite;
}

@keyframes wgp-spin {
  to { transform: rotate(360deg); }
}

.wgp-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.wgp-app.hidden {
  display: none;
}

.wgp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.wgp-topbar h1,
.wgp-topbar h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.wgp-topbar p {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
}

.wgp-logout {
  border: none;
  background: #f1f5f9;
  color: #475569;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.wgp-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.wgp-tab {
  flex: 1;
  border: none;
  background: #f1f5f9;
  padding: 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.wgp-tab.active {
  background: #ea580c;
  color: #fff;
}

.wgp-pane {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 16px 24px;
  -webkit-overflow-scrolling: touch;
}

.wgp-pane--tables,
#wgp-pane-tables {
  padding: 0;
  display: flex;
  flex-direction: column;
}

#wgp-pane-tables .og-tables-block {
  flex: 0 0 auto;
  padding: 10px 12px 48px;
}

#wgp-pane-tables .og-zone-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fafc;
  padding: 10px 0 10px;
  margin: 0;
  gap: 8px;
}

#wgp-pane-tables #og-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  padding: 0;
  margin: 0;
}

#wgp-pane-tables.og-order-mode {
  overflow: hidden;
  padding: 0;
}

#wgp-pane-tables.og-order-mode #og-order-panel {
  flex: 1;
  min-height: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 7.5rem);
}

.wgp-pane.hidden {
  display: none;
}

.wgp-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 14px;
}

.wgp-section-label {
  margin: 12px 0 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.wgp-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.wgp-refresh-btn {
  margin-right: 6px;
}

.wgp-set-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  font-size: 14px;
  font-weight: 700;
}

.wgp-set-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.wgp-set-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wgp-set-row input,
.wgp-set-row select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 480px) {
  .wgp-topbar {
    padding: 10px 12px;
  }
  .wgp-tabs {
    padding: 8px 12px;
  }
  .wgp-tab {
    font-size: 10px;
    padding: 8px 6px;
  }
  .wgp-pane:not(#wgp-pane-tables) {
    padding: 10px 12px 20px;
  }
  #wgp-pane-tables .og-tables-block {
    padding: 8px 10px 56px;
  }
  #wgp-pane-tables #og-tables-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
  }
  .og-order-panel {
    min-height: 240px;
  }
  .wgp-set-row {
    grid-template-columns: 1fr;
  }
}

.og-tables-block.hidden {
  display: none;
}

#wgp-pane-tables.og-order-mode #og-order-panel {
  margin: 0;
  min-height: calc(100dvh - 7.5rem);
  max-height: none;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  background: #f8fafc;
}

.wgp-card.og-order-mode {
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}

.wgp-card.og-order-mode .og-order-panel {
  margin: 0;
  min-height: calc(100dvh - 7.5rem);
  max-height: none;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
}

.og-order-panel.hidden {
  display: none !important;
}

.og-btn-back {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.og-btn-back:active {
  background: #e2e8f0;
}

.og-order-head-text {
  flex: 1;
  min-width: 0;
}

.og-order-no {
  font-size: 14px;
  font-weight: 800;
  color: #94a3b8;
}

#wgp-pane-tables.og-order-mode .og-order-grid,
.wgp-card.og-order-mode .og-order-grid {
  flex: 1;
  min-height: 0;
}

#wgp-pane-tables.og-order-mode .og-prod-grid,
.wgp-card.og-order-mode .og-prod-grid {
  max-height: none;
  flex: 1;
}

#wgp-pane-tables.og-order-mode .og-products-pane,
.wgp-card.og-order-mode .og-products-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 900px) {
  #wgp-pane-tables.og-order-mode .og-order-grid,
  .wgp-card.og-order-mode .og-order-grid {
    grid-template-columns: 1fr 260px;
    align-items: stretch;
  }
  #wgp-pane-tables.og-order-mode .og-prod-grid,
  .wgp-card.og-order-mode .og-prod-grid {
    max-height: calc(100dvh - 18rem);
  }
}

.og-zone-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.og-zone-btn { padding: 8px 14px; border-radius: 999px; border: 2px solid #e2e8f0; background: #fff; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.og-zone-btn.active { background: #ea580c; border-color: #ea580c; color: #fff; }
.og-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  max-height: none !important;
  overflow: visible !important;
  padding: 0;
}
.og-table-card {
  text-align: left;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.og-table-card.og-tbl-fresh { border-color: #22c55e; background: #f0fdf4; }
.og-table-card.og-tbl-warn { border-color: #eab308; background: #fefce8; }
.og-table-card.og-tbl-stale { border-color: #ef4444; background: #fef2f2; }
.og-table-card.og-tbl-selected { border-color: #ea580c; background: #fff7ed; }
.og-tbl-label { display: block; font-size: 9px; font-weight: 800; text-transform: uppercase; color: #94a3b8; }
.og-tbl-no { font-size: 15px; font-weight: 900; }
.og-tbl-meta { display: block; font-size: 10px; font-weight: 700; color: #64748b; margin-top: 4px; }
.og-tbl-amt { display: block; font-size: 11px; font-weight: 800; color: #ea580c; margin-top: 4px; }
.og-order-panel { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 20px; padding: 16px; min-height: 280px; margin-top: 12px; }
.og-order-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #94a3b8; gap: 8px; font-weight: 700; font-size: 13px; min-height: 200px; }
.og-order-head { display: flex; justify-content: flex-start; align-items: center; gap: 12px; margin-bottom: 10px; }
.og-order-kicker { font-size: 10px; font-weight: 800; text-transform: uppercase; color: #94a3b8; margin: 0; }
.og-order-title { margin: 0; font-size: 20px; font-weight: 900; }
.og-order-summary { font-size: 11px; font-weight: 700; color: #475569; padding: 10px 12px; background: #fff; border-radius: 12px; margin-bottom: 12px; }
.og-order-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .og-order-grid { grid-template-columns: 1fr 220px; } }
.og-search { width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid #e2e8f0; margin-bottom: 8px; font-size: 13px; box-sizing: border-box; }
.og-cat-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.og-cat-btn { padding: 6px 12px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; font-size: 10px; font-weight: 800; }
.og-cat-btn.active { background: #0f172a; color: #fff; }
.og-prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; max-height: 240px; overflow-y: auto; }
.og-prod-card { padding: 10px; border-radius: 14px; border: 2px solid #e2e8f0; background: #fff; text-align: center; cursor: pointer; }
.og-prod-name { display: block; font-size: 11px; font-weight: 800; }
.og-prod-price { display: block; font-size: 11px; color: #ea580c; font-weight: 800; margin-top: 4px; }
.og-cart-pane { background: #fff; border-radius: 16px; padding: 12px; border: 1px solid #e2e8f0; }
.og-cart-pane h4 { margin: 0 0 6px; font-size: 10px; text-transform: uppercase; color: #94a3b8; font-weight: 800; }
.og-bill-lines, .og-cart-lines { max-height: 90px; overflow-y: auto; font-size: 11px; margin-bottom: 8px; }
.og-bill-line, .og-cart-line { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.og-cart-rm { border: none; background: #f1f5f9; width: 24px; height: 24px; border-radius: 8px; font-weight: 800; cursor: pointer; }
.og-note { width: 100%; border-radius: 10px; border: 2px solid #e2e8f0; padding: 8px; font-size: 12px; margin-bottom: 8px; box-sizing: border-box; }
.og-cart-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.og-btn-primary { background: #ea580c; color: #fff; border: none; padding: 10px 14px; border-radius: 12px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.og-btn-primary:disabled { opacity: .5; }
.og-btn-soft { background: #f1f5f9; border: none; padding: 8px 12px; border-radius: 12px; font-size: 10px; font-weight: 800; cursor: pointer; }
.og-btn-pay { width: 100%; margin-bottom: 12px; background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; border: none; padding: 16px 20px; border-radius: 16px; font-size: 14px; font-weight: 900; cursor: pointer; }
.og-msg { font-size: 11px; font-weight: 700; min-height: 16px; }
.og-msg.ok { color: #16a34a; }
.og-msg.err { color: #dc2626; }
.og-reports-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.og-rep-periods { display: flex; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 10px; }
.og-rep-p { border: none; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 10px; font-weight: 800; cursor: pointer; }
.og-rep-p.active { background: #fff; color: #ea580c; }
.og-rep-date { padding: 8px 10px; border-radius: 10px; border: 2px solid #e2e8f0; font-size: 12px; }
.og-rep-section-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.og-rep-section-btn { border: 2px solid #e2e8f0; background: #fff; padding: 8px 12px; border-radius: 999px; font-size: 10px; font-weight: 800; cursor: pointer; }
.og-rep-section-btn.active { background: #0f172a; border-color: #0f172a; color: #fff; }
.og-rep-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.og-rep-kpis article { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; }
.og-rep-kpis span { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; color: #94a3b8; }
.og-rep-kpis strong { font-size: 20px; font-weight: 900; }
.og-rep-kpis em { font-size: 10px; font-style: normal; color: #64748b; font-weight: 700; }
.og-rep-finance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.og-rep-finance-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; }
.og-rep-finance-card span { display: block; font-size: 10px; font-weight: 800; color: #94a3b8; text-transform: uppercase; }
.og-rep-finance-card strong { font-size: 18px; font-weight: 900; }
.og-rep-charts { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 768px) { .og-rep-charts { grid-template-columns: 1fr 1fr; } }
.og-rep-chart { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 12px; height: 220px; }
.og-rep-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #f8fafc; border-radius: 10px; margin-bottom: 6px; font-size: 11px; font-weight: 700; }
.og-rep-hint { font-size: 11px; font-weight: 700; color: #64748b; margin-top: 12px; }
