@import url('/css/panel.css');

.pwa-install-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 0;
  padding: 0.85rem 2.5rem 0.85rem 1rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 1px solid #e85d04;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.pwa-install-banner.hidden {
  display: none;
}

.pwa-install-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.pwa-install-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.pwa-install-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.owner-login-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.owner-login-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.owner-login-brand h1 {
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.owner-login-biz {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #38bdf8;
}

.owner-login-biz.hidden {
  display: none;
}

.owner-login-brand #login-sub {
  margin-bottom: 0.5rem;
}

.owner-fiscal-intro {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.hub-fiscal-actions + .owner-license-msg {
  margin-top: 1rem;
}

.fiscal-diagnostics {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.45);
}

.fiscal-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.fiscal-status-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.fiscal-conn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.fiscal-conn-badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
}

.fiscal-conn-badge.connected {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.fiscal-conn-badge.disconnected {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.fiscal-conn-badge.unknown,
.fiscal-conn-badge.testing {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.fiscal-diag-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fiscal-diag-actions .btn {
  margin-bottom: 0;
}

.fiscal-diag-msg {
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.fiscal-diag-msg.ok {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.fiscal-diag-msg.err {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.fiscal-diag-suggestions {
  margin: 0.65rem 0 0 1.1rem;
  padding: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

.fiscal-diag-suggestions li {
  margin-bottom: 0.25rem;
}

.owner-login-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.owner-auth-form.hidden {
  display: none;
}

.owner-forgot-link {
  width: 100%;
  margin-top: 0.65rem;
  font-size: 0.85rem;
}

.owner-reset-hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.alert-ok {
  background: #052e16;
  color: #86efac;
  border: 1px solid #166534;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.alert-ok.hidden {
  display: none;
}

.owner-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.owner-stat .val { color: #38bdf8; }

.order-card {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.65rem;
}

.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.order-card-title {
  font-weight: 700;
  font-size: 1rem;
}

.order-card-total {
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
}

.order-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.order-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.order-items-table th,
.order-items-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.order-items-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
}

.order-items-table td.num {
  text-align: right;
  white-space: nowrap;
}

.order-items-empty {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.filter-row select {
  margin-bottom: 0;
  flex: 1;
  min-width: 130px;
}

.report-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}

.report-bar .bar {
  flex: 1;
  height: 8px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
}

.report-bar .fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 4px;
}

.filter-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: flex-end;
}

.filter-row input { margin-bottom: 0; flex: 1; min-width: 130px; }

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.zreport-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.zreport-stat {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.zreport-stat .lbl {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zreport-stat .val {
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 0.2rem;
}

.zreport-vat table {
  width: 100%;
  font-size: 0.85rem;
}

.zreport-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.zreport-history {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.zreport-history-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.menu-add-row {
  align-items: flex-end;
}

.menu-add-row .btn {
  margin-bottom: 0;
  white-space: nowrap;
}

.menu-owner-table input,
.menu-owner-table select {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.menu-owner-table .menu-price-input {
  max-width: 5.5rem;
}

.menu-status {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.menu-status.active {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.menu-status.inactive {
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
}

.menu-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.menu-owner-table tr.inactive-row {
  opacity: 0.65;
}

.venue-owner-table .venue-edit-count {
  max-width: 4.5rem;
}

.venue-owner-table select {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}
.filter-row button { margin-bottom: 0; }

.live-tables-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.live-updated-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.live-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.live-table-card {
  border-radius: var(--radius);
  padding: 0.75rem;
  border: 2px solid transparent;
  min-height: 5.5rem;
}

.live-table-card.free {
  background: #0f1f17;
  border-color: #22c55e;
}

.live-table-card.occupied {
  background: #2a1a0a;
  border-color: #f59e0b;
}

.live-table-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.live-table-status {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.live-table-card.occupied .live-table-status {
  color: #fcd34d;
}

.live-table-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.live-table-items {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

.live-table-items li {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.35);
  padding: 0.2rem 0;
}

.live-table-total {
  margin-top: 0.45rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fbbf24;
  text-align: right;
}

@media (max-width: 640px) {
  .live-tables-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.links-card { margin-bottom: 1rem; }
.links-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.4;
}
.link-row { margin-bottom: 0.75rem; }
.link-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.link-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.link-actions input {
  flex: 1;
  min-width: 200px;
  font-family: monospace;
  font-size: 16px;
}

.mono-input {
  width: 100%;
  font-family: monospace;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.owner-license-status {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  border: 1px solid var(--border);
}

.owner-license-status.active {
  background: rgba(34, 197, 94, 0.12);
  border-color: #22c55e;
  color: #86efac;
}

.owner-license-status.inactive {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #fca5a5;
}

.owner-license-status.pending {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
}

.owner-license-save {
  width: 100%;
  min-height: 48px;
  margin-top: 0.5rem;
}

.owner-license-note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.owner-license-msg {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.owner-license-msg.ok { color: #86efac; }
.owner-license-msg.err { color: #fca5a5; }

.kiosk-qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 0.75rem;
}

.kiosk-qr-card {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem;
  text-align: center;
}

.kiosk-qr-card img {
  width: 100%;
  max-width: 140px;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
  background: #fff;
  border-radius: 6px;
  padding: 4px;
}

.kiosk-qr-table {
  font-weight: 800;
  font-size: 1.1rem;
  color: #38bdf8;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.public-page-form textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0b1220;
  color: inherit;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.public-logo-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.public-logo-preview-wrap {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.public-logo-preview,
.public-logo-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.public-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1220;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.public-logo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.public-logo-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.menu-photo-cell {
  min-width: 7.5rem;
  vertical-align: top;
}

.menu-photo-thumb {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #0b1220;
  border: 1px solid var(--border);
}

.menu-photo-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1220;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 1.35rem;
}

.menu-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.menu-photo-upload {
  cursor: pointer;
}

.public-hours-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.public-hours-row {
  display: grid;
  grid-template-columns: 5.5rem 5rem 1fr auto 1fr;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.82rem;
}

.public-hours-day {
  font-weight: 700;
  color: var(--muted);
}

.public-hours-closed {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.public-hours-row input[type="time"] {
  width: 100%;
  padding: 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: inherit;
  font-size: 0.8rem;
}

.public-hours-sep {
  text-align: center;
  color: var(--muted);
}

@media (max-width: 520px) {
  .public-hours-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .public-hours-day { grid-column: 1 / -1; }
  .public-hours-closed { grid-column: 1 / -1; }
  .public-hours-sep { display: none; }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .header h1 { font-size: 1rem; }
}
