/* odmor-guest-app admin */
* { box-sizing: border-box; }
/* Theme classes go on <html> (not body) so the <html> element itself
   picks up the variables. Otherwise the area outside the body's box
   keeps the :root background. */
:root, html.theme-dark {
  --bg: #0e1116;
  --bg-elev: #161b22;
  --bg-elev-2: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #2f81f7;
  --accent-hover: #1f6feb;
  --success: #3fb950;
  --warn: #d29922;
  --error: #f85149;
  --shadow: 0 4px 14px rgba(0,0,0,.4);
  --radius: 8px;
}
html.theme-light {
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --bg-elev-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-dim: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #059669;
  --warn: #d97706;
  --error: #dc2626;
  --shadow: 0 4px 14px rgba(15,23,42,.08);
}
html.theme-light .login-page {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}
html.theme-light input[type="text"],
html.theme-light input[type="number"],
html.theme-light input[type="email"],
html.theme-light input[type="password"],
html.theme-light input[type="url"],
html.theme-light input[type="date"],
html.theme-light input[type="time"],
html.theme-light textarea,
html.theme-light select {
  background: #ffffff;
}
/* Theme toggle button */
.theme-toggle {
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.theme-toggle:hover { color: var(--text); background: var(--bg-elev); }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Login --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #0e1116 0%, #161b22 100%);
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 .25rem; font-size: 1.5rem; }
.login-card .subtitle { margin: 0 0 1.5rem; color: var(--text-dim); }
.login-card label {
  display: block;
  margin-bottom: 1rem;
}
.login-card label > span {
  display: block;
  margin-bottom: .35rem;
  font-size: .85rem;
  color: var(--text-dim);
}
.login-card input,
.login-card button {
  width: 100%;
}

/* --- Topbar --- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: .65rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand { font-size: 1.1rem; margin: 0; }
.muted { color: var(--text-dim); font-size: .85rem; }
.property-switcher {
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .35rem .65rem;
}

.subscription-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 500;
  background: var(--bg-elev-2);
}
.subscription-badge.ok { color: var(--success); }
.subscription-badge.warn { color: var(--warn); }
.subscription-badge.error { color: var(--error); }

.subscription-banner {
  padding: 10px 16px;
  font-size: .85rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.subscription-banner.warn { background: rgba(210, 153, 34, .12); color: var(--warn); }
.subscription-banner.paused { background: rgba(248, 81, 73, .15); color: var(--error); }

.chip-allow{display:inline-block;background:#eef2ff;color:#4338ca;padding:2px 8px;border-radius:8px;font-size:11px;font-weight:600}

.filter-chip, .sort-chip {
  background: var(--bg-elev-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 16px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
}
.filter-chip:hover, .sort-chip:hover { color: var(--text); }
.filter-chip.active, .sort-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: .25rem;
  padding: .5rem 1.25rem 0;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  background: transparent;
  color: var(--text-dim);
  border: 0;
  padding: .65rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: .9rem;
  white-space: nowrap;
  position: relative;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab .badge {
  display: inline-block;
  background: var(--error);
  color: #fff;
  font-size: .7rem;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}

/* --- Main content --- */
#main {
  padding: 1.5rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.section-header h2 { margin: 0; font-size: 1.25rem; }

/* --- Forms --- */
input, select, textarea, button {
  font-family: inherit;
  font-size: 14px;
}
input[type="text"], input[type="number"], input[type="email"],
input[type="password"], input[type="url"], textarea, select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem .65rem;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
textarea { font-family: inherit; resize: vertical; min-height: 80px; }

.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  border: 0;
  border-radius: var(--radius);
  padding: .5rem 1rem;
  cursor: pointer;
  font-weight: 500;
  transition: background .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #2d333b; }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: var(--bg-elev-2); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #d6342a; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* --- Cards / lists --- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.list { display: flex; flex-direction: column; gap: .75rem; }
.list-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
  align-items: start;
}
.list-item-body { display: flex; flex-direction: column; gap: .25rem; }
.list-item-title { font-weight: 600; }
.list-item-meta { color: var(--text-dim); font-size: .85rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.request-items { color: var(--text); font-size: .9rem; font-weight: 600; margin-top: 2px; }

/* Unanswered chat indicator — small red star next to "message #N" in vendor
   Zahtjevi list. Disappears the moment reception sends a reply; reappears
   if the guest pings again. */
/* Nearby auto-import card — checkbox + count grid */
.nearby-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; margin-bottom: 12px; }
.nearby-cat-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--bg-elev); }
.nearby-cat-row:hover { background: var(--bg-elev-2); }
.nearby-cat-row input[type=checkbox] { margin: 0; }
.nearby-cat-icon { font-size: 16px; }
.nearby-cat-label { flex: 1; font-size: 13px; }
.nearby-cat-count { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.nearby-cat-count input { width: 60px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 13px; }
.nearby-import-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.nearby-replace-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.nearby-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-translate {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; border: 0; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.btn-translate:hover:not(:disabled) { filter: brightness(1.08); }
.btn-translate:disabled { opacity: 0.6; cursor: not-allowed; }

.unanswered-star {
  display: inline-block;
  margin-left: 6px;
  color: #ef4444;
  font-size: 1rem;
  line-height: 1;
  animation: unansweredPulse 1.6s ease-in-out infinite;
}
@keyframes unansweredPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.75; }
}
.list-item-actions { display: flex; gap: .35rem; }
.list-item-actions button { padding: .35rem .65rem; font-size: .8rem; }

/* --- Status badges --- */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
}
.status-pending { background: rgba(210, 153, 34, .15); color: var(--warn); }
.status-confirmed { background: rgba(47, 129, 247, .15); color: var(--accent); }
.status-preparing { background: rgba(47, 129, 247, .25); color: var(--accent); }
.status-delivered { background: rgba(63, 185, 80, .15); color: var(--success); }
.status-cancelled { background: rgba(248, 81, 73, .15); color: var(--error); }

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 100;
}
.toast {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  box-shadow: var(--shadow);
  min-width: 250px;
  max-width: 400px;
  animation: slideUp .25s ease-out;
}
.toast.toast-error { border-left-color: var(--error); }
.toast.toast-success { border-left-color: var(--success); }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* --- Modal --- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin: 0 0 1rem; }
.modal-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* --- Form grid (modal field layout) --- */
.field-grid {
  display: flex; flex-direction: column; gap: 1rem;
}
.field {
  display: flex; flex-direction: column;
}
.field > label {
  font-size: .85rem;
  color: var(--text-dim);
  margin-bottom: .35rem;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.translatable-fields {
  display: flex; flex-direction: column; gap: .5rem;
}
.translatable-fields details { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .35rem .65rem; }
.translatable-fields summary { cursor: pointer; color: var(--text-dim); font-size: .85rem; }
.translatable-fields details[open] summary { margin-bottom: .5rem; }

.error { color: var(--error); }
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}
.muted-block { color: var(--text-dim); }

/* --- QR --- */
.qr-card { display: flex; align-items: center; gap: 1rem; }
.qr-card img { background: #fff; padding: 8px; border-radius: var(--radius); }
.qr-url { font-family: monospace; font-size: .85rem; word-break: break-all; }

.qr-tokens { display: flex; flex-direction: column; gap: 16px; }
.qr-multi-card { display: flex; flex-direction: column; gap: 16px; }
.qr-multi-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.qr-codes-row { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.qr-code-box { background: #fff; border-radius: 12px; padding: 14px; text-align: center; min-width: 268px; }
.qr-code-box.qr-code-empty { background: transparent; border: 1px dashed var(--border); }
.qr-code-title { font-size: 14px; color: #475569; margin-bottom: 8px; font-weight: 600; }
.qr-code-box img { display: block; margin: 0 auto; }
.qr-link-row { display: flex; flex-direction: column; gap: 6px; }
.qr-link-label { font-size: 13px; color: var(--text-dim); }
.qr-link-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qr-link-value a { color: var(--accent); font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; flex: 1; min-width: 0; }
.qr-copy-btn { padding: 4px 10px; font-size: 14px; }
.qr-print-row { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.qr-print-label { font-size: 13px; color: var(--text-dim); }
.qr-print-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.qr-print-actions .btn-secondary { flex: 1; min-width: 160px; padding: 12px 18px; border-radius: 999px; }

/* --- Room Service tab --- */
.rs-header { align-items: center; }
.rs-toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.rs-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.rs-toggle-slider { width: 44px; height: 24px; background: #6b7280; border-radius: 999px; position: relative; transition: background .2s; }
.rs-toggle-slider::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s; }
.rs-toggle input:checked + .rs-toggle-slider { background: var(--accent); }
.rs-toggle input:checked + .rs-toggle-slider::after { transform: translateX(20px); }

/* Room Service working-hours card — modern indigo theme, dark/light aware. */
.rs-hours-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(15, 23, 42, 0.35));
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
html.theme-light .rs-hours-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(248, 250, 252, 0.7));
  border-color: rgba(99, 102, 241, 0.18);
}

.rs-hours-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.rs-hours-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25) inset;
}
html.theme-light .rs-hours-icon {
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.18) inset;
}
.rs-hours-headtext { min-width: 0; }
.rs-hours-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 2px;
}
.rs-hours-help {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

.rs-hours-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.rs-hours-grid .field { display: flex; flex-direction: column; }
.rs-hours-grid .field span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.rs-hours-grid input[type=time] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.rs-hours-grid input[type=time]:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.rs-days-wrap { display: flex; flex-direction: column; gap: 8px; }
.rs-days-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.rs-days-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-day-chip {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.rs-day-chip:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--accent);
}
.rs-day-chip input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  border: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.rs-day-chip:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.rs-day-chip:has(input:checked):hover { color: #fff; }
.rs-days-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}
.rs-categories-mount { margin-top: 16px; }

/* --- Uputstvo (vendor help) tab --- */
.uputstvo-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) {
  .uputstvo-layout { grid-template-columns: 1fr; }
  .uputstvo-toc { position: static; max-height: none; }
}
.uputstvo-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.uputstvo-toc-heading { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--text-dim); margin-bottom: 10px; }
.uputstvo-toc-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-radius: 6px; color: var(--text-dim); font-size: 13px; line-height: 1.35; text-decoration: none; }
.uputstvo-toc-item:hover { background: var(--bg-elev-2); color: var(--text); }
.uputstvo-toc-num { font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 22px; color: var(--text-dim); }
.uputstvo-toc-icon { flex-shrink: 0; }
.uputstvo-content { min-width: 0; }
.uputstvo-section { margin-bottom: 36px; scroll-margin-top: 16px; }
.uputstvo-section-title { font-size: 20px; font-weight: 700; margin: 0 0 12px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.uputstvo-body { font-size: 14px; line-height: 1.6; color: var(--text); }
.uputstvo-body p { margin: 0 0 10px; }
.uputstvo-body h4 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; color: var(--text); }
.uputstvo-body ul, .uputstvo-body ol { padding-left: 22px; margin: 0 0 10px; }
.uputstvo-body li { margin: 4px 0; }
.uputstvo-body code { background: var(--bg-elev-2); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; color: var(--accent); }
.uputstvo-body a { color: var(--accent); }
.uputstvo-body .tip { background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.3); border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 13px; color: var(--text); }
.uputstvo-body .tip b { color: #fbbf24; }

/* --- New chat to guest picker --- */
.chat-guest-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 2px 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}
.chat-guest-row:hover { background: var(--bg-elev-2); }
.chat-guest-row.selected { background: rgba(47,129,247,.12); border-color: var(--accent); }
.chat-guest-pick { font-size: 12px; color: var(--accent); white-space: nowrap; }

/* --- Multi-WiFi editor --- */
.wifi-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.wifi-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg-elev-2); }
.wifi-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wifi-row-num { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.wifi-row-fields { gap: 6px; }
.wifi-remove { padding: 2px 10px; font-size: 16px; line-height: 1; border-radius: 6px; }
.wifi-remove:disabled { opacity: 0.3; cursor: not-allowed; }

/* --- Address + map widget (Property settings) --- */
.addr-map-widget { display: flex; flex-direction: column; gap: 10px; }
.addr-map-input-row { position: relative; }
.addr-map-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text); font-size: 14px;
}
.addr-map-input:focus { outline: none; border-color: var(--accent); }
.addr-map-suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px;
  max-height: 240px; overflow-y: auto; z-index: 1000;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.addr-map-suggestion {
  display: block; width: 100%; text-align: left; background: transparent;
  border: 0; border-bottom: 1px solid var(--border); padding: 8px 12px;
  color: var(--text); font-size: 13px; cursor: pointer; font-family: inherit;
  line-height: 1.4;
}
.addr-map-suggestion:hover { background: var(--bg-elev-2); }
.addr-map-suggestion:last-child { border-bottom: 0; }
.addr-map-empty { padding: 12px; color: var(--text-dim); font-size: 13px; text-align: center; }
.addr-map { height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.addr-map-readout { font-size: 13px; color: var(--text-dim); }
.addr-map-readout code { background: var(--bg-elev-2); padding: 2px 6px; border-radius: 4px; color: var(--text); }
.addr-map-help { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.addr-map-err { padding: 20px; text-align: center; color: var(--error); }

/* --- Settings tabs (sub-sections) --- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 760px) {
  .settings-grid { grid-template-columns: 1fr 1fr; }
}

/* ─────────────────────────────────────────────────────────────────
 * Mobile optimization (≤ 640px)
 * Tighten padding, stack 2-col grids, hide non-essential topbar text,
 * keep tabs horizontally scrollable. Touch targets are kept ≥ 36px high.
 * ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Topbar: allow wrap, hide username text (avatar + Odjava is enough),
     shrink brand + theme button + property switcher. */
  .topbar {
    flex-wrap: wrap;
    padding: .55rem .75rem;
    gap: .5rem;
  }
  .topbar-left, .topbar-right { gap: .5rem; min-width: 0; }
  .topbar-left { flex: 1 1 100%; }
  .topbar-right { flex: 1 1 100%; justify-content: space-between; }
  .brand { font-size: 1rem; }
  .property-switcher {
    flex: 1; min-width: 0; max-width: 100%;
    text-overflow: ellipsis; padding: .3rem .5rem; font-size: .85rem;
  }
  #current-user { display: none; } /* email overflows; user already knows who they are */
  .theme-toggle { padding: 4px 10px; font-size: .8rem; }
  .subscription-badge { font-size: .75rem; padding: 3px 8px; }

  /* Tabs: tighter horizontal padding so more tabs visible before scroll. */
  .tabs { padding: .35rem .5rem 0; gap: 0; }
  .tab { padding: .55rem .65rem; font-size: .85rem; }

  /* Main content: reclaim horizontal space and the top margin. */
  #main { padding: 1rem .75rem; }
  .section-header { flex-wrap: wrap; gap: .5rem; }
  .section-header h2 { font-size: 1.05rem; }

  /* Action button rows shouldn't overflow — wrap and shrink. */
  .section-header > div { flex-wrap: wrap; }
  .btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
    padding: .5rem .8rem; font-size: .85rem;
  }

  /* List items: stack body above actions instead of side-by-side
     (action row can have 3-4 buttons; they wrap into 2 lines and
     overflow horizontally otherwise). */
  .list-item { grid-template-columns: 1fr; }
  .list-item-actions { flex-wrap: wrap; justify-content: flex-end; }
  .list-item-actions button { padding: .4rem .65rem; }

  /* Modals + popups full-width with breathing room. */
  .modal-backdrop { padding: .5rem; }
  .modal { padding: 1rem; max-height: 95vh; }
  .modal h3 { font-size: 1rem; margin-bottom: .75rem; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions button { flex: 1; min-width: 0; }

  /* 2-column field rows collapse. */
  .field-row { grid-template-columns: 1fr; gap: .5rem; }

  /* Room Service hours card: stack open/close pickers, keep day chips dense. */
  .rs-hours-card { padding: 12px; }
  .rs-hours-grid { grid-template-columns: 1fr !important; gap: 8px; }
  .rs-day-chip { padding: 5px 10px; font-size: 12px; }

  /* Multi-WiFi rows: stack the 4 fields. */
  .wifi-row { padding: 8px 10px; }
  .wifi-row-fields { gap: 4px; }

  /* QR Kodovi: smaller boxes side-by-side (still wraps if extra tight). */
  .qr-multi-header { gap: 8px; }
  .qr-codes-row { gap: 12px; padding: 10px 0; }
  .qr-code-box { min-width: 0; padding: 10px; max-width: 100%; }
  .qr-code-box img { max-width: 100%; height: auto; }
  .qr-print-actions { flex-direction: column; }
  .qr-print-actions .btn-secondary { width: 100%; min-width: 0; flex: 0 0 auto; }
  .qr-link-value { font-size: 12px; }

  /* Uputstvo: TOC already collapses at 900px; tighten section spacing. */
  .uputstvo-section { margin-bottom: 24px; }
  .uputstvo-section-title { font-size: 17px; }
  .uputstvo-body { font-size: 13px; }

  /* Toasts: bottom-center, not overlapping floating bell on the right. */
  .toast-container { left: 1rem; right: 1rem; bottom: .5rem; }
  .toast { min-width: 0; max-width: 100%; }

  /* Chat-guest picker rows: more breathing room for tap. */
  .chat-guest-row { padding: 12px; }

  /* Subscription banner: smaller text. */
  .subscription-banner { font-size: .8rem; padding: 8px 12px; }
}

/* ---------- Integracije tab ---------- */
.integration-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 24px;
  max-width: 760px;
}
.integration-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}
.integration-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.integration-warning {
  padding: 14px;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 8px;
  color: #92400e;
}
.integration-chats { margin: 20px 0; }
.integration-chats h4 { margin: 0 0 12px; font-size: 14px; color: var(--text-muted, #64748b); }
.chat-list { list-style: none; padding: 0; margin: 0; }
.chat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  margin-bottom: 8px;
}
.chat-info { display: flex; flex-direction: column; gap: 2px; }
.chat-meta { font-size: 12px; }
.integration-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.integration-help {
  margin-top: 20px;
  padding: 12px;
  background: var(--bg-subtle, #f8fafc);
  border-radius: 8px;
  font-size: 14px;
}
.integration-help summary { cursor: pointer; font-weight: 600; }
.integration-help ol { margin: 8px 0 0; padding-left: 20px; }
.integration-help li { margin: 4px 0; }

/* Routing tag pill on chat row */
.tag-pill {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(14, 165, 233, 0.15);
  color: #0369a1;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
.integration-link-form {
  margin: 16px 0;
  padding: 14px;
  background: var(--bg-subtle, #f8fafc);
  border-radius: 8px;
}
.integration-link-form label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 13px; }
.select-tag {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card-bg, #fff);
  font-size: 13px;
}
.integration-routing {
  padding: 14px;
  background: var(--bg-subtle, #f8fafc);
  border-radius: 8px;
}
.integration-routing summary { cursor: pointer; font-weight: 600; }
.routing-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.routing-table th, .routing-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-size: 13px;
}
.routing-table th { font-weight: 600; color: var(--text-muted, #64748b); font-size: 11px; text-transform: uppercase; }
.routing-select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card-bg, #fff);
  font-size: 13px;
  min-width: 160px;
}
