/* ============================================================
   TokenServe theme — Bootstrap 5 overlay
   Brand teal #0E6E5E · gold accent #B07818 · mobile-first
   ============================================================ */
:root {
  --ts-brand: #0E6E5E;
  --ts-brand-dark: #0A4A40;
  --ts-brand-soft: #E3F0ED;
  --ts-gold: #B07818;
  --ts-ink: #1E2A28;
  --ts-line: #D8E5E1;
  --ts-bg: #F4F8F7;
  --ts-sidebar-w: 248px;
}

body { background: var(--ts-bg); color: var(--ts-ink); }

/* ---------- Sidebar ---------- */
.ts-sidebar {
  width: var(--ts-sidebar-w);
  background: var(--ts-brand-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
}
/* Bootstrap forces `.offcanvas-lg { background: transparent !important }` at >=992px,
   which would wipe the teal on desktop — re-assert our colour with higher specificity. */
.ts-sidebar.offcanvas-lg { background: var(--ts-brand-dark) !important; }
@media (min-width: 992px) {
  .ts-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1030; }
  .ts-main { margin-left: var(--ts-sidebar-w); }
}
.ts-brand { min-height: 64px; border-bottom: 1px solid rgba(255,255,255,.12); }
.ts-brand-badge {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ts-brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.ts-brand-name { font-weight: 700; letter-spacing: .3px; }
.ts-brand-sub  { font-size: .72rem; color: #9FC7BE; }

.ts-nav { flex: 1; overflow-y: auto; padding: .75rem .5rem; }
.ts-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .8rem; margin: .1rem 0;
  color: #CFE4DF; text-decoration: none;
  border-radius: .5rem; font-size: .92rem;
}
.ts-nav a:hover  { background: rgba(255,255,255,.08); color: #fff; }
.ts-nav a.active { background: var(--ts-brand); color: #fff; font-weight: 600; }
.ts-nav-group {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  color: #7FA89F; padding: .9rem .8rem .3rem;
}
.ts-sidebar-foot {
  padding-top: .75rem; padding-bottom: .9rem;
  font-size: .75rem; color: #9FC7BE;
  border-top: 1px solid rgba(255,255,255,.12);
}

/* ---------- Topbar ---------- */
.ts-topbar {
  min-height: 64px; background: #fff;
  border-bottom: 1px solid var(--ts-line);
  position: sticky; top: 0; z-index: 1020;
}
.ts-burger { font-size: 1.5rem; color: var(--ts-ink); }
.ts-page-title { font-size: 1.15rem; font-weight: 700; }
.ts-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ts-brand-soft); color: var(--ts-brand);
  display: inline-flex; align-items: center; justify-content: center;
}
.ts-userbtn { border: 1px solid var(--ts-line); }

/* ---------- Cards / KPIs ---------- */
.ts-card {
  background: #fff; border: 1px solid var(--ts-line);
  border-radius: .75rem;
}
.ts-card .ts-card-head {
  padding: .8rem 1rem; border-bottom: 1px solid var(--ts-line);
  font-weight: 600; display: flex; align-items: center; gap: .5rem;
}
.ts-card .ts-card-body { padding: 1rem; }

.ts-kpi { display: flex; align-items: center; gap: .9rem; padding: 1rem; }
.ts-kpi .ico {
  width: 46px; height: 46px; border-radius: .75rem; font-size: 1.3rem;
  background: var(--ts-brand-soft); color: var(--ts-brand);
  display: inline-flex; align-items: center; justify-content: center;
}
.ts-kpi .val { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.ts-kpi .lbl { font-size: .78rem; color: #6B7A76; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Buttons ---------- */
.btn-ts {
  background: var(--ts-brand); border-color: var(--ts-brand); color: #fff;
}
.btn-ts:hover, .btn-ts:focus { background: var(--ts-brand-dark); border-color: var(--ts-brand-dark); color: #fff; }
.btn-outline-ts { border-color: var(--ts-brand); color: var(--ts-brand); }
.btn-outline-ts:hover { background: var(--ts-brand); color: #fff; }

/* ---------- Tables ---------- */
.table thead th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: #6B7A76; border-bottom-width: 2px;
}
.badge-ts-on  { background: var(--ts-brand-soft); color: var(--ts-brand); }
.badge-ts-off { background: #F6E7E4; color: #B0463A; }
.badge-ts-lock{ background: #FBF4E6; color: var(--ts-gold); }

/* ---------- Login ---------- */
.ts-login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--ts-brand-dark), var(--ts-brand) 70%);
  padding: 1rem;
}
.ts-login-card {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: 1rem; padding: 2rem;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.ts-login-badge {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--ts-brand); color: #fff; font-size: 1.6rem;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Permission matrix ---------- */
.ts-matrix td, .ts-matrix th { vertical-align: middle; }
.ts-matrix .module-row td {
  background: var(--ts-brand-soft); font-weight: 600; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ts-brand);
}
.ts-matrix input[type="checkbox"] { width: 1.15rem; height: 1.15rem; }

/* ---------- Misc ---------- */
.ts-hint { font-size: .8rem; color: #6B7A76; }
.required::after { content: " *"; color: #B0463A; }
@media (max-width: 575.98px) {
  .ts-content { padding: .9rem !important; }
  .ts-card .ts-card-body { padding: .8rem; }
}

/* ---------- Notification bell ---------- */
.ts-bellbtn { border: 1px solid var(--ts-line); }
.ts-ntf-item { display:flex; gap:.6rem; padding:.6rem .9rem; border-bottom:1px solid var(--ts-line);
  text-decoration:none; color:var(--ts-ink); font-size:.85rem; }
.ts-ntf-item:hover { background: var(--ts-bg); }
.ts-ntf-item.unread { background: #F2F8F6; }
.ts-ntf-item .ico { color: var(--ts-brand); font-size:1.05rem; }

/* ---------- Modal scroll safety net (hotfix) ---------- */
/* Tall forms (e.g. the package modal, booking modal with multi-guest picker)
   must always scroll internally instead of overflowing the viewport. This
   caps the body height even when modal-dialog-centered is in play. */
.modal-dialog-scrollable .modal-body { overflow-y: auto; }
@media (min-height: 400px) {
  .modal-body { max-height: calc(100vh - 12rem); overflow-y: auto; }
}
/* Select2 multi-tags shouldn't blow out the control height inside a modal */
.modal .select2-container .select2-selection--multiple {
  max-height: 8rem; overflow-y: auto;
}
/* Keep Select2 dropdowns above the modal */
.select2-container--open { z-index: 1060; }

/* ============================================================
   THEME PALETTES — selected by super admin (Configuration → Appearance)
   Applied via <html data-theme="..."> . Default = teal (:root above).
   Each theme overrides the same token set the whole UI reads from.
   ============================================================ */

/* 1. Teal (default) — matches :root, listed for the picker preview */
[data-theme="teal"] {
  --ts-brand: #0E6E5E; --ts-brand-dark: #0A4A40; --ts-brand-soft: #E3F0ED;
}

/* 2. Royal Indigo */
[data-theme="indigo"] {
  --ts-brand: #4338CA; --ts-brand-dark: #2E2A78; --ts-brand-soft: #E7E5F9;
}

/* 3. Aubergine & Rose Gold */
[data-theme="aubergine"] {
  --ts-brand: #7A4069; --ts-brand-dark: #4A2540; --ts-brand-soft: #F3E6EF;
}

/* 4. Slate & Amber */
[data-theme="slate"] {
  --ts-brand: #B07818; --ts-brand-dark: #26303B; --ts-brand-soft: #F5ECD9;
}

/* 5. Emerald Night */
[data-theme="emerald"] {
  --ts-brand: #059669; --ts-brand-dark: #103A2E; --ts-brand-soft: #D8F3E7;
}

/* 6. Crimson Charcoal */
[data-theme="crimson"] {
  --ts-brand: #B03A48; --ts-brand-dark: #2B2226; --ts-brand-soft: #F7E4E6;
}

/* ============================================================
   Sidebar accordion navigation
   ============================================================ */
.ts-nav-solo { /* Dashboard etc — top-level, no group */ }
.ts-grp { margin-bottom: .15rem; }
.ts-grp-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: 0; color: rgba(255,255,255,.72);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .6rem .85rem; border-radius: .55rem; cursor: pointer;
}
.ts-grp-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.ts-grp-btn .chev { font-size: .8rem; transition: transform .2s ease; }
.ts-grp.open > .ts-grp-btn { color: #fff; }
.ts-grp.open > .ts-grp-btn .chev { transform: rotate(180deg); }
/* highlight a collapsed group that contains the current page */
.ts-grp.has-active > .ts-grp-btn { color: #fff; }
.ts-grp.has-active > .ts-grp-btn::before {
  content: ""; position: absolute; left: 0; width: 3px; height: 1.2rem;
  background: var(--ts-brand); border-radius: 0 3px 3px 0; margin-left: -.5rem;
}
.ts-grp-btn { position: relative; }

/* collapsible body: animate via max-height */
.ts-grp-body {
  overflow: hidden; max-height: 0; transition: max-height .25s ease;
  padding-left: .35rem;
}
.ts-grp.open > .ts-grp-body { max-height: 30rem; }
.ts-grp-body a { font-size: .9rem; }
