/*
Theme Name: Marklix CRM
Theme URI: https://marklix.in
Author: Marklix
Author URI: https://marklix.in
Description: Marklix CRM - a clean, modern CRM built for a small marketing agency. Kanban deal pipeline, client management, tasks and follow-ups in a fast, minimal SaaS interface. Your team signs in with Google - add your client ID and allowed emails in Appearance - Customize - CRM Settings.
Version: 2.1.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tbs-crm
Tags: one-column, full-width-template, custom-colors, custom-logo, editor-style
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
  --accent: #021f56;
  --accent-hover: #0a2f74;
  --accent-soft: #eef1f7;
  --accent-border: #ccd4e4;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e6e8ec;
  --border-strong: #d7dae1;

  --text: #101828;
  --text-2: #475467;
  --muted: #8a91a0;

  --green: #067647;
  --green-soft: #ecfdf3;
  --red: #b42318;
  --red-soft: #fef3f2;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --blue: #175cd3;
  --blue-soft: #eff8ff;

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.14);

  --sidebar-w: 248px;
  --topbar-h: 64px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.tbs-crm-body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tbs-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Scrollbars */
.tbs-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.tbs-scroll::-webkit-scrollbar-track { background: transparent; }
.tbs-scroll::-webkit-scrollbar-thumb { background: #d8dbe2; border: 3px solid transparent; background-clip: content-box; border-radius: 8px; }
.tbs-scroll::-webkit-scrollbar-thumb:hover { background: #bfc4ce; background-clip: content-box; }

/* ==========================================================================
   3. Shell
   ========================================================================== */
html { height: 100%; }
body.tbs-crm-body:not(.tbs-crm-locked) { height: 100%; overflow: hidden; }

.tbs-shell { display: flex; height: 100vh; }
body.tbs-crm-locked .tbs-shell { height: auto; min-height: 100vh; }

.tbs-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 60;
}

.tbs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.tbs-brand-mark {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: -0.02em;
}
.tbs-brand-logo {
  height: auto;
  width: 132px;
  max-width: 100%;
  flex: 0 0 auto;
}
.tbs-brand-tag {
  flex: 0 0 auto;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 2px 5px;
  line-height: 1;
}
.tbs-brand-text { min-width: 0; }
.tbs-brand-name {
  font-size: 14px; font-weight: 650; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tbs-brand-sub { font-size: 11px; color: var(--muted); }

.tbs-nav { flex: 1 1 auto; overflow-y: auto; padding: 14px 10px; }
.tbs-nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  padding: 6px 10px 8px;
}
.tbs-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 2px;
  border: 0; background: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: background .12s ease, color .12s ease;
}
.tbs-nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; stroke-width: 1.7; }
.tbs-nav-item:hover { background: var(--surface-2); color: var(--text); }
.tbs-nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tbs-nav-count {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  color: var(--text-2);
  background: #f1f2f4;
  border-radius: 20px;
  padding: 1px 7px;
}
.tbs-nav-item.is-active .tbs-nav-count { background: #fff; color: var(--accent); }

.tbs-sidebar-foot { flex: 0 0 auto; border-top: 1px solid var(--border); padding: 12px; }
.tbs-user { display: flex; align-items: center; gap: 10px; }
.tbs-user-meta { min-width: 0; }
.tbs-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbs-user-role { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tbs-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   4. Topbar
   ========================================================================== */
.tbs-topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.tbs-topbar-title { min-width: 0; }
.tbs-topbar-title h1 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.tbs-topbar-title p { font-size: 12.5px; color: var(--muted); }
.tbs-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.tbs-iconbtn.tbs-menu-toggle { display: none; }

.tbs-search {
  position: relative;
  width: 260px;
}
.tbs-search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.tbs-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.tbs-search input::placeholder { color: var(--muted); }
.tbs-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tbs-iconbtn {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.tbs-iconbtn:hover { background: var(--surface-2); color: var(--text); }
.tbs-iconbtn svg { width: 18px; height: 18px; }
.tbs-dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  border-radius: 20px;
  background: #d92d20;
  color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 15px;
  text-align: center;
  border: 2px solid #fff;
  box-sizing: content-box;
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */
.tbs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px; font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, color .12s ease;
}
.tbs-btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.tbs-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.tbs-btn--primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: var(--shadow-xs);
}
.tbs-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.tbs-btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.tbs-btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.tbs-btn--danger { color: var(--red); }
.tbs-btn--danger:hover { background: var(--red-soft); border-color: #fecdc9; }
.tbs-btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-sm); }
.tbs-btn--block { width: 100%; }
.tbs-btn[disabled] { opacity: .5; cursor: not-allowed; }

.tbs-segment {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: #f1f2f4;
  border-radius: var(--radius-sm);
}
.tbs-segment button {
  border: 0; background: none;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12.5px; font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.tbs-segment button:hover { color: var(--text); }
.tbs-segment button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* ==========================================================================
   6. Page canvas
   ========================================================================== */
.tbs-views {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}
.tbs-view { display: none; }
.tbs-view--pad { padding: 24px; }
.tbs-view.is-active { display: block; }
.tbs-view.is-active.tbs-view--flex { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

.tbs-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.tbs-panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.tbs-panel-head h2 { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.tbs-panel-head .tbs-panel-sub { font-size: 12px; color: var(--muted); }
.tbs-panel-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tbs-panel-body { padding: 8px 18px 14px; }
.tbs-panel-body--flush { padding: 0; }

.tbs-grid { display: grid; gap: 16px; }
.tbs-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tbs-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tbs-section-gap { margin-top: 16px; }

/* ==========================================================================
   7. KPI cards
   ========================================================================== */
.tbs-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.tbs-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 16px 16px;
  box-shadow: var(--shadow-xs);
}
.tbs-kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tbs-kpi-ico {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.tbs-kpi-ico svg { width: 15px; height: 15px; }
.tbs-kpi-label { font-size: 12px; font-weight: 550; color: var(--text-2); }
.tbs-kpi-value { font-size: 23px; font-weight: 680; letter-spacing: -0.025em; line-height: 1.15; }
.tbs-kpi-meta { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.tbs-kpi-meta .tbs-up { color: var(--green); font-weight: 600; }

/* ==========================================================================
   8. Lists / rows
   ========================================================================== */
.tbs-list > li { border-bottom: 1px solid var(--border); }
.tbs-list > li:last-child { border-bottom: 0; }
.tbs-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 11px 4px;
  background: none; border: 0;
  text-align: left;
  cursor: pointer;
}
.tbs-row:hover { background: var(--surface-2); }
.tbs-row--static { cursor: default; }
.tbs-row--static:hover { background: none; }
.tbs-row-ico {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.tbs-row-ico svg { width: 15px; height: 15px; }
.tbs-row-ico--accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.tbs-row-ico--green { background: var(--green-soft); border-color: #abefc6; color: var(--green); }
.tbs-row-ico--amber { background: var(--amber-soft); border-color: #fedf89; color: var(--amber); }
.tbs-row-ico--blue { background: var(--blue-soft); border-color: #b2ddff; color: var(--blue); }
.tbs-row-ico--red { background: var(--red-soft); border-color: #fecdc9; color: var(--red); }
.tbs-row-main { min-width: 0; flex: 1 1 auto; display: block; }
.tbs-row-title { display: block; font-size: 13.5px; font-weight: 570; letter-spacing: -0.005em; }
.tbs-row-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.tbs-row-side { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.tbs-row-time { font-size: 12px; font-weight: 560; color: var(--text-2); white-space: nowrap; }

.tbs-avatar {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 650;
  color: #fff;
  letter-spacing: -0.01em;
}
.tbs-avatar--sm { width: 22px; height: 22px; flex: 0 0 22px; font-size: 9.5px; }
.tbs-avatar--lg { width: 40px; height: 40px; flex: 0 0 40px; font-size: 14px; }
.tbs-avatar-stack { display: flex; }
.tbs-avatar-stack .tbs-avatar { margin-left: -6px; border: 2px solid #fff; }
.tbs-avatar-stack .tbs-avatar:first-child { margin-left: 0; }

/* ==========================================================================
   9. Badges
   ========================================================================== */
.tbs-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 570;
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.tbs-badge--green { background: var(--green-soft); border-color: #abefc6; color: var(--green); }
.tbs-badge--red { background: var(--red-soft); border-color: #fecdc9; color: var(--red); }
.tbs-badge--amber { background: var(--amber-soft); border-color: #fedf89; color: var(--amber); }
.tbs-badge--blue { background: var(--blue-soft); border-color: #b2ddff; color: var(--blue); }
.tbs-badge--accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.tbs-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tbs-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}

/* ==========================================================================
   10. Kanban
   ========================================================================== */
.tbs-board-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tbs-board-bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tbs-board-stat { font-size: 12.5px; color: var(--text-2); }
.tbs-board-stat b { color: var(--text); font-weight: 640; }
.tbs-board-stat + .tbs-board-stat { padding-left: 10px; margin-left: 10px; border-left: 1px solid var(--border); }

.tbs-select {
  height: 36px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a91a0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  font-size: 13px;
  appearance: none;
  cursor: pointer;
  max-width: 190px;
}
.tbs-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tbs-select--sm { height: 30px; font-size: 12.5px; }

.tbs-board {
  flex: 1 1 auto;
  display: flex;
  gap: 14px;
  padding: 18px 24px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
  min-height: 0;
}
.tbs-col {
  flex: 0 0 292px;
  width: 292px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  background: #f1f2f4;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background .12s ease, box-shadow .12s ease;
}
.tbs-col.is-over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-border); }
.tbs-col-head { padding: 12px 13px 10px; flex: 0 0 auto; }
.tbs-col-title { display: flex; align-items: center; gap: 7px; }
.tbs-col-title .tbs-stage-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.tbs-col-title h3 {
  font-size: 11.5px; font-weight: 680; letter-spacing: 0.045em;
  text-transform: uppercase; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tbs-col-count {
  margin-left: auto;
  font-size: 11px; font-weight: 650; color: var(--text-2);
  background: #fff; border: 1px solid var(--border);
  border-radius: 20px; padding: 0 7px;
}
.tbs-col-sum { margin-top: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.tbs-col-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 74px;
}
.tbs-col-foot { padding: 0 10px 11px; flex: 0 0 auto; }
.tbs-col-add {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px; font-weight: 550;
  cursor: pointer;
}
.tbs-col-add:hover { background: #fff; color: var(--accent); border-color: var(--accent-border); }
.tbs-col-add svg { width: 14px; height: 14px; }

.tbs-deal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px 10px;
  box-shadow: var(--shadow-xs);
  cursor: grab;
  transition: box-shadow .12s ease, border-color .12s ease, transform .12s ease;
}
.tbs-deal:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.tbs-deal.is-dragging { opacity: .45; }
.tbs-deal-top { display: flex; align-items: flex-start; gap: 8px; }
.tbs-deal-name {
  font-size: 13.5px; font-weight: 620; letter-spacing: -0.01em;
  min-width: 0; flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tbs-deal-person { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.tbs-deal-value {
  margin-top: 9px;
  font-size: 14px; font-weight: 660; letter-spacing: -0.015em;
  color: var(--text);
}
.tbs-deal-value span { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.tbs-deal-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tbs-deal-tag {
  font-size: 11px; font-weight: 540;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.tbs-deal-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--border);
}
.tbs-deal-follow {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 550; color: var(--text-2);
}
.tbs-deal-follow svg { width: 12px; height: 12px; }
.tbs-deal-follow.is-due { color: var(--red); }
.tbs-deal-follow.is-today { color: var(--amber); }
.tbs-deal-phone { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tbs-drop-hint {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   11. Table
   ========================================================================== */
.tbs-table-wrap { overflow-x: auto; }
.tbs-table { width: 100%; border-collapse: collapse; }
.tbs-table th {
  text-align: left;
  font-size: 11.5px; font-weight: 620; letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.tbs-table tbody tr { cursor: pointer; }
.tbs-table tbody tr:hover { background: var(--surface-2); }
.tbs-table tbody tr:last-child td { border-bottom: 0; }
.tbs-table .tbs-cell-strong { font-weight: 600; letter-spacing: -0.005em; }
.tbs-table .tbs-cell-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.tbs-cell-actions { text-align: right; white-space: nowrap; }
.tbs-cell-actions .tbs-mini { display: inline-grid; vertical-align: middle; }
.tbs-cell-actions .tbs-btn { display: inline-flex; vertical-align: middle; }
.tbs-cell-actions > * + * { margin-left: 4px; }
.tbs-cell-with-avatar { display: flex; align-items: center; gap: 9px; }

/* ==========================================================================
   12. Task rows
   ========================================================================== */
.tbs-check {
  width: 19px; height: 19px; flex: 0 0 19px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  display: grid; place-items: center;
  color: transparent;
  transition: all .12s ease;
}
.tbs-check svg { width: 12px; height: 12px; }
.tbs-check:hover { border-color: var(--accent); }
.tbs-check.is-done { background: var(--accent); border-color: var(--accent); color: #fff; }
.tbs-task-title.is-done { text-decoration: line-through; color: var(--muted); }

/* ==========================================================================
   13. Drawer
   ========================================================================== */
.tbs-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 24, 40, 0.32);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
  z-index: 90;
}
.tbs-overlay.is-open { opacity: 1; pointer-events: auto; }

.tbs-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform .22s cubic-bezier(.32, .72, 0, 1);
  z-index: 100;
  display: flex; flex-direction: column;
}
.tbs-drawer.is-open { transform: translateX(0); }
.tbs-drawer-head {
  flex: 0 0 auto;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.tbs-drawer-head-top { display: flex; align-items: flex-start; gap: 10px; }
.tbs-drawer-title { min-width: 0; flex: 1 1 auto; }
.tbs-drawer-title h2 { font-size: 17px; font-weight: 660; letter-spacing: -0.02em; }
.tbs-drawer-title p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tbs-drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 0 18px 22px; }
.tbs-drawer-foot {
  flex: 0 0 auto;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.tbs-drawer-actions { display: flex; gap: 7px; flex-wrap: wrap; padding: 14px 0 4px; }

.tbs-dsection { padding: 16px 0 4px; }
.tbs-dsection + .tbs-dsection { border-top: 1px solid var(--border); }
.tbs-dsection h3 {
  font-size: 11px; font-weight: 680; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
}
.tbs-dl { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 9px 12px; }
.tbs-dl dt { font-size: 12.5px; color: var(--muted); }
.tbs-dl dd { font-size: 13px; font-weight: 520; margin: 0; word-break: break-word; }
.tbs-dl dd a:hover { color: var(--accent); text-decoration: underline; }

.tbs-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.tbs-tab {
  border: 0; background: none;
  padding: 9px 11px;
  font-size: 12.5px; font-weight: 560;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tbs-tab:hover { color: var(--text); }
.tbs-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.tbs-timeline { padding-top: 4px; }
.tbs-tl-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.tbs-tl-item:last-child { border-bottom: 0; }
.tbs-tl-ico {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 7px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.tbs-tl-ico svg { width: 13px; height: 13px; }
.tbs-tl-main { min-width: 0; flex: 1 1 auto; }
.tbs-tl-text { font-size: 13px; line-height: 1.45; }
.tbs-tl-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ==========================================================================
   14. Modal
   ========================================================================== */
.tbs-modal-wrap {
  position: fixed; inset: 0;
  z-index: 110;
  display: none;
  padding: 24px;
  overflow-y: auto;
}
.tbs-modal-wrap.is-open { display: flex; align-items: flex-start; justify-content: center; }
.tbs-modal {
  position: relative;
  width: 100%; max-width: 560px;
  margin: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: tbs-pop .18s cubic-bezier(.32, .72, 0, 1);
}
.tbs-modal--sm { max-width: 420px; }
@keyframes tbs-pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.tbs-modal-head { padding: 18px 20px 0; }
.tbs-modal-head h2 { font-size: 16px; font-weight: 660; letter-spacing: -0.015em; }
.tbs-modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tbs-modal-body { padding: 16px 20px; }
.tbs-modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.tbs-modal-close { position: absolute; top: 14px; right: 14px; }

/* ==========================================================================
   15. Forms
   ========================================================================== */
.tbs-form { display: grid; gap: 13px; }
.tbs-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.tbs-field { display: grid; gap: 5px; min-width: 0; }
.tbs-field label { font-size: 12.5px; font-weight: 560; color: var(--text-2); }
.tbs-field .tbs-hint { font-size: 11.5px; color: var(--muted); }
.tbs-input,
.tbs-textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.tbs-textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.tbs-input:focus,
.tbs-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.tbs-input {
  appearance: none;
  padding-right: 30px;
  background: var(--surface) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a91a0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  cursor: pointer;
}
.tbs-field-full { grid-column: 1 / -1; }
.tbs-inline-form { display: flex; gap: 8px; align-items: flex-start; }
.tbs-inline-form .tbs-input { flex: 1 1 auto; }

/* ==========================================================================
   16. Settings
   ========================================================================== */
.tbs-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tbs-sortrow {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.tbs-sortrow:last-child { border-bottom: 0; }
.tbs-sortrow-name { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 550; }
.tbs-sortrow-actions { display: flex; gap: 3px; }
.tbs-mini {
  width: 26px; height: 26px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.tbs-mini:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.tbs-mini svg { width: 14px; height: 14px; }
.tbs-mini[disabled] { opacity: .35; cursor: not-allowed; }
.tbs-mini--danger:hover { background: var(--red-soft); color: var(--red); border-color: #fecdc9; }

/* ==========================================================================
   17. Notifications & toasts
   ========================================================================== */
.tbs-pop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 80;
  overflow: hidden;
  display: none;
}
.tbs-pop.is-open { display: block; }
.tbs-pop-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.tbs-pop-head h3 { font-size: 13px; font-weight: 640; }
.tbs-pop-body { max-height: 340px; overflow-y: auto; padding: 4px 10px; }
.tbs-topbar-actions { position: relative; }

.tbs-toasts {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.tbs-toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 15px;
  border-radius: 999px;
  background: #101828;
  color: #fff;
  font-size: 13px; font-weight: 520;
  box-shadow: var(--shadow-lg);
  animation: tbs-toast-in .2s ease;
}
.tbs-toast svg { width: 15px; height: 15px; }
.tbs-toast--ok svg { color: #75e0a7; }
@keyframes tbs-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   18. Misc
   ========================================================================== */
.tbs-empty { padding: 34px 20px; text-align: center; }
.tbs-empty-ico {
  width: 40px; height: 40px; margin: 0 auto 10px;
  border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.tbs-empty h3 { font-size: 13.5px; font-weight: 600; }
.tbs-empty p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.tbs-bar { height: 6px; border-radius: 20px; background: #eceef1; overflow: hidden; }
.tbs-bar > span { display: block; height: 100%; border-radius: 20px; background: var(--accent); }

.tbs-pipeline-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 92px; gap: 12px; align-items: center; padding: 9px 0; }
.tbs-pipeline-row + .tbs-pipeline-row { border-top: 1px solid var(--border); }
.tbs-pipeline-name { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 560; }
.tbs-pipeline-name .tbs-stage-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.tbs-pipeline-val { text-align: right; font-size: 12.5px; font-weight: 600; }
.tbs-pipeline-val span { display: block; font-size: 11px; color: var(--muted); font-weight: 450; }

.tbs-demo-note {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: var(--amber-soft);
  border: 1px solid #fedf89;
  border-radius: var(--radius);
  color: #93370d;
  font-size: 12.5px;
}
.tbs-demo-note svg { width: 15px; height: 15px; flex: 0 0 15px; }
.tbs-demo-note button { margin-left: auto; }

.tbs-login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.tbs-login {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
}
.tbs-login .tbs-brand-mark { width: 38px; height: 38px; flex-basis: 38px; font-size: 15px; margin-bottom: 14px; }
.tbs-login-logo { display: block; width: 150px; height: auto; margin: 0 auto 20px; }
.tbs-login h1 { font-size: 18px; font-weight: 660; letter-spacing: -0.02em; text-align: center; }
.tbs-login p { font-size: 13px; color: var(--muted); margin-top: 4px; margin-bottom: 18px; text-align: center; }
.tbs-login label { display: block; font-size: 12.5px; font-weight: 560; color: var(--text-2); margin-bottom: 5px; }
.tbs-login input[type="text"],
.tbs-login input[type="email"],
.tbs-login input[type="password"] {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 12px;
  font-family: var(--sans); color: var(--text); background: #fff;
}
.tbs-login input[type="text"]:focus,
.tbs-login input[type="email"]:focus,
.tbs-login input[type="password"]:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.tbs-login input[type="submit"] {
  width: 100%; height: 38px;
  background: var(--accent); color: #fff;
  border: 0; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 570; cursor: pointer;
}
.tbs-login .login-remember { margin-bottom: 12px; font-size: 12.5px; color: var(--text-2); }
.tbs-login p.forgetmenot { margin: 0 0 12px; }
.tbs-login--wide { max-width: 460px; }

/* Google sign-in gate */
.tbs-login-google {
  display: flex; justify-content: center;
  min-height: 44px;
  margin: 2px 0 10px;
}
.tbs-login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 18px;
  color: var(--muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
}
.tbs-login-divider::before,
.tbs-login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.tbs-field { text-align: left; margin-bottom: 14px; position: relative; }
.tbs-field input { margin-bottom: 0; }
.tbs-field--password input { padding-right: 42px; }
.tbs-field-eye {
  position: absolute; right: 8px; top: 27px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); border-radius: var(--radius-sm);
}
.tbs-field-eye:hover { color: var(--text-2); background: var(--accent-soft); }
.tbs-field-eye .tbs-eye-off { display: none; }
.tbs-field-eye.is-visible .tbs-eye-on { display: none; }
.tbs-field-eye.is-visible .tbs-eye-off { display: block; }
.tbs-field-eye svg { display: block; }

.tbs-login-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; font-size: 12.5px;
}
.tbs-remember { display: flex; align-items: center; gap: 7px; color: var(--text-2); cursor: pointer; }
.tbs-remember input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }

.tbs-link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font-weight: 550; font-size: 12.5px; font-family: var(--sans);
  display: inline-flex; align-items: center; gap: 4px;
}
.tbs-link-btn:hover { text-decoration: underline; }
.tbs-login-panel + .tbs-login-panel { margin-top: 0; }
.tbs-login-error {
  display: none;
  margin-bottom: 14px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  border: 1px solid #fecdc9;
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.45;
}
.tbs-login-error.is-visible { display: block; }
.tbs-login-note { min-height: 18px; font-size: 12px; color: var(--muted); text-align: center; }
.tbs-login-alt {
  margin-top: 18px; padding-top: 15px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12.5px; color: var(--muted);
}
.tbs-login-alt a { color: var(--accent); font-weight: 550; }
.tbs-login-alt a:hover { text-decoration: underline; }
.tbs-login-version { margin-top: 7px; font-size: 11px; color: #b3b8c2; letter-spacing: 0.02em; }

.tbs-setup { text-align: left; }
.tbs-setup ol { display: grid; gap: 12px; margin: 4px 0 0; counter-reset: tbsstep; }
.tbs-setup li {
  counter-increment: tbsstep;
  position: relative;
  padding-left: 29px;
  font-size: 13px; line-height: 1.5;
  color: var(--text-2);
}
.tbs-setup li::before {
  content: counter(tbsstep);
  position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 680;
  display: grid; place-items: center;
}
.tbs-setup a:not(.tbs-btn) { color: var(--accent); font-weight: 550; }
.tbs-setup a:not(.tbs-btn):hover { text-decoration: underline; }
.tbs-setup code {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
}

.tbs-avatar-img {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

/* ==========================================================================
   19. Responsive
   ========================================================================== */
@media (max-width: 1400px) {
  .tbs-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .tbs-grid--2, .tbs-grid--3, .tbs-settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .tbs-sidebar { transform: translateX(-100%); transition: transform .2s cubic-bezier(.32,.72,0,1); box-shadow: var(--shadow-lg); }
  body.tbs-nav-open .tbs-sidebar { transform: none; }
  .tbs-main { margin-left: 0; }
  .tbs-iconbtn.tbs-menu-toggle { display: grid; }
  .tbs-search { width: 170px; }
  .tbs-view--pad { padding: 16px; }
  .tbs-board { padding: 14px 16px 20px; }
  .tbs-board-bar { padding: 12px 16px; }
  .tbs-topbar { padding: 0 16px; }
  .tbs-drawer { width: 100%; }
  .tbs-form-grid { grid-template-columns: minmax(0, 1fr); }
  .tbs-dl { grid-template-columns: 104px minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .tbs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbs-topbar-title p { display: none; }
  .tbs-search { width: 130px; }
  .tbs-hide-sm { display: none !important; }
}

/* ==========================================================================
   20. Member access
   ========================================================================== */
.tbs-perm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tbs-perm-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.tbs-perm-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.tbs-perm-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.tbs-perm-role {
  padding: 6px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px; font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.tbs-perm-role:hover { border-color: var(--border-strong); color: var(--text); }
.tbs-perm-role.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tbs-perm-role.is-custom { cursor: default; border-style: dashed; }
.tbs-perm-role.is-custom:hover { border-color: var(--border); color: var(--text-2); }
.tbs-perm-role.is-custom.is-on { border-style: solid; }

.tbs-perm-matrix { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tbs-perm-row {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.tbs-perm-row:last-child { border-bottom: 0; }
.tbs-perm-name {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 560;
}
.tbs-perm-name svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--muted); }
.tbs-perm-name small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.tbs-perm-seg { flex: 0 0 auto; }
.tbs-perm-opt {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12.5px; font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.tbs-perm-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.tbs-perm-opt:hover { color: var(--text); }
.tbs-perm-opt.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.tbs-perm-opt:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

.tbs-perm-choices { display: flex; gap: 10px; }
.tbs-perm-choice {
  flex: 1 1 0;
  display: flex; gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tbs-perm-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.tbs-perm-choice.is-on { border-color: var(--accent); background: var(--accent-soft); }
.tbs-perm-dot {
  width: 16px; height: 16px; flex: 0 0 16px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: #fff;
}
.tbs-perm-choice.is-on .tbs-perm-dot { border-color: var(--accent); border-width: 5px; }
.tbs-perm-choice b { display: block; font-size: 13px; font-weight: 600; }
.tbs-perm-choice > span > span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.tbs-perm-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.tbs-perm-toggle:last-child { border-bottom: 0; }
.tbs-perm-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.tbs-switch {
  width: 36px; height: 21px; flex: 0 0 36px;
  border-radius: 20px;
  background: #d7dae1;
  position: relative;
  transition: background .14s ease;
}
.tbs-switch::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .2);
  transition: transform .14s ease;
}
.tbs-perm-toggle input:checked + .tbs-switch { background: var(--accent); }
.tbs-perm-toggle input:checked + .tbs-switch::after { transform: translateX(15px); }
.tbs-perm-toggle input:focus-visible + .tbs-switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.tbs-offline {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 9px 16px;
  background: var(--amber-soft);
  border-top: 1px solid #fedf89;
  color: #93370d;
  font-size: 12.5px;
  text-align: center;
  z-index: 150;
}

@media (max-width: 640px) {
  .tbs-perm-row { flex-wrap: wrap; }
  .tbs-perm-choices { flex-direction: column; }
}
