/* 360° Tour Creator — app styles (light management UI).
   Black & white only. Status is shown by fill vs. outline, never by hue. */

:root {
  --black: #000;
  --white: #fff;
  --canvas: #f2f2f2;
  --line: #e5e5e5;
  --line-strong: #cfcfcf;
  --muted: #737373;
  --faint: #a3a3a3;
  --hover: #f5f5f5;

  --r-pill: 999px;
  --r-field: 14px;
  --r-surface: 22px;
  --r-dialog: 28px;

  --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--black);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
.figure-value { font-variant-numeric: tabular-nums; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
::selection { background: var(--black); color: var(--white); }

/* ── Brand mark ─────────────────────────────────────────────────────────── */
.logo-mark { display: block; flex-shrink: 0; }
.auth-card .logo-mark { margin-bottom: 28px; }
.auth-art .brand { position: relative; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand-company { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* ── App shell ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(242, 242, 242, .86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px;
}
.nav { display: flex; gap: 4px; padding: 4px; margin-left: auto; background: var(--white); border-radius: var(--r-pill); border: 1px solid var(--line); }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--muted);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav a:hover { color: var(--black); background: var(--hover); }
.nav a.active { background: var(--black); color: var(--white); }
.nav a i { font-size: 13px; }
.nav-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--black); color: var(--white); font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.nav a.active .nav-count { background: var(--white); color: var(--black); }
.detail-list { display: grid; grid-template-columns: 110px 1fr; gap: 10px 16px; font-size: 14px; margin-bottom: 18px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { word-break: break-word; }
.detail-message { white-space: pre-wrap; background: var(--canvas); border-radius: 16px; padding: 16px 18px; font-size: 14px; line-height: 1.6; margin-bottom: 18px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 4px 14px 4px 4px; cursor: pointer; font: inherit; color: inherit;
}
.user-btn:hover { border-color: var(--line-strong); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--black); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.avatar-light { background: var(--canvas); color: var(--black); }
.user-btn-name { font-size: 14px; font-weight: 500; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .08);
  display: none;
}
.user-menu.open .user-dropdown { display: block; animation: pop .16s var(--ease); }
.user-dropdown-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-dropdown-head strong { display: block; font-size: 14px; font-weight: 600; }
.user-dropdown-head span { font-size: 13px; color: var(--muted); }
.user-dropdown a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  font-size: 14px; text-decoration: none;
}
.user-dropdown a:hover { background: var(--hover); }
.user-dropdown a i { width: 16px; color: var(--muted); }

.page { max-width: 1200px; margin: 0 auto; padding: 24px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 20px 0 28px; flex-wrap: wrap; }
.page-title { font-size: 40px; line-height: 1.05; font-weight: 600; letter-spacing: -.035em; }
.page-sub { color: var(--muted); margin-top: 8px; font-size: 15px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Surfaces ───────────────────────────────────────────────────────────── */
.surface { background: var(--white); border-radius: var(--r-surface); padding: 28px; }
.surface + .surface { margin-top: 16px; }
.grid-2 > .surface + .surface { margin-top: 0; }
.surface-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.surface-title { font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.surface-desc { color: var(--muted); font-size: 14px; margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* Dashboard figures: one black band, numbers divided by hairlines */
.figures {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--black); color: var(--white);
  border-radius: var(--r-surface); padding: 8px; margin-bottom: 16px;
}
.figure { padding: 22px 22px 20px; }
.figure + .figure { border-left: 1px solid rgba(255, 255, 255, .16); }
.figure-value { font-size: 44px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.figure-label { margin-top: 10px; font-size: 14px; color: rgba(255, 255, 255, .6); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1;
  border-radius: var(--r-pill); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn i { font-size: 13px; }
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: #262626; }
.btn-secondary { background: var(--white); color: var(--black); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--black); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--black); background: var(--hover); }
.btn-danger:hover { color: var(--white); background: var(--black); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-icon { width: 34px; padding: 0; }
.btn-block { width: 100%; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.form-label a { font-weight: 400; color: var(--muted); text-decoration: none; }
.form-label a:hover { color: var(--black); }
.form-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; height: 46px; padding: 0 16px;
  background: var(--white); color: var(--black);
  border: 1px solid var(--line-strong); border-radius: var(--r-field);
  font: inherit; font-size: 15px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-textarea { height: auto; min-height: 96px; padding: 12px 16px; resize: vertical; }
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--faint); }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--black); box-shadow: 0 0 0 4px rgba(0, 0, 0, .06); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--faint); }
.form-select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.form-divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0 20px; }
.form-section { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

.input-group { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-field); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.input-group:focus-within { border-color: var(--black); box-shadow: 0 0 0 4px rgba(0, 0, 0, .06); }
.input-group-prefix { display: flex; align-items: center; padding: 0 0 0 16px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.input-group .form-input { border: 0; box-shadow: none; padding-left: 2px; border-radius: 0; }

/* ── Status pills ───────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--muted); background: var(--white);
}
.pill-solid { background: var(--black); border-color: var(--black); color: var(--white); }
.pill-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Notices ────────────────────────────────────────────────────────────── */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-radius: 16px; font-size: 14px; margin-bottom: 20px;
  background: var(--white); border: 1px solid var(--line-strong);
}
.notice i { margin-top: 3px; }
.notice-error { background: var(--black); color: var(--white); border-color: var(--black); }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 56px 20px; }
.empty-ring {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px;
  border: 1.5px dashed var(--line-strong);
  display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 22px;
}
.empty-title { font-size: 17px; font-weight: 600; }
.empty-text { color: var(--muted); font-size: 14px; margin: 4px 0 20px; }

/* ── Tables (plain + DataTables) ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list, table.dataTable { width: 100% !important; border-collapse: collapse !important; }
table.list th, table.dataTable thead th {
  text-align: left; font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 0 16px 12px !important; border-bottom: 1px solid var(--line) !important; background: none;
  white-space: nowrap;
}
table.list td, table.dataTable tbody td {
  padding: 16px !important; border-bottom: 1px solid var(--line) !important;
  font-size: 14px; vertical-align: middle; background: none;
}
table.list tbody tr:last-child td, table.dataTable tbody tr:last-child td { border-bottom: 0 !important; }
table.list tbody tr:hover td, table.dataTable tbody tr:hover td { background: var(--hover); }
table.list tbody tr td:first-child, table.dataTable tbody tr td:first-child { border-radius: 14px 0 0 14px; }
table.list tbody tr td:last-child, table.dataTable tbody tr td:last-child { border-radius: 0 14px 14px 0; }
table.dataTable.no-footer { border-bottom: 0 !important; }
/* neutralise DataTables' default stripes and sorted-column tint */
table.dataTable.display > tbody > tr > *, table.dataTable.display > tbody > tr.odd > *,
table.dataTable.display > tbody > tr > .sorting_1, table.dataTable.order-column > tbody > tr > .sorting_1,
table.dataTable.stripe > tbody > tr.odd > *, table.dataTable.hover > tbody > tr:hover > *,
table.dataTable.display > tbody > tr:hover > * { box-shadow: none !important; background: none; }
table.dataTable.display > tbody > tr:hover > * { background: var(--hover) !important; }
table.dataTable thead th.sorting, table.dataTable thead th.sorting_asc, table.dataTable thead th.sorting_desc { cursor: pointer; }
table.dataTable thead > tr > th.sorting::before, table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::before, table.dataTable thead > tr > th.sorting_asc::after,
table.dataTable thead > tr > th.sorting_desc::before, table.dataTable thead > tr > th.sorting_desc::after { color: var(--black); }

.row-title { font-weight: 600; text-decoration: none; display: block; letter-spacing: -.01em; }
.row-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cell-muted { color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.dt-right { text-align: right; }
.person { display: flex; align-items: center; gap: 12px; font-weight: 500; }

.dataTables_wrapper { background: var(--white); border-radius: var(--r-surface); padding: 20px 12px 12px; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { padding: 0 8px 18px; color: var(--muted); font-size: 14px; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select {
  height: 38px; border: 1px solid var(--line-strong) !important; border-radius: var(--r-pill) !important;
  padding: 0 16px !important; font: inherit; font-size: 14px; background: var(--white); color: var(--black); outline: none; margin-left: 8px;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--black) !important; }
.dataTables_wrapper .dataTables_info { padding: 18px 8px 4px !important; color: var(--muted) !important; font-size: 13px; }
.dataTables_wrapper .dataTables_paginate { padding: 12px 8px 4px !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 0 !important; border-radius: var(--r-pill) !important; background: none !important;
  color: var(--muted) !important; padding: 6px 12px !important; margin: 0 2px !important; font-size: 13px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--hover) !important; color: var(--black) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover { background: var(--black) !important; color: var(--white) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .35; }
.dataTables_empty { color: var(--muted); text-align: center !important; padding: 40px 16px !important; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: flex-start; justify-content: center; padding: 72px 16px; overflow-y: auto;
  background: rgba(0, 0, 0, .32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  width: 100%; max-width: 540px; background: var(--white); border-radius: var(--r-dialog);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .18); animation: pop .2s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 26px 28px 6px; }
.modal-title { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--canvas);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--black);
}
.modal-close:hover { background: var(--line); }
.modal-body { padding: 18px 28px 8px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 28px 26px; }

/* Share dialog */
.share-block { background: var(--canvas); border-radius: 18px; padding: 18px; margin-bottom: 12px; }
.share-block-title { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 12px; }
.share-row { display: flex; gap: 8px; align-items: flex-start; }
.share-code {
  flex: 1; min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--black);
  resize: none; outline: none;
}
.share-qr { display: block; margin: 0 auto; border-radius: 12px; background: var(--white); padding: 10px; }
.share-block-qr { display: flex; gap: 18px; align-items: center; }
.share-block-qr .share-qr { margin: 0; padding: 8px; flex-shrink: 0; }
.share-qr-text { font-size: 13px; color: var(--muted); line-height: 1.45; }
.share-qr { width: 156px; height: 156px; }
@media (max-width: 480px) { .share-block-qr { flex-direction: column; align-items: flex-start; } }
.share-qr svg { display: block; width: 100%; height: 100%; }
.share-qr-dl { display: inline-block; margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--black); text-decoration: underline; text-underline-offset: 3px; }
.share-code { scrollbar-width: none; }
.share-code::-webkit-scrollbar { display: none; }

/* ── SweetAlert2 (toasts, confirms) ─────────────────────────────────────── */
.swal2-popup { font-family: var(--font) !important; border-radius: var(--r-dialog) !important; padding: 28px !important; }
.swal2-title { color: var(--black) !important; font-size: 22px !important; font-weight: 600 !important; letter-spacing: -.02em; }
.swal2-html-container { color: var(--muted) !important; font-size: 15px !important; }
.swal2-icon.swal2-warning, .swal2-icon.swal2-error, .swal2-icon.swal2-question, .swal2-icon.swal2-info { border-color: var(--black) !important; color: var(--black) !important; }
.swal2-icon.swal2-error [class^='swal2-x-mark-line'] { background: var(--black) !important; }
.swal2-actions { gap: 8px; }
.swal2-styled { border-radius: var(--r-pill) !important; font-family: var(--font) !important; font-size: 14px !important; font-weight: 500 !important; padding: 11px 22px !important; margin: 0 !important; box-shadow: none !important; }
.swal2-styled.swal2-confirm { background: var(--black) !important; color: var(--white) !important; }
.swal2-styled.swal2-cancel { background: var(--white) !important; color: var(--black) !important; border: 1px solid var(--line-strong) !important; }

/* ── Auth pages (login, password reset, register) ───────────────────────── */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--white);
}
.auth-art {
  background: var(--black); color: var(--white); position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px;
}
.auth-art-rings { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.auth-art-rings span { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14); }
.auth-art-rings span:nth-child(1) { width: 260px; height: 260px; }
.auth-art-rings span:nth-child(2) { width: 480px; height: 480px; border-style: dashed; animation: turn 120s linear infinite; }
.auth-art-rings span:nth-child(3) { width: 720px; height: 720px; }
@keyframes turn { to { transform: rotate(360deg); } }
.auth-art-degree { position: relative; font-size: clamp(88px, 11vw, 168px); font-weight: 600; letter-spacing: -.06em; line-height: .9; }
.auth-art-line { position: relative; font-size: 17px; color: rgba(255, 255, 255, .7); max-width: 320px; }
.auth-art .brand-name { color: var(--white); position: relative; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-title { font-size: 34px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.auth-desc { color: var(--muted); margin: 10px 0 30px; }
.auth-foot { margin-top: 24px; font-size: 14px; color: var(--muted); }
.auth-foot a { color: var(--black); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.auth-success { text-align: left; }
.auth-success .empty-ring { margin: 0 0 20px; border-style: solid; border-color: var(--black); color: var(--black); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figure:nth-child(3) { border-left: 0; }
  .figure:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .16); }
  .grid-2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 240px; padding: 28px; }
  .auth-art-rings span:nth-child(3) { display: none; }
}
/* Medium widths: navigation and account sit side by side without covering the logo */
.topbar .brand { flex-shrink: 0; }
@media (max-width: 1100px) and (min-width: 761px) {
  .nav a i { display: none; }
  .user-btn-name { display: none; }
  .user-btn { padding: 4px; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  .user-menu { margin-left: auto; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 1; justify-content: center; padding: 8px 10px; font-size: 13px; }
  .nav a i { display: none; }
  .dataTables_wrapper { overflow-x: auto; padding: 16px 8px 8px; }
  .dataTables_wrapper table.dataTable { min-width: 640px; }
  .dataTables_wrapper .dataTables_length { display: none; }
  .dataTables_wrapper .dataTables_filter { float: none; text-align: left; position: sticky; left: 0; }
  .dataTables_wrapper .dataTables_filter input { width: 100%; margin-left: 0; }
  .dataTables_wrapper .dataTables_filter label { display: block; }
  .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { float: none; text-align: center; position: sticky; left: 0; }
  .user-btn-name, .brand-company { display: none; }
  .user-btn { padding: 4px; }
  .page { padding: 8px 16px 48px; }
  .page-title { font-size: 32px; }
  .surface { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .figure-value { font-size: 34px; }
  .hide-sm { display: none !important; }
  .modal-overlay { padding: 24px 12px; }
  .modal-header, .modal-body, .modal-footer { padding-left: 20px; padding-right: 20px; }
}
/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 2000;
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 20px 0 16px; border-radius: 999px;
  background: var(--black); color: var(--white); font-family: var(--font); font-size: 14px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast i {
  width: 20px; height: 20px; border-radius: 50%; background: var(--white); color: var(--black);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── CRM ────────────────────────────────────────────────────────────────── */
.modal-box.modal-wide { max-width: 720px; }
.form-label-hint { font-weight: 400; color: var(--faint); }

/* segmented control (views, status) */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-pill); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-wrap { flex-wrap: wrap; border-radius: 22px; background: var(--canvas); border-color: transparent; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-pill);
  background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.seg-btn:hover { color: var(--black); background: var(--hover); }
.seg-wrap .seg-btn:hover { background: var(--white); }
.seg-btn.active, .seg-wrap .seg-btn.active { background: var(--black); color: var(--white); }
.seg-count { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .6; }

.crm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.crm-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-kind { width: auto; height: 44px; border-radius: var(--r-pill); font-size: 14px; border-color: var(--line); padding-left: 18px; }

/* status pills: progress reads as outline → filled, never by hue */
.crm-status-neu { border-style: dashed; }
.crm-status-kontaktiert, .crm-status-gespraech, .crm-status-angebot { color: var(--black); }
.crm-status-angebot { border-color: var(--black); }
.crm-status-kunde { background: var(--black); border-color: var(--black); color: var(--white); }
.crm-status-potenziell { border-style: dashed; }
.crm-status-interesse { color: var(--black); }
.crm-status-abschluss { background: var(--black); border-color: var(--black); color: var(--white); }
.crm-close { margin-top: 12px; }
.check-inline { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.check-inline .check-row { align-items: center; }
.check-inline .check-row input { margin-top: 0; }
.crm-status-kein_interesse { color: var(--faint); border-color: var(--line); text-decoration: line-through; }

.due { font-weight: 500; }
.due-today { font-weight: 600; }
.due-over { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--black); color: var(--white); font-size: 12px; font-weight: 600; }

/* radio chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span, .chip-btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--white); font: inherit; font-size: 14px; font-weight: 500; color: var(--black);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.chip span:hover, .chip-btn:hover { border-color: var(--black); }
.chip input:checked + span, .chip-btn.active { background: var(--black); border-color: var(--black); color: var(--white); }
.chip input:focus-visible + span { outline: 2px solid var(--black); outline-offset: 2px; }
.chips-sm .chip-btn { height: 30px; padding: 0 12px; font-size: 13px; }

/* detail dialog */
.crm-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); margin: -6px 0 14px; }
.crm-section { margin-top: 24px; }
.crm-section-title { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.crm-card { margin-top: 20px; background: var(--canvas); border-radius: 20px; padding: 18px; }
.crm-card-over { background: var(--black); color: var(--white); }
.crm-card-over .crm-section-title { color: rgba(255, 255, 255, .6); }
.crm-card-over .chip-btn { background: transparent; border-color: rgba(255, 255, 255, .35); color: var(--white); }
.crm-card-over .chip-btn.active, .crm-card-over .chip-btn:hover { background: var(--white); color: var(--black); border-color: var(--white); }
.crm-card-over .btn-secondary { background: var(--white); border-color: var(--white); }
.crm-card-over .btn-primary { background: var(--white); color: var(--black); }
.crm-card-over .form-input { border-color: transparent; }
.crm-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.crm-card-head .crm-section-title { margin-bottom: 2px; }
.crm-next { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.crm-next-form .chips { margin-bottom: 10px; }
.crm-next-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; }
.crm-next-row .form-input, .crm-log-row .form-input { height: 42px; }
.crm-log-text { margin-top: 10px; min-height: 80px; }
.crm-log-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.crm-log-date { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.crm-log-date .form-input { width: 170px; }
.crm-empty { font-size: 14px; }
.crm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.timeline { list-style: none; position: relative; }
.timeline::before { content: ''; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: flex; gap: 14px; padding: 6px 0 14px; }
.timeline-icon {
  position: relative; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--white); border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.timeline-main { flex: 1; min-width: 0; padding-top: 7px; }
.timeline-head { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.timeline-head span { color: var(--muted); font-size: 13px; }
.timeline-del { margin-left: auto; border: 0; background: none; color: var(--faint); cursor: pointer; width: 26px; height: 26px; border-radius: 50%; opacity: 0; transition: opacity .15s; }
.timeline-item:hover .timeline-del, .timeline-del:focus-visible { opacity: 1; }
.timeline-del:hover { background: var(--hover); color: var(--black); }
.timeline-body { white-space: pre-wrap; font-size: 14px; line-height: 1.55; margin-top: 4px; word-break: break-word; }

@media (max-width: 760px) {
  .crm-toolbar { flex-direction: column; align-items: stretch; }
  .crm-filters { flex-direction: column; }
  .crm-kind { width: 100%; }
  .crm-next-row { grid-template-columns: 1fr; }
  .crm-log-row { flex-direction: column; align-items: stretch; }
  .crm-log-date .form-input { flex: 1; width: auto; }
  .timeline-del { opacity: 1; }
}
.crm-flag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-left: 6px; border-radius: var(--r-pill); background: var(--black); color: var(--white); font-size: 11px; font-weight: 600; letter-spacing: 0; vertical-align: 2px; }

/* Tour logo field */
.logo-field{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.logo-preview{height:48px;min-width:48px;max-width:160px;padding:6px;border-radius:12px;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;background:var(--hover)}
.logo-preview img{max-height:36px;max-width:148px;object-fit:contain;display:block}
.logo-preview span{font-size:12px;color:var(--muted)}

/* ── Sicherheit (Einstellungen, Login-Code) ─────────────────────────────── */
.code-input { font-size: 20px; letter-spacing: .22em; font-variant-numeric: tabular-nums; }
.twofa-choices { display: grid; gap: 10px; }
.twofa-choice {
  display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; row-gap: 2px; width: 100%; text-align: left;
  padding: 16px 18px; background: var(--white); border: 1px solid var(--line-strong); border-radius: 18px;
  font: inherit; color: var(--black); cursor: pointer; transition: border-color .15s, background .15s;
}
.twofa-choice:hover { border-color: var(--black); }
.twofa-choice:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.twofa-choice i { grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; background: var(--canvas); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.twofa-choice strong { font-size: 15px; font-weight: 600; }
.twofa-choice span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.twofa-status { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--canvas); border-radius: 16px; margin-bottom: 20px; }
.twofa-status i { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--black); color: var(--white); display: flex; align-items: center; justify-content: center; }
.twofa-status strong { display: block; font-size: 15px; font-weight: 600; }
.twofa-status span { font-size: 13px; color: var(--muted); }
.totp-secret { display: block; margin-top: 6px; font: 600 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--black); letter-spacing: .04em; word-break: normal; }
.backup-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 16px; background: var(--canvas); border-radius: 16px; }
.backup-codes code { font: 600 15px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-align: center; padding: 8px; background: var(--white); border-radius: 10px; }

/* ── Verwaltung ─────────────────────────────────────────────────────────── */
.impersonate-bar {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--black); color: var(--white); font-size: 14px; text-align: center;
}
.impersonate-bar form { display: inline; }
.impersonate-bar .btn { height: 32px; background: var(--white); color: var(--black); }
.adm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.adm-panel[hidden] { display: none; }
.modal-tools { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--line); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--black); }
.check-row span { color: var(--muted); display: block; font-size: 13px; }

/* ── Abo ────────────────────────────────────────────────────────────────── */
.plan-card { border: 1px solid var(--black); border-radius: 20px; padding: 22px; margin: 4px 0 18px; }
.plan-price { font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.plan-price span { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan-net { font-size: 13px; color: var(--muted); margin-top: 2px; }
.plan-list { list-style: none; display: grid; gap: 9px; margin-top: 18px; font-size: 14px; }
.plan-list li { display: flex; gap: 10px; align-items: baseline; }
.plan-list i { font-size: 12px; }
.plan-fields[hidden] { display: none; }

/* ── Verwaltung: Umsatz ─────────────────────────────────────────────────── */
.adm-metrics { margin-bottom: 16px; }
.rev-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.rev-stats span { display: block; font-size: 12px; color: var(--muted); }
.rev-stats strong { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.rev-chart { position: relative; height: 200px; margin: 0 0 12px; padding-left: 0; }
.rev-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; background: var(--canvas); border-radius: 14px; }
.rev-grid { position: absolute; left: 0; right: 0; top: 18px; bottom: 22px; pointer-events: none; }
.rev-grid span { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); line-height: 1; padding-top: 3px; }
.rev-bars { position: absolute; inset: 18px 0 0 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; border-bottom: 0; }
.rev-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; outline: none; cursor: default; }
.rev-col > span { height: 22px; display: flex; align-items: flex-end; font-size: 11px; color: var(--muted); }
.rev-bar { position: relative; width: min(70%, 28px); background: var(--black); border-radius: 4px 4px 0 0; min-height: 0; flex: none; box-shadow: 0 1px 0 var(--black); }
.rev-bar.zero { box-shadow: 0 1px 0 var(--line-strong); }
.rev-bar b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.rev-col:hover .rev-bar, .rev-col:focus .rev-bar { background: #404040; }
.rev-col:focus-visible > span { color: var(--black); text-decoration: underline; }
.rev-tip { position: absolute; top: -8px; z-index: 2; background: var(--black); color: var(--white); font-size: 12px; padding: 6px 10px; border-radius: 10px; white-space: nowrap; pointer-events: none; }
.metric-list > div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); }
.metric-list > div:first-child { border-top: 0; padding-top: 0; }
.metric-list dt { font-size: 14px; font-weight: 500; }
.metric-list dt span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.metric-list dd { font-size: 16px; font-weight: 600; white-space: nowrap; text-align: right; }
.metric-list dd small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.metric-strong dt, .metric-strong dd { font-size: 16px; }
.metric-platform { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
@media (max-width: 720px) { .rev-stats { grid-template-columns: repeat(2, 1fr); } .figure-value { font-size: 28px; } }
.figures-money .figure-value { font-variant-numeric: normal; font-size: 36px; white-space: nowrap; }
.rev-bar b.end { left: auto; right: 0; transform: none; }
@media (max-width: 1100px) { .figures-money .figure-value { font-size: 28px; } }
@media (max-width: 480px) { .figures-money .figure-value { font-size: 22px; } }
.rev-commission { padding-top: 14px; border-top: 1px solid var(--line); }
.plan-block { border: 0; padding: 0; margin: 0; min-width: 0; }
.plan-block[hidden] { display: none; }
.ws-block { border: 0; padding: 0; margin: 0; min-width: 0; }
.ws-block[hidden] { display: none; }

/* Live check of sales offers */
.field-note { font-size: 12px; margin-top: 6px; display: flex; gap: 6px; align-items: baseline; min-height: 0; color: var(--muted); }
.field-note:empty { display: none; }
.field-note i { font-size: 11px; }
.field-note.err { color: var(--black); font-weight: 600; }
.field-note.warn { color: var(--black); }
.form-input.is-invalid, .input-group:has(.is-invalid) { border-color: var(--black); box-shadow: 0 0 0 3px rgba(0, 0, 0, .12); }
.input-group .form-input.is-invalid { box-shadow: none; }
.form-input.is-approval, .input-group:has(.is-approval) { border-style: dashed; border-color: var(--black); }
.input-group .form-input.is-approval { border: 0; }

/* ── Bestellübersicht (öffentlich) ──────────────────────────────────────── */
.order-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.order-item { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.order-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.order-text { font-size: 14px; line-height: 1.55; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ── Infos for sales (PDF list) ── */
.info-list { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: var(--r-surface); overflow: hidden; }
.info-item { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; }
.info-item + .info-item { border-top: 1px solid var(--line); }
.info-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; color: inherit; text-decoration: none; }
.info-main:hover, .info-main:focus-visible { background: #f5f5f5; }
.info-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: #f1f1f1; display: grid; place-items: center; font-size: 18px; }
.info-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.info-title { font-weight: 600; overflow-wrap: anywhere; }
.info-meta { font-size: 13px; color: var(--muted); }
.info-empty { text-align: center; padding: 48px 24px; }
.info-empty p { color: var(--muted); max-width: 420px; margin: 16px auto 0; }
.adm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-panel-head .form-hint { margin: 0; }

/* file picker as a drop zone: the real input lies invisibly over it */
.file-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 22px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-field); background: var(--white); color: var(--muted); font-size: 14px; cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease); }
.file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop i { font-size: 22px; color: var(--faint); }
.file-drop strong { color: var(--black); font-weight: 600; }
.file-drop:hover, .file-drop.drag { border-color: var(--black); background: var(--hover); }
.file-drop:focus-within { outline: 2px solid var(--black); outline-offset: 2px; }
.file-drop.has-file { border-style: solid; border-color: var(--black); }
.file-drop.has-file i { color: var(--black); }
.file-drop-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
