/*
 * Techhive brand layer for the customers area (header, navigation, footer).
 * Loaded after style.css. Colours come from the Techhive logo.
 */
:root {
  --th-navy: #102a56;
  --th-navy-deep: #0b1f42;
  --th-blue: #3078b8;
  --th-blue-bright: #5aa2e6;
  --th-ink: #0f172a;
  --th-muted-on-dark: #b9c6dc;
  --th-line-on-dark: rgba(255, 255, 255, 0.12);
}

/* ---------------------------------------------------------------- skip link */
.th-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 2000;
  background: #fff;
  color: var(--th-navy);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
}
.th-skip-link:focus { left: 12px; }

/* ------------------------------------------------------------------ header */
.navbar.th-header {
  background: var(--th-navy);
  border: 0;
  min-height: 68px;
  margin-bottom: 24px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08), 0 6px 18px rgba(16, 42, 86, 0.12);
}
.th-header .container { display: flex; align-items: center; flex-wrap: wrap; }
.th-header .navbar-header { flex: 0 0 auto; }
.th-header .navbar-collapse { flex: 1 1 auto; }
.th-header .navbar-collapse.collapse { display: flex !important; align-items: center; }
.th-header a.navbar-brand { padding: 14px 0; height: auto; margin-right: 22px; }
.th-header a.navbar-brand img { height: 40px; width: auto; }
.th-header .navbar-brand.logo-text { color: #fff; margin-top: 0; }

.th-header .navbar-nav > li > a,
.th-header.navbar-default .navbar-nav > li > a {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.2;
  padding: 9px 12px;
  margin: 0 2px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.th-header .navbar-nav > li > a i { margin: 0; width: 16px; text-align: center; opacity: 0.9; }
.th-header.navbar-default .navbar-nav > li > a:hover,
.th-header.navbar-default .navbar-nav > li > a:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.th-header.navbar-default .navbar-nav > .active > a,
.th-header.navbar-default .navbar-nav > .active > a:hover,
.th-header.navbar-default .navbar-nav > .active > a:focus {
  background: rgba(90, 162, 230, 0.18);
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--th-blue-bright);
}
.th-header .navbar-nav > li > a:focus-visible,
.th-header .navbar-toggle:focus-visible,
.th-footer a:focus-visible {
  outline: 2px solid var(--th-blue-bright);
  outline-offset: 2px;
}
.th-main-nav { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; }

/* account area */
.th-account-nav { display: flex; align-items: center; margin-left: auto; }
.th-header.navbar-default .navbar-nav > li > a.th-btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  margin-left: 8px;
}
.th-header.navbar-default .navbar-nav > li.customers-nav-item-login > a,
.th-header.navbar-default .navbar-nav > li > a.th-btn-solid {
  background: var(--th-blue) !important;
  color: #fff !important;
  border-radius: 8px !important;
  margin-left: 8px;
  padding: 9px 16px;
}
.th-header.navbar-default .navbar-nav > li > a.th-btn-solid:hover { background: #2668a3 !important; }
.th-header.navbar-default .navbar-nav > li.customers-nav-item-login > a.th-btn-outline {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.th-header.navbar-default .navbar-nav > li.customers-nav-item-login > a.th-btn-outline:hover { background: rgba(255, 255, 255, 0.1) !important; }

.th-header.navbar-default .navbar-nav > li > a.th-profile-toggle {
  padding: 5px 10px 5px 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  position: relative;
}
.th-header.navbar-default .navbar-nav > li.dropdown > a.th-profile-toggle:hover,
.th-header.navbar-default .navbar-nav > .open > a.th-profile-toggle,
.th-header.navbar-default .navbar-nav > .open > a.th-profile-toggle:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 999px;
}
.th-profile-toggle .client-profile-image-small { width: 30px; height: 30px; border-radius: 50%; margin: 0; }
.th-profile-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.th-caret { font-size: 10px; opacity: 0.8; }
.th-dot { position: absolute; top: 4px; left: 28px; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; border: 2px solid var(--th-navy); }

.th-header .dropdown-menu {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
  padding: 6px;
  min-width: 230px;
  margin-top: 8px;
}
.th-header .dropdown-menu > li > a { border-radius: 6px; padding: 8px 10px; color: #334155; }
.th-header .dropdown-menu > li > a i { width: 18px; color: #64748b; text-align: center; margin-right: 4px; }
.th-header .dropdown-menu > li > a:hover { background: #f1f5f9; color: var(--th-ink); }
.th-dropdown-header { padding: 8px 10px 10px; border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.th-dropdown-header strong { display: block; color: var(--th-ink); font-size: 14px; }
.th-dropdown-header span { display: block; color: #64748b; font-size: 12px; text-transform: none; letter-spacing: 0; }

/* mobile header */
.th-header .navbar-toggle { border-color: rgba(255, 255, 255, 0.3); margin: 0 0 0 auto; order: 2; }
.th-header .navbar-toggle .icon-bar { background-color: #fff; }
.th-header.navbar-default .navbar-toggle:hover,
.th-header.navbar-default .navbar-toggle:focus { background: rgba(255, 255, 255, 0.1); }

@media (max-width: 767px) {
  .th-header .container { padding-left: 16px; padding-right: 16px; }
  .th-header .navbar-header { display: flex; align-items: center; width: 100%; }
  .th-header .navbar-header::before, .th-header .navbar-header::after { display: none; }
  .th-header a.navbar-brand { padding: 12px 0; }
  .th-header a.navbar-brand img { margin-left: 0; height: 34px; }
  .th-header .navbar-collapse.collapse { display: none !important; }
  .th-header .navbar-collapse.collapse.in,
  .th-header .navbar-collapse.collapsing { display: block !important; }
  .th-header .navbar-collapse { width: 100%; border-top: 1px solid var(--th-line-on-dark); box-shadow: none; padding: 8px 0 12px; }
  .th-main-nav, .th-account-nav { display: block; margin: 0; }
  .th-header.navbar-default .navbar-nav > li > a { padding: 11px 10px; margin: 2px 0; color: rgba(255, 255, 255, 0.86); }
  .th-header.navbar-default .navbar-nav > .active > a { box-shadow: inset 3px 0 0 var(--th-blue-bright); }
  .th-header.navbar-default .navbar-nav > li > a.th-btn-outline,
  .th-header.navbar-default .navbar-nav > li > a.th-btn-solid { margin: 6px 0 0; justify-content: center; }
  .th-header.navbar-default .navbar-nav > li > a.th-profile-toggle { border: 0; border-radius: 8px; }
  .th-header .navbar-nav .open .dropdown-menu { background: rgba(255, 255, 255, 0.06); border: 0; box-shadow: none; margin: 4px 0 0; }
  .th-header.navbar-default .navbar-nav .open .dropdown-menu > li > a { color: rgba(255, 255, 255, 0.86); }
  .th-header.navbar-default .navbar-nav .open .dropdown-menu > li > a i { color: rgba(255, 255, 255, 0.6); }
  .th-dropdown-header strong { color: #fff; }
  .th-dropdown-header span { color: var(--th-muted-on-dark); }
  .th-dropdown-header { border-color: var(--th-line-on-dark); }
}

/* -------------------------------------------------------------------- footer */
footer.th-footer {
  height: auto;
  margin-top: 48px;
  padding: 0;
  background: var(--th-navy-deep);
  border-top: 0;
  color: var(--th-muted-on-dark);
}
.th-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1fr;
  gap: 32px;
  padding: 44px 0 32px;
}
.th-footer h3 {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 4px 0 14px;
}
.th-footer p { margin: 0 0 12px; line-height: 1.6; }
.th-footer ul { list-style: none; padding: 0; margin: 0; }
.th-footer a { color: #dbe4f3; }
.th-footer a:hover { color: #fff; }
.th-footer-logo img { height: 38px; width: auto; margin-bottom: 14px; }
.th-footer-name { display: block; color: #fff; font-size: 20px; margin-bottom: 12px; }
.th-footer-links li { margin-bottom: 9px; }
.th-footer-contact li { display: flex; gap: 10px; margin-bottom: 11px; line-height: 1.5; }
.th-footer-contact li i, .th-footer-support p i { color: var(--th-blue-bright); width: 16px; text-align: center; margin-top: 3px; }
.th-footer-support p { display: flex; gap: 10px; }
.th-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--th-blue);
  color: #fff !important;
  font-weight: 500;
}
.th-footer-cta:hover { background: #2668a3; }
.th-socials { display: flex; gap: 8px; margin-top: 4px; }
.th-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background 0.15s ease;
}
.th-socials a:hover { background: var(--th-blue); }
.th-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 16px 0 20px;
  border-top: 1px solid var(--th-line-on-dark);
  font-size: 13px;
}
.th-footer-legal { display: inline-flex; gap: 16px; }

@media (max-width: 991px) {
  .th-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 575px) {
  .th-footer-grid { grid-template-columns: 1fr; gap: 26px; padding-top: 32px; }
  .th-footer-bottom { flex-direction: column; }
}

/* print: invoices/estimates printed from the portal should not include chrome */
@media print {
  .th-header, .th-footer, .th-skip-link { display: none !important; }
}

/* ------------------------------------------------ layout fixes & "More" menu */
/* Bootstrap clearfix pseudo-elements would become flex items */
.th-header .container::before, .th-header .container::after,
.th-header .navbar-collapse::before, .th-header .navbar-collapse::after,
.th-main-nav::before, .th-main-nav::after,
.th-account-nav::before, .th-account-nav::after { display: none; }
@media (min-width: 768px) {
  .th-header .container { flex-wrap: nowrap; }
  .th-main-nav { flex-wrap: nowrap; }
  .th-header .navbar-collapse { padding: 0; }
}
.th-header .dropdown-menu > li.active > a,
.th-header .dropdown-menu > li.active > a:hover { background: #eff6ff; color: var(--th-navy); font-weight: 600; }
.th-header .dropdown-menu > li.active > a i { color: var(--th-blue); }
/* Narrower laptops/tablets: icons only (labels stay available as tooltips and to screen readers) */
@media (min-width: 768px) and (max-width: 1199px) {
  .th-header .th-main-nav .th-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .th-header.navbar-default .th-main-nav > li > a { padding: 10px 11px; }
  .th-header .th-main-nav > li > a i { font-size: 16px; }
  .th-profile-name { display: none; }
}
/* open dropdown toggles keep the dark header look */
.th-header.navbar-default .navbar-nav > .open > a,
.th-header.navbar-default .navbar-nav > .open > a:hover,
.th-header.navbar-default .navbar-nav > .open > a:focus {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 8px;
}
.th-footer-logo { display: inline-block; padding: 0; }
@media (max-width: 767px) {
  /* Bootstrap pulls mobile menus to the screen edge with negative margins */
  .th-header .navbar-collapse, .th-header .navbar-nav { margin-left: 0; margin-right: 0; }
  .th-header .navbar-header { margin-left: 0; margin-right: 0; }
}

/* =====================================================================
 * Sidebar layout (logged-in clients)
 * ===================================================================== */
:root { --th-sb-w: 248px; --th-sb-rail: 76px; --th-topbar-h: 64px; }

.th-shell {
  flex: 1;
  display: grid;
  grid-template-columns: var(--th-sb-w) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}
.th-shell > #wrapper { grid-column: 2; grid-row: 2; min-width: 0; }
.th-shell > footer.th-footer { grid-column: 2; grid-row: 3; margin-top: 32px; }
/* Bootstrap's fixed container widths don't fit next to a sidebar */
.th-shell #wrapper .container,
.th-shell footer .container { width: auto; max-width: 1240px; padding-left: 28px; padding-right: 28px; }

/* ---- sidebar */
.th-sidebar {
  grid-column: 1;
  grid-row: 1 / span 3;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--th-navy);
  color: var(--th-muted-on-dark);
  overflow: hidden;
  z-index: 1030;
}
.th-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--th-topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--th-line-on-dark);
  flex: 0 0 auto;
}
.th-sidebar-brand .th-sidebar-logo { padding: 0; display: block; }
.th-sidebar-brand .th-sidebar-logo img { height: 38px; width: auto; max-width: 180px; }
.th-sidebar-mark { display: none; }
.th-sidebar-mark img { width: 34px; height: 34px; border-radius: 8px; background: #fff; padding: 3px; }
.th-sidebar-close { display: none; margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 20px; width: 40px; height: 40px; border-radius: 8px; }
.th-sidebar-close:hover { background: rgba(255, 255, 255, 0.1); }

.th-sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 14px 12px; }
.th-nav-section + .th-nav-section { margin-top: 14px; }
.th-nav-heading {
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(185, 198, 220, 0.7);
}
.th-nav-list > li > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.th-nav-list > li > a i { width: 18px; text-align: center; font-size: 15px; opacity: 0.9; }
.th-nav-list > li > a:hover,
.th-nav-list > li > a:focus { background: rgba(255, 255, 255, 0.08); color: #fff; }
.th-nav-list > li.active > a {
  background: rgba(90, 162, 230, 0.2);
  color: #fff;
}
.th-nav-list > li.active > a::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--th-blue-bright);
}
.th-nav-list > li > a:focus-visible,
.th-sidebar button:focus-visible,
.th-topbar a:focus-visible,
.th-topbar button:focus-visible { outline: 2px solid var(--th-blue-bright); outline-offset: 2px; }

.th-sidebar-help {
  margin: 0 12px 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}
.th-help-title { margin: 0 0 2px; color: #fff; font-weight: 600; font-size: 13px; }
.th-help-title i { color: var(--th-blue-bright); margin-right: 4px; }
.th-help-text { margin: 0 0 10px; font-size: 12px; }
.th-help-actions { display: flex; gap: 8px; }
.th-help-actions a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
}
.th-help-actions a:hover { background: var(--th-blue); color: #fff; }

.th-collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 12px;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  flex: 0 0 auto;
}
.th-collapse:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.th-collapse i { width: 18px; text-align: center; transition: transform 0.2s ease; }

/* ---- top bar */
.th-topbar {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--th-topbar-h);
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
}
.th-page-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--th-ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-menu-btn, .th-topbar-logo { display: none; }
.th-menu-btn { border: 1px solid #e2e8f0; background: #fff; width: 40px; height: 40px; border-radius: 8px; color: var(--th-navy); font-size: 17px; }
.th-topbar-actions { display: flex; align-items: center; gap: 6px; margin: 0; float: none; }
.th-topbar-actions > li { float: none; }
.th-topbar-actions > li > a { padding: 0; }
.th-icon-btn {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #475569;
  font-size: 17px;
}
.th-icon-btn:hover, .th-icon-btn:focus { background: #f1f5f9 !important; color: var(--th-ink); }
.th-count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.th-topbar .th-profile-toggle {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px !important;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #334155;
  font-weight: 500;
}
.th-topbar .th-profile-toggle:hover,
.th-topbar .open > .th-profile-toggle,
.th-topbar .open > .th-profile-toggle:focus { background: #f8fafc !important; color: var(--th-ink); }
.th-topbar .client-profile-image-small { width: 30px; height: 30px; border-radius: 50%; margin: 0; }
.th-topbar .dropdown-menu {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
  padding: 6px;
  min-width: 230px;
  margin-top: 8px;
}
.th-topbar .dropdown-menu > li > a { border-radius: 6px; padding: 8px 10px; color: #334155; }
.th-topbar .dropdown-menu > li > a i { width: 18px; color: #64748b; text-align: center; margin-right: 4px; }
.th-topbar .dropdown-menu > li > a:hover { background: #f1f5f9; color: var(--th-ink); }

.th-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 1029; }
.th-backdrop[hidden] { display: none; }

/* ---- collapsed (icon rail) on desktop */
@media (min-width: 992px) {
  body.th-collapsed .th-shell { grid-template-columns: var(--th-sb-rail) minmax(0, 1fr); }
  body.th-collapsed .th-sidebar .th-label,
  body.th-collapsed .th-sidebar .th-sidebar-logo,
  body.th-collapsed .th-nav-heading { display: none; }
  body.th-collapsed .th-sidebar-mark { display: block; }
  body.th-collapsed .th-sidebar-brand { justify-content: center; padding: 0; }
  body.th-collapsed .th-nav-section + .th-nav-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--th-line-on-dark); }
  body.th-collapsed .th-nav-list > li > a { justify-content: center; padding: 11px 0; }
  body.th-collapsed .th-nav-list > li > a i { font-size: 17px; }
  body.th-collapsed .th-sidebar-help { padding: 8px 6px; margin: 0 10px 10px; }
  body.th-collapsed .th-help-title { text-align: center; margin: 0 0 6px; }
  body.th-collapsed .th-help-actions { flex-direction: column; gap: 6px; }
  body.th-collapsed .th-collapse { justify-content: center; }
  body.th-collapsed .th-collapse i { transform: rotate(180deg); }
}

/* ---- tablets & phones: off-canvas sidebar */
@media (max-width: 991px) {
  .th-shell { grid-template-columns: minmax(0, 1fr); }
  .th-shell > #wrapper, .th-shell > footer.th-footer, .th-topbar { grid-column: 1; }
  .th-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(286px, 86vw);
    height: auto;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  }
  body.th-sidebar-open .th-sidebar { transform: translateX(0); }
  body.th-sidebar-open { overflow: hidden; }
  .th-sidebar-close, .th-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .th-collapse { display: none; }
  .th-topbar { padding: 0 16px; gap: 10px; }
  .th-topbar-logo { display: block; }
  .th-topbar-logo .th-mobile-logo { padding: 0; display: block; }
  .th-topbar-logo img { height: 30px; width: auto; }
  .th-page-title { display: none; }
  .th-topbar-actions { margin-left: auto; }
  .th-shell #wrapper .container, .th-shell footer .container { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .th-topbar .th-profile-name, .th-topbar .th-caret { display: none; }
  .th-topbar .th-profile-toggle { padding: 3px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .th-sidebar, .th-shell, .th-collapse i { transition: none; }
}
@media print {
  .th-sidebar, .th-topbar, .th-backdrop { display: none !important; }
  .th-shell { display: block; }
}
/* Some Perfex views overhang the content column by a few pixels (Bootstrap row margins),
   which would show a horizontal scrollbar. clip (not hidden) keeps the sticky top bar working. */
.th-shell > #wrapper { overflow-x: clip; }
@media (max-width: 991px) {
  /* Closed drawer: no shadow at the screen edge, and not reachable with Tab */
  .th-sidebar { box-shadow: none; visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s; }
  body.th-sidebar-open .th-sidebar { box-shadow: 0 0 40px rgba(0, 0, 0, 0.25); visibility: visible; transition: transform 0.22s ease, visibility 0s; }
}

/* =====================================================================
 * Dashboard
 * ===================================================================== */
.th-dash { padding-bottom: 8px; }
.th-reveal { opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.4s ease; }
.th-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .th-reveal { opacity: 1; transform: none; transition: none; } }

/* hero */
.th-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 30px;
  margin-bottom: 20px;
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(90, 162, 230, 0.35), transparent 45%),
    linear-gradient(120deg, var(--th-navy-deep) 0%, var(--th-navy) 45%, #1f5aa6 100%);
  box-shadow: 0 14px 30px rgba(16, 42, 86, 0.18);
}
.th-hero-text { position: relative; z-index: 1; max-width: 640px; }
.th-hero-date { margin: 0 0 6px; color: var(--th-muted-on-dark); font-size: 13px; }
.th-hero h2 { margin: 0 0 8px; font-size: 28px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.th-hero-summary { margin: 0; font-size: 15px; color: #dbe6f6; }
.th-hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.th-hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.12); color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 600; font-size: 14px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.th-hero-btn:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-1px); }
.th-hero-btn-primary { background: #fff; color: var(--th-navy) !important; border-color: #fff; }
.th-hero-btn-primary:hover { background: #eef5ff; }
.th-hero-art { position: absolute; right: -30px; top: -40px; width: 260px; height: 260px; opacity: 0.18; pointer-events: none; }
.th-hero-art polygon { fill: none; stroke: #fff; stroke-width: 2; }
.th-hero-art .hex-1 { fill: rgba(90, 162, 230, 0.6); stroke: none; }
.th-hero-art .hex-2 { fill: rgba(255, 255, 255, 0.25); stroke: none; }

/* KPI tiles */
.th-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.th-kpi {
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 18px 16px; border-radius: 14px;
  background: #fff; border: 1px solid #e2e8f0;
  color: #334155 !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.th-kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08); border-color: #cbd5e1; }
.th-kpi.is-alert { border-color: #fecaca; background: linear-gradient(180deg, #fff 0%, #fff7f7 100%); }
.th-kpi-icon { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 10px; }
.th-kpi-icon.blue { background: #e0edfb; color: #1f5aa6; }
.th-kpi-icon.green { background: #dcfce7; color: #15803d; }
.th-kpi-icon.red { background: #fee2e2; color: #b91c1c; }
.th-kpi-icon.purple { background: #ede9fe; color: #6d28d9; }
.th-kpi-icon.amber { background: #fef3c7; color: #b45309; }
.th-kpi-label { font-size: 13px; color: #64748b; font-weight: 500; }
.th-kpi-value { font-size: 26px; font-weight: 700; color: var(--th-ink); line-height: 1.25; font-variant-numeric: tabular-nums; word-break: break-word; }
.th-kpi-foot { font-size: 12.5px; color: #64748b; }

/* cards */
.th-dash-cols > [class*="col-"] { display: flex; flex-direction: column; gap: 20px; }
.th-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px 20px; }
.th-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.th-card h3, .th-card-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--th-ink); display: flex; align-items: center; gap: 8px; }
.th-card h3 i { color: var(--th-blue); }
.th-card-title { margin-bottom: 12px; }
.th-link { font-size: 13px; font-weight: 500; color: var(--th-blue); margin-left: 12px; }
.th-link:hover { color: var(--th-navy); }
.th-muted-block { margin: 4px 0 2px; color: #64748b; }
.th-sub { font-size: 12px; color: #64748b; }
.th-strong { font-weight: 600; color: var(--th-ink); }

.th-pill { min-width: 24px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; }
.th-pill.bad { background: #fee2e2; color: #b91c1c; }
.th-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.th-chip.ok { background: #dcfce7; color: #166534; }
.th-chip.warn { background: #fef3c7; color: #92400e; }
.th-chip.bad { background: #fee2e2; color: #b91c1c; }
.th-chip.info { background: #e0edfb; color: #1e4f8f; }

.th-btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1px solid #e2e8f0; background: #fff; color: #334155 !important; white-space: nowrap;
}
.th-btn-sm:hover { background: #f8fafc; border-color: #cbd5e1; }
.th-btn-sm.primary { background: var(--th-blue); border-color: var(--th-blue); color: #fff !important; }
.th-btn-sm.primary:hover { background: #2668a3; }
.th-btn-sm.danger { background: #dc2626; border-color: #dc2626; color: #fff !important; }
.th-btn-sm.danger:hover { background: #b91c1c; }
.th-btn-sm.whatsapp { background: #16a34a; border-color: #16a34a; color: #fff !important; }
.th-btn-sm.whatsapp:hover { background: #15803d; }
.th-btn-sm.light { background: #fff; border-color: #fff; color: var(--th-navy) !important; }
.th-block { display: flex; width: 100%; margin-top: 14px; padding: 9px 12px; }

/* needs attention */
.th-empty { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: #f0fdf4; color: #166534; }
.th-empty span { color: #15803d; }
.th-empty-icon { width: 42px; height: 42px; border-radius: 50%; background: #dcfce7; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.th-todo { list-style: none; margin: 0; padding: 0; }
.th-todo li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #f1f5f9; }
.th-todo li:first-child { border-top: 0; padding-top: 4px; }
.th-todo-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; background: #e0edfb; color: #1f5aa6; }
.th-todo-overdue .th-todo-icon { background: #fee2e2; color: #b91c1c; }
.th-todo-contract .th-todo-icon { background: #ede9fe; color: #6d28d9; }
.th-todo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.th-todo-text strong { color: var(--th-ink); font-weight: 600; }
.th-todo-text span { font-size: 12.5px; color: #64748b; }

/* invoices table */
.th-table { margin: 0; }
.th-table > thead > tr > th { border-bottom: 1px solid #e2e8f0 !important; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; font-weight: 600; }
.th-table > tbody > tr > td { vertical-align: middle; border-top: 1px solid #f1f5f9 !important; }
.th-table > tbody > tr:hover { background: #f8fafc; }

/* chart */
.th-chart-filters { display: flex; gap: 8px; }
.th-chart-filters select { width: auto; min-width: 100px; }
.th-chart-wrap { position: relative; height: 300px; }

/* projects */
.th-projects { list-style: none; margin: 0; padding: 0; }
.th-projects li + li { margin-top: 6px; }
.th-projects a { display: block; padding: 10px; margin: 0 -10px; border-radius: 10px; color: inherit; }
.th-projects a:hover { background: #f8fafc; }
.th-proj-top { display: flex; justify-content: space-between; gap: 10px; }
.th-proj-top strong { color: var(--th-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-proj-pct { font-weight: 700; color: var(--th-blue); font-variant-numeric: tabular-nums; }
.th-progress { display: block; height: 8px; margin: 8px 0 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.th-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--th-blue), var(--th-blue-bright)); transition: width 0.8s ease; }
.th-progress.light { background: rgba(255, 255, 255, 0.25); }
.th-progress.light > span { background: #fff; }
.th-proj-meta { font-size: 12.5px; color: #64748b; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.th-dot-status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.th-late { color: #b91c1c; font-weight: 600; }

/* tickets */
.th-tickets { list-style: none; margin: 0; padding: 0; }
.th-tickets a { display: flex; flex-direction: column; gap: 4px; padding: 10px; margin: 0 -10px; border-radius: 10px; color: inherit; }
.th-tickets a:hover { background: #f8fafc; }
.th-tickets strong { color: var(--th-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-tickets span { font-size: 12.5px; color: #64748b; }

/* feature card (prospecting) */
.th-card-feature { background: linear-gradient(135deg, #1f5aa6 0%, var(--th-navy) 100%); border: 0; color: #dbe6f6; }
.th-card-feature h3 { color: #fff; margin-bottom: 8px; }
.th-card-feature h3 i { color: #fff; }
.th-card-feature p { margin: 0 0 10px; }
.th-card-feature .th-btn-sm { margin-top: 6px; }

/* account manager */
.th-manager { display: flex; align-items: center; gap: 12px; }
.th-manager + .th-manager { margin-top: 12px; }
.th-manager img, .th-manager-logo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.th-manager-logo { display: inline-flex; align-items: center; justify-content: center; background: #e0edfb; color: #1f5aa6; font-size: 20px; }
.th-manager strong { display: block; color: var(--th-ink); }
.th-manager a { font-size: 13px; word-break: break-all; }

@media (max-width: 767px) {
  .th-hero { padding: 22px 20px; border-radius: 14px; }
  .th-hero h2 { font-size: 23px; }
  .th-hero-actions { width: 100%; }
  .th-hero-btn { flex: 1 1 auto; justify-content: center; }
  .th-kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .th-kpi { padding: 14px; }
  .th-kpi-value { font-size: 20px; }
  .th-kpi-foot { display: none; }
  .th-card { padding: 16px; }
  .th-todo li { flex-wrap: wrap; }
  .th-todo .th-btn-sm { margin-left: 48px; }
}
@media (max-width: 380px) { .th-kpis { grid-template-columns: 1fr; } }
@media (max-width: 1199px) { .th-dash-cols > .col-lg-4 { margin-top: 20px; } }
.th-card h3.th-card-title { margin-bottom: 14px; }
@media (max-width: 767px) {
  /* attention items: action button drops below the text */
  .th-todo-text { flex: 1 1 calc(100% - 48px); }
  .th-todo .th-btn-sm { margin-left: 48px; }
  /* invoices: the invoice number is the tap target; let cells wrap instead of scrolling */
  .th-dash .table-responsive { border: 0; overflow-x: visible; }
  .th-table > thead > tr > th, .th-table > tbody > tr > td { white-space: normal !important; padding: 10px 6px; }
  .th-table .th-chip { white-space: normal; text-align: center; }
}
.th-table .th-strong { white-space: nowrap; }

/* Slim footer: copyright left, legal links right */
footer.th-footer-slim .th-footer-bottom { padding: 18px 0; border-top: 0; }
.th-shell > footer.th-footer-slim { margin-top: 40px; }
@media (max-width: 575px) { footer.th-footer-slim .th-footer-bottom { flex-direction: row; justify-content: space-between; } }

/* =====================================================================
 * Projects page
 * ===================================================================== */
.th-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.th-page-head h2 { margin: 0 0 4px; font-size: 24px; font-weight: 700; color: var(--th-ink); }
.th-page-head p { margin: 0; color: #64748b; }
.th-warn-text { color: #b45309; font-weight: 600; }

.th-filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.th-fpill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: #fff; border: 1px solid #e2e8f0;
  color: #334155 !important; font-size: 13.5px; font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.th-fpill i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.th-fpill span { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 700; text-align: center; }
.th-fpill:hover { border-color: #94a3b8; }
.th-fpill.active { background: var(--th-navy); border-color: var(--th-navy); color: #fff !important; }
.th-fpill.active span { background: rgba(255, 255, 255, 0.18); color: #fff; }

.th-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.th-search { position: relative; flex: 1 1 280px; max-width: 420px; margin: 0; font-weight: 400; }
.th-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.th-search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.th-search input:focus { outline: none; border-color: var(--th-blue); box-shadow: 0 0 0 3px rgba(48, 120, 184, 0.15); }
.th-sort { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: #64748b; font-size: 13px; }
.th-sort select { width: auto; height: 36px; border-radius: 8px; }

.th-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.th-project-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 20px; border-radius: 14px;
  background: #fff; border: 1px solid #e2e8f0;
  color: #334155 !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.th-project-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08); border-color: #cbd5e1; }
.th-project-card:focus-visible { outline: 2px solid var(--th-blue); outline-offset: 2px; }
.th-project-card[hidden] { display: none; }
.th-project-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.th-status-chip i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.th-due { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.th-due.ok { color: #64748b; }
.th-due.soon { color: #b45309; }
.th-due.late { color: #b91c1c; }
.th-due.done { color: #15803d; }
.th-project-name { font-size: 17px; font-weight: 700; color: var(--th-ink); line-height: 1.3; }
.th-project-desc { font-size: 13.5px; color: #64748b; line-height: 1.5; }
.th-project-progress { display: block; margin-top: 2px; }
.th-progress-label { display: flex; justify-content: space-between; font-size: 12.5px; color: #64748b; }
.th-progress-label strong { color: var(--th-blue); font-variant-numeric: tabular-nums; }
.th-project-progress .th-progress { margin: 6px 0 0; }
.th-project-facts { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid #f1f5f9; font-size: 13px; color: #475569; }
.th-project-facts i { width: 16px; color: #94a3b8; margin-right: 7px; text-align: center; }
.th-project-open { margin-top: auto; padding-top: 4px; font-size: 13px; font-weight: 600; color: var(--th-blue); }
.th-project-card:hover .th-project-open i { transform: translateX(3px); }
.th-project-open i { transition: transform 0.15s ease; }

.th-empty-page { text-align: center; padding: 40px 20px; }
.th-empty-page h3 { justify-content: center; margin: 12px 0 6px; font-size: 18px; }
.th-empty-page p { color: #64748b; margin: 0 0 14px; }
.th-empty-icon.big { width: 64px; height: 64px; font-size: 26px; background: #e0edfb; color: #1f5aa6; margin: 0 auto; display: flex; border-radius: 50%; align-items: center; justify-content: center; }

@media (max-width: 767px) {
  .th-page-head h2 { font-size: 21px; }
  .th-project-grid { grid-template-columns: 1fr; }
  .th-filter-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .th-fpill { flex: 0 0 auto; }
  .th-search { max-width: none; }
}
.th-sort span { white-space: nowrap; }
.th-page-head .th-page-summary { font-size: 15px; color: #475569; }

/* =====================================================================
 * Invoices page
 * ===================================================================== */
.th-bad-text { color: #b91c1c; font-weight: 600; }
.th-fpill i.dot-warn { background: #f59e0b; }
.th-fpill i.dot-ok { background: #16a34a; }
.th-fpill i.dot-info { background: #3078b8; }
.th-fpill i.dot-bad { background: #dc2626; }
.th-fpill i.dot-muted { background: #94a3b8; }
.th-chip.muted { background: #f1f5f9; color: #475569; }
div.th-kpi:hover { transform: none; box-shadow: none; border-color: #e2e8f0; }

.th-invoice-list { padding: 6px 0; }
.th-inv-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(130px, 1fr) minmax(150px, 1.2fr) 140px minmax(150px, auto);
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
}
.th-inv-row[hidden] { display: none; }
.th-inv-head { border-top: 0; padding-top: 10px; padding-bottom: 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
#th-invoice-rows .th-inv-row:hover { background: #f8fafc; }
.th-inv-row.is-overdue { box-shadow: inset 3px 0 0 #dc2626; }
.th-inv-row small { display: block; font-size: 12px; color: #64748b; }
.th-inv-number a { font-weight: 700; color: var(--th-ink); white-space: nowrap; }
.th-inv-number a:hover { color: var(--th-blue); }
.th-inv-due small.th-due { display: block; margin-top: 2px; }
.th-inv-amount strong { color: var(--th-ink); font-variant-numeric: tabular-nums; }
.th-progress.thin { height: 5px; margin: 6px 0 0; max-width: 160px; }
.th-inv-actions { text-align: right; }

@media (max-width: 991px) {
  .th-inv-head { display: none; }
  /* Phones & tablets: one card per invoice. Amount top-right, status under it, due line, then the action */
  .th-invoice-list { padding: 0; background: none; border: 0; box-shadow: none; display: flex; flex-direction: column; gap: 12px; }
  .th-inv-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "num amount" "due status" "act act";
    gap: 6px 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
  }
  .th-inv-row.is-overdue { box-shadow: none; border-left: 4px solid #dc2626; padding-left: 13px; }
  #th-invoice-rows { display: flex; flex-direction: column; gap: 12px; }
  #th-invoice-rows .th-inv-row:hover { background: #fff; }
  .th-inv-number { grid-area: num; }
  .th-inv-amount { grid-area: amount; text-align: right; }
  .th-inv-amount strong { font-size: 17px; }
  .th-inv-amount .th-progress.thin { margin-left: auto; }
  .th-inv-status { grid-area: status; justify-self: end; align-self: start; }
  .th-inv-due { grid-area: due; font-size: 13px; color: #334155; }
  .th-inv-due-label i { color: #94a3b8; margin-right: 2px; }
  .th-inv-actions { grid-area: act; text-align: left; margin-top: 6px; }
  .th-inv-actions .th-btn-sm { width: 100%; padding: 10px 12px; justify-content: center; }
  /* Paid: a quiet link instead of a full-width button */
  .th-inv-actions .th-btn-sm.th-inv-view { width: auto; margin-top: -2px; padding: 0; gap: 0; border: 0; background: none; box-shadow: none; color: var(--th-blue) !important; font-weight: 600; justify-content: flex-start; }
  .th-inv-actions .th-btn-sm.th-inv-view:hover { background: none; text-decoration: underline; }
}
.th-inv-view-more { display: none; }
@media (max-width: 991px) { .th-inv-view-more { display: inline; margin-left: 0.3em; } }
/* Money must never break mid-number; shrink to fit instead */
.th-kpi-value { overflow-wrap: normal; word-break: normal; }
@media (max-width: 767px) {
  .th-kpi-value { white-space: nowrap; font-size: clamp(15px, 4.6vw, 20px); }
  .th-page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* =====================================================================
 * Single project page
 * ===================================================================== */
.th-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #64748b; margin-bottom: 10px; }
.th-back:hover { color: var(--th-blue); }
.th-project-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.th-project-title h2 { margin: 0 0 8px; font-size: 24px; font-weight: 700; color: var(--th-ink); letter-spacing: -0.01em; }
.th-project-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.th-muted { color: #64748b; font-size: 13px; }
.th-team { display: inline-flex; align-items: center; gap: 8px; }
.th-team > span[data-toggle] { display: inline-flex; margin-right: -6px; }
.th-team-avatar { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; }
.th-team .th-muted { margin-left: 8px; }
.th-new-task { padding: 9px 14px; }

.th-project-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.th-pstat { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.th-pstat-label { font-size: 12.5px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.th-pstat-label i { margin-right: 4px; color: var(--th-blue); }
.th-pstat-value { font-size: 24px; font-weight: 700; color: var(--th-ink); line-height: 1.25; }
.th-pstat-value small { font-size: 14px; font-weight: 500; color: #64748b; }
.th-pstat-sub { font-size: 12.5px; color: #64748b; }
.th-pstat .th-progress { margin: 8px 0 0; }
.th-pstat-late { border-color: #fecaca; background: linear-gradient(180deg, #fff 0%, #fff7f7 100%); }
.th-pstat-late .th-pstat-value { color: #b91c1c; }
.th-pstat-late .th-progress > span { background: linear-gradient(90deg, #f87171, #dc2626); }
.th-pstat-soon .th-pstat-value { color: #b45309; }
.th-pstat-done .th-pstat-value { color: #15803d; }
.th-pstat-done .th-progress > span { background: linear-gradient(90deg, #4ade80, #16a34a); }
.th-progress.th-time > span { background: linear-gradient(90deg, #94a3b8, #64748b); }

/* tabs (Perfex markup, brand styling) */
.th-project-body { padding: 0; overflow: hidden; }
.th-project-body .horizontal-scrollable-tabs { margin: 0; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.th-project-body .nav-tabs { border: 0; padding: 0 12px; }
.th-project-body .nav-tabs > li > a {
  border: 0 !important; border-radius: 0; margin: 0; padding: 14px 14px 12px;
  color: #64748b; font-weight: 500; background: transparent !important;
  box-shadow: inset 0 -2px 0 transparent; transition: color 0.15s ease, box-shadow 0.15s ease;
}
.th-project-body .nav-tabs > li > a:hover { color: var(--th-ink); box-shadow: inset 0 -2px 0 #cbd5e1; }
.th-project-body .nav-tabs > li.active > a,
.th-project-body .nav-tabs > li.active > a:hover,
.th-project-body .nav-tabs > li.active > a:focus { color: var(--th-navy); font-weight: 600; box-shadow: inset 0 -2px 0 var(--th-blue); }
.th-project-body .nav-tabs .menu-icon { margin-right: 6px; opacity: 0.8; }
.th-project-tab-content { padding: 20px 22px 22px; }
.th-project-tab-content .table > thead > tr > th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; border-bottom: 1px solid #e2e8f0; }
.th-project-tab-content .panel_s { box-shadow: none; }

/* overview tab */
.th-overview { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 22px; }
.th-ov-section + .th-ov-section { margin-top: 22px; }
.th-ov-section h3 { margin: 0 0 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.th-ov-description { font-size: 15px; line-height: 1.7; color: #334155; }
.th-overview-side .th-ov-section { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: 16px 18px; }
.th-details { margin: 0; }
.th-details > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid #eef2f7; }
.th-details > div:first-child { border-top: 0; padding-top: 0; }
.th-details dt { font-weight: 500; color: #64748b; }
.th-details dd { font-weight: 600; color: var(--th-ink); text-align: right; }
.th-details > div.ok dd { color: #15803d; }
.th-mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.th-mini-stat { border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.th-mini-stat span { font-size: 12.5px; color: #64748b; }
.th-mini-stat strong { font-size: 17px; color: var(--th-ink); }
.th-mini-stat small { font-size: 12.5px; color: #475569; }
.th-mini-stat.info strong { color: #1e4f8f; }
.th-mini-stat.ok strong { color: #15803d; }
.th-mini-stat.bad strong { color: #b91c1c; }

@media (max-width: 991px) {
  .th-overview { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .th-project-title h2 { font-size: 21px; }
  .th-project-tab-content { padding: 16px; }
  .th-new-task { width: 100%; justify-content: center; }
}
/* Perfex's scrollable tab bar has a fixed height; let it size to the tabs and scroll sideways */
.th-project-body .horizontal-scrollable-tabs { height: auto; }
.th-project-body .horizontal-tabs { height: auto; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: thin; }
.th-project-body .nav-tabs { display: flex; flex-wrap: nowrap; height: auto; }
.th-project-body .nav-tabs > li { float: none; flex: 0 0 auto; }
.th-project-body .nav-tabs > li > a { line-height: 1.4; padding: 13px 14px 11px; }
.th-project-body .horizontal-scrollable-tabs .scroller { display: none !important; }
/* Perfex gives this tab list a -24px top margin, which pushed the labels out of the card */
.th-project-body .nav-tabs.nav-tabs-horizontal { margin: 0 !important; }
.th-project-body .nav-tabs.nav-tabs-horizontal { padding: 0 10px !important; }

/* Project overview: finance tables */
.th-fin-table-wrap { border: 1px solid #e2e8f0; border-radius: 12px; overflow-x: auto; }
.th-fin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.th-fin-table th, .th-fin-table td { padding: 11px 16px; text-align: left; border-top: 1px solid #f1f5f9; }
.th-fin-table thead th { border-top: 0; background: #f8fafc; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.th-fin-table tbody th { font-weight: 500; color: #334155; white-space: nowrap; }
.th-fin-table td { font-weight: 600; color: var(--th-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-fin-table:not(.th-fin-cols) td, .th-fin-table:not(.th-fin-cols) thead th:not(:first-child) { text-align: right; }
.th-fin-table i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: #94a3b8; vertical-align: middle; }
.th-fin-table .info i { background: #3078b8; }
.th-fin-table .ok i { background: #16a34a; }
.th-fin-table .bad i { background: #dc2626; }
.th-fin-table tr.info td, .th-fin-table td.info { color: #1e4f8f; }
.th-fin-table tr.ok td, .th-fin-table td.ok { color: #15803d; }
.th-fin-table tr.bad td, .th-fin-table td.bad { color: #b91c1c; }
.th-fin-cols th, .th-fin-cols td { width: 25%; }
.th-fin-cols tbody td { font-size: 16px; padding-top: 14px; padding-bottom: 14px; }
@media (max-width: 575px) {
  /* expenses: stack the four columns as label/value rows on phones */
  .th-fin-cols thead { display: none; }
  .th-fin-cols tbody tr { display: grid; grid-template-columns: 1fr; }
  .th-fin-cols tbody td { width: auto; display: flex; justify-content: space-between; border-top: 1px solid #f1f5f9; font-size: 15px; }
  .th-fin-cols tbody td:first-child { border-top: 0; }
  .th-fin-cols tbody td::before { content: attr(data-label); font-weight: 500; color: #475569; }
}
/* Tab bar edges: Perfex pulls these tabs outwards (for padded panels), so undo that here,
   and add real spacers at both ends so the first and last tab never touch the card edge,
   even when the bar scrolls sideways */
.th-project-body .panel-full-width-tabs,
.th-project-body .horizontal-scrollable-tabs,
.th-project-body .horizontal-tabs { margin-left: 0 !important; margin-right: 0 !important; }
.th-project-body .nav-tabs.nav-tabs-horizontal { padding: 0 !important; }
.th-project-body .nav-tabs.nav-tabs-horizontal::before,
.th-project-body .nav-tabs.nav-tabs-horizontal::after { content: ""; display: block; flex: 0 0 14px; }
.th-project-body .nav-tabs.nav-tabs-horizontal { display: flex !important; flex-wrap: nowrap; }
/* Perfex snaps this bar to tab starts, which made the end spacer unreachable */
.th-project-body .nav-tabs.nav-tabs-horizontal { scroll-snap-type: none !important; }

/* ---------- Project › Tasks tab ---------- */
.th-tasks .th-filter-pills { margin-bottom: 14px; }
.th-tasks button.th-fpill { font: inherit; cursor: pointer; }
.th-tasks .th-toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.th-segment { display: inline-flex; padding: 3px; border-radius: 10px; background: #f1f5f9; }
.th-segment button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #475569; }
.th-segment button i { margin-right: 4px; }
.th-segment button[aria-pressed="true"] { background: #fff; color: var(--th-navy); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }

.th-task-list { border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.th-task-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 150px 150px 40px;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid #eef2f7;
  background: #fff;
  transition: background 0.15s;
}
.th-task-row:first-child { border-top: 0; }
.th-task-row:hover { background: #f8fafc; }
.th-task-row.is-late { box-shadow: inset 3px 0 0 #dc2626; }
.th-task-dot { color: var(--dot, #94a3b8); font-size: 18px; line-height: 1; }
.th-task-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.th-task-name { font-weight: 600; color: var(--th-ink) !important; overflow-wrap: anywhere; }
.th-task-name:hover { color: var(--th-blue) !important; }
.is-done .th-task-name { color: #64748b !important; text-decoration: line-through; text-decoration-color: #cbd5e1; }
.th-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12.5px; color: #64748b; }
.th-task-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.th-task-meta i { color: #94a3b8; font-size: 11px; }
.th-task-tag { padding: 1px 8px; border-radius: 6px; background: #f1f5f9; color: #475569; font-weight: 500; }
.th-task-tag.ok { background: #dcfce7; color: #166534; }
.th-task-tag.ok i { color: #16a34a; }
.th-task-due { font-size: 12.5px; }
.th-task-status { display: flex; }
.th-task-actions { display: flex; justify-content: flex-end; }
.th-task-actions .th-icon-btn { width: 34px; height: 34px; font-size: 15px; }

.th-task-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.th-board-col { flex: 0 0 290px; display: flex; flex-direction: column; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-top: 3px solid var(--col, var(--th-blue)); }
.th-board-head { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 12px 14px 10px; }
.th-board-head strong { color: var(--th-ink); overflow-wrap: anywhere; }
.th-board-head small { grid-column: 1 / -1; color: #64748b; font-size: 12px; }
.th-board-head .th-progress.thin { grid-column: 1 / -1; max-width: none; }
.th-board-count { font-size: 12px; font-weight: 700; color: #475569; background: #e2e8f0; border-radius: 999px; padding: 1px 8px; align-self: start; }
.th-board-desc { grid-column: 1 / -1; margin-top: 6px; font-size: 12.5px; color: #475569; }
.th-board-desc summary { cursor: pointer; color: var(--th-blue); font-weight: 600; }
.th-board-desc > div { margin-top: 6px; }
.th-board-body { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 12px; }
.th-board-empty { margin: 4px; font-size: 13px; color: #94a3b8; }
.th-task-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.th-task-card:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06); }
.th-task-card.is-late { border-left: 3px solid #dc2626; }
.th-task-card .th-task-dot { font-size: 16px; padding-top: 1px; }
.th-task-card .th-task-meta { gap: 4px 10px; }
.th-task-card .th-task-actions .th-icon-btn { width: 28px; height: 28px; font-size: 13px; }

@media (max-width: 991px) {
  .th-task-row { grid-template-columns: 28px minmax(0, 1fr) auto 34px; }
  .th-task-row .th-task-due { grid-column: 2; grid-row: 2; }
  .th-task-row .th-task-status { grid-column: 3; grid-row: 1; }
  .th-task-row .th-task-actions { grid-column: 4; grid-row: 1; }
}
@media (max-width: 575px) {
  .th-task-row { grid-template-columns: 24px minmax(0, 1fr) 34px; padding: 12px; gap: 6px 10px; }
  .th-task-row .th-task-status { grid-column: 2; grid-row: 3; }
  .th-task-row .th-task-actions { grid-column: 3; grid-row: 1; }
  .th-tasks .th-toolbar-right { width: 100%; justify-content: space-between; }
  .th-board-col { flex-basis: 82vw; }
}
.th-sort select { padding-right: 28px; }

/* ---------- Project › single task ---------- */
.th-task-view .th-back { margin-bottom: 14px; }
.th-task-head { display: flex; align-items: flex-start; gap: 12px; }
.th-task-head .th-task-dot { font-size: 22px; padding-top: 3px; }
.th-task-title { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.th-task-title h3 { margin: 0; font-size: 21px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-task-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 0; }
.th-task-facts > div { padding: 11px 14px; border: 1px solid #eef2f7; border-radius: 10px; background: #f8fafc; }
.th-task-facts > div.ok { background: #f0fdf4; border-color: #dcfce7; }
.th-task-facts dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; margin-bottom: 4px; }
.th-task-facts dd { font-weight: 600; color: var(--th-ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.th-task-facts dd small { font-size: 12px; }
.th-task-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: #f0fdf4; color: #166534; font-size: 13.5px; }
.th-task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; margin-top: 22px; padding-top: 20px; border-top: 1px solid #eef2f7; }
.th-task-layout.single { grid-template-columns: minmax(0, 1fr); }
.th-task-side .th-ov-section { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: 16px 18px; }
.th-task-side .th-ov-section + .th-ov-section { margin-top: 14px; }
.th-h-count { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 11.5px; letter-spacing: 0; }
.th-task-body .th-progress.thin { max-width: 240px; margin: -4px 0 10px; }
.th-checklist { list-style: none; margin: 0; padding: 0; }
.th-checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid #f1f5f9; }
.th-checklist li:first-child { border-top: 0; }
.th-checklist li i { color: #94a3b8; font-size: 16px; margin-top: 2px; }
.th-checklist li.is-done i { color: #16a34a; }
.th-checklist li.is-done span { color: #64748b; text-decoration: line-through; text-decoration-color: #cbd5e1; }
.th-attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.th-attachment { position: relative; display: flex; flex-direction: column; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; }
.th-attachment-preview { height: 110px; display: flex; align-items: center; justify-content: center; background: #f1f5f9; }
.th-attachment-preview a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: #64748b; font-size: 30px; }
.th-attachment-preview img, .th-attachment-preview video { width: 100%; height: 100%; object-fit: cover; }
.th-attachment-info { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; min-width: 0; }
.th-attachment-name { font-weight: 600; font-size: 13px; color: var(--th-ink) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-attachment-info small { color: #64748b; font-size: 11.5px; }
.th-attachment .th-icon-btn { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; font-size: 13px; background: rgba(255, 255, 255, 0.92); }
.th-attachment .th-icon-btn + .th-icon-btn { right: 40px; }
.th-icon-btn.danger { color: #dc2626; }
#show-more-less-task-attachments-col { margin-top: 10px; font-size: 13px; font-weight: 600; }
.th-dropzone.dropzone { min-height: 110px; border: 2px dashed #cbd5e1 !important; border-radius: 12px; background: #f8fafc; }
.th-dropzone.dropzone:hover { border-color: var(--th-blue) !important; }
.th-upload-extra { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
.th-comment { display: flex; gap: 12px; margin-bottom: 14px; }
.th-comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.th-comment-bubble { flex: 1 1 auto; min-width: 0; padding: 10px 14px; border-radius: 4px 12px 12px 12px; background: #f1f5f9; }
.th-comment.is-client .th-comment-bubble { background: #e8f1fb; }
.th-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.th-comment-head strong { color: var(--th-ink); }
.th-comment-head small { color: #64748b; font-size: 12px; }
.th-comment-actions { margin-left: auto; display: inline-flex; gap: 12px; }
.th-comment-actions a { color: #64748b; }
.th-comment-actions a:hover { color: var(--th-blue); }
.th-comment-actions a.text-danger:hover { color: #b91c1c; }
.th-comment .comment-content { overflow-wrap: anywhere; }
.th-comment .comment-content .th-attachments { margin-top: 8px; }
.th-comment-edit-actions, .th-comment-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.th-comment-form { margin-top: 6px; }
.th-comment-form textarea, [data-edit-comment] textarea { border-radius: 10px; resize: vertical; }
.th-assignees { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.th-assignees li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.th-assignees .th-team-avatar { width: 32px; height: 32px; border: 0; }
@media (max-width: 991px) {
  .th-task-layout { grid-template-columns: minmax(0, 1fr); }
  .th-task-side { order: -1; }
}
@media (max-width: 575px) {
  .th-task-head { flex-wrap: wrap; }
  .th-task-head .th-btn-sm { margin-left: 34px; }
  .th-task-facts { grid-template-columns: 1fr 1fr; }
}
.th-comments #task-comments { display: block; width: auto; max-width: none; margin: 0 0 14px; padding: 0; background: none; border: 0; }
.th-dropzone + .th-upload-extra:empty, .th-upload-extra:not(:has(:not(.hide):not(:empty))) { display: none; }

/* ---------- Project › new / edit task form ---------- */
.th-task-form-page { max-width: 820px; }
.th-form-head h3 { margin: 4px 0 4px; font-size: 21px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-form-head p { margin: 0 0 18px; color: #64748b; }
.th-form-section { padding: 18px 0; border-top: 1px solid #eef2f7; }
.th-form-section h4 { margin: 0 0 14px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.th-form .control-label, .th-form legend.control-label { font-weight: 600; color: #334155; font-size: 13.5px; }
.th-form legend { border: 0; margin-bottom: 8px; width: auto; }
.th-form .form-control { border-radius: 10px; min-height: 40px; }
.th-form textarea.form-control { resize: vertical; }
.th-form .input-group .form-control { border-radius: 10px 0 0 10px; }
.th-form .input-group-addon, .th-form .input-group-btn .btn { border-radius: 0 10px 10px 0; min-height: 40px; }
.th-form .bootstrap-select > .dropdown-toggle { border-radius: 10px; min-height: 40px; }
.th-req { color: #dc2626; }
.th-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.th-form-hint { margin: 0; font-size: 12.5px; color: #64748b; }
.th-form-hint i { margin-right: 4px; }
.th-choice-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.th-choice { margin: 0; cursor: pointer; font-weight: 500; }
.th-choice input { position: absolute; opacity: 0; pointer-events: none; }
.th-choice span { display: inline-block; padding: 7px 16px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #475569; font-size: 13.5px; transition: all 0.15s; }
.th-choice:hover span { border-color: #94a3b8; }
.th-choice input:focus-visible + span { outline: 2px solid var(--th-blue); outline-offset: 2px; }
.th-choice input:checked + span { font-weight: 600; }
.th-choice.muted input:checked + span { background: #f1f5f9; border-color: #94a3b8; color: #334155; }
.th-choice.info input:checked + span { background: #e0edfb; border-color: #3078b8; color: #1e4f8f; }
.th-choice.warn input:checked + span { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.th-choice.bad input:checked + span { background: #fee2e2; border-color: #dc2626; color: #b91c1c; }
.th-form .attachments .attachment + .attachment { margin-top: -6px; }
.th-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid #eef2f7; }
.th-form-actions .th-btn-sm { min-height: 40px; padding-left: 18px; padding-right: 18px; }
@media (max-width: 575px) {
  .th-form-grid { grid-template-columns: minmax(0, 1fr); }
  .th-form-actions { flex-direction: column-reverse; }
  .th-form-actions .th-btn-sm { justify-content: center; }
}

/* ---------- Project › Timesheets tab ---------- */
.th-ts-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.th-ts-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid #eef2f7; border-radius: 12px; background: #f8fafc; }
.th-ts-stat strong { font-size: 22px; font-weight: 700; color: var(--th-ink); font-variant-numeric: tabular-nums; }
.th-ts-stat small { color: #64748b; font-size: 12.5px; }
.th-ts-stat.live { background: #f0fdf4; border-color: #dcfce7; }
.th-ts-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; display: inline-flex; align-items: center; gap: 6px; }
.th-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); animation: th-pulse 1.6s infinite; }
@keyframes th-pulse { 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .th-live-dot { animation: none; } }
.th-ts-breakdown { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; margin-bottom: 22px; }
.th-ts-breakdown.single { grid-template-columns: minmax(0, 1fr); }
.th-ts-breakdown .th-ov-section { margin: 0; padding: 16px 18px; border: 1px solid #eef2f7; border-radius: 12px; }
.th-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.th-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: center; }
.th-bars li > a, .th-bar-person { font-weight: 500; color: var(--th-ink) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-bars li > a:hover { color: var(--th-blue) !important; }
.th-bars li strong { font-size: 13px; color: #334155; font-variant-numeric: tabular-nums; }
.th-bar { grid-column: 1 / -1; display: block; height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.th-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--th-blue), var(--th-blue-bright)); }
.th-bars.people .th-bar > span { background: linear-gradient(90deg, #0f766e, #2dd4bf); }
.th-bar-person { display: inline-flex; align-items: center; gap: 8px; }
.th-bar-person .th-team-avatar { width: 24px; height: 24px; border: 0; }
.th-timesheets .th-toolbar { justify-content: flex-start; }
.th-ts-days { display: flex; flex-direction: column; gap: 16px; }
.th-ts-day header { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 8px; }
.th-ts-day h4 { margin: 0; font-size: 13.5px; font-weight: 700; color: #334155; }
.th-ts-day-total { font-size: 13px; font-weight: 700; color: var(--th-blue); font-variant-numeric: tabular-nums; }
.th-ts-day ul { list-style: none; margin: 0; padding: 0; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.th-ts-entry { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #eef2f7; background: #fff; }
.th-ts-entry:first-child { border-top: 0; }
.th-ts-entry[hidden] { display: none; }
.th-ts-entry.is-running { background: #f7fef9; }
.th-ts-who .th-team-avatar { width: 34px; height: 34px; border: 0; }
.th-ts-what { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.th-ts-what a { font-weight: 600; color: var(--th-ink) !important; overflow-wrap: anywhere; }
.th-ts-what a:hover { color: var(--th-blue) !important; }
.th-ts-what small { color: #64748b; font-size: 12.5px; }
.th-ts-dur { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.th-ts-dur strong { min-width: 58px; text-align: right; font-variant-numeric: tabular-nums; color: var(--th-ink); }
.th-ts-dur .th-chip { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 767px) {
  .th-ts-breakdown { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575px) {
  .th-ts-stats { grid-template-columns: 1fr 1fr; }
  .th-ts-stat strong { font-size: 19px; }
  .th-ts-entry { padding: 11px 12px; gap: 10px; }
  .th-ts-dur { flex-direction: column; align-items: flex-end; gap: 4px; }
  .th-ts-dur strong { min-width: 0; }
  .th-ts-who .th-team-avatar { width: 30px; height: 30px; }
  .th-timesheets .th-toolbar .th-sort { flex: 1 1 100%; }
  .th-timesheets .th-toolbar .th-sort select { flex: 1 1 auto; min-width: 0; }
}

/* ---------- Project › Milestones tab (roadmap) ---------- */
.th-ms-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 24px; }
.th-ms-summary > div { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid #eef2f7; border-radius: 12px; background: #f8fafc; }
.th-ms-summary strong { font-size: 17px; color: var(--th-ink); }
.th-ms-summary small { color: #64748b; font-size: 12.5px; }
.th-ms-summary-next.th-ms-late { background: #fef2f2; border-color: #fee2e2; }
.th-ms-summary-next.th-ms-late small { color: #b91c1c; }
.th-ms-summary-next.th-ms-done { background: #f0fdf4; border-color: #dcfce7; }
.th-ms-steps { display: flex; gap: 4px; margin-top: 6px; }
.th-ms-steps i { flex: 1 1 0; height: 6px; border-radius: 999px; background: #e2e8f0; }
.th-ms-steps i.done { background: #16a34a; }
.th-ms-steps i.current { background: var(--th-blue); }
.th-ms-steps i.late { background: #dc2626; }

.th-roadmap { list-style: none; margin: 0; padding: 0; }
.th-ms { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
.th-ms:last-child { padding-bottom: 0; }
.th-ms::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: #e2e8f0; }
.th-ms:last-child::before { display: none; }
.th-ms.th-ms-done::before { background: #86efac; }
.th-ms-node { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; background: #fff; border: 2px solid var(--ms); color: var(--ms); }
.th-ms-done .th-ms-node { background: #16a34a; border-color: #16a34a; color: #fff; }
.th-ms-current .th-ms-node { background: var(--ms); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--ms) 18%, transparent); }
.th-ms-late .th-ms-node { background: #dc2626; border-color: #dc2626; color: #fff; }
.th-ms-upcoming .th-ms-node { border-style: dashed; color: #94a3b8; border-color: #cbd5e1; }
.th-ms-card { min-width: 0; padding: 14px 18px 16px; border: 1px solid #e2e8f0; border-left: 4px solid var(--ms); border-radius: 12px; background: #fff; }
.th-ms-current .th-ms-card { box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07); }
.th-ms-upcoming .th-ms-card { background: #fcfdfe; }
.th-ms-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.th-ms-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-ms-state { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e0edfb; color: #1e4f8f; white-space: nowrap; }
.th-ms-done .th-ms-state { background: #dcfce7; color: #166534; }
.th-ms-late .th-ms-state { background: #fee2e2; color: #b91c1c; }
.th-ms-upcoming .th-ms-state { background: #f1f5f9; color: #475569; }
.th-ms-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 6px 0 0; font-size: 13px; color: #64748b; }
.th-ms-dates i { margin-right: 5px; color: #94a3b8; }
.th-ms-desc { margin-top: 10px; color: #334155; font-size: 14px; }
.th-ms-desc p:last-child { margin-bottom: 0; }
.th-ms-progress { margin-top: 12px; }
.th-ms-progress .th-progress { margin-bottom: 0; }
.th-ms-done .th-ms-progress .th-progress > span { background: #16a34a; }
.th-ms-late .th-ms-progress .th-progress > span { background: #dc2626; }
.th-ms-notasks { margin: 10px 0 0; }
.th-ms-tasks { margin-top: 10px; }
.th-ms-tasks summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--th-blue); }
.th-ms-tasks[open] summary { margin-bottom: 6px; }
.th-ms-tasks ul { list-style: none; margin: 0; padding: 0; }
.th-ms-tasks li { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid #f1f5f9; font-size: 13.5px; }
.th-ms-tasks li a { flex: 1 1 auto; color: var(--th-ink) !important; min-width: 0; overflow-wrap: break-word; }
.th-ms-tasks li a:hover { color: var(--th-blue) !important; }
.th-ms-tasks li.is-done a { color: #64748b !important; text-decoration: line-through; text-decoration-color: #cbd5e1; }
.th-ms-tasks li small { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 575px) {
  .th-ms-summary { grid-template-columns: minmax(0, 1fr); }
  .th-ms { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .th-ms::before { left: 13px; top: 28px; }
  .th-ms-node { width: 28px; height: 28px; font-size: 11px; }
  .th-ms-card { padding: 12px 14px 14px; }
  .th-ms-tasks li { flex-wrap: wrap; row-gap: 2px; }
  .th-ms-tasks li small { flex-basis: 100%; padding-left: 23px; }
}

/* ---------- Files (project tab, client Files page, preview modal) ---------- */
.th-upload { margin-bottom: 20px; }
.th-files-page .th-upload { padding: 18px 20px; }
.th-upload-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--th-ink); display: flex; align-items: center; gap: 8px; }
.th-upload-title i { color: var(--th-blue); }
.th-files-page .th-upload > .th-muted { margin: 0 0 12px; }
.th-files .th-dropzone.dropzone { min-height: 96px; padding: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; }
.th-files .th-dropzone .dz-message { margin: 0; color: var(--th-blue); font-weight: 600; }
.th-files .th-dropzone .dz-message::before { content: "\f0ee"; font-family: "Font Awesome 6 Free"; font-weight: 900; display: block; font-size: 22px; margin-bottom: 4px; text-align: center; }
.th-upload-extra:empty { display: none; }
.th-files .th-toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.th-files .th-filter-pills button.th-fpill { font: inherit; cursor: pointer; }

.th-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.th-file-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; overflow: hidden; transition: box-shadow 0.15s, border-color 0.15s; }
.th-file-card:hover { border-color: #cbd5e1; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); }
.th-file-card[hidden] { display: none; }
.th-file-thumb { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 130px; padding: 0; border: 0; background: #f1f5f9; color: #64748b; cursor: pointer; overflow: hidden; }
.th-file-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.th-file-card:hover .th-file-thumb img { transform: scale(1.04); }
.th-file-thumb > i { font-size: 40px; }
.th-file-ext { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.th-file-source { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; color: #334155; font-size: 13px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15); }
.th-kind-pdf .th-file-thumb, .th-file-modal-icon.th-kind-pdf { background: #fef2f2; color: #dc2626; }
.th-kind-doc .th-file-thumb, .th-file-modal-icon.th-kind-doc { background: #eff6ff; color: #2563eb; }
.th-kind-sheet .th-file-thumb, .th-file-modal-icon.th-kind-sheet { background: #f0fdf4; color: #16a34a; }
.th-kind-slides .th-file-thumb, .th-file-modal-icon.th-kind-slides { background: #fff7ed; color: #ea580c; }
.th-kind-archive .th-file-thumb, .th-file-modal-icon.th-kind-archive { background: #fefce8; color: #a16207; }
.th-kind-video .th-file-thumb, .th-file-modal-icon.th-kind-video { background: #faf5ff; color: #9333ea; }
.th-file-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 4px; min-width: 0; }
.th-file-name { font-weight: 600; color: var(--th-ink) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-file-name:hover { color: var(--th-blue) !important; }
.th-file-body small { color: #64748b; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-file-foot { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 6px 12px; margin-top: auto; }
.th-file-talk { font-size: 12.5px; color: #94a3b8; }
.th-file-talk.has { color: var(--th-blue); font-weight: 600; }
.th-file-actions { display: flex; }
.th-file-actions .th-icon-btn { width: 32px; height: 32px; font-size: 14px; }

.th-file-modal .modal-content { display: flex; flex-direction: column; border: 0; border-radius: 14px; overflow: hidden; }
.th-file-modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #eef2f7; }
.th-file-modal-icon { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: #f1f5f9; color: #475569; }
.th-file-modal-title { flex: 1 1 auto; min-width: 0; }
.th-file-modal-title h4 { margin: 0; font-size: 17px; font-weight: 700; color: var(--th-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-file-modal-title small { color: #64748b; font-size: 12.5px; }
.th-file-modal-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.th-file-modal-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.th-file-preview { min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 18px; background: #f1f5f9; }
.th-file-preview img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12); background: #fff; }
.th-file-preview iframe, .th-file-preview video { width: 100%; height: 100%; min-height: 60vh; border: 0; border-radius: 8px; background: #fff; }
.th-file-markdown { align-self: flex-start; width: 100%; max-width: 760px; padding: 24px; border-radius: 8px; background: #fff; }
.th-file-nopreview { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: #64748b; }
.th-file-nopreview > i { font-size: 56px; color: #94a3b8; }
.th-file-nopreview strong { color: var(--th-ink); overflow-wrap: anywhere; }
.th-file-nopreview p { margin: 0 0 6px; }
.th-file-side { min-height: 0; overflow-y: auto; border-left: 1px solid #eef2f7; padding: 16px 18px; background: #fff; }
.th-file-side h5 { margin: 0 0 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.th-file-details { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid #eef2f7; }
.th-file-details .form-control { border-radius: 10px; }
@media (max-width: 991px) {
  .th-file-modal .full-screen-modal { position: relative; width: 100%; height: auto; margin: 0; }
  .th-file-modal .modal-content { height: auto; max-height: none; min-height: 100vh; border-radius: 0; }
  .th-file-modal-body { grid-template-columns: minmax(0, 1fr); }
  .th-file-preview { max-height: 55vh; }
  .th-file-side { border-left: 0; border-top: 1px solid #eef2f7; }
}
@media (max-width: 575px) {
  .th-file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .th-file-thumb { height: 100px; }
  .th-file-modal-head { flex-wrap: wrap; }
  .th-file-modal-title { flex: 1 1 calc(100% - 52px); }
  .th-file-modal-actions { width: 100%; justify-content: space-between; }
}
.th-upload-extra:not(:has(*)) { display: none; }
/* Perfex fixes these panels at 400px; let them fill the modal instead */
.th-file-modal .project_file_area, .th-file-modal .project_file_discusssions_area { height: auto !important; overflow-y: auto; margin-top: 0; }

/* ---------- Project › Discussions ---------- */
.th-disc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.th-disc-top .th-page-summary { margin: 0; }
.th-disc-new { margin-bottom: 18px; padding: 16px 18px; border: 1px solid #dbe7f5; border-radius: 12px; background: #f8fbff; }
.th-disc-new h4 { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--th-ink); }
.th-disc-new .th-form-actions { padding-top: 4px; border-top: 0; }
.th-disc-list { list-style: none; margin: 0; padding: 0; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.th-disc-list > li + li { border-top: 1px solid #eef2f7; }
.th-disc-list > li[hidden] { display: none; }
.th-disc-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; color: inherit !important; text-decoration: none !important; transition: background 0.15s; }
.th-disc-item:hover { background: #f8fafc; }
.th-disc-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.th-disc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.th-disc-main strong { color: var(--th-ink); font-size: 15px; overflow-wrap: anywhere; }
.th-disc-item:hover .th-disc-main strong { color: var(--th-blue); }
.th-disc-main strong .th-chip { margin-left: 6px; vertical-align: 2px; font-size: 11px; }
.th-disc-excerpt { color: #475569; font-size: 13.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.th-disc-main small { color: #94a3b8; font-size: 12.5px; }
.th-disc-count { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 12.5px; font-weight: 600; }
.th-disc-count.has { background: #e0edfb; color: #1e4f8f; }

.th-disc-head h3 { margin: 0; font-size: 21px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-disc-meta { margin: 4px 0 16px; color: #64748b; font-size: 13px; }
.th-disc-post { display: flex; gap: 12px; }
.th-disc-post-body { flex: 1 1 auto; min-width: 0; padding: 12px 16px; border-radius: 4px 12px 12px 12px; background: #e8f1fb; }
.th-disc-post.is-team .th-disc-post-body { background: #f1f5f9; }
.th-disc-post-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.th-disc-post-head strong { color: var(--th-ink); }
.th-disc-post .tc-content p:last-child { margin-bottom: 0; }
.th-disc-replies { margin-top: 22px; padding-top: 18px; border-top: 1px solid #eef2f7; }
.th-disc-replies h4 { margin: 0 0 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }

/* Perfex's comment widget (discussions + file discussions) */
.jquery-comments .textarea-wrapper .textarea { border-radius: 10px; border-color: #e2e8f0; }
.jquery-comments .textarea-wrapper .control-row > .send.enabled { background: var(--th-blue); border-radius: 8px; }
.jquery-comments .textarea-wrapper .control-row > span { border-radius: 8px; }
.jquery-comments ul.navigation li.active:after { background: var(--th-blue); }
.jquery-comments ul.main li.comment .name { color: var(--th-ink); font-weight: 600; }
.jquery-comments ul.main li.comment .wrapper .content { color: #334155; }
.jquery-comments .profile-picture.round { object-fit: cover; }
@media (max-width: 575px) {
  .th-disc-item { gap: 10px; padding: 12px; }
  .th-disc-avatar { width: 34px; height: 34px; }
  .th-disc-count { padding: 2px 8px; }
}

/* ---------- Project › Gantt (timeline) ---------- */
.th-gantt { --label: 230px; --row: 38px; }
.th-gantt-bar { align-items: center; }
.th-gantt-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #475569; }
.th-gantt-legend li { display: inline-flex; align-items: center; gap: 6px; }
.th-gantt-legend li span { color: #94a3b8; font-weight: 600; }
.th-gantt-legend i { width: 14px; height: 8px; border-radius: 4px; display: inline-block; }
.th-gantt-legend i.done, .th-gantt-task.done { background: #22c55e; }
.th-gantt-legend i.active, .th-gantt-task.active { background: var(--th-blue); }
.th-gantt-legend i.planned, .th-gantt-task.planned { background: #94a3b8; }
.th-gantt-legend i.late, .th-gantt-task.late { background: #dc2626; }
.th-gantt-scroll { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; scrollbar-width: thin; }
.th-gantt-scroll:focus-visible { outline: 2px solid var(--th-blue); outline-offset: 2px; }
.th-gantt-inner { position: relative; min-width: 100%; }
.th-gantt-row { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); min-height: var(--row); border-top: 1px solid #f1f5f9; }
.th-gantt-label { position: sticky; left: 0; z-index: 3; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px 0 16px; background: #fff; border-right: 1px solid #e2e8f0; font-size: 13.5px; }
.th-gantt-label a, .th-gantt-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-gantt-label a { color: #334155 !important; }
.th-gantt-label a:hover { color: var(--th-blue) !important; }
.th-gantt-track { position: relative; min-width: 0; }
.th-gantt-head { position: relative; z-index: 4; min-height: 52px; border-top: 0; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.th-gantt-head .th-gantt-label { background: #f8fafc; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.th-gantt-months, .th-gantt-weeks { position: absolute; left: 0; right: 0; }
.th-gantt-months { top: 6px; height: 20px; }
.th-gantt-weeks { bottom: 4px; height: 18px; }
.th-gantt-months span { position: absolute; top: 0; padding-left: 6px; font-size: 12.5px; font-weight: 700; color: var(--th-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid #cbd5e1; }
.th-gantt-weeks span { position: absolute; top: 0; padding-left: 3px; font-size: 11px; color: #94a3b8; }
.th-gantt[data-zoom="fit"] .th-gantt-weeks span:nth-child(even) { visibility: hidden; }
.th-gantt-body { position: relative; }
.th-gantt-grid { position: absolute; top: 0; bottom: 0; left: var(--label); right: 0; pointer-events: none; z-index: 0; }
.th-gantt-grid i { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #eef2f7; }
.th-gantt-grid i.month { border-left: 1px solid #e2e8f0; }
.th-gantt-today { position: absolute; top: 0; bottom: 0; z-index: 2; border-left: 2px solid #f59e0b; }
.th-gantt-today span { position: absolute; top: 4px; left: 4px; padding: 1px 6px; border-radius: 6px; background: #f59e0b; color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.th-gantt-group { background: color-mix(in srgb, var(--ms) 6%, #fff); }
.th-gantt-group .th-gantt-label { background: color-mix(in srgb, var(--ms) 6%, #fff); font-weight: 700; color: var(--th-ink); }
.th-gantt-group .th-gantt-label i { color: var(--ms); font-size: 12px; }
.th-gantt-span { position: absolute; top: 50%; height: 10px; transform: translateY(-50%); border-radius: 999px; background: color-mix(in srgb, var(--ms) 35%, transparent); border: 1px solid var(--ms); z-index: 1; }
.th-gantt-task { position: absolute; top: 50%; height: 18px; min-width: 6px; transform: translateY(-50%); border-radius: 6px; z-index: 1; transition: filter 0.15s, box-shadow 0.15s; }
.th-gantt-task:hover, .th-gantt-task:focus-visible { filter: brightness(1.08); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25); outline: none; }
.th-gantt-task.open-end { background-image: linear-gradient(90deg, transparent 60%, rgba(255, 255, 255, 0.6)); }
.th-gantt-date { position: absolute; top: 50%; transform: translateY(-50%); font-size: 11px; color: #94a3b8; white-space: nowrap; z-index: 1; pointer-events: none; }
.th-gantt[data-zoom="fit"] .th-gantt-date { display: none; }
.th-gantt-hint { margin-top: 10px; }
@media (max-width: 767px) {
  .th-gantt { --label: 140px; --row: 36px; }
  .th-gantt-label { padding: 0 8px 0 10px; font-size: 12.5px; }
}
@media (hover: none) { .th-gantt-hint .fa-hand-pointer + * { display: none; } }

/* ---------- Tickets (Support list, project tab, single ticket, open form) ---------- */
.th-info-text { color: var(--th-blue); font-weight: 600; }
.th-ticket-list { list-style: none; margin: 0; padding: 0; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; background: #fff; }
.th-tickets-page .th-ticket-list { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.th-ticket { position: relative; border-top: 1px solid #eef2f7; }
.th-ticket:first-child { border-top: 0; }
.th-ticket[hidden] { display: none; }
.th-ticket.is-unread { box-shadow: inset 3px 0 0 var(--th-blue); background: #fafcff; }
.th-ticket-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: inherit !important; text-decoration: none !important; transition: background 0.15s; }
.th-ticket-link:hover { background: #f8fafc; }
.th-ticket-icon { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #64748b; font-size: 16px; }
.is-unread .th-ticket-icon { background: #e0edfb; color: var(--th-blue); }
.th-ticket-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.th-ticket-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.th-ticket-id { font-size: 12.5px; font-weight: 700; color: #94a3b8; font-variant-numeric: tabular-nums; }
.th-ticket-title strong { color: var(--th-ink); font-size: 15px; overflow-wrap: anywhere; }
.th-ticket-link:hover .th-ticket-title strong { color: var(--th-blue); }
.th-ticket-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: #64748b; }
.th-ticket-meta span { display: inline-flex; align-items: center; gap: 5px; }
.th-ticket-meta i { color: #94a3b8; font-size: 11px; }
.th-ticket-side { flex: 0 0 auto; display: grid; justify-items: end; gap: 5px; text-align: right; }
.th-ticket-when { font-size: 12px; color: #94a3b8; white-space: nowrap; }
.th-ticket-project { position: static; display: inline-flex; align-items: center; gap: 6px; margin: -6px 0 12px 68px; font-size: 12.5px; color: var(--th-blue) !important; }
.th-ticket-wrap .th-toolbar { margin-bottom: 14px; }

.th-ticket-page .th-back { margin-bottom: 10px; }
.th-ticket-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 20px; }
.th-ticket-heading { min-width: 0; }
.th-ticket-heading h2 { margin: 2px 0 0; font-size: 22px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-ticket-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.th-ticket-badges .ticket-status-inline { display: inline-flex; align-items: center; gap: 8px; }
.th-ticket-badges .ticket-status-inline.hide, .th-ticket-badges .ticket-status.hide { display: none; }
.th-ticket-status-edit { display: inline-flex; align-items: center; gap: 4px; }
.th-ticket-status-edit select { width: auto; border-radius: 8px; }
.th-ticket-banner { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #eff6ff; color: #1e4f8f; font-size: 13.5px; }
.th-ticket-banner a { font-weight: 700; }
.th-ticket-banner.warn { background: #fffbeb; color: #92400e; margin-bottom: 14px; }
.th-ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; margin-top: 20px; align-items: start; }
.th-ticket-thread { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.th-ticket-side-panel .th-ov-section { padding: 16px 18px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; position: sticky; top: calc(var(--th-topbar-h, 64px) + 16px); }
.th-msgs { display: flex; flex-direction: column; gap: 16px; }
.th-msg { display: flex; gap: 12px; max-width: 92%; }
.th-msg.is-mine { flex-direction: row-reverse; align-self: flex-end; }
.th-msg-avatar { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: #e0edfb; color: var(--th-blue); }
.th-msg.is-staff .th-msg-avatar { background: var(--th-navy); color: #fff; }
.th-msg-bubble { min-width: 0; padding: 12px 16px; border-radius: 4px 14px 14px 14px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.th-msg.is-staff .th-msg-bubble { background: #f8fafc; }
.th-msg.is-mine .th-msg-bubble { border-radius: 14px 4px 14px 14px; background: #e8f1fb; border-color: #d3e3f6; }
.th-msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 6px; }
.th-msg-head strong { color: var(--th-ink); }
.th-msg-head time { margin-left: auto; font-size: 12px; color: #94a3b8; }
.th-msg-body { color: #334155; overflow-wrap: anywhere; }
.th-msg-body p:last-child { margin-bottom: 0; }
.th-msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.th-msg-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; font-size: 13px; color: #334155 !important; }
.th-msg-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-msg-image img { display: block; max-width: 220px; max-height: 160px; border-radius: 8px; border: 1px solid #e2e8f0; object-fit: cover; }
.th-msg-waiting { margin: 0; padding: 12px 14px; border-radius: 10px; background: #f8fafc; color: #64748b; font-size: 13.5px; }
.th-reply-box { padding: 16px 18px; }
.th-reply-box h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--th-ink); display: flex; align-items: center; gap: 8px; }
.th-reply-box h3 i { color: var(--th-blue); }
.th-reply-box textarea, .th-ticket-form textarea { border-radius: 10px; resize: vertical; }
.th-reply-box .th-form-actions { padding-top: 6px; border-top: 0; }
.th-reply-box .attachments .attachment + .attachment, .th-ticket-form .attachments .attachment + .attachment { margin-top: -6px; }
.th-open-ticket { max-width: 860px; }
.th-ticket-form { padding: 20px 22px; }
.th-ticket-form .th-form-section:first-of-type { border-top: 0; padding-top: 4px; }
@media (max-width: 991px) {
  .th-ticket-layout { grid-template-columns: minmax(0, 1fr); }
  .th-ticket-side-panel { order: -1; }
  .th-ticket-side-panel .th-ov-section { position: static; }
}
@media (max-width: 575px) {
  .th-ticket-link { flex-wrap: wrap; gap: 8px 12px; padding: 12px; }
  .th-ticket-icon { width: 32px; height: 32px; font-size: 14px; }
  .th-ticket-main { flex-basis: calc(100% - 44px); }
  .th-ticket-side { grid-auto-flow: column; justify-items: start; align-items: center; margin-left: 44px; text-align: left; }
  .th-ticket-project { margin-left: 56px; }
  .th-msg { max-width: 100%; gap: 8px; }
  .th-msg-avatar { width: 30px; height: 30px; font-size: 13px; }
  .th-ticket-form { padding: 16px; }
}

/* ---------- Contracts list (page + project tab) ---------- */
.th-kpis-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.th-contracts-page .th-filter-pills button.th-fpill { font: inherit; cursor: pointer; }
.th-contract-list { list-style: none; margin: 0; padding: 0; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; background: #fff; }
.th-contract { border-top: 1px solid #eef2f7; }
.th-contract:first-child { border-top: 0; }
.th-contract[hidden] { display: none; }
.th-contract.needs-sign { box-shadow: inset 3px 0 0 #f59e0b; background: #fffdf7; }
.th-contract.is-expired { opacity: 0.75; }
.th-contract-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: inherit !important; text-decoration: none !important; transition: background 0.15s; }
.th-contract-link:hover { background: #f8fafc; }
.th-contract-icon { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #f0fdf4; color: #16a34a; font-size: 17px; }
.needs-sign .th-contract-icon { background: #fef3c7; color: #b45309; }
.is-expired .th-contract-icon { background: #f1f5f9; color: #94a3b8; }
.th-contract-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.th-contract-main strong { color: var(--th-ink); font-size: 15px; overflow-wrap: anywhere; }
.th-contract-link:hover .th-contract-main strong { color: var(--th-blue); }
.th-contract-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: #64748b; }
.th-contract-meta span { display: inline-flex; align-items: center; gap: 5px; }
.th-contract-meta i { color: #94a3b8; font-size: 11px; }
.th-contract-side { flex: 0 0 auto; display: grid; justify-items: end; gap: 5px; text-align: right; }
.th-contract-side .th-chip i { font-size: 10px; }
.th-contract-cta { flex: 0 0 auto; min-width: 112px; }
@media (max-width: 767px) {
  .th-contract-link { flex-wrap: wrap; gap: 8px 12px; padding: 12px; }
  .th-contract-icon { width: 34px; height: 34px; font-size: 15px; }
  .th-contract-main { flex-basis: calc(100% - 46px); }
  .th-contract-side { grid-auto-flow: column; justify-items: start; align-items: center; margin-left: 46px; text-align: left; }
  .th-contract-cta { margin-left: auto; min-width: 0; }
  .th-contract .th-ticket-project { margin-left: 58px; }
}

/* ---------- Document pages (contract view; reusable for proposals / estimates) ---------- */
.th-doc-page { padding-bottom: 30px; }
.th-doc-bar { position: relative; z-index: 20; margin: 0 -15px 18px; padding: 12px 15px; background: rgba(248, 250, 252, 0.94); border-bottom: 1px solid #e2e8f0; backdrop-filter: blur(6px); }
.th-doc-bar.th-doc-bar-stuck { box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08); }
.th-doc-bar-inner { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; }
.th-doc-logo img { max-height: 40px; width: auto; display: block; }
.th-doc-title { flex: 1 1 260px; min-width: 0; }
.th-doc-title h1 { margin: 0; font-size: 19px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-doc-title p { margin: 2px 0 0; color: #64748b; font-size: 13px; }
.th-doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.th-doc-actions .th-btn-sm { min-height: 36px; }
.th-inline-form { display: inline; margin: 0; }
.th-doc-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; border: 1px solid; }
.th-doc-banner > i { font-size: 20px; }
.th-doc-banner > div { flex: 1 1 auto; display: flex; flex-direction: column; }
.th-doc-banner strong { color: inherit; }
.th-doc-banner span { font-size: 13.5px; opacity: 0.9; }
.th-doc-banner.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.th-doc-banner.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.th-doc-banner.muted { background: #f8fafc; border-color: #e2e8f0; color: #475569; }
.th-doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.th-doc-paper { min-width: 0; padding: 40px 44px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06); }
.th-doc-paper .tc-content { color: #1e293b; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.th-doc-paper .tc-content h1, .th-doc-paper .tc-content h2, .th-doc-paper .tc-content h3 { color: var(--th-ink); font-weight: 700; margin-top: 0; }
.th-doc-paper .tc-content h4 { color: var(--th-ink); font-weight: 700; margin-top: 22px; }
.th-doc-paper .tc-content table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.th-doc-paper .tc-content table td, .th-doc-paper .tc-content table th { padding: 8px 10px; border: 1px solid #e2e8f0 !important; }
.th-doc-paper .tc-content table th { background: #f8fafc; }
.th-doc-paper .tc-content img { max-width: 100%; height: auto; }
.th-doc-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.th-doc-card { padding: 16px 18px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }
.th-doc-card h2 { margin: 0 0 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.th-doc-value { display: flex; flex-direction: column; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #eef2f7; }
.th-doc-value span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.th-doc-value strong { font-size: 24px; color: var(--th-ink); font-variant-numeric: tabular-nums; }
.th-doc-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.th-doc-files a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 8px; color: #334155 !important; font-size: 13px; }
.th-doc-files a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-doc-comments { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.th-doc-comments li { padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: #f1f5f9; }
.th-doc-comments li.is-client { background: #e8f1fb; border-radius: 12px 4px 12px 12px; }
.th-doc-comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.th-doc-comment-head .th-team-avatar { width: 22px; height: 22px; border: 0; }
.th-doc-comment-head strong { font-size: 13px; color: var(--th-ink); }
.th-doc-comment-head time { margin-left: auto; font-size: 11.5px; color: #94a3b8; }
.th-doc-comments .tc-content { font-size: 13.5px; color: #334155; }
.th-doc-comment-form { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.th-doc-comment-form textarea { border-radius: 10px; resize: vertical; }
.th-doc-company address { margin: 0; font-size: 13px; color: #475569; font-style: normal; }
@media (max-width: 991px) {
  .th-doc-layout { grid-template-columns: minmax(0, 1fr); }
  .th-doc-paper { padding: 26px 22px; }
}
@media (max-width: 575px) {
  .th-doc-bar-inner { gap: 10px; }
  .th-doc-logo { display: none; }
  .th-doc-actions { width: 100%; }
  .th-doc-actions .th-btn-sm span { display: none; }
  .th-doc-actions #accept_action { flex: 1 1 auto; }
  .th-doc-banner { flex-wrap: wrap; }
  .th-doc-banner .th-btn-sm { width: 100%; }
  .th-doc-paper { padding: 20px 16px; }
}

/* Signature & identity pop-up (contracts, proposals, estimates) */
#identityConfirmationModal .modal-content { border: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25); }
#identityConfirmationModal .modal-header { padding: 16px 20px; border-bottom: 1px solid #eef2f7; }
#identityConfirmationModal .modal-title { font-weight: 700; color: var(--th-ink); }
#identityConfirmationModal .modal-body { padding: 18px 20px; }
#identityConfirmationModal .form-control { border-radius: 10px; }
#identityConfirmationModal #signatureLabel { margin-top: 6px; color: #334155; }
#identityConfirmationModal .signature-pad--body { border: 2px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; overflow: hidden; }
#identityConfirmationModal .signature-pad--body canvas { display: block; width: 100%; max-width: 100%; height: 160px; touch-action: none; }
#identityConfirmationModal .modal-footer { padding: 14px 20px; border-top: 1px solid #eef2f7; }
#identityConfirmationModal .e-sign-legal-text { font-size: 12px; }
#identityConfirmationModal .modal-footer .btn-success, #identityConfirmationModal .modal-footer .btn-primary { background: var(--th-blue); border-color: var(--th-blue); border-radius: 8px; }
/* Doc bar: CSS sticky (Perfex's sticky.js mis-positioned it) and a sensible logo size */
.th-doc-bar { position: sticky; top: 0; }
.th-doc-logo a { display: block; }
.th-doc-logo img { max-height: 40px !important; max-width: 160px; width: auto !important; height: auto; }
.th-doc-paper .table-responsive { border: 0; margin: 10px 0; }
.th-doc-paper .table-responsive > table { margin: 0; }

/* ---------- Proposals (list + document) ---------- */
.th-proposals-page .th-filter-pills button.th-fpill { font: inherit; cursor: pointer; }
.th-proposal-total { font-size: 15px; color: var(--th-ink); font-variant-numeric: tabular-nums; }
.th-proposal.th-p-accepted .th-contract-icon { background: #f0fdf4; color: #16a34a; }
.th-proposal.th-p-declined .th-contract-icon { background: #fef2f2; color: #dc2626; }
.th-proposal-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: -6px 0 12px 70px; }
.th-proposal-links .th-ticket-project { margin: 0; }
@media (max-width: 767px) { .th-proposal-links { margin-left: 58px; } }
.th-btn-sm.success { background: #16a34a; border-color: #16a34a; color: #fff !important; }
.th-btn-sm.success:hover { background: #15803d; }
.th-doc-banner.bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.th-doc-banner .th-inline-form { flex: 0 0 auto; }
.th-doc-address { margin: 0; font-style: normal; font-size: 13.5px; color: #475569; line-height: 1.6; }

/* Items + totals inside document pages */
.th-items { margin: 18px 0; }
.th-doc-paper .th-items .table-responsive { margin: 0 0 12px; border: 1px solid #e2e8f0 !important; border-radius: 10px; }
.th-doc-paper table.th-items-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 14px; }
.th-doc-paper table.th-items-table thead th { padding: 10px 12px; background: #f8fafc; border: 0 !important; border-bottom: 1px solid #e2e8f0 !important; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; white-space: nowrap; }
.th-doc-paper table.th-items-table tbody td { padding: 12px; border: 0 !important; border-top: 1px solid #f1f5f9 !important; vertical-align: top; }
.th-doc-paper table.th-items-table tbody tr:first-child td { border-top: 0 !important; }
.th-doc-paper table.th-items-table .description { color: var(--th-ink); }
.th-doc-paper table.th-items-table .description strong { font-weight: 600; }
.th-doc-paper table.th-items-table .description span[style*="color"] { color: #64748b !important; font-size: 13px; }
/* Keep numbers on one line (Perfex sets narrow % widths on these cells) */
.th-doc-paper table.th-items-table td[align="right"], .th-doc-paper table.th-items-table th[align="right"], .th-doc-paper table.th-items-table td.amount { white-space: nowrap; width: auto !important; font-variant-numeric: tabular-nums; }
.th-doc-paper table.th-totals { width: auto; min-width: 280px; margin: 0 0 0 auto; border: 0; font-size: 14px; }
.th-doc-paper table.th-totals th, .th-doc-paper table.th-totals td { padding: 6px 0 6px 24px; border: 0 !important; background: none; text-align: right; font-weight: 500; color: #475569; }
.th-doc-paper table.th-totals th { font-weight: 500; }
.th-doc-paper table.th-totals td { color: var(--th-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-doc-paper table.th-totals tr.th-totals-grand th, .th-doc-paper table.th-totals tr.th-totals-grand td { padding-top: 10px; border-top: 2px solid #e2e8f0 !important; font-size: 17px; font-weight: 700; color: var(--th-ink); }
.th-total-words { margin: 10px 0 0; text-align: right; font-size: 13px; color: #64748b; }
@media (max-width: 575px) {
  .th-doc-paper table.th-totals { min-width: 0; width: 100%; }
  .th-doc-banner .th-inline-form, .th-doc-banner .th-inline-form .th-btn-sm { width: 100%; }
}

/* ---------- Estimates document extras (parties, notes) ---------- */
.th-doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid #eef2f7; }
.th-doc-parties > div:last-child { text-align: right; }
.th-doc-label { display: block; margin: 0 0 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
.th-doc-parties .th-doc-address + .th-doc-label { margin-top: 12px; }
.th-doc-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid #eef2f7; }
.th-doc-section h2 { margin: 0 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.th-doc-section .tc-content { font-size: 14px; color: #475569; }
.th-doc-banner > .th-btn-sm { flex: 0 0 auto; }
@media (max-width: 575px) {
  .th-doc-parties { grid-template-columns: 1fr; }
  .th-doc-parties > div:last-child { text-align: left; }
  .th-doc-banner > .th-btn-sm { width: 100%; }
}
/* Items table on phones (proposals, estimates, invoices): stack each line instead of scrolling sideways */
@media (max-width: 575px) {
  .th-doc-paper .th-items .table-responsive { overflow: visible; }
  .th-doc-paper table.th-items-table thead { display: none; }
  .th-doc-paper table.th-items-table, .th-doc-paper table.th-items-table tbody { display: block; width: 100%; }
  .th-doc-paper table.th-items-table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; padding: 10px 12px; border-top: 1px solid #f1f5f9; box-sizing: border-box; width: 100%; }
  .th-doc-paper table.th-items-table tbody tr:first-child { border-top: 0; }
  .th-doc-paper table.th-items-table tbody td { display: block; padding: 0 !important; border: 0 !important; width: auto !important; }
  .th-doc-paper table.th-items-table tbody td:first-child { flex: 0 0 22px; color: #94a3b8; }
  .th-doc-paper table.th-items-table tbody td.description { flex: 1 1 calc(100% - 22px); min-width: 0; margin-bottom: 4px; white-space: normal !important; overflow-wrap: anywhere; }
  .th-doc-paper table.th-items-table tbody td[align="right"]:not(.amount) { margin-left: 22px; font-size: 12.5px; color: #64748b; }
  .th-doc-paper table.th-items-table tbody td[align="right"]:not(.amount) + td[align="right"]:not(.amount) { margin-left: 0; }
  .th-doc-paper table.th-items-table tbody td[align="right"]:not(.amount) + td[align="right"]:not(.amount)::before { content: "\00a0·\00a0"; color: #cbd5e1; }
  .th-doc-paper table.th-items-table tbody td.amount { margin-left: auto; font-weight: 700; color: var(--th-ink); }
  .th-doc-paper table.th-items-table tbody td.amount::before { content: none; }
}

/* ---------- Invoice document: amount due, payments, pay section ---------- */
.th-doc-paper table.th-totals tr.th-totals-due th, .th-doc-paper table.th-totals tr.th-totals-due td { padding-top: 8px; font-weight: 700; color: var(--th-ink); }
.th-doc-paper table.th-totals tr.th-totals-due.has-due th, .th-doc-paper table.th-totals tr.th-totals-due.has-due td { color: #b91c1c; }
.th-invoice-doc .th-doc-card .th-progress { margin: 4px 0 6px; }
.th-invoice-doc .th-doc-card .th-form-hint { margin: 0 0 12px; }
.th-payments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.th-payments li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; }
.th-pay-icon { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #dcfce7; color: #16a34a; font-size: 13px; }
.th-pay-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.th-pay-main strong { color: var(--th-ink); font-variant-numeric: tabular-nums; }
.th-pay-main small { color: #64748b; font-size: 12.5px; }
.th-pay { margin-top: 22px; padding: 20px 22px; border-radius: 14px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06); scroll-margin-top: 90px; }
.th-pay > h2 { margin: 0 0 16px; font-size: 18px; font-weight: 700; color: var(--th-ink); display: flex; align-items: center; gap: 10px; }
.th-pay > h2 i { color: var(--th-blue); }
.th-pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.th-pay-grid.single { grid-template-columns: minmax(0, 1fr); }
.th-pay-card { padding: 16px 18px; border: 1px solid #eef2f7; border-radius: 12px; background: #f8fafc; min-width: 0; }
.th-pay-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--th-ink); }
.th-pay-card > .th-form-hint { margin-bottom: 12px; }
.th-pay-modes { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; border: 0; padding: 0; }
.th-pay-mode { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; cursor: pointer; font-weight: 400; }
.th-pay-mode:has(input:checked) { border-color: var(--th-blue); box-shadow: 0 0 0 3px rgba(48, 120, 184, 0.12); }
.th-pay-mode input { margin-top: 3px; accent-color: var(--th-blue); }
.th-pay-mode span { display: flex; flex-direction: column; min-width: 0; }
.th-pay-mode strong { color: var(--th-ink); }
.th-pay-mode small { color: #64748b; font-size: 12.5px; }
.th-pay-card .input-group .form-control { border-radius: 0 10px 10px 0; min-height: 42px; font-size: 16px; font-variant-numeric: tabular-nums; }
.th-pay-card .input-group-addon { border-radius: 10px 0 0 10px; }
.th-pay-fixed { margin: 0; font-size: 16px; font-weight: 700; color: var(--th-ink); }
.th-pay-submit { width: 100%; min-height: 44px; font-size: 15px; }
.th-pay-offline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.th-pay-offline li { padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.th-pay-offline li strong { color: var(--th-ink); }
.th-pay-offline .tc-content { margin-top: 4px; font-size: 13.5px; color: #475569; overflow-wrap: anywhere; }
.th-pay-offline .tc-content p:last-child { margin-bottom: 0; }
@media (max-width: 767px) { .th-pay-grid { grid-template-columns: minmax(0, 1fr); } .th-pay { padding: 16px; } }

/* ---------- Account statement ---------- */
.th-kpis-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.th-statement-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.th-statement-period { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding: 14px 18px; margin-bottom: 18px; }
.th-statement-range { flex: 0 1 260px; margin: 0; }
.th-statement-dates { display: flex; flex-wrap: wrap; gap: 12px; }
.th-statement-dates .form-group { margin: 0; min-width: 180px; }
.th-statement-dates.hide { display: none; }
.th-statement { padding: 20px 22px; }
.th-statement-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid #eef2f7; }
.th-statement-company { text-align: right; }
.th-statement-info { margin: 14px 0; color: #64748b; font-size: 13.5px; }
.th-statement-table { margin: 0; font-size: 14px; }
.th-statement-table > thead > tr > th { padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid #e2e8f0 !important; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; white-space: nowrap; }
.th-statement-table > tbody > tr > td { padding: 10px 12px; border-top: 1px solid #f1f5f9 !important; vertical-align: middle; }
.th-statement-table td.text-right { white-space: nowrap; font-variant-numeric: tabular-nums; }
.th-statement-table .th-st-opening td { color: #64748b; font-style: italic; }
.th-statement-table .th-st-paid { color: #15803d; }
.th-statement-table .th-st-balance { font-weight: 600; color: var(--th-ink); }
.th-statement-table tfoot td { padding: 12px; border-top: 2px solid #e2e8f0 !important; font-size: 16px; font-weight: 700; color: var(--th-ink); }
.th-st-tag { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.th-st-tag.invoice { background: #e0edfb; color: #1e4f8f; }
.th-st-tag.payment { background: #dcfce7; color: #166534; }
.th-st-tag.credit { background: #f3e8ff; color: #6b21a8; }
.th-st-tag.refund { background: #fef3c7; color: #92400e; }
@media (max-width: 575px) {
  .th-statement-company { text-align: left; }
  .th-statement { padding: 16px; }
  .th-statement-range { flex-basis: 100%; }
}

/* ---------- Project › Activity (timeline) ---------- */
.th-activity .th-filter-pills button.th-fpill { font: inherit; cursor: pointer; }
.th-afilter-icon { width: auto !important; height: auto !important; background: none !important; font-size: 12px; margin-right: 2px; color: #94a3b8; }
.th-fpill.active .th-afilter-icon { color: #fff; }
.th-feed-day + .th-feed-day { margin-top: 20px; }
.th-feed-day[hidden] { display: none; }
.th-feed-day h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: #334155; }
.th-feed-day ol { list-style: none; margin: 0; padding: 0; position: relative; }
.th-feed-day ol::before { content: ""; position: absolute; left: 16px; top: 8px; bottom: 8px; width: 2px; background: #eef2f7; }
.th-feed-item { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 6px 0; }
.th-feed-item[hidden] { display: none; }
.th-feed-icon { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; background: #f1f5f9; color: #64748b; border: 3px solid #fff; }
.th-cat-task .th-feed-icon { background: #e0edfb; color: var(--th-blue); }
.th-cat-time .th-feed-icon { background: #ccfbf1; color: #0f766e; }
.th-cat-file .th-feed-icon { background: #fef3c7; color: #b45309; }
.th-cat-discussion .th-feed-icon { background: #f3e8ff; color: #7e22ce; }
.th-cat-milestone .th-feed-icon { background: #ffe4e6; color: #be123c; }
.th-feed-item.is-done .th-feed-icon { background: #dcfce7; color: #16a34a; }
.th-feed-body { min-width: 0; padding-top: 6px; }
.th-feed-body p { margin: 0; color: #475569; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.th-feed-body strong { color: var(--th-ink); }
.th-feed-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; vertical-align: -5px; margin-right: 4px; }
.th-feed-team { display: inline-block; margin: 0 4px 0 2px; padding: 0 6px; border-radius: 999px; background: #e0edfb; color: #1e4f8f; font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
.th-feed-detail { margin-top: 3px !important; font-size: 13px !important; color: var(--th-ink) !important; font-weight: 500; }
.th-feed-item time { padding-top: 8px; font-size: 12px; color: #94a3b8; white-space: nowrap; font-variant-numeric: tabular-nums; }
.th-feed-older { margin: 16px 0 0 46px; }
@media (max-width: 575px) {
  .th-feed-item { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .th-feed-icon { width: 30px; height: 30px; font-size: 12px; }
  .th-feed-day ol::before { left: 14px; }
  .th-feed-item time { grid-column: 2; padding-top: 0; }
  .th-feed-older { margin-left: 40px; }
}

/* ---------- Prospecting (client portal; markup shared with admin stays untouched, styles scoped here) ---------- */
.th-ok-text { color: #15803d; font-weight: 600; }
.th-pr-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.th-pr-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #e0edfb; color: #1e4f8f; font-size: 11.5px; font-weight: 700; text-align: center; }
.th-pr-kpis .th-kpi .th-progress { height: 6px; margin: 8px 0 0; }
.th-pr-kpis .th-kpi .th-progress .progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--th-blue), var(--th-blue-bright)); box-shadow: none; }
.th-pr-kpis .th-kpi .th-progress .progress-bar-warning { background: #f59e0b; }
.th-pr-kpis .th-kpi .th-progress .progress-bar-danger { background: #dc2626; }
.th-pr-plan-name { font-size: 22px !important; }
.th-prospecting .th-doc-banner { margin-bottom: 18px; }

/* search workspace */
.th-prospecting .panel_s { border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); background: #fff; margin-bottom: 18px; }
.th-prospecting .panel_s > .panel-body { padding: 18px 20px; }
.th-prospecting .pr-search .control-label { font-weight: 600; color: #334155; font-size: 13px; }
.th-prospecting .pr-search .form-control { height: 44px; border-radius: 10px; font-size: 15px; }
.th-prospecting .pr-search #pr-search-btn { height: 44px; border-radius: 10px; background: var(--th-blue); border-color: var(--th-blue); }
.th-prospecting .pr-search #pr-search-btn:hover { background: #2668a3; }
.th-prospecting .pr-chip { padding: 4px 12px; border-color: #e2e8f0; font-size: 12.5px; transition: all 0.15s; }
.th-prospecting .pr-chip:hover { border-color: var(--th-blue); background: #eff6ff; color: var(--th-navy); }
.th-prospecting .pr-chip.active { background: var(--th-navy); border-color: var(--th-navy); }
.th-prospecting #pr-empty .panel-body { padding: 40px 20px; }
.th-prospecting #pr-empty .fa-map-location-dot { color: var(--th-blue) !important; }
.th-prospecting .pr-step b { background: #e0edfb; color: var(--th-navy); }
.th-prospecting .pr-stat { border-radius: 12px; padding: 14px 16px; border-color: #eef2f7; background: #f8fafc; }
.th-prospecting .pr-stat .pr-stat-value { font-size: 24px; }
.th-prospecting #prospecting-map { border-radius: 12px; border: 1px solid #e2e8f0; }
.th-prospecting #pr-table { margin: 0; }
.th-prospecting #pr-table > thead > tr > th { padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid #e2e8f0 !important; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.th-prospecting #pr-table > tbody > tr > td { padding: 12px; border-top: 1px solid #f1f5f9; }
.th-prospecting #pr-table > tbody > tr.pr-row:hover { background: #f8fafc; }
.th-prospecting #pr-table > tbody > tr.pr-row.open { background: #eff6ff; }
.th-prospecting tr.pr-detail > td { background: #f8fafc; }
.th-prospecting .pr-score { border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.th-prospecting .pr-bulkbar { background: var(--th-navy); border-radius: 14px; }
.th-prospecting #pr-load-more { border-radius: 10px; margin-top: 12px; }
@media (min-width: 992px) { .th-shell .th-prospecting .pr-bulkbar { left: calc(50% + var(--th-sb-w) / 2); } }

/* plans */
.th-pr-current { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 18px 24px; align-items: center; padding: 18px 20px; margin-bottom: 22px; }
.th-pr-current.is-bad { border-color: #fecaca; background: #fffafa; }
.th-pr-current-main { display: flex; gap: 14px; align-items: center; }
.th-pr-current-main h3 { margin: 2px 0 2px; font-size: 20px; font-weight: 700; color: var(--th-ink); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.th-pr-current-main p { margin: 0; }
.th-pr-current-usage .th-progress { margin-bottom: 0; }
.th-pr-current-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.th-btn-link-danger { border-color: transparent !important; background: none !important; color: #b91c1c !important; }
.th-btn-link-danger:hover { background: #fef2f2 !important; }
.th-pr-section-title { margin: 6px 0 14px; font-size: 15px; font-weight: 700; color: var(--th-ink); }
.th-pr-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; }
.th-pr-plan { position: relative; display: flex; flex-direction: column; padding: 22px 22px 20px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.th-pr-plan.popular { border: 2px solid var(--th-blue); box-shadow: 0 12px 30px rgba(48, 120, 184, 0.15); }
.th-pr-plan.current { border: 2px solid #16a34a; box-shadow: none; }
.th-pr-ribbon { position: absolute; top: -11px; left: 20px; padding: 2px 10px; border-radius: 999px; background: var(--th-blue); color: #fff; font-size: 11.5px; font-weight: 700; }
.th-pr-ribbon.current { background: #16a34a; }
.th-pr-plan h3 { margin: 4px 0 4px; font-size: 18px; font-weight: 700; color: var(--th-ink); }
.th-pr-plan > .th-muted { margin: 0 0 10px; min-height: 36px; }
.th-pr-price { font-size: 32px !important; font-weight: 800 !important; color: var(--th-ink); letter-spacing: -0.02em; }
.th-pr-price small { font-size: 13px; font-weight: 500; color: #64748b; letter-spacing: 0; }
.th-pr-features { list-style: none; margin: 14px 0 18px !important; padding: 0 !important; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.th-pr-features li { display: flex; gap: 8px; align-items: baseline; font-size: 14px; color: #334155; }
.th-pr-features i { color: #16a34a; font-size: 12px; }
.th-pr-plan-btn { width: 100%; min-height: 42px; font-size: 14px; }
.th-pr-pay-status { margin-top: 16px; border-radius: 10px; }
.th-pr-secure { margin: 14px 0 0; font-size: 13px; color: #64748b; }
.th-pr-secure i { color: #16a34a; margin-right: 4px; }
.th-pr-faq { margin-top: 28px; }
.th-pr-faq details { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 12px 16px; }
.th-pr-faq details + details { margin-top: 8px; }
.th-pr-faq summary { cursor: pointer; font-weight: 600; color: var(--th-ink); }
.th-pr-faq details p { margin: 8px 0 0; color: #475569; font-size: 14px; }
@media (max-width: 991px) { .th-pr-current { grid-template-columns: minmax(0, 1fr); } .th-pr-current-actions { justify-content: flex-start; } }

/* saved prospects */
.th-pr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.th-pr-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border: 1px solid #e2e8f0; border-left: 4px solid #cbd5e1; border-radius: 14px; background: #fff; }
.th-pr-card[hidden] { display: none; }
.th-pr-card.th-pr-new { border-left-color: var(--th-blue); }
.th-pr-card.th-pr-contacted { border-left-color: #f59e0b; }
.th-pr-card.th-pr-won { border-left-color: #16a34a; }
.th-pr-card.th-pr-lost { border-left-color: #94a3b8; opacity: 0.85; }
.th-pr-card.th-pr-highlight { box-shadow: 0 0 0 3px rgba(48, 120, 184, 0.3); }
.th-pr-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.th-pr-card-title h3 { margin: 0 0 3px; font-size: 16px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-pr-card-title p { margin: 0; font-size: 12.5px; color: #64748b; }
.th-pr-card-title p i { color: #94a3b8; margin-right: 2px; }
.th-pr-status select { width: auto; min-width: 110px; border-radius: 8px; font-weight: 600; }
.th-pr-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.th-pr-issues li { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: #fef2f2; color: #b91c1c; font-size: 12px; font-weight: 600; }
.th-pr-issues li i { font-size: 10.5px; }
.th-pr-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.th-pr-contact { display: flex; flex-wrap: wrap; gap: 6px; }
.th-pr-contact .th-btn-sm { min-height: 32px; }
.th-prospecting .th-pr-contact .th-btn-sm.whatsapp .fa-whatsapp { color: #fff; }
.th-pr-card-foot .th-icon-btn { border: 0; background: none; }
.th-pr-card-foot .th-icon-btn:hover { background: #fef2f2 !important; }
.th-pr-notes { margin: 0; font-weight: 400; }
.th-pr-notes > span { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: #64748b; }
.th-pr-saved { margin-left: auto; color: #16a34a; font-weight: 600; }
.th-pr-notes textarea { border-radius: 10px; resize: vertical; font-size: 13.5px; }
@media (max-width: 575px) {
  .th-pr-list { grid-template-columns: minmax(0, 1fr); }
  .th-pr-card-head { grid-template-columns: auto minmax(0, 1fr); }
  .th-pr-status { grid-column: 1 / -1; }
  .th-pr-status select { width: 100%; }
  .th-pr-contact .th-btn-sm span { display: none; }
}

/* ---------- Sidebar dropdown groups (menu items with children, e.g. Prospecting) ---------- */
.th-nav-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; margin-bottom: 2px; border: 0; border-radius: 8px; background: none;
  color: rgba(255, 255, 255, 0.8); font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap;
  position: relative; cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.th-nav-toggle > i:first-child { width: 18px; text-align: center; font-size: 15px; opacity: 0.9; }
.th-nav-toggle:hover, .th-nav-toggle:focus { background: rgba(255, 255, 255, 0.08); color: #fff; }
.th-nav-caret { margin-left: auto; font-size: 11px; opacity: 0.7; transition: transform 0.2s ease; }
.th-nav-group.is-open > .th-nav-toggle .th-nav-caret { transform: rotate(180deg); }
.th-nav-group.active > .th-nav-toggle { color: #fff; }
.th-nav-group.active > .th-nav-toggle::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--th-blue-bright);
}
.th-subnav { list-style: none; margin: 0 0 6px; padding: 2px 0 2px 21px; position: relative; }
.th-subnav[hidden] { display: none; }
.th-subnav::before { content: ""; position: absolute; left: 20px; top: 4px; bottom: 4px; width: 1px; background: rgba(255, 255, 255, 0.14); }
.th-subnav > li > a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 16px; margin: 1px 0;
  border-radius: 8px; color: rgba(255, 255, 255, 0.72); font-size: 13.5px; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.th-subnav > li > a i { width: 16px; text-align: center; font-size: 13px; opacity: 0.85; }
.th-subnav > li > a:hover, .th-subnav > li > a:focus { background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; }
.th-subnav > li.active > a { background: rgba(90, 162, 230, 0.2); color: #fff; font-weight: 600; }
.th-subnav > li > a:focus-visible { outline: 2px solid var(--th-blue-bright); outline-offset: 2px; }
@media (min-width: 992px) {
  /* Icon-only sidebar: no room for sub-items, the icon opens the main page */
  body.th-collapsed .th-nav-toggle { justify-content: center; padding: 11px 0; }
  body.th-collapsed .th-nav-toggle > i:first-child { font-size: 17px; }
  body.th-collapsed .th-subnav { display: none; }
  body.th-collapsed .th-nav-group.active > .th-nav-toggle { background: rgba(90, 162, 230, 0.2); }
}
@media (prefers-reduced-motion: reduce) { .th-nav-caret { transition: none; } }

/* ---------- Calendar ---------- */
.th-cal-legend { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #475569; }
.th-cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.th-cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.th-cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.th-cal-card { padding: 16px 18px; min-width: 0; }
.th-calendar-page .fc { --fc-border-color: #eef2f7; --fc-today-bg-color: #eff6ff; --fc-neutral-bg-color: #f8fafc; font-size: 13px; }
.th-calendar-page .fc .fc-toolbar { flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.th-calendar-page .fc .fc-toolbar-title { font-size: 19px; font-weight: 700; color: var(--th-ink); }
.th-calendar-page .fc .fc-button { padding: 6px 12px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #334155; font-size: 13px; font-weight: 600; text-transform: capitalize; box-shadow: none !important; }
.th-calendar-page .fc .fc-button:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--th-ink); }
.th-calendar-page .fc .fc-button-primary:not(:disabled).fc-button-active, .th-calendar-page .fc .fc-button-primary:not(:disabled):active { background: var(--th-navy); border-color: var(--th-navy); color: #fff; }
.th-calendar-page .fc .fc-button:disabled { opacity: 0.5; }
.th-calendar-page .fc .fc-button-group > .fc-button { border-radius: 0; }
.th-calendar-page .fc .fc-button-group > .fc-button:first-child { border-radius: 8px 0 0 8px; }
.th-calendar-page .fc .fc-button-group > .fc-button:last-child { border-radius: 0 8px 8px 0; }
.th-calendar-page .fc .fc-col-header-cell-cushion { padding: 8px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.th-calendar-page .fc .fc-daygrid-day-number { padding: 6px 8px; font-size: 12.5px; font-weight: 600; color: #475569; }
.th-calendar-page .fc .fc-day-today .fc-daygrid-day-number { margin: 4px; padding: 2px 7px; border-radius: 999px; background: var(--th-blue); color: #fff; }
.th-calendar-page .fc .fc-day-other .fc-daygrid-day-number { color: #cbd5e1; }
.th-calendar-page .fc-theme-standard .fc-scrollgrid { border-radius: 10px; overflow: hidden; }
.th-calendar-page .fc .fc-daygrid-event { margin: 1px 4px; padding: 1px 6px; border-radius: 6px; border: 0; font-size: 12px; font-weight: 600; }
.th-calendar-page .fc .fc-daygrid-event .fc-event-title { overflow: hidden; text-overflow: ellipsis; }
.th-calendar-page .fc .fc-daygrid-dot-event { color: #334155; background: none; }
.th-calendar-page .fc .fc-daygrid-dot-event:hover { background: #f1f5f9; }
.th-calendar-page .fc .fc-daygrid-more-link { font-size: 12px; font-weight: 600; color: var(--th-blue); }
.th-calendar-page .fc a { text-decoration: none; }
.th-agenda { padding: 16px 18px; position: sticky; top: calc(var(--th-topbar-h, 64px) + 16px); }
.th-agenda h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--th-ink); display: flex; align-items: center; gap: 8px; }
.th-agenda h3 i { color: var(--th-blue); }
.th-agenda-day + .th-agenda-day { margin-top: 12px; }
.th-agenda-day h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.th-agenda-day.is-today h4 { color: var(--th-blue); }
.th-agenda-day ul { list-style: none; margin: 0; padding: 0; }
.th-agenda-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; color: inherit !important; text-decoration: none !important; }
.th-agenda-item:hover { background: #f8fafc; }
.th-agenda-icon { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.th-agenda-text { min-width: 0; display: flex; flex-direction: column; }
.th-agenda-text strong { font-size: 13.5px; color: var(--th-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-agenda-text small { font-size: 12px; color: #64748b; }
.th-agenda-more { margin: 10px 0 0; }
.th-agenda-empty { margin: 0; }
@media (max-width: 991px) {
  .th-cal-layout { grid-template-columns: minmax(0, 1fr); }
  .th-agenda { order: -1; position: static; }
}
@media (max-width: 575px) {
  .th-cal-card { padding: 10px; }
  .th-calendar-page .fc .fc-toolbar { justify-content: center; }
  .th-calendar-page .fc .fc-toolbar-title { font-size: 16px; }
  .th-calendar-page .fc .fc-button { padding: 5px 9px; font-size: 12px; }
  .th-calendar-page .fc .fc-daygrid-event { font-size: 10.5px; margin: 1px 2px; padding: 0 3px; }
}
/* Calendar: show the whole month (no inner scrollbar) and theme FullCalendar's own button variables */
.th-calendar-page .fc {
  --fc-button-bg-color: #fff; --fc-button-border-color: #e2e8f0; --fc-button-text-color: #334155;
  --fc-button-hover-bg-color: #f8fafc; --fc-button-hover-border-color: #cbd5e1;
  --fc-button-active-bg-color: var(--th-navy); --fc-button-active-border-color: var(--th-navy);
}
.th-calendar-page .fc .fc-button-primary { color: #334155; }
.th-calendar-page .fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.th-calendar-page .fc .fc-today-button:disabled { background: #f1f5f9; color: #94a3b8; }
.th-calendar-page .fc .fc-view-harness { height: auto !important; padding-bottom: 0 !important; }
.th-calendar-page .fc .fc-view-harness-active > .fc-view { position: static !important; }
.th-calendar-page .fc .fc-scroller { overflow: visible !important; }
.th-calendar-page .fc .fc-scroller-liquid-absolute { position: static !important; }
.th-calendar-page .fc .fc-daygrid-body, .th-calendar-page .fc .fc-scrollgrid-sync-table, .th-calendar-page .fc .fc-col-header { width: 100% !important; }
.th-calendar-page .fc .fc-daygrid-day-frame { min-height: 92px; }
@media (max-width: 575px) { .th-calendar-page .fc .fc-daygrid-day-frame { min-height: 58px; } }
.th-calendar-page .fc .fc-button.fc-button-primary { background-color: #fff !important; border-color: #e2e8f0 !important; color: #334155 !important; }
.th-calendar-page .fc .fc-button.fc-button-primary:hover { background-color: #f8fafc !important; border-color: #cbd5e1 !important; color: var(--th-ink) !important; }
.th-calendar-page .fc .fc-button.fc-button-primary.fc-button-active, .th-calendar-page .fc .fc-button.fc-button-primary:not(:disabled):active { background-color: var(--th-navy) !important; border-color: var(--th-navy) !important; color: #fff !important; }
.th-calendar-page .fc .fc-button.fc-today-button:disabled { background-color: #f1f5f9 !important; color: #94a3b8 !important; }
/* Phones: month cells are too narrow for labels, show coloured dots (the "Up next" list names them) */
@media (max-width: 575px) {
  .th-calendar-page .fc .fc-daygrid-day-events { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; padding: 0 2px; }
  .th-calendar-page .fc .fc-daygrid-event-harness { margin: 0 !important; }
  .th-calendar-page .fc .fc-daygrid-event { width: 9px; height: 9px; min-width: 0; margin: 0; padding: 0; border-radius: 50%; }
  .th-calendar-page .fc .fc-daygrid-event .fc-event-main, .th-calendar-page .fc .fc-daygrid-event .fc-event-title { display: none; }
  .th-calendar-page .fc .fc-daygrid-day-bottom { font-size: 10px; text-align: center; }
}

/* ---------- Profile ---------- */
.th-profile-page .th-card { padding: 20px 22px; }
.th-profile-hero { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; background: linear-gradient(120deg, #fff 55%, #eef5fc 100%); }
.th-avatar-edit { position: relative; flex: 0 0 auto; }
.th-avatar-img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12); background: #e2e8f0; }
.th-avatar-btn { position: absolute; right: 0; bottom: 2px; width: 32px; height: 32px; margin: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--th-blue); color: #fff; border: 3px solid #fff; cursor: pointer; font-size: 12px; }
.th-avatar-btn:hover { background: #2668a3; }
#profile_image:focus-visible + .th-avatar-btn, .th-avatar-edit:focus-within .th-avatar-btn { outline: 2px solid var(--th-blue); outline-offset: 2px; }
.th-profile-id { min-width: 0; }
.th-profile-id h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-profile-id p { margin: 3px 0 0; color: #475569; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; overflow-wrap: anywhere; }
.th-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.th-photo-actions label { margin: 0; cursor: pointer; }
.th-profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.th-profile-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.th-profile-card h3 { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--th-ink); display: flex; align-items: center; gap: 8px; }
.th-profile-card h3 i { color: var(--th-blue); font-size: 14px; }
.th-profile-main .th-form-actions { border-top: 0; padding-top: 0; }
.th-notif-intro { margin: -8px 0 12px; }
.th-switch-list { list-style: none; margin: 0; padding: 0; border: 1px solid #eef2f7; border-radius: 12px; overflow: hidden; }
.th-switch-list li + li { border-top: 1px solid #eef2f7; }
.th-switch-row { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; cursor: pointer; font-weight: 400; }
.th-switch-row:hover { background: #f8fafc; }
.th-switch-icon { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #e0edfb; color: var(--th-blue); font-size: 14px; }
.th-switch-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.th-switch-text strong { color: var(--th-ink); font-size: 14px; }
.th-switch-text small { color: #64748b; font-size: 12.5px; }
.th-switch { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 42px; height: 24px; margin: 0; border-radius: 999px; background: #cbd5e1; position: relative; cursor: pointer; transition: background 0.2s; }
.th-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); transition: transform 0.2s; }
.th-switch:checked { background: #16a34a; }
.th-switch:checked::after { transform: translateX(18px); }
.th-switch:focus-visible { outline: 2px solid var(--th-blue); outline-offset: 2px; }
.th-profile-side { position: sticky; top: calc(var(--th-topbar-h, 64px) + 16px); }
.th-profile-side .last-password-change { margin: -8px 0 12px; }
.th-pw-field { position: relative; }
.th-pw-field .form-control { padding-right: 42px; }
.th-pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: #64748b; }
.th-pw-toggle:hover { background: #f1f5f9; color: var(--th-ink); }
.th-pw-meter { height: 5px; margin-top: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.th-pw-meter span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 0.2s, background 0.2s; }
.th-pw-meter span.weak { background: #dc2626; }
.th-pw-meter span.fair { background: #f59e0b; }
.th-pw-meter span.good { background: #3078b8; }
.th-pw-meter span.strong { background: #16a34a; }
.th-form-hint.is-ok { color: #15803d; }
.th-form-hint.is-bad { color: #b91c1c; }
.th-pw-submit { width: 100%; min-height: 42px; }
@media (max-width: 991px) {
  .th-profile-layout { grid-template-columns: minmax(0, 1fr); }
  .th-profile-side { position: static; }
}
@media (max-width: 575px) {
  .th-profile-hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .th-profile-page .th-card { padding: 16px; }
  .th-profile-main .th-form-actions .th-btn-sm { width: 100%; justify-content: center; }
}
.th-profile-meta { gap: 2px 14px !important; }
.th-profile-meta span { white-space: nowrap; }
.th-profile-meta span:first-child { white-space: normal; overflow-wrap: anywhere; }

/* ---------- Contacts ---------- */
.th-contact-avatar { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: #e2e8f0; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1); }
.th-contact-id { min-width: 0; display: flex; flex-direction: column; }
.th-contact-id h3 { margin: 0; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.th-contact-id h3 a { color: var(--th-ink); }
.th-contact-id h3 a:hover { color: var(--th-blue); }
.th-contact-id > span { color: #64748b; font-size: 13px; overflow-wrap: anywhere; }
.th-contact-me { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px; }
.th-contact-me .th-contact-id { flex: 1 1 200px; }
.th-contact-me strong { color: var(--th-ink); }
.th-contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.th-contact-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; margin: 0; }
.th-contact-card[hidden] { display: none; }
.th-contact-head { display: flex; align-items: center; gap: 12px; }
.th-contact-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: #475569; }
.th-contact-lines li { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.th-contact-lines i { width: 14px; flex: 0 0 auto; color: #94a3b8; text-align: center; }
.th-contact-lines a { color: #334155; overflow-wrap: anywhere; min-width: 0; }
.th-contact-lines a:hover { color: var(--th-blue); }
.th-contact-access { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.th-contact-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid #eef2f7; }
.th-contact-delete { margin: 0; }
.th-contact-form-page .th-back { margin-bottom: 12px; }
.th-new-photo { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.th-new-photo label { margin: 0; cursor: pointer; }
.th-profile-side { display: flex; flex-direction: column; gap: 18px; }
.th-check-row { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 12px; border: 1px solid #eef2f7; border-radius: 10px; cursor: pointer; font-weight: 400; }
.th-check-row:hover { background: #f8fafc; }
.th-check-row input { margin: 3px 0 0; width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--th-blue); }
.th-check-row span { display: flex; flex-direction: column; }
.th-check-row strong { color: var(--th-ink); font-size: 13.5px; font-weight: 600; }
.th-check-row small { color: #64748b; font-size: 12.5px; }
.th-pw-field-2 .form-control { padding-right: 78px; }
.th-pw-field-2 .th-pw-toggle { right: 40px; }
.th-pw-field-2 .th-pw-gen { right: 4px; }
.th-contact-form-page > form > .th-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@media (max-width: 575px) {
  .th-contact-grid { grid-template-columns: minmax(0, 1fr); }
  .th-contact-me > .th-btn-sm { width: 100%; justify-content: center; }
  .th-contact-form-page > form > .th-form-actions .th-btn-sm { flex: 1 1 0; justify-content: center; }
}
.th-contact-delete .th-icon-btn { width: 34px; height: 34px; font-size: 14px; border: 1px solid #fecaca; background: #fff; }
.th-contact-delete .th-icon-btn:hover, .th-contact-delete .th-icon-btn:focus { background: #fef2f2 !important; color: #b91c1c; }
.th-contact-access .th-chip { background: #f1f5f9; color: #475569; font-weight: 500; }
.th-contact-access + .th-form-hint { margin-top: 12px; }

/* Top bar profile menu on phones: Bootstrap's collapsed-navbar rules make an open dropdown static and transparent,
   which stretched the top bar and drew the menu over the page. Keep it a floating white panel under the avatar. */
@media (max-width: 767px) {
  .th-topbar .th-topbar-logo { flex: 0 0 auto; }
  .th-topbar .navbar-nav.th-topbar-actions { margin: 0 0 0 auto; }
  .th-topbar .navbar-nav > li { position: relative; }
  .th-topbar .navbar-nav > .open > .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    float: left;
    width: auto;
    min-width: 230px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - var(--th-topbar-h) - 24px);
    overflow-y: auto;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  }
  .th-topbar .navbar-nav > .open > .dropdown-menu > li > a { padding: 10px 12px; line-height: 1.4; color: #334155; }
  .th-topbar .navbar-nav .open .dropdown-menu .th-dropdown-header { padding: 8px 12px 10px; border-color: #f1f5f9; }
  .th-topbar .th-dropdown-header strong { color: var(--th-ink); }
  .th-topbar .th-dropdown-header span { color: #64748b; }
}

/* Tighter side edges on tablets and phones: Perfex's style.css adds 15px to #content on top of the container
   padding (31px per side). Drop that and use one 12px gutter for top bar, content and footer. */
@media (max-width: 991px) {
  .th-shell #content { padding-left: 0; padding-right: 0; }
  .th-shell #wrapper .container, .th-shell footer .container { padding-left: 12px; padding-right: 12px; }
  .th-topbar { padding: 0 12px; }
}

/* ---------- Company details ---------- */
.th-company-page .th-card { padding: 20px 22px; }
.th-company-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; background: linear-gradient(120deg, #fff 55%, #eef5fc 100%); }
.th-company-mark { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--th-navy); color: #fff; font-size: 28px; font-weight: 700; }
.th-company-id { min-width: 0; }
.th-company-id h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-company-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; color: #475569; font-size: 13.5px; }
.th-company-meta span { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.th-company-meta i { color: #94a3b8; }
.th-company-meta a { color: var(--th-blue); }
.th-doc-banner.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.th-doc-banner.info > div { display: flex; flex-direction: column; }
.th-company-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 18px; }
.th-company-fieldset[disabled] .form-control { background: #f8fafc; color: #334155; cursor: default; }
.th-company-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.th-company-page .th-profile-card { margin: 0; }
.th-address-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.th-address-head h3 { margin: 0; }
.th-address-head + .th-notif-intro { margin: -8px 0 12px; }
.th-company-page .th-form-actions { display: flex; justify-content: flex-end; margin: 0; padding: 0; border: 0; }
@media (max-width: 991px) {
  .th-company-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575px) {
  .th-company-page .th-card { padding: 16px; }
  .th-company-hero { align-items: flex-start; }
  .th-company-mark { width: 52px; height: 52px; font-size: 22px; border-radius: 14px; }
  .th-company-page .th-form-actions .th-btn-sm { width: 100%; justify-content: center; }
}
.th-company-page .th-doc-banner { flex-wrap: nowrap; align-items: flex-start; }
.th-company-page .th-doc-banner > i { margin-top: 2px; }

/* ---------- GDPR, consent, privacy policy, terms ---------- */
.th-gdpr-intro { padding: 18px 22px; margin-bottom: 18px; color: #334155; }
.th-gdpr-intro > :last-child { margin-bottom: 0; }
.th-gdpr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.th-gdpr-right { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 20px; }
.th-gdpr-right h3, .th-gdpr-erasure h3 { margin: 4px 0 0; font-size: 16px; font-weight: 700; color: var(--th-ink); }
.th-gdpr-right p, .th-gdpr-erasure p { margin: 0; color: #475569; font-size: 13.5px; line-height: 1.55; }
.th-gdpr-right strong { color: var(--th-ink); }
.th-gdpr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.th-gdpr-icon { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.th-gdpr-icon.blue { background: #e0edfb; color: var(--th-blue); }
.th-gdpr-icon.amber { background: #fef3c7; color: #b45309; }
.th-gdpr-icon.green { background: #dcfce7; color: #15803d; }
.th-gdpr-icon.purple { background: #ede9fe; color: #6d28d9; }
.th-gdpr-icon.red { background: #fee2e2; color: #b91c1c; }
.th-gdpr-erasure { padding: 20px 22px; border-color: #fecaca; }
.th-gdpr-erasure-head { display: flex; gap: 14px; margin-bottom: 14px; }
.th-gdpr-erasure .th-doc-banner { margin: 0; }
.th-gdpr-erasure form .form-group { margin-bottom: 12px; }
.th-choice.ok input:checked + span { background: #dcfce7; border-color: #16a34a; color: #166534; }

.th-consent-wrap { max-width: 760px; margin: 24px auto 40px; }
.th-consent-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.th-consent-head h1 { margin: 4px 0 6px; font-size: 26px; font-weight: 700; color: var(--th-ink); }
.th-consent-head p { margin: 0; }
.th-consent-eyebrow { margin: 0; color: var(--th-blue) !important; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.th-consent-intro { padding: 18px 22px; margin-bottom: 16px; }
.th-consent-list { display: flex; flex-direction: column; gap: 14px; }
.th-consent-item { margin: 0; padding: 18px 20px; }
.th-consent-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.th-consent-item-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--th-ink); }
.th-consent-desc { margin: 8px 0 0; color: #475569; font-size: 14px; line-height: 1.55; }
.th-consent-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid #eef2f7; }
.th-consent-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 18px; padding: 0; border: 0; }
.th-consent-actions .th-btn-sm[disabled] { opacity: 0.55; cursor: not-allowed; }

.th-legal { max-width: 860px; margin: 0 auto; padding: 28px 32px; }
.th-legal-head { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid #eef2f7; }
.th-legal-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; color: var(--th-ink); }
.th-legal-head p { margin: 0; }
.th-legal-icon { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: #e0edfb; color: var(--th-blue); font-size: 20px; }
.th-legal-body { color: #334155; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.th-legal-body h1, .th-legal-body h2, .th-legal-body h3 { color: var(--th-ink); font-weight: 700; margin: 1.4em 0 0.5em; }
.th-legal-body img { max-width: 100%; height: auto; }
.th-legal-body table { display: block; max-width: 100%; overflow-x: auto; }
.th-legal-empty { padding: 20px 0 8px; border: 0; box-shadow: none; }
.th-legal-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid #eef2f7; }
.th-legal-foot .th-back { margin: 0; }
@media (max-width: 575px) {
  .th-legal { padding: 20px 16px; }
  .th-legal-head { align-items: flex-start; }
  .th-legal-head h1 { font-size: 20px; }
  .th-consent-wrap { margin-top: 8px; }
  .th-consent-head h1 { font-size: 22px; }
  .th-consent-actions { flex-direction: column-reverse; align-items: stretch; }
  .th-consent-actions .th-btn-sm { justify-content: center; }
  .th-gdpr-erasure .th-btn-sm { width: 100%; justify-content: center; }
}
.th-consent-item-head h3.gdpr-purpose-heading { margin: 0; font-size: 16px; font-weight: 700; color: var(--th-ink); }
.th-consent-logo { margin-bottom: 22px; }
.th-consent-logo a { display: inline-block; padding: 0; }
.th-consent-logo img { height: 40px; width: auto; }
.th-manager > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.th-manager-role { color: #64748b; font-size: 12.5px; margin-bottom: 2px; }
.th-manager a i { width: 14px; color: #94a3b8; margin-right: 4px; text-align: center; }

/* Sidebar menu: still scrolls on short screens, but without a visible scrollbar */
.th-sidebar-nav { scrollbar-width: none; -ms-overflow-style: none; }
.th-sidebar-nav::-webkit-scrollbar { display: none; }

/* Invoice list: "Due" before the date once the column headers are hidden */
.th-inv-due-label { display: none; }
@media (max-width: 991px) { .th-inv-due-label { display: inline; color: #64748b; } }

/* Row hover in lists and tables: a light brand-blue tint, so the highlight reads as part of the white card
   (the old #f8fafc matched the page background and looked like a hole) */
:root { --th-row-hover: #f3f7fc; }
.th-table > tbody > tr:hover,
.th-projects a:hover,
.th-tickets a:hover,
#th-invoice-rows .th-inv-row:hover,
.th-task-row:hover,
.th-disc-item:hover,
.th-ticket-link:hover,
.th-contract-link:hover,
.th-prospecting #pr-table > tbody > tr.pr-row:hover,
.th-agenda-item:hover,
.th-switch-row:hover,
.th-check-row:hover { background: var(--th-row-hover); }
/* Invoice table: rows run to the card's edges and its rounded corners clip the highlight */
@media (min-width: 992px) {
  .th-invoice-list { padding: 0; overflow: hidden; }
}

/* ---------- Prospect pipeline (My Prospects) ---------- */
.th-fpill i.dot-purple { background: #7c3aed; }
.th-fpill i.dot-amber { background: #ea580c; }
.th-pipe-kpis { margin-bottom: 16px; }
.th-pipe-kpis div.th-kpi .th-kpi-value { font-size: 24px; }

.th-pipe-due { padding: 16px 18px; margin-bottom: 16px; border-color: #fde68a; background: #fffdf5; }
.th-pipe-due h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--th-ink); display: flex; align-items: center; gap: 8px; }
.th-pipe-due h3 i { color: #d97706; }
.th-pipe-due ul { list-style: none; margin: 0; padding: 0; }
.th-pipe-due li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #fdecc8; }
.th-pipe-due li:first-child { border-top: 0; padding-top: 2px; }
.th-pipe-due-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.th-pipe-due-name { font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th-pipe-due-name:hover { color: var(--th-blue); }
.th-pipe-due-sub { font-size: 12.5px; color: #64748b; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.th-pipe-due-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.th-pipe-toolbar { margin-bottom: 12px; }
.th-pipe-tabs { display: none; }
.th-pipe-tabs .th-fpill { font: inherit; cursor: pointer; }

/* Board: one column per stage, scrolls sideways when the columns don't fit */
.th-pipe { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.th-pipe-col { min-width: 0; display: flex; flex-direction: column; border-radius: 14px; background: #f1f5f9; border-top: 3px solid #cbd5e1; }
.th-pipe-new { border-top-color: var(--th-blue); }
.th-pipe-contacted { border-top-color: #f59e0b; }
.th-pipe-meeting { border-top-color: #7c3aed; }
.th-pipe-proposal { border-top-color: #ea580c; }
.th-pipe-won { border-top-color: #16a34a; background: #f0fdf4; }
.th-pipe-lost { border-top-color: #94a3b8; }
.th-pipe-col-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px 8px; }
.th-pipe-col-title { font-size: 13.5px; font-weight: 700; color: var(--th-ink); display: inline-flex; align-items: center; gap: 7px; }
.th-pipe-col-title i { color: #64748b; }
.th-pipe-col-value { margin-left: auto; font-size: 12.5px; font-weight: 600; color: #475569; }
.th-pipe-cards { display: flex; flex-direction: column; gap: 10px; min-height: 90px; padding: 4px 10px 12px; border-radius: 0 0 14px 14px; transition: background 0.15s; }
.th-pipe-cards.is-over { background: #e0edfb; outline: 2px dashed var(--th-blue); outline-offset: -6px; }
.th-pipe-empty { display: none; margin: 0; padding: 18px 8px; text-align: center; color: #94a3b8; font-size: 12.5px; border: 1px dashed #cbd5e1; border-radius: 10px; }
.th-pipe-cards.is-empty .th-pipe-empty { display: block; }
.th-pipe-empty-phone { display: none; }

.th-pipe-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); cursor: grab; }
.th-pipe-card[hidden] { display: none; }
.th-pipe-card.is-dragging { opacity: 0.5; cursor: grabbing; }
.th-pipe-card.th-pr-highlight { box-shadow: 0 0 0 3px rgba(48, 120, 184, 0.35); }
.th-pipe-lost .th-pipe-card { opacity: 0.8; }
.th-pipe-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.th-pipe-card-top h4 { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.3; color: var(--th-ink); overflow-wrap: anywhere; }
.th-pipe-card-top .pr-score { flex: 0 0 auto; min-width: 0; font-size: 11.5px; padding: 2px 8px; }
.th-pipe-meta { margin: 0; font-size: 12.5px; color: #64748b; }
.th-pipe-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.th-pipe-chips:empty { display: none; }
.th-pipe-chips .th-chip { font-size: 11.5px; }
.th-pipe-quick { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.th-pipe-icon { width: 34px; height: 34px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; color: #334155; font-size: 14px; }
.th-pipe-icon:hover { border-color: var(--th-blue); color: var(--th-blue); }
.th-pipe-icon.wa { color: #16a34a; }
.th-pipe-move { margin: 0 0 0 auto; font-weight: 400; }
.th-pipe-move select { height: 34px; padding: 4px 26px 4px 10px; border: 1px solid #e2e8f0; border-radius: 9px; background-color: #fff; font-size: 12.5px; font-weight: 600; color: #334155; cursor: pointer; }

.th-pipe-more { margin-top: 2px; border-top: 1px solid #f1f5f9; padding-top: 6px; }
.th-pipe-more summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--th-blue); list-style: none; }
.th-pipe-more summary::-webkit-details-marker { display: none; }
.th-pipe-more summary::after { content: " \2304"; }
.th-pipe-more[open] summary::after { content: " \2303"; }
.th-pipe-more[open] { cursor: default; }
.th-pipe-more > * + * { margin-top: 10px; }
.th-pipe-line { margin: 10px 0 0; font-size: 12.5px; color: #475569; }
.th-pipe-line i { color: #94a3b8; width: 14px; }
.th-pipe-links { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; font-size: 12.5px; }
.th-pipe-links:empty { display: none; }
.th-pipe-links a { color: var(--th-blue); overflow-wrap: anywhere; }
.th-pipe-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.th-pipe-fields label { margin: 0; font-weight: 400; min-width: 0; }
.th-pipe-fields label > span { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: #64748b; }
.th-pipe-fields .form-control { height: 38px; border-radius: 9px; font-size: 13.5px; padding: 6px 10px; }
.th-pipe-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.th-pipe-foot .th-pr-saved { margin-left: 0; }
.th-pipe-delete { color: #b91c1c !important; border-color: #fecaca; }
.th-pipe-delete:hover { background: #fef2f2 !important; }

/* Phones: stage tabs, one stage at a time, full-width cards; move with the select (no dragging) */
@media (max-width: 767px) {
  .th-pipe-tabs { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; margin: 0 -12px 12px; padding: 0 12px 4px; scrollbar-width: none; }
  .th-pipe-tabs::-webkit-scrollbar { display: none; }
  .th-pipe-tabs .th-fpill { flex: 0 0 auto; }
  .th-pipe { display: block; overflow: visible; padding: 0; }
  .th-pipe-col { display: none; background: none; border-top: 0; }
  .th-pipe-col.is-active { display: flex; }
  .th-pipe-col-head { padding: 0 2px 10px; }
  .th-pipe-col-head .th-pr-count { display: none; }
  .th-pipe-cards { padding: 0; min-height: 0; }
  .th-pipe-card { cursor: default; padding: 14px; }
  .th-pipe-card-top h4 { font-size: 15.5px; }
  .th-pipe-icon { width: 40px; height: 40px; font-size: 15px; }
  .th-pipe-move select { height: 40px; }
  .th-pipe-empty-desk { display: none; }
  .th-pipe-empty-phone { display: inline; }
  .th-pipe-empty { padding: 28px 12px; background: #fff; }
  .th-pipe-due li { flex-wrap: wrap; }
  .th-pipe-due-actions { width: 100%; }
  .th-pipe-due-actions .th-pipe-done { margin-left: auto; }
  .th-pipe-kpis div.th-kpi .th-kpi-value { font-size: 20px; }
}
@media (max-width: 380px) {
  .th-pipe-fields { grid-template-columns: minmax(0, 1fr); }
}
.th-feature-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.th-feature-actions .th-btn-sm { margin-top: 0; }
.th-feature-actions .th-pr-count { background: #f59e0b; color: #fff; }
/* Pipeline fixes: the stage select fills the space left in the row (never wider), notes use the full card */
.th-pipe-move { flex: 1 1 auto; min-width: 0; }
.th-pipe-move select { display: block; width: 100% !important; max-width: 100%; } /* beats bootstrap-select's fixed 220px */
.th-pipe-more textarea, .th-pipe-more .th-pr-notes { width: 100%; }
/* Phones: the three figures as one compact row */
@media (max-width: 767px) {
  .th-pipe-kpis.th-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .th-pipe-kpis div.th-kpi { padding: 12px 10px; min-height: 0; }
  .th-pipe-kpis .th-kpi-icon, .th-pipe-kpis .th-kpi-foot { display: none; }
  .th-pipe-kpis .th-kpi-label { font-size: 11.5px; line-height: 1.3; }
  .th-pipe-kpis div.th-kpi .th-kpi-value { font-size: 16px; margin-top: 4px; overflow-wrap: anywhere; }
}

/* ---------- Sign in, register, forgot / reset password, verify email ---------- */
.th-auth { padding-top: 28px; padding-bottom: 40px; }
.th-auth-card { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); max-width: 980px; margin: 0 auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08); }
.th-auth-wide .th-auth-card { max-width: 1180px; grid-template-columns: 360px minmax(0, 1fr); }
.th-auth-brand { position: relative; padding: 40px 36px; color: #fff; background: radial-gradient(120% 90% at 100% 0%, #1f5aa6 0%, var(--th-navy) 60%); overflow: hidden; }
.th-auth-brand::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 260px; height: 260px; opacity: 0.12; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='none' stroke='white' stroke-width='3' d='M50 5l39 22.5v45L50 95 11 72.5v-45z'/%3E%3C/svg%3E") center / contain no-repeat; }
.th-auth-brand-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.th-auth-eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.th-auth-brand h2 { margin: 0 0 10px; font-size: 26px; font-weight: 800; line-height: 1.2; color: #fff; }
.th-auth-lead { margin: 0 0 24px; color: rgba(255, 255, 255, 0.82); font-size: 14.5px; line-height: 1.55; }
.th-auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.th-auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: rgba(255, 255, 255, 0.92); }
.th-auth-points i { width: 32px; height: 32px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(255, 255, 255, 0.12); font-size: 13px; }
.th-auth-points span { padding-top: 6px; }
.th-auth-help { margin: auto 0 0; padding-top: 28px; font-size: 13px; color: rgba(255, 255, 255, 0.75); display: flex; flex-direction: column; gap: 6px; }
.th-auth-help a { color: #fff; font-weight: 600; }
.th-auth-main { padding: 40px 44px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.th-auth-main h1 { margin: 0 0 6px; font-size: 26px; font-weight: 800; color: var(--th-ink); }
.th-auth-sub { margin: 0 0 22px; color: #64748b; }
.th-auth-sub a, .th-auth-switch a { color: var(--th-blue); font-weight: 600; }
.th-auth-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.th-auth .form-control { height: 46px; border-radius: 10px; font-size: 15px; }
.th-auth .control-label { font-weight: 600; color: #334155; }
.th-auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.th-auth-link { font-size: 13px; font-weight: 600; color: var(--th-blue); }
.th-auth-remember { margin-bottom: 18px; }
.th-auth-submit { width: 100%; min-height: 48px; justify-content: center; font-size: 15px; border-radius: 10px; }
.th-auth-switch { margin: 18px 0 0; text-align: center; color: #64748b; }
.th-auth-lang { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; color: #64748b; }
.th-auth-title-row .th-auth-lang { margin-top: 0; }
.th-auth-lang label { margin: 0; }
.th-auth-lang .bootstrap-select:not(.input-group-btn) { width: 140px !important; }
.th-auth-lang .bootstrap-select > .dropdown-toggle, .th-auth-lang-select { height: 34px; border-radius: 8px; font-size: 13px; }
.th-auth-section { padding: 18px 0; border-top: 1px solid #f1f5f9; }
.th-auth-section:first-of-type { border-top: 0; padding-top: 4px; }
.th-auth-section h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--th-ink); }
.th-auth-section h2 span { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e0edfb; color: var(--th-navy); font-size: 13px; }
.th-auth .register-terms-and-conditions-wrapper { margin: 6px 0 16px; }
.th-auth .register-recaptcha { margin-bottom: 16px; }
.th-honey { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.th-auth-done { text-align: center; }
.th-auth-done p { color: #475569; }
.th-auth-done-icon { width: 60px; height: 60px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #e0edfb; color: var(--th-blue); font-size: 24px; }
.th-verify-page { padding-top: 10px; }
.th-verify { max-width: 620px; margin: 0 auto; padding: 32px; text-align: center; }
.th-verify h1 { margin: 0 0 8px; font-size: 22px; font-weight: 800; color: var(--th-ink); }
.th-verify p { color: #475569; }
.th-verify-steps { display: inline-flex; flex-direction: column; gap: 6px; margin: 6px 0 18px; padding-left: 20px; text-align: left; color: #334155; list-style: decimal; }
.th-verify-steps li { display: list-item; padding-left: 4px; }
.th-verify-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
@media (max-width: 991px) {
  .th-auth-wide .th-auth-card { grid-template-columns: minmax(0, 1fr); }
  .th-auth-wide .th-auth-points, .th-auth-wide .th-auth-help { display: none; }
  .th-auth-wide .th-auth-brand { padding: 24px 28px; }
}
@media (max-width: 767px) {
  .th-auth { padding-top: 12px; padding-bottom: 24px; }
  .th-auth-card { grid-template-columns: minmax(0, 1fr); border-radius: 16px; }
  .th-auth-brand { padding: 22px 20px; }
  .th-auth-brand h2 { font-size: 20px; margin-bottom: 4px; }
  .th-auth-lead { margin: 0; font-size: 13.5px; }
  .th-auth-points, .th-auth-help { display: none; }
  .th-auth-brand::after { width: 150px; height: 150px; right: -40px; bottom: -50px; }
  .th-auth-main { padding: 24px 20px 28px; }
  .th-auth-main h1 { font-size: 22px; }
  .th-verify { padding: 24px 18px; }
}

/* ---------- Knowledge base (help centre) ---------- */
.th-kb-hero { margin: -8px 0 22px; padding: 30px 0 34px; background: radial-gradient(120% 140% at 100% 0%, #1f5aa6 0%, var(--th-navy) 65%); color: #fff; }
.th-shell .th-kb-hero { margin-top: -24px; }
.th-kb-hero .container { max-width: 760px !important; text-align: center; }
.th-kb-eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.th-kb-hero h2 { margin: 0 0 16px; font-size: 26px; font-weight: 800; color: #fff; }
.th-kb-search { position: relative; display: flex; gap: 8px; margin: 0; padding: 6px; background: #fff; border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18); }
.th-kb-search > i { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.th-kb-search input { flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 12px 0 42px; border: 0; border-radius: 10px; font-size: 15px; color: var(--th-ink); outline: none; }
.th-kb-search button { flex: 0 0 auto; padding: 0 22px; border: 0; border-radius: 10px; background: var(--th-blue); color: #fff; font-weight: 600; }
.th-kb-search button:hover { background: #2668a3; }
.th-kb-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.th-kb-topic { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 20px; }
.th-kb-topic header { display: flex; align-items: center; gap: 12px; }
.th-kb-topic-icon { width: 42px; height: 42px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); font-size: 17px; }
.th-kb-topic h3 { margin: 0; font-size: 16px; font-weight: 700; }
.th-kb-topic h3 a { color: var(--th-ink); }
.th-kb-topic h3 a:hover { color: var(--th-blue); }
.th-kb-topic small { color: #64748b; font-size: 12.5px; }
.th-kb-topic-desc { margin: 0; color: #475569; font-size: 13.5px; }
.th-kb-topic ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.th-kb-topic li a { display: flex; gap: 8px; align-items: baseline; color: #334155; font-size: 13.5px; }
.th-kb-topic li a:hover { color: var(--th-blue); }
.th-kb-topic li i { color: #94a3b8; }
.th-kb-more { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--th-blue); }
.th-kb-cat-head h1 { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: var(--th-ink); }
.th-kb-cat-head p { margin: 0 0 14px; color: #475569; }
.th-kb-card { padding: 8px 0; }
.th-kb-card .th-page-summary { margin: 10px 20px 4px; }
.th-kb-list { list-style: none; margin: 0; padding: 0; }
.th-kb-list li + li { border-top: 1px solid #f1f5f9; }
.th-kb-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: inherit; }
.th-kb-item:hover { background: var(--th-row-hover, #f3f7fc); }
.th-kb-item-icon { width: 36px; height: 36px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #e0edfb; color: var(--th-blue); }
.th-kb-item-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.th-kb-item-text strong { color: var(--th-ink); font-size: 14.5px; }
.th-kb-item-text small { color: #64748b; font-size: 13px; line-height: 1.5; }
.th-kb-item-text em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--th-blue); }
.th-kb-item-go { color: #cbd5e1; }
.th-kb-help { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 16px 20px; border: 1px solid #dbeafe; border-radius: 14px; background: #f5f9ff; }
.th-kb-help > span { width: 42px; height: 42px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #e0edfb; color: var(--th-blue); font-size: 17px; }
.th-kb-help > div { flex: 1 1 auto; }
.th-kb-help p { margin: 2px 0 0; color: #475569; font-size: 13.5px; }
.th-kb-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.th-kb-crumbs a { color: #64748b; font-weight: 500; }
.th-kb-crumbs a:hover { color: var(--th-blue); }
.th-kb-crumbs i { font-size: 10px; color: #cbd5e1; }
.th-kb-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.th-kb-article-layout.is-single { grid-template-columns: minmax(0, 860px); }
.th-kb-article { padding: 28px 32px; margin: 0; }
.th-kb-article h1 { margin: 0 0 16px; font-size: 26px; font-weight: 800; color: var(--th-ink); line-height: 1.25; }
.th-kb-body { color: #334155; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.th-kb-body h2, .th-kb-body h3 { color: var(--th-ink); font-weight: 700; margin: 1.4em 0 0.5em; }
.th-kb-body img { max-width: 100%; height: auto; border-radius: 10px; }
.th-kb-body ol, .th-kb-body ul { padding-left: 22px; }
.th-kb-body ol { list-style: decimal; }
.th-kb-body ul { list-style: disc; }
.th-kb-body li { display: list-item; margin-bottom: 4px; }
.th-kb-body table { display: block; max-width: 100%; overflow-x: auto; }
.th-kb-useful { margin-top: 28px; padding-top: 18px; border-top: 1px solid #f1f5f9; }
.th-kb-useful > p:first-child { margin: 0 0 10px; font-weight: 600; color: var(--th-ink); }
.th-kb-useful .article_useful_buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.th-kb-useful .answer_response { margin: 8px 0 0; }
.th-kb-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--th-topbar-h, 64px) + 16px); }
.th-kb-related, .th-kb-ask { margin: 0; padding: 18px; }
.th-kb-related h2, .th-kb-ask h2 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--th-ink); }
.th-kb-related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.th-kb-related a { display: flex; gap: 8px; align-items: baseline; color: #334155; font-size: 13.5px; }
.th-kb-related a:hover { color: var(--th-blue); }
.th-kb-related i { color: #94a3b8; }
.th-kb-ask p { margin: 0 0 12px; color: #475569; font-size: 13.5px; }
.th-kb-ask .th-btn-sm { width: 100%; justify-content: center; }
@media (max-width: 991px) {
  .th-kb-article-layout { grid-template-columns: minmax(0, 1fr); }
  .th-kb-side { position: static; }
}
@media (max-width: 575px) {
  .th-kb-hero { padding: 22px 0 24px; }
  .th-kb-hero h2 { font-size: 21px; }
  .th-kb-search button { padding: 0 14px; }
  .th-kb-article { padding: 20px 18px; }
  .th-kb-article h1 { font-size: 21px; }
  .th-kb-help { flex-direction: column; align-items: flex-start; }
  .th-kb-help .th-btn-sm { width: 100%; justify-content: center; }
}
/* Help-centre banner sits flush under the top bar on phones too (#content has 15px top padding there) */
@media (max-width: 768px) { .th-shell .th-kb-hero { margin-top: -39px; } }

/* ---------- Announcements ---------- */
.th-ann-list { padding: 4px 0; }
.th-ann-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: inherit; border-top: 1px solid #f1f5f9; }
.th-ann-item:first-child { border-top: 0; }
.th-ann-item:hover { background: var(--th-row-hover, #f3f7fc); }
.th-ann-item.is-new { box-shadow: inset 3px 0 0 var(--th-blue); }
.th-ann-icon { width: 40px; height: 40px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #e0edfb; color: var(--th-blue); }
.th-ann-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.th-ann-text strong { color: var(--th-ink); font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-ann-item:not(.is-new) .th-ann-text strong { font-weight: 600; }
.th-ann-text small { color: #64748b; font-size: 13px; line-height: 1.5; }
.th-ann-item time { flex: 0 0 auto; font-size: 12.5px; color: #94a3b8; white-space: nowrap; }
.th-ann-article { max-width: 860px; padding: 28px 32px; }
.th-ann-article header { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid #f1f5f9; }
.th-ann-article h1 { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: var(--th-ink); }
.th-ann-article header p { margin: 0; color: #64748b; font-size: 13px; }
.th-ann-body { color: #334155; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.th-ann-body img { max-width: 100%; height: auto; border-radius: 10px; }
@media (max-width: 575px) {
  .th-ann-item { flex-wrap: wrap; padding: 14px 16px; }
  .th-ann-item time { width: 100%; padding-left: 54px; }
  .th-ann-article { padding: 20px 18px; }
  .th-ann-article h1 { font-size: 19px; }
}
.th-ann-strip-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.th-ann-strip { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border: 1px solid #bfdbfe; border-radius: 12px; background: #f5f9ff; }
.th-ann-strip .th-ann-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
.th-ann-strip-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.th-ann-strip-text strong { color: var(--th-ink); font-size: 14px; }
.th-ann-strip-text span { color: #475569; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-ann-strip-close { float: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: #64748b; opacity: 1; font-size: 15px; text-shadow: none; }
.th-ann-strip-close:hover { background: #e0edfb; color: var(--th-ink); }
@media (max-width: 575px) {
  .th-ann-strip { flex-wrap: wrap; }
  .th-ann-strip-text { flex-basis: calc(100% - 90px); }
  .th-ann-strip-text span { white-space: normal; }
  .th-ann-strip > .th-btn-sm { margin-left: 46px; }
}
