/* ============================================================
   Book経済圏 CRM — Polished Stripe redesign
   Tokens, layout, sidebar, components — single self-contained CSS.
   ============================================================ */

:root {
  /* Brand — DOTPROJECT-20: warm orange (deepened to reduce glare) */
  --primary:        #EA580C;
  --primary-hover:  #C2410C;
  --primary-soft:   #FFF1E6;
  --primary-text:   #C2410C;
  --gradient-primary: linear-gradient(180deg, #F97316 0%, #EA580C 100%);

  /* Module accents */
  --hotel:      #F97066;  --hotel-soft: #FDE8E5;
  --kon:        #EC4899;  --kon-soft:   #FCE7F0;
  --tomo:       #A78BFA;  --tomo-soft:  #EEE7FE;
  --kari:       #0EA5E9;  --kari-soft:  #DDF1FB;

  /* Surfaces — DOTPROJECT-20: warm-neutral (was cool blue-grey) so hover /
     search / borders / cards harmonise with the orange–maroon theme. */
  --bg:           #FAF6F2;
  --surface:      #FFFFFF;
  --surface-alt:  #F7F0EA;
  --border:       #ECE3DC;
  --border-strong:#D9CDC3;

  /* Text */
  --text:        #0F1729;
  --text-muted:  #4E5870;
  --text-faint:  #8B92A6;

  /* States */
  --success:      #10B981;  --success-soft: #DDF5EB;
  --warn:         #F59E0B;  --warn-soft:    #FCEFD7;
  --danger:       #EF4444;  --danger-soft:  #FDE2E2;

  /* Sidebar (deep warm maroon) — DOTPROJECT-20 */
  --sb-bg:        #740A00;
  --sb-bg-alt:    #A62A1A;  /* hover / search box / badge — rõ sáng hơn nền */
  --sb-text:      #FBE9E4;
  --sb-text-mute: #E6B0A6;
  --sb-border:    rgba(255,255,255,0.14);
  --sb-active-bg: rgba(249,115,22,0.26);
  --sb-active-fg: #FFC78A;

  /* Shape */
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Filter bar — single source of truth for every chip's height so
     search input, select chips, range inputs and checkbox groups line up
     pixel-perfectly across all customer index screens. */
  --filterbar-h: 40px;

  /* Shadow */
  --shadow-card: 0 1px 2px rgba(15,23,41,0.04), 0 1px 1px rgba(15,23,41,0.02);
  --shadow-pop:  0 18px 40px -16px rgba(15,23,41,0.18), 0 4px 12px -4px rgba(15,23,41,0.08);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "palt";
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }

/* ---------- App shell ---------- */
/* Fixed-height shell: sidebar + main fill the viewport.
   Scrolling happens inside `.sidebar` (if its nav overflows) and `.page`
   (for body content). The shell itself never scrolls. */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sb-bg);
  color: var(--sb-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sb-border);
  overflow: hidden;
}
.sidebar__brand,
.sidebar__search,
.sidebar__user { flex-shrink: 0; }
.sidebar__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,210,190,0.30) transparent;
}
.sidebar__scroll::-webkit-scrollbar { width: 6px; }
.sidebar__scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar__scroll::-webkit-scrollbar-thumb {
  background: rgba(255,210,190,0.25);
  border-radius: 999px;
}
.sidebar__scroll::-webkit-scrollbar-thumb:hover { background: rgba(253,186,116,0.45); }
.sidebar__brand {
  padding: 20px 18px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.sidebar__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #FB923C 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  box-shadow: 0 8px 20px -6px rgba(249,115,22,0.5);
}
.sidebar__title {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.sidebar__subtitle {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sb-text-mute);
  margin-top: 2px;
}
.sidebar__search {
  position: relative;
  margin: 4px 14px 14px;
}
.sidebar__search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background: var(--sb-bg-alt);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--sb-text);
  outline: none;
}
.sidebar__search input::placeholder { color: var(--sb-text-mute); }
.sidebar__search i {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--sb-text-mute);
  font-size: 11.5px;
  pointer-events: none;
}
.sidebar__section-label {
  padding: 14px 18px 6px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sb-text-mute);
  font-weight: 600;
}
.sidebar__nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--sb-text);
  font-size: 13px;
  text-decoration: none;
  position: relative;
}
.sidebar__link:hover { background: var(--sb-bg-alt); text-decoration: none; }
.sidebar__link i:first-child { font-size: 13px; width: 18px; text-align: center; color: var(--sb-text-mute); }
.sidebar__link.is-active {
  background: var(--sb-active-bg);
  color: var(--sb-active-fg);
}
.sidebar__link.is-active i:first-child { color: var(--sb-active-fg); }
.sidebar__link.is-active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px; bottom: 8px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.sidebar__badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--sb-bg-alt);
  color: var(--sb-text-mute);
  font-weight: 600;
}
.sidebar__badge--accent { background: rgba(249,115,22,0.25); color: #FDBA74; }
.sidebar__group { display: block; }
.sidebar__group > summary { list-style: none; cursor: pointer; }
.sidebar__group > summary::-webkit-details-marker { display: none; }
.sidebar__group-caret {
  margin-left: auto !important;
  font-size: 10px !important;
  width: auto !important;
  color: var(--sb-text-mute) !important;
  transition: transform 0.18s ease;
}
.sidebar__group[open] > summary .sidebar__group-caret { transform: rotate(180deg); }
.sidebar__sublist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 6px 30px;
  padding-left: 8px;
  border-left: 1px dashed rgba(255,255,255,0.08);
}
.sidebar__sublink {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--sb-text-mute);
  font-size: 12.5px;
  text-decoration: none;
}
.sidebar__sublink:hover {
  background: var(--sb-bg-alt);
  color: var(--sb-text);
  text-decoration: none;
}
.sidebar__sublink.is-active {
  background: var(--sb-active-bg);
  color: var(--sb-active-fg);
}
.sidebar__user {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--sb-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.sidebar__user-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.sidebar__user-email { font-size: 11px; color: var(--sb-text-mute); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.sidebar__user-menu {
  width: 28px; height: 28px; border: none; background: transparent;
  color: var(--sb-text-mute); border-radius: 6px; font-size: 12px;
}
.sidebar__user-menu:hover { background: var(--sb-bg-alt); color: var(--sb-text); }

/* ---------- Main ---------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- Topbar ---------- */
.topbar {
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar__breadcrumb {
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 6px;
}
.topbar__breadcrumb i { font-size: 8px; opacity: 0.5; }
.topbar__breadcrumb .is-current { color: var(--text); }
.topbar__title {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.topbar__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.topbar__right { display: flex; align-items: center; gap: 10px; }

.topbar__search { position: relative; }
.topbar__search input {
  width: 220px;
  padding: 8px 12px 8px 32px;
  background: var(--surface-alt);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.topbar__search input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.topbar__search i {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 11.5px;
}
.topbar__search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  padding: 2px 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 10px; color: var(--text-faint);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.topbar__bell {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: var(--surface-alt); color: var(--text);
  border: none; font-size: 13px; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar__bell::after {
  content: "";
  position: absolute; top: 7px; right: 9px;
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--danger);
  border: 2px solid var(--surface-alt);
}

/* ---------- Segmented control ---------- */
.segmented {
  display: inline-flex;
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 2px;
}
.segmented__btn {
  padding: 6px 12px;
  border: none; border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.segmented__btn.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:hover { background: var(--surface-alt); }
.btn--ghost { background: transparent; border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-alt); border-color: var(--border-strong); }
/* Modal cancel/close button — clear coloured hover (red tint) so it reads as a
   "close" action, not just a border change. */
.modal__footer .btn--ghost:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}
.btn--secondary { background: var(--surface); border-color: var(--border); }
.btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 20px -6px rgba(249,115,22,0.5),
              inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn--primary:hover { background: var(--primary-hover); }
.btn--danger {
  background: var(--danger); color: #fff; font-weight: 600;
}
.btn--block { width: 100%; justify-content: center; }
.btn i { font-size: 11px; }

/* Icon buttons (table actions) */
.icon-btn {
  width: 30px; height: 30px; border-radius: 7px;
  border: none; background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text); }
.icon-btn--danger { color: var(--danger); }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card__header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card__title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.card__subtitle { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.card__body { padding: 18px; }
.card__footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  /* 3-track grid centers the pagination geometrically:
       col1 (1fr) holds the row-count text on the left,
       col2 (auto) holds the pagination — naturally centered because
       col1 and col3 are equal 1fr tracks,
       col3 (1fr) stays empty as a balancing spacer. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.card__footer > :nth-child(1) { justify-self: start; }
.card__footer > :nth-child(2) { justify-self: center; }

/* ---------- Pagination ----------
   Rendered by resources/views/vendor/pagination/admin.blade.php
   (set as default in AppServiceProvider). Replaces Laravel's Tailwind
   default — we don't load Tailwind, so the default would render huge
   inline SVG arrows. */
.pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
}
.pagination__btn:hover {
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
  border-color: var(--border-strong);
}
.pagination__btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: default;
}
.pagination__btn.is-active:hover {
  background: var(--primary);
  color: #fff;
}
.pagination__btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--surface);
  color: var(--text-faint);
}
.pagination__btn.is-disabled:hover {
  background: var(--surface);
  color: var(--text-faint);
  border-color: var(--border);
}
.pagination__btn i {
  font-size: 11px;
}
.pagination__ellipsis {
  padding: 0 6px;
  color: var(--text-faint);
  font-size: 13px;
  user-select: none;
}

/* ---------- Form controls ---------- */
.field { margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field__help { margin-top: 4px; font-size: 11px; color: var(--text-faint); }
.field__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
/* Single `.input` selector — extra typed selectors (e.g. `input[type="email"].input`)
   would bump specificity above `.input--with-icon` and re-introduce the icon-overlap bug. */
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* Cross-browser <select>: Safari/Firefox render a bulky native chevron even
   after a plain reset. Strip native chrome and draw our own chevron so the
   control looks identical everywhere (matches the counseling-form selects). */
select.input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%238B92A6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}
/* Strip native number steppers (Safari renders oversized ones) — typed entry. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
/* Hide Safari/Chrome native password key / auto-fill icon — it overlaps our
   custom show/hide eye toggle (.input-icon-right). Applied to ALL inputs (not
   just type=password) because the eye toggle flips the field to type=text when
   revealing, and Safari still shows the key icon on the revealed field. */
input::-webkit-credentials-auto-fill-button,
input::-webkit-strong-password-auto-fill-button,
input::-webkit-contacts-auto-fill-button {
  visibility: hidden !important;
  display: none !important;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}
.input--with-icon { padding-left: 36px; }
.input-wrap { position: relative; }
.input-wrap > .input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 12px; pointer-events: none;
}
.input-wrap > .input-icon-right {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 12px;
  background: transparent; border: none;
}
.input-error {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--danger);
  display: flex; align-items: center; gap: 6px;
}

/* ---------- KPI card ---------- */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.kpi__row { display: flex; align-items: center; justify-content: space-between; }
.kpi__icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.kpi__delta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.kpi__delta--up   { background: var(--success-soft); color: var(--success); }
.kpi__delta--down { background: var(--danger-soft);  color: var(--danger); }
.kpi__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}
.kpi__value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.kpi__sub { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* ---------- Status pill / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.pill__dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pill--active   { background: var(--success-soft); color: var(--success); }
.pill--inactive { background: var(--surface-alt);  color: var(--text-faint); }
.pill--warn     { background: var(--warn-soft);    color: var(--warn); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}
.badge--super  { background: var(--primary-soft); color: var(--primary-text); }
.badge--hotel  { background: var(--hotel-soft);   color: var(--hotel); }
.badge--kon    { background: var(--kon-soft);     color: var(--kon); }
.badge--tomo   { background: var(--tomo-soft);    color: var(--tomo); }
.badge--kari   { background: var(--kari-soft);    color: var(--kari); }
.badge--you {
  padding: 2px 7px;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--primary);
  color: #fff;
}

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  background: var(--surface-alt);
  padding: 11px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td { padding: 14px 18px; vertical-align: middle; }
.table tbody tr { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-alt); }
.table-checkbox { width: 38px; }
.table-actions { text-align: right; width: 110px; }

.table-user { display: flex; align-items: center; gap: 10px; }
.table-user__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 11.5px;
}
.table-user__name { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.table-user__kana {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.table-user__id {
  font-size: 11px;
  color: var(--text-faint);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin-top: 1px;
}

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; }
.pagination__btn {
  min-width: 30px; height: 30px; padding: 0 9px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.pagination__btn:hover { background: var(--surface-alt); }
.pagination__btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- Filter bar ----------
   Every chip wrapper (search, select, age range, services checkbox group)
   shares the same flex chrome + `var(--filterbar-h)` so the bar is one
   horizontal line of pixel-aligned controls. Inner inputs/selects render
   borderless and transparent — the wrapper border owns the visuals.
   Page-specific CSS only contributes decoration (theme colors, gap, etc.).
*/
.filterbar { padding: 12px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.filterbar__search,
.filterbar__select,
.filterbar__age,
.filterbar__services {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--filterbar-h);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.filterbar__search { flex: 1; min-width: 240px; }
.filterbar__search input {
  border: 0;
  background: transparent;
  flex: 1;
  font-size: 13px;
  color: var(--text);
  outline: none;
  padding: 0;
}
.filterbar__search i { color: var(--text-faint); font-size: 12px; }

.filterbar__select-label {
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.filterbar__select select {
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  padding: 0 16px 0 0;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  /* Normalise Safari/Firefox native chevron → our own small chevron. */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%238B92A6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 11px;
}
.filterbar__select select:focus { color: var(--primary-text); }

.chip {
  padding: 7px 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.chip:hover { background: var(--surface-alt); }
.chip.is-on--super  { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
.chip.is-on--hotel  { background: var(--hotel-soft);   color: var(--hotel);        border-color: var(--hotel);   font-weight: 600; }
.chip.is-on--kon    { background: var(--kon-soft);     color: var(--kon);          border-color: var(--kon);     font-weight: 600; }
.chip.is-on--tomo   { background: var(--tomo-soft);    color: var(--tomo);         border-color: var(--tomo);    font-weight: 600; }
.chip.is-on--kari   { background: var(--kari-soft);    color: var(--kari);         border-color: var(--kari);    font-weight: 600; }
.filterbar__divider {
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-muted);
}
.active-filter {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 4px 4px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11.5px;
}
.active-filter__value { font-weight: 600; color: var(--text); }
.active-filter__remove {
  width: 18px; height: 18px; border-radius: 4px;
  border: none; background: transparent;
  color: var(--text-faint); font-size: 10px;
}
.active-filter__remove:hover { background: var(--surface-alt); color: var(--text); }

/* ---------- Modal ---------- */
/* Backdrop + dialog visuals live in the compat layer at the end of the file
   (`.modal.is-open` = backdrop, `.modal__dialog` = box). The shared elements
   below — header / body / footer — apply regardless of wrapper class. */
.modal__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal__title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.modal__sub { font-size: 12px; color: var(--text-muted); margin: 3px 0 0; }
.modal__close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-alt); color: var(--text-muted);
  border: none; font-size: 14px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.modal__close:hover { background: var(--danger); color: #fff; }
.modal__body { padding: 22px 24px; overflow-y: auto; }
.modal__footer {
  padding: 14px 24px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}

/* Stepper */
.stepper { display: flex; align-items: center; gap: 6px; margin-bottom: 22px; }
.stepper__item { display: flex; align-items: center; gap: 7px; }
.stepper__dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-alt); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.stepper__item.is-active .stepper__dot { background: var(--primary); color: #fff; }
.stepper__item.is-done   .stepper__dot { background: var(--success); color: #fff; }
.stepper__label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.stepper__item.is-active .stepper__label { color: var(--text); font-weight: 600; }
.stepper__line { flex: 1; height: 1px; background: var(--border); margin: 0 6px; }

/* Role pickers */
.role-pick {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.role-pick:hover { background: var(--surface-alt); }
.role-pick i { font-size: 11px; }
.role-pick.is-on--super  { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
.role-pick.is-on--hotel  { background: var(--hotel-soft);   color: var(--hotel);        border-color: var(--hotel);   font-weight: 600; }
.role-pick.is-on--kon    { background: var(--kon-soft);     color: var(--kon);          border-color: var(--kon);     font-weight: 600; }
.role-pick.is-on--tomo   { background: var(--tomo-soft);    color: var(--tomo);         border-color: var(--tomo);    font-weight: 600; }
.role-pick.is-on--kari   { background: var(--kari-soft);    color: var(--kari);         border-color: var(--kari);    font-weight: 600; }

/* Toggle switch */
.switch {
  width: 40px; height: 22px;
  background: var(--surface-alt);
  border-radius: 999px;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.switch::after {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left .15s;
}
.switch.is-on { background: var(--primary); }
.switch.is-on::after { left: 20px; }
.switch-row {
  padding: 12px 14px; background: var(--surface-alt);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* Password strength */
.pwd-strength { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.pwd-strength__bar { flex: 1; height: 4px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.pwd-strength__fill { height: 100%; background: var(--success); border-radius: 999px; }
.pwd-strength__label { font-size: 11px; font-weight: 600; color: var(--success); }

/* ---------- Auth (login) layout ---------- */
.auth {
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(249,115,22,0.18) 0%, rgba(249,115,22,0) 60%),
    radial-gradient(700px 500px at 5% 110%, rgba(139,92,246,0.18) 0%, rgba(139,92,246,0) 60%),
    radial-gradient(500px 400px at 50% 100%, rgba(14,165,233,0.12) 0%, rgba(14,165,233,0) 60%),
    linear-gradient(180deg, #F6F8FC 0%, #FFFFFF 100%);
  overflow: hidden;
}
.auth__bar {
  padding: 24px 40px;
  display: flex; align-items: center; justify-content: space-between;
}
.auth__brand { display: flex; align-items: center; gap: 11px; }
.auth__brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #FB923C 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  box-shadow: 0 8px 24px -6px rgba(249,115,22,0.5);
}
.auth__brand-title { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; }
.auth__brand-sub {
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); margin-top: 1px;
}
.auth__nav { display: flex; gap: 6px; }
.auth__nav a { padding: 6px 12px; font-size: 12.5px; color: var(--text-muted); }
.auth__nav a:hover { color: var(--text); text-decoration: none; }

.auth__layout {
  position: relative;
  display: flex;
  gap: 80px;
  align-items: center;
  justify-content: center;
  padding: 32px 48px 96px;
  min-height: calc(100vh - 220px);
}
.auth__intro { width: 460px; }
.auth__intro-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--primary-text);
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.auth__intro-pill .pill__dot { background: var(--success); }
.auth__intro-title {
  margin: 0;
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
}
.auth__intro-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, #FB923C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth__intro-text {
  margin: 18px 0 28px;
  font-size: 15.5px;
  color: var(--text-muted);
  line-height: 1.7;
}
.auth__intro-points { display: flex; flex-direction: column; gap: 12px; }
.auth__intro-point { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-muted); }
.auth__intro-point-icon {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--primary-soft); color: var(--primary-text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}

.auth__card {
  width: 480px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  padding: 52px 44px 44px;
}
.auth__card-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.auth__card-sub { margin: 10px 0 32px; font-size: 13.5px; color: var(--text-muted); }

/* Inputs / submit buttons inside auth cards are larger than the shared admin
   versions — login is a single-focus screen, so the form should breathe. */
.auth__card .field { margin-bottom: 22px; }
.auth__card .field__label { font-size: 13px; margin-bottom: 8px; }
.auth__card .input { padding: 13px 14px; font-size: 14.5px; }
.auth__card .input--with-icon { padding-left: 40px; }
.auth__card .input-wrap__icon { font-size: 13.5px; left: 13px; }
.auth__card .btn--block { padding: 14px 18px; font-size: 14.5px; margin-top: 6px; }
.auth__card .field__forgot {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  text-align: right;
}
/* Read-only email pill on the password-reset screen — replaces the input
   since email is derived from the reset link and must not be changed. */
.auth__email-display {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.auth__email-display i { color: var(--text-faint); font-size: 13.5px; }
.auth__divider {
  margin: 20px 0; position: relative; text-align: center;
  font-size: 11px; color: var(--text-faint);
}
.auth__divider::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--border); z-index: 0;
}
.auth__divider span { position: relative; background: var(--surface); padding: 0 10px; }
.auth__legal {
  margin-top: 22px;
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.6;
}
.auth__footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 40px;
  display: flex; justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ---------- Home hero panel ---------- */
.hero-panel {
  padding: 22px 26px; margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 50%, #EA580C 100%);
  color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  position: relative; overflow: hidden;
  box-shadow: 0 18px 40px -16px rgba(234, 88, 12, 0.4);
}
.hero-panel::before,
.hero-panel::after {
  content: ""; position: absolute; border-radius: 50%;
}
.hero-panel::before {
  right: -40px; top: -60px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 60%);
}
.hero-panel::after {
  right: 100px; bottom: -80px; width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,214,153,0.30) 0%, rgba(255,214,153,0) 60%);
}
.hero-panel > * { position: relative; }
.hero-panel__label {
  font-size: 11.5px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.hero-panel__value {
  font-size: 42px; font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hero-panel__row { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; }
.hero-panel__delta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(16,185,129,0.18); color: #5EE5A8;
  font-size: 11.5px; font-weight: 600;
}
.hero-panel__sub { font-size: 12px; color: rgba(255,255,255,0.82); }
.hero-panel__modules { display: flex; gap: 32px; }
.hero-panel__module-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: rgba(255,255,255,0.82);
}
.hero-panel__module-value {
  font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  margin-top: 4px;
}

/* ---------- Layout grids ---------- */
.page { flex: 1; overflow-y: auto; padding: 22px 32px 32px; }
.grid { display: grid; gap: 14px; }
.grid--kpi    { grid-template-columns: repeat(4, 1fr); }
.grid--split  { grid-template-columns: 1.4fr 1fr; }
.grid--quad   { grid-template-columns: repeat(4, 1fr); }
.grid--three  { grid-template-columns: repeat(3, 1fr); }
.grid--two    { grid-template-columns: repeat(2, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Activity list ---------- */
.activity { padding: 8px 0; max-height: 360px; overflow-y: auto; }
.activity__item { padding: 10px 18px; display: flex; align-items: flex-start; gap: 11px; }
.activity__icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.activity__text { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.activity__who { font-weight: 600; }
.activity__time { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ---------- Module shortcut cards ---------- */
.module-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.module-card:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.module-card__icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.module-card__title { font-size: 13px; font-weight: 600; }
.module-card__sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.module-card__chevron { color: var(--text-faint); font-size: 11px; margin-left: auto; }

/* ---------- "Coming soon" module hero ---------- */
.coming {
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
  margin-bottom: 18px;
}
.coming::before,
.coming::after { content: ""; position: absolute; border-radius: 50%; }
.coming::before {
  right: -80px; top: -80px; width: 280px; height: 280px;
  background: radial-gradient(circle, var(--hotel-soft) 0%, rgba(252,227,224,0) 70%);
}
.coming::after {
  right: 60px; bottom: -60px; width: 180px; height: 180px;
  background: radial-gradient(circle, var(--warn-soft) 0%, rgba(251,234,208,0) 70%);
}
.coming > * { position: relative; max-width: 520px; }
.coming__pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--hotel-soft); color: var(--hotel);
  font-size: 11.5px; font-weight: 600;
  margin-bottom: 16px;
}
.coming__title {
  margin: 0;
  font-size: 30px; font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.coming__text {
  margin: 12px 0 22px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.7;
}
.coming__progress { margin-bottom: 22px; }
.coming__progress-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 7px; font-size: 11.5px;
}
.coming__progress-bar {
  height: 6px; background: var(--surface-alt);
  border-radius: 999px; overflow: hidden;
}
.coming__progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--hotel) 0%, var(--warn) 100%);
}
.coming__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn--hotel {
  background: linear-gradient(180deg, var(--hotel) 0%, #DD4F45 100%);
  color: #fff; font-weight: 600; border: none;
  box-shadow: 0 8px 20px -6px rgba(249,112,102,0.5);
}

.section-eyebrow {
  margin-bottom: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Feature card */
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex; gap: 12px; align-items: flex-start;
}
.feature__icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--hotel-soft); color: var(--hotel);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.feature__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 4px;
}
.feature__title { font-size: 13.5px; font-weight: 600; }
.feature__tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--hotel-soft);
  color: var(--hotel);
  border-radius: 4px;
}
.feature__desc { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.55; }

/* Roadmap */
.roadmap { position: relative; padding-left: 24px; }
.roadmap::before {
  content: ""; position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.roadmap__item { position: relative; padding-bottom: 18px; }
.roadmap__dot {
  position: absolute; left: -22px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 9px;
}
.roadmap__item.is-done .roadmap__dot { background: var(--success); border-color: var(--success); }
.roadmap__item.is-active .roadmap__dot {
  background: var(--hotel); border-color: var(--hotel);
  box-shadow: 0 0 0 4px var(--hotel-soft);
}
.roadmap__q { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.04em; }
.roadmap__item.is-active .roadmap__q { color: var(--hotel); }
.roadmap__text { font-size: 12.5px; color: var(--text); margin-top: 2px; line-height: 1.45; }

.tip-box {
  margin-top: 4px;
  padding: 12px 14px;
  background: var(--primary-soft);
  border-radius: var(--radius);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 11.5px;
  color: var(--primary-text);
  line-height: 1.55;
}
.tip-box i { margin-top: 2px; font-size: 13px; }

/* Utility */
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-mb-14 { margin-bottom: 14px !important; }
.u-mb-16 { margin-bottom: 16px !important; }
.u-mb-18 { margin-bottom: 18px !important; }
.u-flex { display: flex; }
.u-gap-8 { gap: 8px; }
.u-gap-10 { gap: 10px; }
.u-gap-14 { gap: 14px; }
.u-items-center { align-items: center; }
.u-between { justify-content: space-between; }
.u-text-muted { color: var(--text-muted); }
.u-text-faint { color: var(--text-faint); }
.u-num { font-variant-numeric: tabular-nums; }
.u-strong { color: var(--text); font-weight: 600; }
.u-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Label-as-control variants: chips and segmented buttons wrap a hidden input
   so they participate in a GET form. Keep them clickable like real buttons. */
.chip--toggle,
.segmented__btn--toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

/* ============================================================
   Compat layer — bridges existing admin.js modal/form expectations
   with the new crm.css visual system.
   ============================================================ */

/* Modal state machine driven by admin.js (`.modal.is-open` on outer wrapper).
   Outer `.modal` becomes the backdrop; inner `.modal__dialog` is the box. */
.modal:not(.is-open) { display: none; }
.modal.is-open {
  position: fixed; inset: 0;
  background: rgba(14,21,37,0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal__dialog {
  width: 600px; max-width: 100%; max-height: 95vh;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modal-pop .18s ease-out;
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
body.modal-open { overflow: hidden; }

/* Modal--confirm: header with warning icon (for destructive actions) */
.modal--confirm .modal__header {
  background: var(--danger-soft);
  color: var(--danger);
}
.modal--confirm .modal__header .modal__title {
  color: var(--danger);
}

/* Form: bridge old `.form__*` class names to new `.field` visuals */
.form__group { margin-bottom: 14px; }
.form__group > label,
.form__label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
/* Inputs inside .form__group inherit visuals from the global `.input` class
   (see top of file). Don't redefine padding here — it would override
   `.input--with-icon`'s padding-left and cause the icon to overlap text. */
.form__help {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.45;
}
.form__error {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--danger);
  line-height: 1.4;
}
.is-invalid,
input.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.16) !important;
}
.form__checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.form__checkbox input { accent-color: var(--primary); }

/* Role grid (admin modal) — visual card per role */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.role-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 12.5px;
  background: var(--surface);
  transition: border-color .12s, background .12s, color .12s;
}
.role-card input { margin: 0; accent-color: var(--primary); }
.role-card:hover { border-color: var(--border-strong); }
.role-card.is-on {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 600;
}
.role-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.role-card__dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* System-administrator card spans the grid so it reads as a higher-tier
   choice over the per-service cards beneath it. */
.role-card--system {
  grid-column: 1 / -1;
  border-style: dashed;
}
.role-card--system.is-on {
  border-style: solid;
}
/* Per-service role cards adopt their own service colour: on hover the border +
   text preview the hue; when selected the card fills with the service tint —
   instead of the generic primary, so each role reads as its corresponding color. */
.role-card--hotel:hover { border-color: var(--hotel); color: var(--hotel); }
.role-card--kon:hover   { border-color: var(--kon);   color: var(--kon); }
.role-card--tomo:hover  { border-color: var(--tomo);  color: var(--tomo); }
.role-card--kari:hover  { border-color: var(--kari);  color: var(--kari); }
.role-card--hotel.is-on { border-color: var(--hotel); background: var(--hotel-soft); color: var(--hotel); }
.role-card--kon.is-on   { border-color: var(--kon);   background: var(--kon-soft);   color: var(--kon); }
.role-card--tomo.is-on  { border-color: var(--tomo);  background: var(--tomo-soft);  color: var(--tomo); }
.role-card--kari.is-on  { border-color: var(--kari);  background: var(--kari-soft);  color: var(--kari); }

/* Slide toggle (admin modal footer) */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.toggle input {
  opacity: 0; width: 0; height: 0; position: absolute;
}
.toggle__track {
  width: 34px; height: 20px;
  background: var(--border-strong);
  border-radius: 99px;
  position: relative;
  transition: background .15s;
  flex-shrink: 0;
}
.toggle__track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform .15s;
}
.toggle input:checked + .toggle__track { background: var(--primary); }
.toggle input:checked + .toggle__track::after { transform: translateX(14px); }
.toggle input:disabled + .toggle__track { opacity: .55; cursor: not-allowed; }

/* Modal header with icon (admins-modal style) */
.modal__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.modal--confirm .modal__icon {
  background: var(--danger-soft);
  color: var(--danger);
}
.modal__header--with-icon {
  align-items: flex-start;
  gap: 14px;
}
.modal__header--with-icon .modal__close { margin-left: auto; }

/* Centered confirm dialog — big icon, title, body stacked vertically. Used
   for destructive actions (delete) where a clear visual stop is needed. */
.modal--centered .modal__dialog { width: 460px; }
.modal--centered .modal__header {
  background: transparent;
  border-bottom: none;
  padding: 12px 14px 0;
  justify-content: flex-end;
}
.confirm-pane {
  padding: 4px 28px 24px;
  text-align: center;
}
.confirm-pane__icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--warn-soft);
  color: var(--warn);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 14px;
}
.confirm-pane__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.confirm-pane__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}
.confirm-pane__name {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 13.5px;
}
.confirm-pane__notice {
  margin-top: 16px;
  padding: 11px 14px;
  background: var(--warn-soft);
  border-radius: 8px;
  font-size: 12px;
  color: #8B5A00;
  display: flex; align-items: flex-start; gap: 9px;
  text-align: left;
}
.confirm-pane__notice i { margin-top: 2px; color: var(--warn); font-size: 13px; }

/* Input wrap with icon (login form, modal email/password) */
.input-wrap { position: relative; }
.input-wrap__icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint); font-size: 12px;
  pointer-events: none;
}
.input--with-icon { padding-left: 34px; }
.input-icon-right {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border: none; background: transparent;
  color: var(--text-faint);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.input-icon-right:hover { background: var(--surface-alt); color: var(--text); }

/* Self badge (current admin row) */
.badge--self,
.badge--you {
  display: inline-block;
  padding: 1px 8px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-text);
  vertical-align: middle;
  letter-spacing: 0.04em;
}

/* ============================================================
   Toastr — white card, colored left border + circular FA icon,
   colored progress bar. Replaces the default solid-color block
   look (which painted a checkmark image over the message text).
   ============================================================ */
#toast-container > div {
  background-image: none !important;
  color: var(--text);
  box-shadow: var(--shadow-pop);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--border-strong);
  opacity: 1;
  padding: 14px 40px 14px 58px;
  width: 360px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
  font-family: inherit;
}

/* Tinted backgrounds + matching left border per type so the toast
   lifts off the near-white page background (--bg #F6F8FC). */
#toast-container > .toast-success {
  background: var(--success-soft) !important;
  border-color: #A7E2C7;
  border-left-color: var(--success);
}
#toast-container > .toast-error {
  background: var(--danger-soft) !important;
  border-color: #F5B5B5;
  border-left-color: var(--danger);
}
#toast-container > .toast-info {
  background: #DBEAFE !important;
  border-color: #A8C7F0;
  border-left-color: #3B82F6;
}
#toast-container > .toast-warning {
  background: #FEF3C7 !important;
  border-color: #F4D58A;
  border-left-color: #F59E0B;
}

/* Circular icon badge on the left — drawn via ::before so it
   never overlaps message text (default toastr puts a background
   image behind the text which caused the overlap bug). */
#toast-container > div::before {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 13px;
  color: #fff;
}

#toast-container > .toast-success::before { content: "\f00c"; background: var(--success); }
#toast-container > .toast-error::before   { content: "\f00d"; background: var(--danger); }
#toast-container > .toast-info::before    { content: "\f129"; background: #3B82F6; }
#toast-container > .toast-warning::before { content: "\f12a"; background: #F59E0B; }

.toast-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.toast-message {
  color: var(--text-muted);
  word-wrap: break-word;
}

.toast-close-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  opacity: 1;
  text-shadow: none;
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  float: none;
}

.toast-close-button:hover,
.toast-close-button:focus {
  color: var(--text);
  opacity: 1;
}

/* Progress bar tinted to match the toast type. */
.toast-progress {
  background: var(--border-strong);
  height: 3px;
  border-radius: 0 0 var(--radius) var(--radius);
  opacity: 1;
}

#toast-container > .toast-success > .toast-progress { background: var(--success); }
#toast-container > .toast-error   > .toast-progress { background: var(--danger); }
#toast-container > .toast-info    > .toast-progress { background: #3B82F6; }
#toast-container > .toast-warning > .toast-progress { background: #F59E0B; }

/* Page-level wrapper alignment for legacy `.page-title` / `.notice` */
.page-title {
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 18px;
}
.notice {
  background: var(--primary-soft);
  border: 1px solid rgba(249,115,22,0.18);
  color: var(--primary-text);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
}

/* ============================================================
   Service placeholder card (used on hotel/kon/tomo/kari dashboards
   while modules are under development).
   Each page sets --mod, --mod-end, --mod-soft, --mod-text on .ph.
   ============================================================ */
.ph {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px 64px;
  min-height: calc(100vh - 200px);
}
.ph__breadcrumb {
  align-self: flex-start;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--text-muted);
}
.ph__breadcrumb i { font-size: 9px; margin: 0 8px; opacity: .5; }
.ph__breadcrumb .is-current { color: var(--text); font-weight: 500; }
.ph__card {
  width: 100%; max-width: 680px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15,23,41,0.04);
  position: relative; overflow: hidden;
}
.ph__halo {
  position: absolute; inset: auto auto auto 50%; top: -120px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--mod-soft) 0%, transparent 65%);
  transform: translateX(-50%);
  opacity: .9; pointer-events: none;
}
.ph__icon-stack {
  position: relative; width: 96px; height: 96px;
  margin: 0 auto 28px;
}
.ph__icon-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--mod-soft);
  animation: phPulse 2.6s ease-in-out infinite;
}
.ph__icon-ring--2 {
  inset: 8px; background: #fff;
  border: 1px dashed var(--mod); opacity: .5;
}
.ph__icon {
  position: absolute; inset: 18px;
  border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  color: var(--mod);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(15,23,41,0.06);
}
@keyframes phPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.06); opacity: .7; }
}
.ph__badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mod-text);
  background: var(--mod-soft);
  padding: 5px 12px;
  border-radius: 99px;
  margin-bottom: 14px;
}
.ph__badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mod);
  box-shadow: 0 0 0 3px var(--mod-soft);
}
.ph__title {
  font-size: 24px; font-weight: 700;
  margin: 0 0 10px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.ph__title-screen {
  font-weight: 500;
  color: var(--text-muted, #6B7280);
  font-size: 0.85em;
}
.ph__screen-subtitle {
  margin-top: -8px;
  margin-bottom: 14px;
  color: var(--text-muted, #6B7280);
  font-size: 13px;
}
.ph__message {
  font-size: 14.5px; color: var(--text);
  margin: 0 0 6px; font-weight: 500;
}
.ph__hint {
  font-size: 13px; color: var(--text-muted);
  margin: 0 0 28px; line-height: 1.6;
}
.ph__progress { max-width: 300px; margin: 0 auto 32px; }
.ph__progress-label {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--text-muted);
  margin-bottom: 6px;
}
.ph__progress-track {
  height: 6px; background: var(--surface-alt);
  border-radius: 99px; overflow: hidden;
}
.ph__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--mod) 0%, var(--mod-end) 100%);
  border-radius: 99px; transition: width .5s;
}
.ph__features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: left;
  margin-bottom: 28px;
}
.ph__feature {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.ph__feature i {
  color: var(--mod); font-size: 14px;
  margin-bottom: 8px; display: block;
}
.ph__feature-title { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.ph__feature-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.ph__cta {
  display: flex; gap: 10px;
  justify-content: center; align-items: center;
}
@media (max-width: 680px) {
  .ph__features { grid-template-columns: 1fr; }
  .ph__card { padding: 36px 22px; }
}

/* Module color presets — each page applies the matching class on .ph wrapper. */
.ph--hotel { --mod: #F97066; --mod-end: #FB923C; --mod-soft: #FDE8E5; --mod-text: #B91C1C; }
.ph--kon   { --mod: #EC4899; --mod-end: #F472B6; --mod-soft: #FCE7F0; --mod-text: #9D174D; }
.ph--tomo  { --mod: #A78BFA; --mod-end: #C084FC; --mod-soft: #EEE7FE; --mod-text: #5B21B6; }
.ph--kari  { --mod: #0EA5E9; --mod-end: #38BDF8; --mod-soft: #DDF1FB; --mod-text: #0369A1; }
