/* ==========================================================================
   Safforix Technology Portal — Core Bento Design System & Layout
   Colors: Deep Navy (#072b5f), Vibrant Cyan (#03a1d0), Light Sky (#e0f2fe)
   ========================================================================== */

:root {
  --page: #f4f9fd;
  --panel: #ffffff;
  --card: #ffffff;
  --hair: #e2effa;
  --ink: #072b5f;
  --muted: #5e6d82;
  --faint: #8ca0b8;

  /* Safforix Brand Tokens */
  --saff-navy: #072b5f;
  --saff-navy-deep: #041b3d;
  --saff-cyan: #03a1d0;
  --saff-cyan-hover: #0288b2;
  --saff-sky: #e0f2fe;
  --saff-sky-light: #f0f8ff;
  --saff-glow: rgba(3, 161, 208, 0.18);

  /* Status Colors */
  --emerald: #10b981;
  --emerald-bg: #ecfdf5;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --rose: #ef4444;
  --rose-bg: #fef2f2;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --gap: 16px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: 0 0 0 3px #ffffff, 0 0 0 5px var(--saff-cyan);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  overflow-y: auto;
}

body {
  background-color: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: block !important;
  overflow-x: hidden;
  overflow-y: auto;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: transparent;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ==========================================================================
   Main Shell Layout
   ========================================================================== */

.portal-app {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
  max-width: 1720px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 28px 48px; /* Clean, generous breathing room at top and sides */
  transition: grid-template-columns 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-app.sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr);
}

@media (max-width: 1024px) {
  .portal-app,
  .portal-app.sidebar-collapsed {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .portal-app,
  .portal-app.sidebar-collapsed {
    padding: 12px 12px calc(88px + env(safe-area-inset-bottom, 0px)); /* Extra bottom padding for mobile app bar */
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    gap: 12px;
  }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.portal-sidebar {
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  width: 270px;
  height: auto;
  min-height: auto;
  max-height: none;
  align-self: start;
  padding: 16px 0 10px;
  position: sticky;
  top: 24px;
  box-shadow: var(--shadow-sm);
  overflow: visible;
  z-index: 40;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-sidebar.is-collapsed {
  width: 84px;
  padding: 14px 0 10px;
}

@media (max-width: 1024px) {
  .portal-sidebar,
  .portal-sidebar.is-collapsed {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 82vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    box-shadow: 0 20px 48px rgba(7, 43, 95, 0.28);
  }
  .portal-sidebar.is-open {
    transform: translateX(0);
  }
}

.portal-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 14px;
  border-bottom: 1px solid var(--hair);
  position: relative;
  flex-shrink: 0;
  gap: 8px;
}

.portal-sidebar.is-collapsed .portal-brand {
  flex-direction: column;
  padding: 0 8px 12px;
  gap: 8px;
  justify-content: center;
}

.portal-brand-badge {
  background: #ffffff;
  border: 1px solid rgba(226, 239, 250, 0.95);
  padding: 7px 18px;
  border-radius: 999px;
  box-shadow: 
    0 2px 8px rgba(7, 43, 95, 0.04),
    0 8px 24px -4px rgba(3, 161, 208, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.portal-brand-badge:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 4px 14px rgba(7, 43, 95, 0.07),
    0 12px 30px -4px rgba(3, 161, 208, 0.28);
  border-color: rgba(3, 161, 208, 0.4);
}

.portal-sidebar.is-collapsed .portal-brand-badge {
  padding: 6px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.portal-brand-icon-only {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.portal-brand-logo-img {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.portal-sidebar-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.portal-sidebar-toggle-btn:hover {
  background: var(--saff-sky);
  color: var(--saff-navy);
  border-color: rgba(3, 161, 208, 0.3);
  transform: scale(1.05);
}

@media (max-width: 1024px) {
  .portal-sidebar-toggle-btn {
    display: none;
  }
}

.portal-sidebar-close {
  position: absolute;
  right: 12px;
  top: 6px;
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

@media (max-width: 1024px) {
  .portal-sidebar-close {
    display: flex;
  }
}

.portal-nav-section {
  padding: 10px 0 2px;
}

.portal-nav-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  padding: 0 20px 6px;
}

.portal-nav-list {
  list-style: none;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: all 0.2s var(--ease);
}

.portal-nav-link:hover {
  color: var(--saff-navy);
  background: rgba(3, 161, 208, 0.05);
}

.portal-nav-link.active {
  color: var(--saff-navy);
  font-weight: 700;
  background: var(--saff-sky);
}

.portal-nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 4px;
  background: var(--saff-cyan);
  border-radius: 0 4px 4px 0;
}

.portal-nav-icon {
  width: 19px;
  height: 19px;
  color: var(--muted);
  transition: color 0.2s;
}

.portal-nav-link.active .portal-nav-icon,
.portal-nav-link:hover .portal-nav-icon {
  color: var(--saff-cyan);
}

.portal-nav-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-nav-icon-svg svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  stroke: currentColor;
}

.portal-nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--saff-navy);
  color: #ffffff;
}

.portal-nav-badge.cyan {
  background: var(--saff-cyan);
}

.portal-accordion-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s var(--ease);
  min-height: 44px;
}

.portal-accordion-btn:hover {
  color: var(--saff-navy);
  background: rgba(3, 161, 208, 0.05);
}

.portal-accordion-btn.has-active-child {
  color: var(--saff-navy);
  font-weight: 700;
  background: rgba(3, 161, 208, 0.08);
}

.portal-accordion-btn.has-active-child .portal-nav-icon,
.portal-accordion-btn.has-active-child svg:first-child {
  color: var(--saff-cyan);
}

.portal-nav-chevron {
  margin-left: auto;
  transition: transform 0.25s ease;
  color: var(--faint);
}

.portal-nav-chevron.open {
  transform: rotate(180deg);
  color: var(--saff-cyan);
}

.portal-submenu-list {
  list-style: none;
  padding: 4px 0 6px 36px;
  margin: 0;
  position: relative;
}

.portal-submenu-list::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 6px;
  bottom: 8px;
  width: 2px;
  background: rgba(3, 161, 208, 0.2);
  border-radius: 2px;
}

.portal-submenu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--r-md);
  transition: all 0.15s ease;
  min-height: 44px;
  position: relative;
}

.portal-submenu-link:hover {
  color: var(--saff-navy);
  background: rgba(3, 161, 208, 0.06);
}

.portal-submenu-link.active {
  color: var(--saff-navy);
  font-weight: 700;
  background: var(--saff-sky);
  box-shadow: inset 3px 0 0 var(--saff-cyan);
}

.portal-submenu-link.active svg {
  color: var(--saff-cyan);
}

.portal-submenu-link.active::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--saff-cyan);
  margin-left: auto;
}

.portal-sidebar-body {
  flex: 0 1 auto;
  min-height: auto;
  overflow: visible;
  padding: 6px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.portal-sidebar-body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.portal-sidebar.is-collapsed .portal-nav-label {
  display: none;
}

.portal-sidebar.is-collapsed .portal-nav-link,
.portal-sidebar.is-collapsed .portal-accordion-btn {
  width: 46px;
  height: 46px;
  margin: 3px auto;
  padding: 0;
  border-radius: 12px;
  justify-content: center;
  position: relative;
}

.portal-sidebar.is-collapsed .portal-nav-text,
.portal-sidebar.is-collapsed .portal-nav-chevron {
  display: none !important;
}

.portal-sidebar.is-collapsed .portal-nav-link.active,
.portal-sidebar.is-collapsed .portal-accordion-btn.has-active-child {
  background: var(--saff-navy) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.portal-sidebar.is-collapsed .portal-nav-link.active .portal-nav-icon,
.portal-sidebar.is-collapsed .portal-accordion-btn.has-active-child .portal-nav-icon,
.portal-sidebar.is-collapsed .portal-nav-link.active svg,
.portal-sidebar.is-collapsed .portal-accordion-btn.has-active-child svg {
  color: #ffffff !important;
}

.portal-sidebar.is-collapsed .portal-nav-link.active::before {
  display: none;
}

.portal-sidebar.is-collapsed .portal-nav-link:hover,
.portal-sidebar.is-collapsed .portal-accordion-btn:hover {
  background: var(--saff-sky);
  color: var(--saff-navy);
  transform: scale(1.06);
}

@media (max-width: 1024px) {
  .portal-sidebar.is-collapsed .portal-nav-text {
    display: inline !important;
  }
  .portal-sidebar.is-collapsed .portal-nav-chevron {
    display: inline-block !important;
  }
  .portal-sidebar.is-collapsed .portal-nav-label {
    display: block !important;
  }
  .portal-sidebar.is-collapsed .portal-nav-link,
  .portal-sidebar.is-collapsed .portal-accordion-btn {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 9px 20px !important;
    justify-content: flex-start !important;
    border-radius: 0 !important;
  }
}

.portal-sidebar-footer {
  padding: 10px 14px 4px;
  border-top: 1px solid var(--hair);
  flex-shrink: 0;
}

.portal-sidebar.is-collapsed .portal-sidebar-footer {
  padding: 8px 8px 4px;
  display: flex;
  justify-content: center;
}

.portal-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.portal-sidebar-user:hover {
  background: rgba(3, 161, 208, 0.06);
}

.portal-sidebar.is-collapsed .portal-sidebar-user {
  padding: 0;
  justify-content: center;
}

.portal-sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--saff-navy);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  flex-shrink: 0;
}

.portal-sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--saff-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.portal-sidebar-user-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}

.portal-floating-flyout {
  pointer-events: auto;
  animation: portalFlyoutFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes portalFlyoutFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.portal-flyout-tooltip {
  background: var(--saff-navy);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(7, 43, 95, 0.25);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.portal-flyout-card {
  min-width: 190px;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(7, 43, 95, 0.18), 0 4px 12px rgba(7, 43, 95, 0.06);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.portal-flyout-header {
  padding: 6px 12px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--saff-navy);
  border-bottom: 1px solid var(--hair);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portal-flyout-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}

.portal-flyout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s ease;
}

.portal-flyout-link:hover {
  background: var(--saff-sky);
  color: var(--saff-navy);
}

.portal-flyout-link.active {
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-weight: 700;
}

.portal-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.portal-toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  background-color: #cbd5e1;
  border-radius: 999px;
  transition: background-color 0.25s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 3px;
}

.portal-toggle-switch.active {
  background-color: var(--saff-cyan);
  box-shadow: 0 0 0 3px rgba(3, 161, 208, 0.2);
}

.portal-toggle-thumb {
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
}

.portal-toggle-switch.active .portal-toggle-thumb {
  transform: translateX(20px);
}

.portal-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--saff-navy);
  line-height: 1.2;
}

.portal-toggle-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

.portal-tab-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
}

.portal-tab-btn.active {
  background: var(--saff-sky);
  color: var(--saff-navy);
  border-color: rgba(3, 161, 208, 0.35);
  font-weight: 700;
}

.portal-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  width: 100%;
}

.portal-icon-chip {
  width: 100%;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.portal-icon-chip:hover {
  color: var(--saff-navy);
  border-color: var(--saff-cyan);
  background: var(--saff-sky);
}

.portal-icon-chip.active {
  color: var(--saff-cyan);
  border-color: var(--saff-cyan);
  background: var(--saff-sky);
  box-shadow: 0 0 0 2px rgba(3, 161, 208, 0.25);
}

/* ==========================================================================
   Shell (Topbar + Content)
   ========================================================================== */

.portal-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Topbar */
.portal-topbar {
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--r-xl);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.portal-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  max-width: 480px;
}

.portal-menu-trigger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hair);
  color: var(--saff-navy);
}

@media (max-width: 1024px) {
  .portal-menu-trigger {
    display: flex;
  }
}

.portal-search {
  position: relative;
  width: 100%;
}

.portal-search input {
  width: 100%;
  height: 44px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 0 60px 0 44px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.portal-search input:focus {
  background: #ffffff;
  border-color: var(--saff-cyan);
  box-shadow: var(--focus);
}

.portal-search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--faint);
  pointer-events: none;
}

.portal-search-kbd {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  pointer-events: none;
}

.portal-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-topbar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--saff-navy);
  position: relative;
  transition: all 0.2s;
}

.portal-topbar-btn:hover {
  background: var(--saff-sky);
  color: var(--saff-cyan);
  border-color: rgba(3, 161, 208, 0.3);
}

.portal-btn-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--saff-cyan);
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.portal-profile-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px 4px 4px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: 999px;
  transition: all 0.2s;
}

.portal-profile-pill:hover {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.3);
}

.portal-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--saff-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.portal-profile-meta {
  display: flex;
  flex-direction: column;
}

.portal-profile-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--saff-navy);
  line-height: 1.2;
}

.portal-profile-role {
  font-size: 11px;
  color: var(--muted);
}

/* ==========================================================================
   Board Header & Shared Cards
   ========================================================================== */

.portal-board {
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--r-xl);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  min-height: calc(100vh - 120px);
}

.portal-board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
}

.portal-board-title {
  font-size: clamp(1.4rem, 4vw + 0.5rem, 1.875rem);
  overflow-wrap: break-word;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--saff-navy);
  line-height: 1.1;
}

.portal-board-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}

.portal-board-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn-saff-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  background: var(--saff-navy);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: filter 0.15s ease, opacity 0.15s ease;
  box-shadow: none;
}

.btn-saff-primary:hover {
  background: var(--saff-navy);
  filter: brightness(1.15);
  transform: none;
}

.btn-saff-primary:active {
  filter: brightness(0.95);
}

.btn-saff-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  background: #ffffff;
  border: 1px solid var(--hair);
  color: var(--saff-navy);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-saff-ghost:hover {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.3);
}

/* ==========================================================================
   Bento Grid & Cards
   ========================================================================== */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}

.bento-col-3 {
  grid-column: span 3;
}

.bento-col-4 {
  grid-column: span 4;
}

.bento-col-5 {
  grid-column: span 5;
}

.bento-col-6 {
  grid-column: span 6;
}

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
  }
  .bento-col-3 {
    grid-column: span 3;
  }
  .bento-col-4,
  .bento-col-5,
  .bento-col-6 {
    grid-column: span 6;
  }
}

/* Mobile Phones (768px and below) — Native Mobile Experience */
@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* 4 KPI Stat Cards display in an intuitive 2x2 widget grid */
  .bento-col-3.kpi-card {
    grid-column: span 1;
    min-height: 122px;
    padding: 14px;
    border-radius: 16px;
  }

  .kpi-card .kpi-label {
    font-size: 12px;
  }

  .kpi-card .kpi-num {
    font-size: 24px;
    margin: 4px 0;
  }

  .kpi-card .kpi-note {
    font-size: 10.5px;
    gap: 4px;
    flex-wrap: wrap;
  }

  .kpi-card .kpi-arrow {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  /* All other cards span full width (2 cols) */
  .bento-col-3:not(.kpi-card),
  .bento-col-4,
  .bento-col-5,
  .bento-col-6 {
    grid-column: span 2;
  }

  .bento-card {
    padding: 16px;
    border-radius: 16px;
  }
}

.bento-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
}

.bento-card:hover {
  box-shadow: var(--shadow-md);
}

/* KPI Stat Cards */
.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}

.kpi-card-hero {
  background: var(--saff-navy);
  color: #ffffff;
  border-color: transparent;
}

.kpi-card-hero .kpi-label {
  color: rgba(255, 255, 255, 0.85);
}

.kpi-card-hero .kpi-note {
  color: rgba(255, 255, 255, 0.7);
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.kpi-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--saff-cyan);
  transition: all 0.2s;
}

.kpi-card-hero .kpi-arrow {
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.kpi-arrow {
  position: relative;
}

.kpi-arrow::after {
  content: "";
  position: absolute;
  inset: -10px;
}

.kpi-arrow:hover {
  background: var(--saff-cyan);
  color: #ffffff;
  transform: rotate(45deg);
}

.kpi-num {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 12px 0 6px;
}

.kpi-note {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--saff-sky);
  color: var(--saff-navy);
}

.kpi-card-hero .kpi-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ==========================================================================
   Kanban Board Styles
   ========================================================================== */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767.98px) {
  .kanban-board {
    display: flex;
    gap: 12px;
    margin: 12px -14px 0;
    padding: 0 14px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 14px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .kanban-board::-webkit-scrollbar {
    display: none;
  }

  .kanban-col {
    flex: 0 0 86%;
    max-width: 340px;
    scroll-snap-align: start;
    min-width: 0;
  }
}

.kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}

@media (min-width: 768px) {
  .kanban-col-body {
    min-height: 400px;
  }
}

.kanban-col {
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hair);
}

.kanban-col-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--saff-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--muted);
}

.kanban-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(7, 43, 95, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
  cursor: grab;
}

.kanban-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: rgba(3, 161, 208, 0.4);
}

.kanban-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--saff-navy);
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   Messages Suite Styles
   ========================================================================== */

.messages-suite {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  height: 680px;
}

@media (max-width: 900px) {
  .messages-suite {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.msg-contacts-pane {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.msg-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  transition: all 0.2s;
  cursor: pointer;
}

.msg-contact-item:hover, .msg-contact-item.active {
  background: var(--saff-sky);
}

.msg-chat-pane {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.msg-chat-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.msg-chat-stream {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-bubble {
  max-width: 65%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.msg-bubble.incoming {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.msg-bubble.outgoing {
  align-self: flex-end;
  background: var(--saff-navy);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.msg-chat-composer {
  padding: 14px 20px;
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: center;
  gap: 10px;
}

.msg-composer-input {
  flex: 1;
  height: 42px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  outline: none;
}

.msg-composer-input:focus {
  border-color: var(--saff-cyan);
  background: #ffffff;
}

/* ==========================================================================
   Modals
   ========================================================================== */

html:has(.portal-modal-backdrop),
body:has(.portal-modal-backdrop) {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

@keyframes modalSlideUpMobile {
  from {
    transform: translateY(100%);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.portal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 43, 95, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
}

.portal-modal-box {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 20px;
  touch-action: pan-y;
  padding: 20px 16px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.25s var(--ease);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin: auto;
}

@media (max-width: 767.98px) {
  .portal-modal-box:not(.user-modal-box-wide) {
    margin: auto 12px;
    max-width: calc(100vw - 24px);
  }
}

@media (min-width: 768px) {
  .portal-modal-backdrop {
    padding: 24px;
    align-items: center;
    justify-content: center;
  }

  .portal-modal-box {
    padding: 28px;
    border-radius: var(--r-xl);
    max-height: calc(100dvh - 48px);
  }
}

.portal-modal-close-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #f1f5f9;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.portal-modal-close-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: var(--saff-navy);
}

.portal-modal-close-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.portal-modal-close-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.portal-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}

@media (min-width: 640px) {
  .portal-form-grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

.portal-icon-tabs-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
  width: 100%;
}

@media (min-width: 640px) {
  .portal-icon-tabs-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.portal-icon-tabs {
  display: flex;
  gap: 6px;
  width: 100%;
}

@media (min-width: 640px) {
  .portal-icon-tabs {
    width: auto;
  }
}

.portal-icon-tabs .portal-tab-btn {
  flex: 1;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.portal-icon-search-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  min-width: 0;
}

.portal-icon-preview-box {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  background: var(--saff-sky);
  color: var(--saff-cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(3, 161, 208, 0.3);
  flex-shrink: 0;
}

.portal-icon-help-text {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  line-height: 1.4;
}

.portal-icon-help-text a {
  color: var(--saff-cyan);
  text-decoration: underline;
}

.portal-icon-selected-badge {
  font-weight: 700;
  color: var(--saff-navy);
  word-break: break-all;
}

.portal-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  user-select: none;
  transition: all 0.15s ease;
  min-height: 52px;
}

.portal-toggle-card:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: rgba(3, 161, 208, 0.35);
}

.portal-toggle-card:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.portal-toggle-card:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.portal-toggle-card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.portal-modal-title {
  font-size: clamp(1.2rem, 4vw, 1.35rem);
  font-weight: 700;
  color: var(--saff-navy);
  margin-bottom: 6px;
  line-height: 1.25;
}

.portal-modal-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 18px;
}

.portal-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Hide top progress bar completely */
#nprogress,
.nprogress-busy,
#nprogress .bar,
#nprogress .peg,
#nprogress .spinner {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  height: 0 !important;
}

/* ==========================================================================
   Mobile-First Responsiveness & Native App Styles (< 768px)
   ========================================================================== */

@media (max-width: 768px) {
  .portal-board {
    padding: 16px 14px;
    border-radius: 18px;
    min-height: auto;
  }

  .portal-board-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }

  .portal-board-sub {
    font-size: 13px;
  }

  .portal-board-head > div:first-child {
    min-width: 0;
    width: 100%;
  }

  .portal-board-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .portal-board-actions .btn-saff-primary,
  .portal-board-actions .btn-saff-ghost {
    flex: 1 1 0;
    min-width: 0;
    height: 44px;
    font-size: 13px;
    padding: 0 12px;
  }

  .portal-topbar {
    padding: 8px 10px;
    border-radius: 16px;
    gap: 8px;
    position: sticky;
    top: max(8px, env(safe-area-inset-top, 0px));
    z-index: 30;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 6px 20px rgba(7, 43, 95, 0.06);
  }

  .portal-topbar-left {
    gap: 8px;
    max-width: none;
    min-width: 0;
  }

  .portal-topbar-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .portal-menu-trigger {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .portal-search input {
    height: 44px;
    padding: 0 12px 0 36px;
  }

  .portal-search-icon {
    left: 10px;
    width: 15px;
    height: 15px;
  }

  .portal-search-kbd {
    display: none;
  }

  .portal-topbar-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .portal-profile-pill {
    padding: 4px;
    gap: 6px;
    min-height: 44px;
  }

  .portal-profile-pill .portal-avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  .portal-profile-meta {
    display: none;
  }

  .portal-profile-role {
    display: none;
  }

  .portal-profile-name {
    font-size: 12px;
    max-width: 65px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .portal-modal-box {
    padding: 22px 18px;
    border-radius: 20px;
  }
}

@media (max-width: 480px) {
  .portal-search {
    display: none; /* Collapse search on narrow mobile viewports for clean header */
  }
}

/* ==========================================================================
   Mobile Drawer Backdrop & Bottom App Nav
   ========================================================================== */

.portal-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 43, 95, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.portal-mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .portal-mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--hair);
    box-shadow: 0 -4px 20px rgba(7, 43, 95, 0.08);
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .portal-mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    flex: 1;
    height: 100%;
    transition: color 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: transparent;
    border: none;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    position: relative;
  }

  .portal-mobile-tab:active {
    transform: scale(0.94);
  }

  .portal-mobile-tab.active {
    color: var(--saff-cyan);
    font-weight: 700;
  }

  .portal-mobile-tab.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--saff-cyan);
    transform: translateX(-50%);
  }

  .portal-mobile-tab.active svg {
    stroke: var(--saff-cyan);
  }

  .portal-mobile-badge {
    position: absolute;
    top: -3px;
    right: -8px;
    background: var(--saff-cyan);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 999px;
    line-height: 1.2;
  }
}

.user-table-wrap {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  overflow-x: auto;
  box-shadow: 0 4px 16px rgba(7, 43, 95, 0.05);
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.user-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.user-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.user-table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #f1f5f9;
}

.user-table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--saff-cyan);
}

.user-desktop-table {
  display: none;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

@media (min-width: 768px) {
  .user-desktop-table {
    display: table;
  }
}

.user-desktop-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 5;
  padding: 13px 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--hair);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

.user-desktop-table td {
  padding: 13px 14px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid var(--hair);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  vertical-align: middle;
  background: #ffffff;
}

.user-desktop-table tr:hover td {
  background-color: #f8fafc;
}

.user-desktop-table th.col-sticky-left,
.user-desktop-table td.col-sticky-left {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #ffffff;
  border-right: 1px solid var(--hair);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.02);
}

.user-desktop-table thead th.col-sticky-left {
  z-index: 15;
  background: #f8fafc;
}

.user-desktop-table tr:hover td.col-sticky-left {
  background: #f8fafc;
}

.user-desktop-table th.col-sticky-right,
.user-desktop-table td.col-sticky-right {
  position: sticky;
  right: 0;
  z-index: 6;
  background: #ffffff;
  border-left: 1px solid var(--hair);
  border-right: none;
  box-shadow: -3px 0 6px rgba(0, 0, 0, 0.025);
}

.user-desktop-table thead th.col-sticky-right {
  z-index: 15;
  background: #f8fafc;
}

.user-desktop-table tr:hover td.col-sticky-right {
  background: #f8fafc;
}

.user-desktop-table th:first-child,
.user-desktop-table td:first-child {
  padding-left: 16px;
}

.user-desktop-table th:last-child,
.user-desktop-table td:last-child {
  padding-right: 16px;
}

.user-desktop-table tbody tr:last-child td {
  border-bottom: none;
}

.user-desktop-table tbody tr {
  transition: background-color 0.15s ease;
}

.btn-action-kebab:hover {
  background: var(--saff-sky) !important;
  color: var(--saff-navy) !important;
  border-color: rgba(3, 161, 208, 0.35) !important;
}

.action-dropdown-item:hover {
  background: var(--saff-sky) !important;
  color: var(--saff-navy) !important;
}

.action-dropdown-item-delete:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

.user-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

@media (min-width: 768px) {
  .user-cards-list {
    display: none;
  }
}

.user-mobile-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(7, 43, 95, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.user-mobile-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-mobile-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: var(--r-sm);
  font-size: 13px;
  min-width: 0;
}

.user-mobile-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-actions-mobile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  width: 100%;
}

.btn-action-permissions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #bbf7d0;
  transition: all 0.2s ease;
  user-select: none;
  cursor: pointer;
}

.btn-action-permissions:hover {
  background: #dcfce7;
  color: #14532d;
  transform: translateY(-1px);
}

.btn-action-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(3, 161, 208, 0.25);
  transition: all 0.2s ease;
  user-select: none;
  cursor: pointer;
}

.btn-action-edit:hover {
  background: #bae6fd;
  color: var(--saff-navy-deep);
  transform: translateY(-1px);
}

.btn-action-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #fecaca;
  transition: all 0.2s ease;
  user-select: none;
  cursor: pointer;
}

.btn-action-delete:hover {
  background: #fee2e2;
  color: #b91c1c;
  transform: translateY(-1px);
}

.user-copy-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.user-copy-btn:hover {
  background: var(--saff-sky);
  color: var(--saff-cyan);
  border-color: rgba(3, 161, 208, 0.25);
}

.user-copy-btn.copied {
  background: #ecfdf5;
  color: #10b981;
  border-color: #a7f3d0;
}

.user-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .user-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.user-search-wrapper {
  position: relative;
  width: 100%;
  height: 44px;
}

@media (min-width: 640px) {
  .user-search-wrapper {
    max-width: 380px;
  }
}

.user-search-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 42px;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.user-search-input:focus {
  background: #ffffff;
  border-color: var(--saff-cyan);
  box-shadow: var(--focus);
}

.user-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.user-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-search-clear:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.user-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 20px;
  background: #ffffff;
  border-top: 1px solid var(--hair);
}

.user-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-page-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--hair);
  transition: all 0.15s ease;
  user-select: none;
}

.user-page-btn:hover:not(:disabled) {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.3);
  color: var(--saff-navy);
}

.user-page-btn.active {
  background: var(--saff-navy);
  color: #ffffff;
  border-color: var(--saff-navy);
}

.user-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.user-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--saff-navy);
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  font-size: 16px;
  color: var(--ink);
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.user-form-input:focus {
  background: #ffffff;
  border-color: var(--saff-cyan);
  box-shadow: var(--focus);
}

.user-form-input-error {
  border-color: #ef4444;
  background: #fffbfa;
}

.user-form-error-msg {
  font-size: 12px;
  color: #ef4444;
  font-weight: 600;
}

.user-password-wrap {
  position: relative;
  width: 100%;
}

.user-password-input {
  padding-right: 44px;
}

.user-password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 0 10px 10px 0;
}

.user-password-toggle:hover {
  color: var(--saff-navy);
}

.user-modal-header-responsive {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.portal-modal-box.user-modal-box-compact {
  width: calc(100vw - 32px);
  max-width: 480px;
  height: auto;
  min-height: auto;
  max-height: calc(100dvh - 48px);
  border-radius: 20px;
  border: 1px solid var(--hair);
  box-shadow: 0 20px 48px rgba(7, 43, 95, 0.25);
  margin: auto;
  padding: 22px 20px 20px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: modalScale 0.25s var(--ease);
}

.portal-modal-box.user-modal-box-compact .user-modal-header-responsive {
  position: static;
  padding: 0;
  margin-bottom: 16px;
  border-bottom: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-modal-box.user-modal-box-compact form {
  padding: 0;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
}

.portal-modal-box.user-modal-box-compact .user-modal-actions-responsive {
  position: static;
  padding: 0;
  margin-top: 20px;
  margin-left: 0;
  margin-right: 0;
  border-top: none;
  box-shadow: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.user-modal-box-wide {
  width: 100vw;
  max-width: 100vw;
  min-width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  border: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUpMobile 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  background: #ffffff;
}

.portal-modal-box.user-modal-box-wide > div:first-child,
.portal-modal-box.user-modal-box-wide .user-modal-header-responsive {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 20;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--hair);
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.portal-modal-box.user-modal-box-wide > form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 18px 16px 0;
  min-height: 0;
}

.portal-modal-box.user-modal-box-wide > form > .user-form-grid-2,
.portal-modal-box.user-modal-box-wide > form > div:not(.user-modal-actions-responsive):not(.portal-modal-actions) {
  flex: 1 0 auto;
  padding-bottom: 24px;
}

.user-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.user-form-col-full {
  grid-column: 1 / -1;
}

.user-modal-actions-responsive {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
  margin-left: -16px;
  margin-right: -16px;
  border-top: 1px solid var(--hair);
  box-shadow: 0 -4px 16px rgba(7, 43, 95, 0.05);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.user-modal-actions-responsive .btn-saff-primary,
.user-modal-actions-responsive .btn-saff-ghost {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .user-modal-box-wide {
    max-width: 680px;
    width: 100%;
    min-width: auto;
    height: auto;
    min-height: auto;
    max-height: calc(100dvh - 48px);
    border-radius: var(--r-xl);
    border: 1px solid var(--hair);
    box-shadow: var(--shadow-lg);
    padding: 24px 28px;
    margin: auto;
    overflow-y: auto;
    animation: modalScale 0.25s var(--ease);
  }

  .portal-modal-box.user-modal-box-compact {
    max-width: 500px;
    padding: 26px 28px;
  }

  .portal-modal-box.user-modal-box-compact .user-modal-actions-responsive {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 12px;
  }

  .portal-modal-box.user-modal-box-compact .user-modal-actions-responsive .btn-saff-primary,
  .portal-modal-box.user-modal-box-compact .user-modal-actions-responsive .btn-saff-ghost {
    width: auto;
  }

  .portal-modal-box.user-modal-box-wide > div:first-child,
  .portal-modal-box.user-modal-box-wide .user-modal-header-responsive {
    position: static;
    padding: 0;
    margin-bottom: 16px;
    border-bottom: none;
  }

  .portal-modal-box.user-modal-box-wide > form {
    padding: 0;
    overflow-y: visible;
  }

  .portal-modal-box.user-modal-box-wide > form > .user-form-grid-2,
  .portal-modal-box.user-modal-box-wide > form > div:not(.user-modal-actions-responsive):not(.portal-modal-actions) {
    padding-bottom: 0;
  }

  .user-form-grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
  }

  .user-modal-actions-responsive {
    position: static;
    padding: 0;
    margin-top: 20px;
    margin-left: 0;
    margin-right: 0;
    border-top: none;
    box-shadow: none;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 12px;
  }

  .user-modal-actions-responsive .btn-saff-primary,
  .user-modal-actions-responsive .btn-saff-ghost {
    width: auto;
    min-height: 40px;
  }
}

.user-toast-alert {
  position: fixed;
  bottom: 84px;
  right: 16px;
  left: 16px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--saff-navy);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  border-left: 4px solid var(--saff-cyan);
}

@media (min-width: 640px) {
  .user-toast-alert {
    left: auto;
    right: 24px;
    max-width: 420px;
  }
}

.role-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

@media (min-width: 640px) {
  .role-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .role-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1440px) {
  .role-cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.role-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
  min-width: 0;
}

.role-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(3, 161, 208, 0.35);
  transform: translateY(-2px);
}

.role-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.role-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  border: 1px solid rgba(3, 161, 208, 0.2);
  white-space: nowrap;
}

.role-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--saff-navy);
  line-height: 1.3;
  margin-top: 10px;
  word-break: break-word;
}

.role-card-meta {
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-card-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--muted);
}

.role-card-meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

.menu-accordion-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  border: 1px solid rgba(3, 161, 208, 0.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
}

.menu-accordion-pill:hover {
  background: rgba(3, 161, 208, 0.15);
  border-color: var(--saff-cyan);
}

.menu-accordion-pill.open {
  background: var(--saff-navy);
  color: #ffffff;
  border-color: var(--saff-navy);
}

.menu-single-item-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: #f1f5f9;
  color: var(--muted);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
}

.menu-chevron-icon {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.menu-chevron-icon.rotated {
  transform: rotate(180deg);
}

.btn-action-kebab {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-kebab:hover,
.btn-action-kebab.active {
  background: var(--saff-sky);
  color: var(--saff-navy);
  border-color: rgba(3, 161, 208, 0.3);
}

.action-dropdown-menu {
  position: absolute;
  right: 0;
  z-index: 100;
  min-width: 160px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--hair);
  box-shadow: 0 10px 25px -5px rgba(7, 43, 95, 0.12), 0 8px 10px -6px rgba(7, 43, 95, 0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: customSelectDropdownFade 0.15s ease-out;
}

.action-dropdown-menu.menu-up {
  bottom: calc(100% + 6px) !important;
  top: auto !important;
}

.action-dropdown-menu.menu-down {
  top: calc(100% + 6px) !important;
  bottom: auto !important;
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  box-sizing: border-box;
}

.action-dropdown-item:hover {
  background: #f1f5f9;
  color: var(--saff-navy);
}

.action-dropdown-item.is-danger {
  color: #dc2626;
}

.action-dropdown-item.is-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.menu-parent-row {
  transition: background-color 0.15s ease;
}

.menu-parent-row.expanded {
  background: #f8fafc;
}

.menu-subitems-panel {
  background: #f8fafc;
  border-left: 3px solid var(--saff-cyan);
  margin: 6px 16px 14px 16px;
  border-radius: var(--r-md);
  border-top: 1px solid var(--hair);
  border-right: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  overflow: visible;
  animation: fadeIn 0.2s ease;
}

.menu-subitems-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--hair);
  flex-wrap: wrap;
  gap: 8px;
}

.menu-subitems-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.menu-subitems-table th {
  background: #f1f5f9;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--hair);
}

.menu-subitems-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--hair);
  vertical-align: middle;
}

.menu-subitems-table tbody tr:last-child td {
  border-bottom: none;
}

.menu-subitems-table tbody tr:hover {
  background: #ffffff;
}

.menu-subitem-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--hair);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}

.menu-mobile-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--saff-navy);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.menu-mobile-accordion-toggle:hover {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.35);
}

.menu-mobile-accordion-toggle.open {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.4);
  color: var(--saff-navy);
}

.menu-mobile-subitems-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--saff-cyan);
  margin-top: 10px;
  animation: fadeIn 0.2s ease;
}

.menu-mobile-subitem-card {
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-modal-box-scrollable {
  max-width: 680px;
  width: 100%;
  max-height: calc(100dvh - 32px);
  height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

@media (min-width: 640px) {
  .portal-modal-box-scrollable {
    max-height: min(800px, calc(100dvh - 64px));
    height: auto;
    padding: 0;
  }
}

.perm-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 16px 14px 16px;
  border-bottom: 1px solid var(--hair);
  flex-shrink: 0;
  background: #ffffff;
}

@media (min-width: 640px) {
  .perm-modal-head {
    padding: 20px 24px 16px 24px;
  }
}

.perm-modal-toolbar {
  padding: 12px 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--hair);
}

@media (min-width: 640px) {
  .perm-modal-toolbar {
    padding: 14px 24px;
  }
}

.perm-modal-body {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 16px 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(3, 161, 208, 0.4) #f1f5f9;
}

@media (min-width: 640px) {
  .perm-modal-body {
    padding: 18px 24px 32px 24px;
  }
}

.perm-modal-body::-webkit-scrollbar {
  width: 6px;
}

.perm-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.perm-modal-body::-webkit-scrollbar-thumb {
  background: rgba(3, 161, 208, 0.4);
  border-radius: 999px;
}

.perm-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--saff-cyan);
}

.perm-modal-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--hair);
  background: #ffffff;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .perm-modal-foot {
    padding: 16px 24px;
  }
}

.permissions-hero-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--hair);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 768px) {
  .permissions-hero-card {
    padding: 20px 24px;
    margin-bottom: 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
}

.permissions-action-bar {
  position: sticky;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hair);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 30;
  box-shadow: 0 -4px 16px rgba(7, 43, 95, 0.08);
  margin-top: 20px;
}

@media (max-width: 768px) {
  .portal-app.no-mobile-nav {
    padding-bottom: 24px;
  }

  .portal-app.no-mobile-nav .permissions-action-bar {
    bottom: 12px;
  }
}

@media (min-width: 769px) {
  .permissions-action-bar {
    bottom: 20px;
    padding: 14px 20px;
  }
}

.permissions-module-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.2s ease;
}

.permissions-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  min-height: 52px;
  gap: 10px;
}

@media (min-width: 768px) {
  .permissions-module-header {
    padding: 14px 18px;
    gap: 12px;
  }
}

.permissions-module-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

@media (min-width: 640px) {
  .permissions-module-left {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
}

.permissions-module-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.permissions-module-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  margin-left: 28px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .permissions-module-badge {
    margin-left: 0;
  }
}

.permissions-module-action-btn {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.permissions-module-action-btn.active {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.4);
  color: var(--saff-navy);
}

.permissions-toolbar-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

@media (min-width: 640px) {
  .permissions-toolbar-controls {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: auto;
  }
}

.permissions-select-group {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.permissions-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-top: 1px solid var(--hair);
  cursor: pointer;
  min-height: 52px;
  transition: background 0.15s ease;
}

@media (min-width: 768px) {
  .permissions-toggle-row {
    padding: 14px 18px;
    gap: 16px;
  }
}

.permissions-toggle-row:hover {
  background: rgba(3, 161, 208, 0.04);
}

.permissions-toggle-row.active {
  background: rgba(3, 161, 208, 0.03);
}

.custom-select-wrapper {
  position: relative;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-select-trigger {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--hair, #e2e8f0);
  font-size: 16px;
  color: var(--ink, #0f172a);
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  transition: all 0.2s ease;
  user-select: none;
  box-sizing: border-box;
}

.custom-select-trigger:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #ffffff;
}

.custom-select-trigger:focus-visible,
.custom-select-trigger.is-open {
  background: #ffffff;
  border-color: var(--saff-cyan, #03a1d0);
  box-shadow: 0 0 0 3px rgba(3, 161, 208, 0.25);
}

.custom-select-trigger.has-error {
  border-color: #ef4444;
  background: #fffbfa;
}

.custom-select-trigger.has-error:focus-visible,
.custom-select-trigger.has-error.is-open {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.custom-select-trigger.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
}

.custom-select-value {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  color: var(--ink, #0f172a);
}

.custom-select-value.is-placeholder {
  color: var(--muted, #64748b);
}

.custom-select-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #64748b);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.custom-select-arrow.is-open {
  transform: rotate(180deg);
  color: var(--saff-cyan, #03a1d0);
}

.custom-select-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 43, 95, 0.45);
  backdrop-filter: blur(2px);
  z-index: 9999;
  animation: customSelectFadeIn 0.2s ease-out;
}

.custom-select-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(7, 43, 95, 0.2);
  animation: customSelectSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.custom-select-drag-pill {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 10px auto 4px auto;
  flex-shrink: 0;
}

.custom-select-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 10px 16px;
  border-bottom: 1px solid var(--hair, #e2e8f0);
  flex-shrink: 0;
}

.custom-select-sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--saff-navy, #072b5f);
}

.custom-select-sheet-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #64748b);
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.custom-select-sheet-close:hover {
  background: #e2e8f0;
  color: var(--ink, #0f172a);
}

.custom-select-search-wrap {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hair, #e2e8f0);
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: #ffffff;
}

.custom-select-search-icon {
  position: absolute;
  left: 26px;
  color: var(--muted, #64748b);
  pointer-events: none;
}

.custom-select-search-input {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 38px;
  border-radius: 8px;
  border: 1px solid var(--hair, #e2e8f0);
  background: #f8fafc;
  font-size: 16px;
  color: var(--ink, #0f172a);
  outline: none;
  transition: all 0.18s ease;
  box-sizing: border-box;
}

.custom-select-search-input:focus {
  background: #ffffff;
  border-color: var(--saff-cyan, #03a1d0);
  box-shadow: 0 0 0 3px rgba(3, 161, 208, 0.2);
}

.custom-select-search-clear {
  position: absolute;
  right: 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.custom-select-search-clear:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.custom-select-options {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  list-style: none;
  margin: 0;
  max-height: 50vh;
  box-sizing: border-box;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  min-height: 48px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--ink, #0f172a);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, color 0.12s ease;
  box-sizing: border-box;
}

.custom-select-option:active {
  background: rgba(3, 161, 208, 0.12);
}

.custom-select-option.is-highlighted {
  background: #0d6efd;
  color: #ffffff;
}

.custom-select-option.is-selected:not(.is-highlighted) {
  background: #e0f2fe;
  color: var(--saff-navy, #072b5f);
  font-weight: 600;
}

.custom-select-option.is-selected.is-highlighted {
  background: #072b5f;
  color: #ffffff;
  font-weight: 600;
}

.custom-select-option-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custom-select-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted, #64748b);
  font-size: 14px;
  font-weight: 500;
}

.custom-select-sheet-bottom-pad {
  height: max(16px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}

@keyframes customSelectFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes customSelectSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes customSelectDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .custom-select-backdrop {
    display: none;
  }

  .custom-select-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    bottom: auto;
    border-radius: 12px;
    border: 1px solid var(--hair, #e2e8f0);
    box-shadow: 0 12px 28px -6px rgba(7, 43, 95, 0.16), 0 6px 12px -4px rgba(7, 43, 95, 0.08);
    max-height: 300px;
    animation: customSelectDropdownFade 0.18s ease-out;
  }

  .custom-select-drag-pill,
  .custom-select-sheet-header,
  .custom-select-sheet-bottom-pad {
    display: none;
  }

  .custom-select-search-wrap {
    padding: 8px 10px;
  }

  .custom-select-search-input {
    height: 38px;
    font-size: 14px;
  }

  .custom-select-options {
    max-height: 220px;
    padding: 6px;
  }

  .custom-select-option {
    padding: 9px 12px;
    min-height: 40px;
    font-size: 14px;
  }
}

.chat-feed-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.chat-feed-container {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--hair, #e2e8f0);
  box-shadow: 0 1px 3px rgba(7, 43, 95, 0.04);
  overflow: hidden;
  position: relative;
  min-width: 0;
  height: clamp(480px, calc(100vh - 240px), 680px);
}

@media (min-width: 1024px) {
  .chat-feed-container {
    flex-direction: row;
    align-items: stretch;
    height: clamp(520px, calc(100vh - 240px), 720px);
  }
}

@media (max-width: 1023px) {
  .chat-feed-container.has-open-thread .chat-feed-main {
    display: none;
  }
  .chat-feed-container.has-open-thread .chat-thread-drawer {
    height: 100%;
    flex: 1;
  }
}

.chat-feed-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.chat-feed-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--hair, #e2e8f0);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.chat-feed-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--saff-navy, #072b5f);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-feed-subtitle {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin: 2px 0 0;
}

.chat-messages-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  scroll-behavior: smooth;
}

.chat-messages-scroll::-webkit-scrollbar,
.chat-thread-body::-webkit-scrollbar {
  width: 6px;
}

.chat-messages-scroll::-webkit-scrollbar-track,
.chat-thread-body::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages-scroll::-webkit-scrollbar-thumb,
.chat-thread-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.chat-messages-scroll::-webkit-scrollbar-thumb:hover,
.chat-thread-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.chat-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0 16px;
  position: relative;
  width: 100%;
}

.chat-date-separator::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #e2e8f0;
  z-index: 1;
}

.chat-date-separator-pill {
  position: relative;
  z-index: 2;
  background: #ffffff;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chat-message-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background-color 0.15s ease;
  min-width: 0;
}

.chat-message-row:hover,
.chat-message-row.is-active-thread {
  background: #f8fafc;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13.5px;
  flex-shrink: 0;
  user-select: none;
}

.chat-message-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-author-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--saff-navy, #072b5f);
}

.chat-timestamp {
  font-size: 12px;
  color: var(--muted, #64748b);
  font-weight: 500;
}

.chat-phase-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.chat-edited-badge {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

.chat-message-text {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-action-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px 4px;
  box-shadow: 0 4px 12px rgba(7, 43, 95, 0.08);
  margin-top: 6px;
  align-self: flex-start;
}

@media (min-width: 768px) {
  .chat-action-bar {
    position: absolute;
    top: -12px;
    right: 12px;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translateY(2px);
    z-index: 5;
  }

  .chat-message-row:hover .chat-action-bar,
  .chat-message-row:focus-within .chat-action-bar,
  .chat-message-row.is-active-thread .chat-action-bar {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
}

.chat-more-btn {
  display: none;
}

.chat-action-btn {
  min-width: 36px;
  min-height: 36px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
  padding: 0;
}

.chat-action-btn:hover {
  background: #f1f5f9;
  color: var(--saff-navy, #072b5f);
}

.chat-action-btn.btn-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

.chat-action-btn.btn-edit:hover {
  background: #e0f2fe;
  color: #0369a1;
}

.chat-action-btn.btn-reply:hover {
  background: #e0f2fe;
  color: #03a1d0;
}

.chat-action-btn.btn-like:hover {
  background: #fef3c7;
}

.chat-action-btn.btn-heart:hover {
  background: #fee2e2;
}

.chat-action-btn.btn-congrats:hover {
  background: #fef3c7;
}

.chat-action-btn.btn-star {
  color: #94a3b8;
}

.chat-action-btn.btn-star:hover {
  background: #fef3c7;
  color: #d97706;
}

.chat-action-btn.btn-star.is-starred {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.chat-action-divider {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  margin: 0 3px;
  align-self: center;
}

.chat-bookmark-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.chat-reactions-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.chat-reaction-chip {
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-reaction-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.chat-reaction-chip.has-reacted {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.chat-thread-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 4px;
  transition: background-color 0.15s ease;
  width: fit-content;
}

.chat-thread-pill:hover {
  background: #f1f5f9;
}

.chat-thread-avatar-stack {
  display: flex;
  align-items: center;
}

.chat-thread-mini-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  margin-left: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
}

.chat-thread-mini-avatar:first-child {
  margin-left: 0;
}

.chat-thread-replies-text {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--saff-cyan, #03a1d0);
}

.chat-thread-last-time {
  font-size: 11.5px;
  color: #94a3b8;
}

.chat-composer-box {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid var(--hair, #e2e8f0);
  flex-shrink: 0;
}

.chat-composer-card {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.chat-composer-card:focus-within {
  border-color: var(--saff-cyan, #03a1d0);
  box-shadow: 0 0 0 3px rgba(3, 161, 208, 0.15);
}

.chat-composer-input {
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.5;
  color: #0f172a;
  background: transparent;
  resize: none;
  font-family: inherit;
}

.chat-composer-input::placeholder {
  color: #94a3b8;
}

.chat-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fafafa;
  border-top: 1px solid #f1f5f9;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-composer-tools-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--saff-navy, #072b5f);
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.chat-thread-drawer {
  width: 100%;
  background: #ffffff;
  border-top: 1px solid var(--hair, #e2e8f0);
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

@media (min-width: 1024px) {
  .chat-thread-drawer {
    width: 400px;
    max-width: 420px;
    border-top: none;
    border-left: 1px solid var(--hair, #e2e8f0);
    flex-shrink: 0;
  }
}

.chat-thread-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--hair, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
  flex-shrink: 0;
}

.chat-thread-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-thread-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--saff-navy, #072b5f);
  margin: 0;
}

.chat-thread-close-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-thread-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.chat-thread-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.chat-thread-root-card {
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.chat-thread-divider-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.chat-thread-divider-line::before,
.chat-thread-divider-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.chat-thread-divider-text {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.chat-inline-editor {
  background: #ffffff;
  border: 1px solid var(--saff-cyan, #03a1d0);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 0 0 3px rgba(3, 161, 208, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.chat-inline-textarea {
  width: 100%;
  min-height: 60px;
  border: none;
  outline: none;
  resize: vertical;
  font-size: 14.5px;
  color: #0f172a;
  line-height: 1.5;
  font-family: inherit;
  background: transparent;
}

.chat-mention-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 12px;
  width: min(340px, calc(100vw - 32px));
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 36px -4px rgba(7, 43, 95, 0.18), 0 6px 14px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  z-index: 60;
  animation: customSelectDropdownFade 0.18s ease-out;
}

.chat-mention-header {
  padding: 8px 12px;
  background: #fafafa;
  border-bottom: 1px solid #f1f5f9;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-mention-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  user-select: none;
}

.chat-mention-item:hover,
.chat-mention-item.is-selected {
  background: #f1f5f9;
}

.chat-mention-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-mention-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--saff-navy, #072b5f);
}

.chat-mention-role {
  font-size: 11.5px;
  color: #64748b;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.chat-attachment-previews {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px 4px;
  background: #fafafa;
  border-bottom: 1px solid #f1f5f9;
}

.chat-attachment-thumb-wrap {
  position: relative;
  display: inline-block;
}

.chat-attachment-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.chat-attachment-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: transform 0.15s ease;
}

.chat-attachment-remove-btn:hover {
  transform: scale(1.15);
  background: #dc2626;
}

.chat-attachment-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.chat-message-attachments {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chat-message-image-thumb {
  max-width: 280px;
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
}

.chat-message-image-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(7, 43, 95, 0.12);
}

.chat-message-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--saff-navy, #072b5f);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.chat-message-file-chip:hover {
  background: #e0f2fe;
  border-color: #03a1d0;
  color: #0369a1;
}

.chat-mention-tag {
  display: inline-block;
  background: rgba(3, 161, 208, 0.12);
  color: #0284c7;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin: 0 2px;
}

.chat-hash-tag {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin: 0 2px;
}

.chat-composer-tool-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
}

.chat-composer-tool-btn:hover {
  background: #e2e8f0;
  color: var(--saff-navy, #072b5f);
}

.chat-composer-tool-btn.is-active {
  background: #e0f2fe;
  color: #0369a1;
}

.portal-container {
  width: 100%;
  min-width: 0;
}

.portal-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 16px;
  min-width: 0;
  position: relative;
}

@media (min-width: 768px) {
  .portal-card {
    padding: 20px;
  }
}

.user-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.user-form-grid-1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .user-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
  }
}

.btn-saff-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  background: #ffffff;
  border: 1px solid var(--hair);
  color: var(--saff-navy);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-saff-secondary:hover {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.3);
}

.btn-saff-primary,
.btn-saff-ghost,
.btn-saff-secondary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.btn-saff-primary:disabled,
.btn-saff-ghost:disabled,
.btn-saff-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rsp-grid-kpi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 1024px) {
  .rsp-grid-kpi {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
  }
}

.rsp-grid-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 1024px) {
  .rsp-grid-split {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 20px;
  }
}

.rsp-grid-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 1024px) {
  .rsp-grid-side {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
  }
}

.rsp-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 1024px) {
  .rsp-stack {
    gap: 20px;
  }
}

.rsp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.rsp-row > * {
  min-width: 0;
}

.rsp-ellipsis {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-pill-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.portal-pill-scroll::-webkit-scrollbar {
  display: none;
}

.portal-pill-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  flex-shrink: 0;
  white-space: nowrap;
  scroll-snap-align: start;
  touch-action: manipulation;
  cursor: pointer;
}

@media (min-width: 768px) {
  .portal-pill-tab.is-compact {
    min-height: 34px;
  }
}

.portal-form-footer {
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}

.portal-form-footer > .btn-saff-primary,
.portal-form-footer > .btn-saff-ghost,
.portal-form-footer > .btn-saff-secondary {
  width: 100%;
}

.portal-form-footer-note {
  text-align: center;
}

@media (min-width: 768px) {
  .portal-form-footer {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
  }

  .portal-form-footer > .btn-saff-primary,
  .portal-form-footer > .btn-saff-ghost,
  .portal-form-footer > .btn-saff-secondary {
    width: auto;
    min-width: 120px;
  }

  .portal-form-footer-note {
    order: -1;
    margin-right: auto;
    text-align: left;
  }
}

.portal-split-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
}

.portal-split-footer-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-split-footer-group > .btn-saff-primary,
.portal-split-footer-group > .btn-saff-ghost,
.portal-split-footer-group > .btn-saff-secondary {
  width: 100%;
}

@media (min-width: 768px) {
  .portal-split-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .portal-split-footer-group {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .portal-split-footer-group > .btn-saff-primary,
  .portal-split-footer-group > .btn-saff-ghost,
  .portal-split-footer-group > .btn-saff-secondary {
    width: auto;
  }
}

.portal-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.portal-icon-btn:hover {
  background: #f1f5f9;
  color: var(--saff-navy);
}

.portal-icon-btn.is-danger {
  color: #dc2626;
}

.portal-icon-btn.is-danger:hover {
  background: #fef2f2;
}

.portal-toolbar-filter {
  width: 100%;
  min-width: 0;
}

@media (min-width: 640px) {
  .portal-toolbar-filter {
    width: 220px;
  }
}

.portal-notify-panel {
  position: fixed;
  top: calc(76px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 40px rgba(7, 43, 95, 0.18);
  padding: 16px;
  z-index: 60;
  animation: customSelectDropdownFade 0.18s ease-out;
}

@media (min-width: 768px) {
  .portal-notify-panel {
    position: absolute;
    top: 52px;
    left: auto;
    right: 0;
    width: 320px;
  }
}

.help-hero {
  background: linear-gradient(135deg, var(--saff-navy) 0%, #0a3a7d 100%);
  color: #ffffff;
  padding: 22px 18px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .help-hero {
    padding: 36px 30px;
    margin-bottom: 24px;
  }
}

.cal-week-head,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-week-head {
  text-align: center;
  margin-bottom: 8px;
}

.cal-day {
  min-height: 46px;
  border-radius: 10px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  min-width: 0;
  touch-action: manipulation;
  transition: all 0.15s;
}

.cal-day-blank {
  min-height: 46px;
  background: #f8fafc;
  border-radius: 10px;
  opacity: 0.5;
}

.cal-day-head {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.cal-day-event {
  display: none;
}

@media (min-width: 768px) {
  .cal-week-head,
  .cal-grid {
    gap: 8px;
  }

  .cal-week-head {
    margin-bottom: 10px;
  }

  .cal-day,
  .cal-day-blank {
    min-height: 80px;
  }

  .cal-day {
    padding: 8px;
    align-items: stretch;
    justify-content: space-between;
  }

  .cal-day-head {
    justify-content: space-between;
  }

  .cal-day-event {
    display: block;
  }
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 3px;
}

@media (min-width: 768px) {
  .heatmap-grid {
    gap: 5px;
  }
}

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--hair);
}

.team-modal-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px;
}

@media (min-width: 768px) {
  .team-modal-list {
    flex: 0 1 auto;
    max-height: 360px;
    margin: 16px 0;
    padding: 0;
  }
}

.msg-back-btn {
  display: none;
}

@media (max-width: 767.98px) {
  .messages-suite {
    display: block;
    height: auto;
  }

  .messages-suite.show-chat .msg-contacts-pane,
  .messages-suite:not(.show-chat) .msg-chat-pane {
    display: none;
  }

  .msg-contacts-pane {
    padding: 12px;
    border-radius: 16px;
  }

  .msg-contact-item {
    min-height: 64px;
    padding: 10px;
  }

  .msg-chat-pane {
    height: calc(100dvh - 250px - env(safe-area-inset-bottom, 0px));
    min-height: 380px;
    border-radius: 16px;
  }

  .msg-chat-head {
    padding: 10px 12px;
    gap: 8px;
  }

  .msg-chat-stream {
    padding: 14px 12px;
  }

  .msg-bubble {
    max-width: 85%;
  }

  .msg-chat-composer {
    padding: 10px 12px;
    gap: 8px;
  }

  .msg-composer-input {
    height: 44px;
    min-width: 0;
  }

  .msg-back-btn {
    display: inline-flex;
  }
}

@media (max-width: 767.98px) {
  body {
    overflow-x: clip;
    overflow-y: visible;
  }

  .portal-board {
    overflow-wrap: break-word;
    min-width: 0;
  }

  .portal-board img,
  .portal-board video {
    max-width: 100%;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  .portal-nav-link,
  .portal-accordion-btn {
    min-height: 48px;
  }

  .portal-sidebar {
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .portal-sidebar-close {
    width: 44px;
    height: 44px;
    top: 0;
  }

  .portal-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .portal-modal-actions > .btn-saff-primary,
  .portal-modal-actions > .btn-saff-ghost,
  .portal-modal-actions > .btn-saff-secondary {
    width: 100%;
    padding: 0 12px;
  }

  .portal-modal-box.user-modal-box-wide > .user-modal-actions-responsive {
    margin-left: 0;
    margin-right: 0;
  }

  .portal-card {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .bento-card {
    min-width: 0;
  }

  .user-pagination-bar {
    padding: 14px 12px;
    justify-content: center !important;
  }

  .user-pagination-controls {
    justify-content: center !important;
  }

  .btn-action-kebab {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .action-dropdown-item {
    min-height: 44px;
  }

  .user-copy-btn {
    width: 44px;
    height: 44px;
  }

  .user-search-clear {
    width: 44px;
    height: 44px;
    right: 0;
    background: transparent;
  }

  .chat-feed-container {
    height: calc(100dvh - 230px - env(safe-area-inset-bottom, 0px));
    min-height: 440px;
    border-radius: 14px;
  }

  .chat-feed-header {
    padding: 12px 14px;
  }

  .chat-messages-scroll {
    padding: 12px 10px 16px;
  }

  .chat-message-row {
    gap: 10px;
    padding: 8px;
  }

  .chat-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .chat-message-row {
    flex-wrap: wrap;
  }

  .chat-message-content {
    flex: 1 1 0;
    min-width: 0;
  }

  .chat-message-top {
    flex-wrap: wrap;
    row-gap: 2px;
    min-height: 32px;
  }

  .chat-action-bar {
    display: none;
  }

  .chat-message-row.show-actions .chat-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    flex: 0 0 100%;
    width: 100%;
    margin: 0;
    padding: 4px;
    border-radius: 12px;
    animation: customSelectDropdownFade 0.16s ease-out;
  }

  .chat-message-row.show-actions {
    background: #f8fafc;
  }

  .chat-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -8px -8px -8px auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
  }

  .chat-more-btn.is-open {
    color: var(--saff-cyan);
    background: var(--saff-sky);
  }

  .chat-thread-pill {
    min-height: 44px;
    flex-wrap: wrap;
    max-width: 100%;
  }

  .chat-feed-header .user-page-btn {
    min-height: 44px;
  }

  .chat-action-btn,
  .chat-thread-close-btn,
  .chat-composer-tool-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .chat-send-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .chat-reaction-chip {
    min-height: 36px;
    padding: 4px 10px;
  }

  .chat-composer-box {
    padding: 10px;
  }

  .chat-mention-item {
    min-height: 48px;
  }

  .chat-message-image-thumb {
    max-width: 100%;
  }

  .chat-attachment-remove-btn {
    width: 28px;
    height: 28px;
    top: -8px;
    right: -8px;
  }
}


.task-board .kanban-col {
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-board .kanban-col.is-drop-target {
  background: var(--saff-sky);
  border-color: var(--saff-cyan);
}

.task-board .kanban-col-body {
  min-height: 120px;
}

@media (min-width: 768px) {
  .kanban-board.task-board {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 0;
  }

  .task-board .kanban-col-body {
    min-height: 180px;
  }
}

.task-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-col-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
  border: 2px dashed var(--hair);
  border-radius: 10px;
}

.task-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.task-card:hover {
  border-color: rgba(3, 161, 208, 0.45);
  box-shadow: 0 6px 16px rgba(7, 43, 95, 0.08);
}

.task-card:active {
  transform: scale(0.99);
}

.task-card:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.task-card[draggable="true"] {
  cursor: grab;
}

.task-card.is-overdue {
  border-left: 3px solid #ef4444;
}

.task-card.is-done .task-card-title {
  text-decoration: line-through;
  color: var(--muted);
}

.task-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.task-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.task-chip-project {
  background: var(--saff-sky);
  color: var(--saff-navy);
  border-radius: 6px;
}

.task-chip-danger {
  background: #fef2f2;
  color: #dc2626;
}

.task-chip-warn {
  background: #fffbeb;
  color: #b45309;
}

.task-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--saff-navy);
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.task-phase-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-checklist-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.task-checklist-bar {
  flex: 1;
  height: 5px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.task-checklist-bar span {
  display: block;
  height: 100%;
  background: #10b981;
  border-radius: 999px;
}

.task-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.task-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.task-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-avatar-empty {
  background: #f1f5f9;
  color: var(--faint);
  font-weight: 700;
  border: 1px dashed #cbd5e1;
}

.task-unassigned {
  font-size: 12px;
  color: var(--faint);
  font-style: italic;
}

.task-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.task-due.is-overdue {
  color: #dc2626;
}

.task-card-move {
  padding-top: 8px;
  border-top: 1px solid var(--hair);
}

.task-card-move .custom-select-trigger {
  background: #ffffff;
  font-size: 14px;
}

.task-card-move .custom-select-value {
  font-size: 14px;
  font-weight: 600;
}

.task-list {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 4px 4px;
  border-bottom: 1px solid var(--hair);
  min-width: 0;
  transition: background 0.15s ease;
}

.task-row:last-child {
  border-bottom: none;
}

.task-row:hover {
  background: #f8fafc;
}

.task-done-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
}

.task-done-toggle:disabled {
  cursor: default;
  opacity: 0.5;
}

.task-done-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: all 0.15s ease;
}

.task-done-toggle:not(:disabled):hover .task-done-circle {
  border-color: #10b981;
}

.task-done-toggle.is-checked .task-done-circle {
  background: #10b981;
  border-color: #10b981;
}

.task-row-main {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.task-row-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--saff-navy);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.task-row.is-done .task-row-title {
  text-decoration: line-through;
  color: var(--muted);
}

.task-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.task-row-meta-text {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.task-row-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.task-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.task-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.task-summary-progress {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #072b5f 0%, #0c3e85 100%);
  color: #ffffff;
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-summary-progress .task-summary-label {
  color: rgba(255, 255, 255, 0.75);
}

.task-summary-percent {
  font-size: 22px;
  font-weight: 900;
  color: var(--saff-cyan);
  line-height: 1;
}

.task-summary-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  overflow: hidden;
}

.task-summary-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #03a1d0 0%, #38bdf8 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.task-summary-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.task-summary-stat {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.task-summary-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--saff-navy);
  line-height: 1.1;
}

.task-summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

@media (min-width: 768px) {
  .task-summary {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .task-summary-progress {
    grid-column: auto;
  }
}

.task-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.task-filter-pill {
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.task-filter-pill.is-active {
  background: var(--saff-navy);
  border-color: var(--saff-cyan);
  color: #ffffff;
}

.task-filter-count {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: #f1f5f9;
  color: var(--muted);
}

.task-filter-pill.is-active .task-filter-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.task-toolbar-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.task-search {
  position: relative;
  grid-column: 1 / -1;
  min-width: 0;
}

.task-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.task-search .user-form-input {
  padding-left: 38px;
  border-radius: 999px;
  background: #ffffff;
}

.task-phase-filter {
  min-width: 0;
}

.task-phase-filter .custom-select-trigger {
  background: #ffffff;
}

.task-view-toggle {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px;
  justify-self: end;
}

.task-view-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.task-view-toggle button.is-active {
  background: #ffffff;
  color: var(--saff-navy);
  box-shadow: 0 1px 4px rgba(7, 43, 95, 0.12);
}

@media (min-width: 768px) {
  .task-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .task-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .task-search {
    width: 220px;
  }

  .task-view-toggle button {
    min-height: 38px;
  }

  .task-phase-filter {
    width: 210px;
  }
}

@media (max-width: 767.98px) {
  .task-add-btn {
    width: 100%;
  }
}

.task-detail-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--saff-navy);
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
}

.task-detail-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

.task-detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.task-detail-description {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-line;
  margin: 0;
  overflow-wrap: anywhere;
}

.task-check-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.task-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  min-height: 44px;
}

.task-check-item.is-done {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.task-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.task-check-label input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #10b981;
}

.task-check-label span {
  overflow-wrap: anywhere;
}

.task-check-item.is-done .task-check-label span {
  text-decoration: line-through;
  color: var(--muted);
}

.task-delete-btn {
  color: #dc2626;
  width: 100%;
}

.task-delete-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

@media (min-width: 768px) {
  .task-delete-btn {
    width: auto;
    justify-self: start;
  }
}

.task-kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.task-kpi-num {
  font-size: clamp(1.5rem, 6vw, 2.125rem);
  font-weight: 800;
  color: var(--saff-navy);
  letter-spacing: -0.03em;
  line-height: 1;
}

.task-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--saff-navy);
  margin: 0 0 8px 4px;
}

.task-section-title span {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
}

.task-section-title.is-danger {
  color: #dc2626;
}

.task-section-title.is-warn {
  color: #b45309;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.activity-day-label {
  position: sticky;
  top: 0;
  z-index: 2;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--saff-navy);
  background: var(--saff-sky);
  padding: 4px 12px;
  border-radius: 999px;
  margin: 0 0 10px;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.activity-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 16px;
  min-width: 0;
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 2px;
  width: 2px;
  background: var(--hair);
  border-radius: 2px;
}

.activity-item:last-child {
  padding-bottom: 4px;
}

.activity-item:last-child::before {
  display: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.activity-body {
  flex: 1;
  min-width: 0;
  padding-top: 5px;
}

.activity-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.activity-text strong {
  color: var(--saff-navy);
  font-weight: 700;
}

.activity-pill {
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  vertical-align: 1px;
}

.activity-pill.is-to {
  background: var(--saff-sky);
  color: var(--saff-navy);
}

.activity-quote {
  display: block;
  margin-top: 4px;
  padding: 8px 12px;
  border-left: 3px solid #fcd34d;
  background: #fffbeb;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--ink);
  font-style: italic;
}

.activity-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.activity-changes {
  list-style: none;
  margin: 6px 0 0;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-changes li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.activity-change-field {
  font-weight: 700;
  color: var(--ink);
  min-width: 84px;
}

.activity-change-from {
  text-decoration: line-through;
  color: var(--faint);
}

.activity-change-to {
  font-weight: 700;
  color: var(--saff-navy);
}

.activity-time {
  display: block;
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 4px;
  font-weight: 600;
}

.activity-load-more {
  width: 100%;
}

@media (min-width: 768px) {
  .activity-load-more {
    width: auto;
    align-self: center;
  }

  .activity-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .activity-item::before {
    left: 16px;
    top: 36px;
  }
}

.portal-btn-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  border: 2px solid #ffffff;
  box-sizing: content-box;
}

.portal-notify-panel {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notify-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  border-bottom: 1px solid var(--hair);
  flex-shrink: 0;
}

.notify-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--saff-navy);
  margin: 0;
}

.notify-panel-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef2f2;
  color: #dc2626;
}

.notify-panel-action {
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--saff-cyan);
  background: transparent;
  border: none;
  cursor: pointer;
}

.notify-panel-action:hover {
  background: var(--saff-sky);
}

.portal-notify-panel .notify-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}

.notify-panel-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-top: 1px solid var(--hair);
  font-size: 13px;
  font-weight: 700;
  color: var(--saff-navy);
  flex-shrink: 0;
}

.notify-panel-footer:hover {
  background: #f8fafc;
}

.notify-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.notify-empty span {
  display: block;
  font-size: 26px;
  margin-bottom: 6px;
}

.notify-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notify-list-page {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 6px;
}

.notify-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  min-height: 56px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  touch-action: manipulation;
}

.notify-item:hover {
  background: #f8fafc;
}

.notify-item.is-unread {
  background: rgba(3, 161, 208, 0.06);
}

.notify-item.is-unread:hover {
  background: rgba(3, 161, 208, 0.11);
}

.notify-item.is-compact {
  padding: 10px;
}

.notify-item-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notify-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notify-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--saff-navy);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.notify-item:not(.is-unread) .notify-item-title {
  font-weight: 600;
}

.notify-item-text {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notify-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
  margin-top: 2px;
}

.notify-item-dot {
  width: 9px;
  height: 9px;
  min-width: 9px;
  border-radius: 50%;
  background: var(--saff-cyan);
  margin-top: 6px;
}

.notify-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.notify-pager-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

@media (min-width: 768px) {
  .notify-pager {
    justify-content: center;
  }

  .portal-notify-panel {
    width: 360px;
  }
}

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.health-badge-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  display: inline-block;
}

.health-badge-score {
  padding-left: 6px;
  margin-left: 2px;
  border-left: 1px solid currentColor;
  opacity: 0.85;
}

.health-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.health-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.health-ring {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.health-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.health-card-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.health-card-eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.health-card-headline {
  font-size: clamp(1.1rem, 4vw, 1.3rem);
  font-weight: 800;
  color: var(--saff-navy);
  margin: 0;
  line-height: 1.2;
}

.health-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.health-metric-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.health-metric-head strong {
  color: var(--saff-navy);
}

.health-bar {
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.health-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.health-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.health-chip {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
}

.health-chip.is-warn {
  background: #fffbeb;
  color: #b45309;
}

.health-chip.is-danger {
  background: #fef2f2;
  color: #dc2626;
}

.health-reasons {
  list-style: none;
  margin: 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.health-reasons li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.health-reasons li svg {
  margin-top: 1px;
}

@media (min-width: 1024px) {
  .health-card {
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.2fr) minmax(0, 1.3fr);
    align-items: center;
    padding: 18px 20px;
  }
}

.health-watchlist {
  margin-bottom: 16px;
}

.health-watchlist-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.health-count {
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.health-count-num {
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  font-weight: 900;
  line-height: 1;
}

.health-count-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.health-attention-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 6px;
}

.health-attention-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.health-attention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 56px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.health-attention-item:hover {
  background: #ffffff;
  border-color: rgba(3, 161, 208, 0.4);
}

.health-attention-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--saff-navy);
}

.health-attention-reason {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-all-good {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #047857;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

@media (min-width: 768px) {
  .health-watchlist-counts {
    gap: 12px;
  }

  .health-count {
    padding: 12px 16px;
  }
}

.client-hero {
  background: linear-gradient(135deg, #072b5f 0%, #0c3e85 60%, #03a1d0 140%);
  color: #ffffff;
  border-radius: var(--r-xl);
  padding: 20px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.client-hero-eyebrow {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--saff-cyan);
  margin: 0 0 4px;
}

.client-hero-title {
  font-size: clamp(1.35rem, 5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.client-hero-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}

.client-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.client-hero-stats div {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.client-hero-stats strong {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.client-hero-stats span {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

@media (min-width: 900px) {
  .client-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 26px 28px;
  }

  .client-hero-stats {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 10px;
  }
}

.client-callout {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: var(--r-lg);
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.client-callout strong {
  color: #92400e;
  font-size: 14px;
}

.client-callout p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #a16207;
}

.client-callout-icon {
  font-size: 22px;
}

.client-callout .btn-saff-primary {
  width: 100%;
}

@media (min-width: 640px) {
  .client-callout .btn-saff-primary {
    width: auto;
  }
}

.client-heading {
  font-size: 16px;
  font-weight: 800;
  color: var(--saff-navy);
  margin: 0 0 10px;
}

.client-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.client-project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  color: inherit;
  text-decoration: none;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.client-project-card:hover {
  border-color: rgba(3, 161, 208, 0.45);
  box-shadow: 0 8px 22px rgba(7, 43, 95, 0.08);
}

.client-project-card:active {
  transform: scale(0.99);
}

.client-project-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.client-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.client-project-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--saff-navy);
  margin: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.client-project-meta {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.client-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.client-ring span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: var(--saff-navy);
}

.client-current-phase {
  padding: 10px 12px;
  background: var(--saff-sky-light);
  border: 1px solid var(--hair);
  border-radius: 12px;
}

.client-current-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--saff-cyan);
}

.client-current-pct {
  font-size: 12px;
  font-weight: 800;
  color: var(--saff-navy);
}

.client-current-name {
  display: block;
  font-size: 13.5px;
  color: var(--saff-navy);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.client-project-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.client-foot-item {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.client-foot-item.is-late {
  color: #dc2626;
}

.client-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--saff-navy);
  margin: 0;
}

.client-section-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--saff-cyan);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.client-empty {
  margin: 0;
  padding: 18px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: #f8fafc;
  border-radius: 12px;
}

.client-update-list,
.client-meeting-list,
.client-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.client-update {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.client-update:hover {
  background: #f8fafc;
}

.client-update-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--saff-navy);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.client-update-avatar.is-team {
  background: var(--saff-navy);
  color: #ffffff;
}

.client-update-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  color: var(--saff-navy);
}

.client-team-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--saff-sky);
  color: var(--saff-navy);
}

.client-update-time {
  font-size: 11.5px;
  color: var(--faint);
  font-weight: 600;
}

.client-update-text {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
  margin-top: 2px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.client-update-foot {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

.client-meeting {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  min-height: 56px;
}

.client-date-tile {
  width: 46px;
  min-width: 46px;
  height: 50px;
  border-radius: 12px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.client-date-tile span {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--saff-cyan);
}

.client-date-tile strong {
  font-size: 18px;
  font-weight: 900;
}

.client-meeting-title {
  display: block;
  font-size: 14px;
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.client-meeting-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.client-join-btn {
  padding: 0 16px;
  flex-shrink: 0;
}

.client-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  min-height: 56px;
  border-radius: 12px;
  color: var(--saff-navy);
  text-decoration: none;
  font-size: 13.5px;
}

.client-file:hover {
  background: #f8fafc;
}

.client-file-type {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--saff-navy);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.client-file-meta {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.chat-internal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.chat-internal-toggle.is-active {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.chat-composer-card.is-internal {
  border-color: #fcd34d;
  background: #fffdf5;
}

.chat-internal-banner {
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
}

.chat-internal-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.chat-client-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
}

@media (max-width: 767.98px) {
  .chat-internal-toggle {
    min-height: 44px;
    padding: 0 12px;
  }
}

.approval-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.approval-box.is-pending {
  background: #fffbeb;
  border-color: #fde68a;
}

.approval-box.is-approved {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.approval-box.is-changes_requested {
  background: #fef2f2;
  border-color: #fecaca;
}

.approval-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.approval-head.is-compact {
  flex-wrap: wrap;
}

.approval-head strong {
  display: block;
  font-size: 14px;
  color: var(--saff-navy);
}

.approval-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.approval-sub {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.approval-quote {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid currentColor;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.approval-box.is-pending .approval-quote {
  border-left-color: #f59e0b;
}

.approval-box.is-approved .approval-quote {
  border-left-color: #10b981;
}

.approval-box.is-changes_requested .approval-quote {
  border-left-color: #ef4444;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.approval-actions > button {
  width: 100%;
}

@media (min-width: 640px) {
  .approval-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .approval-actions > button {
    width: auto;
  }
}

.btn-saff-primary.approval-btn-approve {
  background: #059669;
}

.btn-saff-primary.approval-btn-changes {
  background: #dc2626;
}

.approval-btn-outline-changes {
  color: #b91c1c;
  border-color: #fecaca;
}

.approval-btn-outline-changes:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.approval-request-btn {
  width: 100%;
}

@media (min-width: 640px) {
  .approval-request-btn {
    width: auto;
  }
}

.approval-history {
  border-top: 1px dashed rgba(7, 43, 95, 0.12);
  padding-top: 4px;
}

.approval-history-toggle {
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--saff-cyan);
  cursor: pointer;
}

.approval-history-list {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.approval-history-list li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
}

.approval-history-comment {
  display: block;
  font-style: italic;
  color: var(--muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.approval-history-time {
  display: block;
  font-size: 11.5px;
  color: var(--faint);
  font-weight: 600;
  margin-top: 2px;
}

.approval-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  margin-top: 4px;
  background: #94a3b8;
}

.approval-dot.is-requested {
  background: #f59e0b;
}

.approval-dot.is-approved {
  background: #10b981;
}

.approval-dot.is-changes_requested {
  background: #ef4444;
}

.phase-highlight {
  animation: phaseHighlightPulse 2.2s ease-out 1;
}

@keyframes phaseHighlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(3, 161, 208, 0.55);
  }
  60% {
    box-shadow: 0 0 0 10px rgba(3, 161, 208, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(3, 161, 208, 0);
  }
}

.client-approval-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-approval-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #fde68a;
  color: #78350f;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.client-approval-list a span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.client-approval-cta {
  color: #b45309;
  white-space: nowrap;
  flex-shrink: 0;
}

.cr-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.cr-summary-item {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cr-summary-item strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.cr-summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

@media (min-width: 768px) {
  .cr-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

.cr-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cr-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-left: 4px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  scroll-margin-top: 90px;
}

.cr-card.is-requested {
  border-left-color: #8b5cf6;
}

.cr-card.is-submitted {
  border-left-color: #f59e0b;
}

.cr-card.is-approved {
  border-left-color: #10b981;
}

.cr-card.is-rejected {
  border-left-color: #ef4444;
}

.cr-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.cr-phase {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.cr-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--saff-navy);
  margin: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.cr-description {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.cr-impacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cr-impact {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
}

.cr-impact.is-cost,
.cr-impact.is-delay {
  background: #fff7ed;
  color: #c2410c;
}

.cr-impact.is-saving {
  background: #ecfdf5;
  color: #047857;
}

.cr-impact.is-pending {
  background: #f5f3ff;
  color: #6d28d9;
}

.cr-applied {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #ecfdf5;
  font-size: 12.5px;
  color: #065f46;
}

.cr-comment {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid var(--hair);
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  font-style: italic;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.cr-comment.is-approved {
  border-left-color: #10b981;
}

.cr-comment.is-rejected {
  border-left-color: #ef4444;
}

.cr-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.cr-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hair);
}

.cr-actions > button {
  width: 100%;
}

@media (min-width: 640px) {
  .cr-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .cr-actions > button {
    width: auto;
  }
}

.cr-waiting {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.cr-estimate-box {
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cr-estimate-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--saff-navy);
}

.cr-estimate-hint {
  font-size: 12px;
  color: var(--muted);
}

.cr-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--hair);
}

.cr-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}

.cr-preview-row strong {
  color: var(--saff-navy);
}

.client-callout.is-change {
  background: #fdf2f8;
  border-color: #fbcfe8;
}

.client-callout.is-change strong {
  color: #9d174d;
}

.client-callout.is-change .client-approval-list a {
  border-color: #fbcfe8;
  color: #831843;
}

.client-callout.is-change .client-approval-cta {
  color: #be185d;
}

.client-cr-impact {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #9d174d;
  opacity: 0.85;
}

.fb-type-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.fb-type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 84px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1.5px solid var(--hair);
  background: #ffffff;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.fb-type-option.is-active {
  border-color: var(--saff-cyan);
  background: var(--saff-sky);
  box-shadow: 0 0 0 3px rgba(3, 161, 208, 0.15);
}

.fb-type-icon {
  font-size: 22px;
  line-height: 1.2;
}

.fb-type-label {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--saff-navy);
}

.fb-type-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.fb-dropzone {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  color: var(--saff-navy);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.fb-dropzone:hover:not(:disabled) {
  border-color: var(--saff-cyan);
  background: var(--saff-sky-light);
}

.fb-dropzone:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fb-dropzone strong {
  display: block;
  font-size: 14px;
}

.fb-dropzone small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.fb-file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.fb-file-preview {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: #f1f5f9;
  overflow: visible;
}

.fb-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.fb-file-ext {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--saff-navy);
}

.fb-file-remove {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fb-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  background: #f0f9ff;
}

.fb-critical-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 800;
  color: #b91c1c;
  white-space: nowrap;
  flex-shrink: 0;
}

.fb-card.sev-critical.is-open,
.fb-card.sev-critical.is-converted {
  border-left-color: #ef4444;
}

.fb-card.is-open {
  border-left-color: #8b5cf6;
}

.fb-card.is-converted {
  border-left-color: #03a1d0;
}

.fb-card.is-resolved {
  border-left-color: #10b981;
}

.fb-type-chip {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
}

.fb-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fb-thumb {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--hair);
  display: block;
  flex-shrink: 0;
}

.fb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.fb-thumb:hover img {
  transform: scale(1.05);
}

.fb-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  color: var(--saff-navy);
  text-decoration: none;
}

.fb-file-chip small {
  color: var(--muted);
  flex-shrink: 0;
}

.fb-task-link a,
.fb-task-link span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.client-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.client-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.client-report-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.client-hero-issues {
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.client-report-picker {
  margin-top: 10px;
  padding: 8px;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 420px;
  box-shadow: 0 12px 30px rgba(4, 27, 61, 0.3);
}

.client-report-picker > span {
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.client-report-picker a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--saff-navy);
  font-size: 14px;
  text-decoration: none;
}

.client-report-picker a:hover {
  background: var(--saff-sky);
}

.running-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.running-timer-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}

.running-timer-dot {
  width: 9px;
  height: 9px;
  min-width: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: timerPulse 1.6s ease-out infinite;
}

@keyframes timerPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.running-timer-clock {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.running-timer-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  opacity: 0.85;
}

.running-timer-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.running-timer-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: #ef4444;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}

.running-timer-stop:disabled {
  opacity: 0.7;
}

.running-timer.is-bar {
  padding: 4px 4px 4px 14px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
}

.running-timer.is-pill {
  padding: 0 0 0 12px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  max-width: 340px;
}

.running-timer.is-pill .running-timer-stop {
  min-height: 42px;
  padding: 0 12px;
}

.running-timer-topbar {
  display: none;
  min-width: 0;
}

.running-timer-mobile {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 39;
  animation: customSelectDropdownFade 0.2s ease-out;
}

.portal-app.no-mobile-nav .running-timer-mobile {
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 768px) {
  .portal-app.has-running-timer {
    padding-bottom: calc(148px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 769px) {
  .running-timer-mobile {
    display: none;
  }

  .running-timer-topbar {
    display: flex;
  }
}

.ts-approver-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: #f8fafc;
  border: 1px solid var(--hair);
}

.ts-approver-bar .btn-saff-primary {
  width: 100%;
}

.ts-approved-tag {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13.5px;
  font-weight: 800;
  color: #047857;
}

@media (min-width: 640px) {
  .ts-approver-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .ts-member-picker {
    width: 280px;
  }

  .ts-approver-bar .btn-saff-primary {
    width: auto;
  }
}

.ts-timer {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: #ffffff;
  border: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ts-timer-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--saff-navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ts-timer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.ts-timer-form .custom-select-trigger {
  background: #ffffff;
}

.ts-start-btn,
.ts-stop-btn {
  width: 100%;
}

.ts-start-btn {
  background: #059669;
}

.ts-stop-btn {
  background: #ef4444;
}

@media (min-width: 900px) {
  .ts-timer-form {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
    align-items: center;
  }

  .ts-start-btn {
    width: auto;
  }
}

.ts-timer.is-running {
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  border-color: transparent;
  color: #ffffff;
}

.ts-timer-live {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ts-timer-clock {
  font-size: clamp(2rem, 9vw, 2.75rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.ts-timer-meta {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
  overflow-wrap: anywhere;
}

.ts-timer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.ts-timer.is-running .btn-saff-ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

@media (min-width: 640px) {
  .ts-timer.is-running {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .ts-timer-actions {
    display: flex;
  }

  .ts-stop-btn {
    width: auto;
  }
}

.ts-empty-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.ts-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ts-week-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.ts-week-label strong {
  font-size: 15px;
  color: var(--saff-navy);
}

.ts-this-week {
  min-height: 32px;
  border: none;
  background: transparent;
  color: var(--saff-cyan);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.ts-week-nav .portal-topbar-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ts-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.ts-stats div {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ts-stats span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.ts-stats strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--saff-navy);
}

.ts-stats strong.is-approved {
  color: #047857;
}

@media (min-width: 768px) {
  .ts-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

.ts-days {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ts-day {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.ts-day.is-today {
  border-color: rgba(3, 161, 208, 0.5);
  box-shadow: 0 0 0 3px rgba(3, 161, 208, 0.08);
}

.ts-day-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--hair);
}

.ts-day-name {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--saff-navy);
  min-width: 0;
}

.ts-day-name small {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.ts-day-name em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--saff-sky);
  color: var(--saff-navy);
}

.ts-day-total {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--saff-navy);
  font-variant-numeric: tabular-nums;
}

.ts-day-empty {
  margin: 0;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--faint);
  min-height: 10px;
}

.ts-entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ts-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 8px 14px;
  border-top: 1px solid var(--hair);
  min-width: 0;
}

.ts-entry:first-child {
  border-top: none;
}

.ts-entry.is-running {
  background: #ecfdf5;
}

.ts-entry-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ts-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ts-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
}

.ts-tag.is-approved {
  background: #ecfdf5;
  color: #047857;
}

.ts-tag.is-running {
  background: #fef2f2;
  color: #dc2626;
}

.ts-entry-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.ts-entry-note {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ts-entry-duration {
  font-size: 14px;
  font-weight: 800;
  color: var(--saff-navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.ts-entry-actions {
  display: flex;
  flex-shrink: 0;
}

.te-duration {
  display: flex;
  gap: 8px;
}

.te-duration-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.te-duration-field .user-form-input {
  padding-right: 34px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.te-duration-field span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

.te-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.te-quick-chip {
  min-height: 40px;
  min-width: 52px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: #ffffff;
  font-size: 13px;
  font-weight: 700;
  color: var(--saff-navy);
  cursor: pointer;
  touch-action: manipulation;
}

.te-quick-chip.is-active {
  background: var(--saff-navy);
  border-color: var(--saff-navy);
  color: #ffffff;
}

@media (max-width: 767.98px) {
  .te-quick-chip {
    min-height: 44px;
  }
}

.task-time-meta {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.task-time-meta.is-over {
  color: #dc2626;
}

.task-time-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--hair);
}

.task-timer-btn {
  color: #047857;
  border-color: #a7f3d0;
  width: 100%;
}

@media (min-width: 640px) {
  .task-timer-btn {
    width: auto;
  }
}

.project-time-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.project-time-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  min-width: 0;
}

.project-time-stats span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.project-time-stats strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--saff-navy);
}

.project-time-people {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-time-people li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
}

.project-time-people strong {
  color: var(--saff-navy);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.inv-stats,
.bill-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.inv-stats > div,
.bill-stats > div {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.inv-stats span,
.bill-stats span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.inv-stats strong,
.bill-stats strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.inv-stats .is-danger strong,
.bill-stats .is-danger strong {
  color: #dc2626;
}

.inv-stats .is-good strong,
.bill-stats .is-good strong {
  color: #047857;
}

@media (min-width: 768px) {
  .inv-stats,
  .bill-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

.inv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 64px;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-left: 4px solid var(--hair);
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inv-row:hover {
  box-shadow: 0 6px 18px rgba(7, 43, 95, 0.07);
}

.inv-row.is-sent {
  border-left-color: #03a1d0;
}

.inv-row.is-overdue {
  border-left-color: #ef4444;
}

.inv-row.is-paid {
  border-left-color: #10b981;
}

.inv-row.is-void {
  opacity: 0.65;
}

.inv-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inv-row-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inv-number {
  font-size: 14.5px;
  color: var(--saff-navy);
  font-variant-numeric: tabular-nums;
}

.inv-row-sub {
  font-size: 12.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.inv-row-total {
  font-size: 15px;
  font-weight: 800;
  color: var(--saff-navy);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.bill-budget {
  background: linear-gradient(135deg, #072b5f 0%, #0c3e85 100%);
  color: #ffffff;
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bill-budget-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
}

.bill-budget-value {
  font-size: 20px;
  font-weight: 900;
}

.bill-budget-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.bill-ready {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 13.5px;
  color: #14532d;
}

.bill-ready .is-muted {
  color: var(--muted);
}

.bill-ready .btn-saff-primary {
  width: 100%;
  margin-top: 4px;
}

@media (min-width: 640px) {
  .bill-ready .btn-saff-primary {
    width: auto;
    align-self: flex-start;
  }
}

.inv-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.inv-toolbar > .btn-saff-ghost {
  align-self: flex-start;
}

.inv-toolbar-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inv-toolbar-actions > :first-child:last-child {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .inv-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .inv-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
  }
}

.inv-banner {
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 600;
}

.inv-banner.is-draft {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.inv-banner.is-void,
.inv-banner.is-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.inv-doc {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.inv-doc.is-void .inv-items,
.inv-doc.is-void .inv-totals {
  opacity: 0.6;
}

.inv-doc-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inv-from {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.inv-from > div,
.inv-meta > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.inv-from strong,
.inv-meta > div:first-child strong {
  font-size: 15px;
  color: var(--saff-navy);
}

.inv-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.inv-title-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.inv-title-block h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--saff-navy);
  text-transform: uppercase;
}

.inv-doc-number {
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.inv-stamp {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inv-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
}

.inv-meta-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inv-meta-dates div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
  min-width: 0;
}

.inv-meta-dates strong {
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.inv-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.inv-items {
  display: flex;
  flex-direction: column;
}

.inv-items-head {
  display: none;
}

.inv-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "desc amount"
    "meta meta";
  gap: 4px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
}

.inv-item-desc {
  grid-area: desc;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inv-item-desc small {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inv-item-qty,
.inv-item-rate {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.inv-item-qty {
  grid-area: meta;
}

.inv-item-qty::after {
  content: " ×";
}

.inv-item-rate {
  grid-area: meta;
  padding-left: 3.5em;
}

.inv-item-amount {
  grid-area: amount;
  font-size: 14px;
  font-weight: 800;
  color: var(--saff-navy);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .inv-doc {
    padding: 32px 36px;
  }

  .inv-doc-head {
    flex-direction: row;
    justify-content: space-between;
  }

  .inv-title-block {
    align-items: flex-end;
    text-align: right;
  }

  .inv-meta {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .inv-items-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 80px 130px 140px;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 2px solid var(--saff-navy);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--saff-navy);
  }

  .inv-items-head span:not(:first-child) {
    text-align: right;
  }

  .inv-item {
    grid-template-columns: minmax(0, 1fr) 80px 130px 140px;
    grid-template-areas: none;
    gap: 12px;
    align-items: start;
  }

  .inv-item-desc,
  .inv-item-qty,
  .inv-item-rate,
  .inv-item-amount {
    grid-area: auto;
  }

  .inv-item-qty,
  .inv-item-rate {
    text-align: right;
    padding-left: 0;
    font-size: 13.5px;
    color: var(--ink);
  }

  .inv-item-qty::after {
    content: "";
  }
}

.inv-totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: auto;
  width: 100%;
  max-width: 340px;
}

.inv-totals > div,
.inv-form-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.inv-totals strong,
.inv-form-totals strong {
  color: var(--saff-navy);
  font-variant-numeric: tabular-nums;
}

.inv-grand {
  padding-top: 8px;
  margin-top: 4px;
  border-top: 2px solid var(--saff-navy);
  font-size: 17px !important;
}

.inv-grand span {
  font-weight: 800;
  color: var(--saff-navy);
}

.inv-grand strong {
  font-size: 19px;
  font-weight: 900;
}

.inv-paid-line {
  color: #047857 !important;
  font-weight: 700;
}

.inv-paid-line strong {
  color: #047857 !important;
}

.inv-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}

.inv-footer p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .inv-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.inv-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 13px;
  font-weight: 700;
  color: var(--saff-cyan);
  margin-bottom: 4px;
}

.inv-section-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--saff-navy);
  margin: 0 0 10px;
}

.inv-sources,
.inv-lines,
.inv-settings,
.inv-form-totals {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 14px;
}

.inv-source-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.inv-source-label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
}

.inv-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px dashed #93c5fd;
  background: #f0f9ff;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.inv-source-item:hover {
  background: #e0f2fe;
}

.inv-source-item > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.inv-source-item strong {
  font-size: 14px;
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.inv-source-item small {
  font-size: 12px;
  color: var(--muted);
}

.inv-source-add {
  font-size: 13px;
  font-weight: 800;
  color: var(--saff-cyan);
  white-space: nowrap;
  flex-shrink: 0;
}

.inv-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.inv-hint.is-warn {
  color: #b45309;
  font-weight: 700;
}

.inv-add-manual {
  width: 100%;
  border-style: dashed;
}

.inv-line {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: #f8fafc;
  margin-bottom: 10px;
}

.inv-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px -6px 0 0;
}

.inv-line-type {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.inv-line.is-phase .inv-line-type {
  color: #7c3aed;
}

.inv-line.is-time .inv-line-type {
  color: #0369a1;
}

.inv-line-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inv-line-numbers label,
.inv-line-amount {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.inv-line-numbers label > span,
.inv-line-amount > span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inv-line-amount {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.inv-line-amount strong {
  font-size: 15px;
  color: var(--saff-navy);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .inv-line-numbers {
    grid-template-columns: 120px 180px minmax(0, 1fr);
    align-items: end;
  }

  .inv-line-amount {
    grid-column: auto;
    flex-direction: column;
    align-items: flex-end;
  }

  .inv-add-manual {
    width: auto;
  }
}

.inv-form-totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-form-footer {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.client-callout.is-invoice {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.client-callout.is-invoice strong {
  color: #075985;
}

.client-callout.is-invoice .client-approval-list a {
  border-color: #bae6fd;
  color: #0c4a6e;
}

.client-callout.is-invoice .client-approval-cta {
  color: #0369a1;
}

.client-cr-impact.is-overdue {
  color: #dc2626;
}

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: #ffffff !important;
  }

  .portal-sidebar,
  .portal-topbar,
  .portal-mobile-nav,
  .running-timer-mobile,
  .portal-sidebar-backdrop,
  .no-print,
  .portal-floating-flyout {
    display: none !important;
  }

  .portal-app,
  .portal-app.sidebar-collapsed {
    display: block !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .portal-board {
    border: none !important;
    padding: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
  }

  .inv-doc {
    border: none !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .inv-banner.is-void {
    border: 2px solid #991b1b;
  }

  .inv-meta {
    background: #f8fafc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .inv-stamp {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.viz-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.viz-filters .task-view-toggle {
  justify-self: auto;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.viz-filters .task-view-toggle button {
  white-space: nowrap;
}

@media (max-width: 639.98px) {
  .viz-filters .task-view-toggle {
    width: 100%;
  }

  .viz-filters .task-view-toggle button {
    flex: 1;
    padding: 0 8px;
  }

  .viz-filters > .btn-saff-ghost {
    width: 100%;
  }
}

.viz-page {
  transition: opacity 0.2s ease;
}

.viz-page.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.viz-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

@media (min-width: 768px) {
  .viz-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 1200px) {
  .viz-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .viz-stats.is-revenue {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.viz-stat {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.viz-stat-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.viz-stat-value {
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 800;
  color: var(--saff-navy);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.viz-stats.is-revenue .viz-stat-value {
  font-size: clamp(1rem, 4vw, 1.25rem);
}

.viz-stat-note {
  font-size: 12px;
  color: var(--muted);
}

.viz-stat.is-warn .viz-stat-note {
  color: #b45309;
  font-weight: 700;
}

.viz-stat.is-danger .viz-stat-note,
.viz-stat.is-danger .viz-stat-value {
  color: #b91c1c;
}

.viz-stat.is-good .viz-stat-value {
  color: #006300;
}

.viz-row {
  margin-bottom: 14px;
}

.viz-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 14px;
  min-width: 0;
}

@media (min-width: 768px) {
  .viz-card {
    padding: 18px 20px;
  }
}

.viz-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.viz-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--saff-navy);
  margin: 0;
}

.viz-subtitle {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0 0;
}

.viz-toggle {
  min-height: 44px;
  min-width: 64px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--saff-navy);
  cursor: pointer;
  flex-shrink: 0;
}

.viz-toggle[aria-pressed="true"] {
  background: var(--saff-sky);
}

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 8px;
}

.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #52514e;
}

.viz-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.viz-swatch.is-line {
  width: 16px;
  height: 3px;
  border-radius: 2px;
}

.viz-empty {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: #fcfcfb;
  border-radius: 12px;
}

.viz-plot {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto 26px;
}

.viz-yaxis {
  position: relative;
  height: 200px;
}

.viz-yaxis span {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-size: 11px;
  color: #898781;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.viz-svg-wrap {
  position: relative;
  height: 200px;
  outline: none;
  touch-action: pan-y;
  cursor: crosshair;
}

.viz-svg-wrap:focus-visible {
  box-shadow: var(--focus);
  border-radius: 6px;
}

.viz-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.viz-grid {
  stroke: #e1e0d9;
  stroke-width: 1;
}

.viz-baseline {
  stroke: #c3c2b7;
  stroke-width: 1;
}

.viz-crosshair {
  stroke: #898781;
  stroke-width: 1;
}

.viz-marker {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #0288b2;
  box-shadow: 0 0 0 2px #ffffff;
  pointer-events: none;
}

.viz-tooltip {
  position: absolute;
  top: 6px;
  transform: translateX(10px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(11, 11, 11, 0.1);
  box-shadow: 0 10px 24px rgba(7, 43, 95, 0.14);
  font-size: 12px;
  color: #52514e;
  pointer-events: none;
}

.viz-tooltip.is-left {
  transform: translateX(calc(-100% - 10px));
}

.viz-tooltip strong {
  color: #0b0b0b;
  font-size: 12.5px;
}

.viz-tooltip b {
  color: #0b0b0b;
  font-variant-numeric: tabular-nums;
}

.viz-tooltip i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
}

.viz-xaxis {
  grid-column: 2;
  position: relative;
  height: 26px;
}

.viz-xaxis span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  font-size: 11px;
  color: #898781;
  white-space: nowrap;
}

.viz-xaxis span.is-first {
  transform: none;
}

.viz-xaxis span.is-last {
  transform: translateX(-100%);
}

@media (max-width: 479.98px) {
  .viz-yaxis,
  .viz-svg-wrap {
    height: 170px;
  }
}

.viz-ranked {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.viz-ranked-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 13px;
}

.viz-ranked-head strong {
  color: #0b0b0b;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.viz-ranked-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #52514e;
}

.viz-ranked-track {
  height: 8px;
  border-radius: 999px;
  background: #f1f0ec;
  overflow: hidden;
}

.viz-ranked-track span {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
}

.viz-table-wrap {
  max-height: 320px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--hair);
  border-radius: 10px;
}

.viz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.viz-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--hair);
}

.viz-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hair);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.viz-table tr:last-child td {
  border-bottom: none;
}

.viz-portfolio {
  display: flex;
  flex-direction: column;
}

.viz-portfolio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13.5px;
  color: #52514e;
}

.viz-portfolio-row strong {
  color: #0b0b0b;
  font-size: 15px;
}

.viz-mini-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 14px 0 4px;
}

.viz-footnote {
  font-size: 12px;
  color: var(--faint);
  text-align: center;
  margin: 4px 0 0;
}

.dash-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  height: 170px;
  align-items: end;
}

.dash-week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  min-width: 0;
}

.dash-week-col.is-future {
  opacity: 0.45;
}

.dash-week-value {
  font-size: 12px;
  font-weight: 800;
  color: #0b0b0b;
  min-height: 16px;
}

.dash-week-track {
  flex: 1;
  width: 100%;
  max-width: 34px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #c3c2b7;
}

.dash-week-track span {
  display: block;
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.4s ease;
}

.dash-week-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.dash-empty-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.dash-project-row,
.dash-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--hair);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.dash-project-row:hover,
.dash-task-row:hover {
  border-color: rgba(3, 161, 208, 0.45);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.calx-views {
  margin-bottom: 12px;
}

.calx-views .portal-pill-tab {
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--saff-navy);
  font-size: 14px;
  font-weight: 700;
}

.calx-views .portal-pill-tab.active {
  background: var(--saff-navy);
  border-color: var(--saff-navy);
  color: #ffffff;
}

.calx-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.calx-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-width: 0;
  padding-bottom: 2px;
}

.calx-chips::-webkit-scrollbar {
  display: none;
}

.calx-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.calx-chip b {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.calx-chip .calx-dot {
  opacity: 0.35;
}

.calx-chip.is-on {
  color: var(--saff-navy);
  border-color: var(--calx-type);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--calx-type);
}

.calx-chip.is-on .calx-dot {
  opacity: 1;
}

.calx-chip:not(.is-on) {
  text-decoration: line-through;
  background: #f8fafc;
}

.calx-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--calx-type, var(--saff-cyan));
  flex-shrink: 0;
}

.calx-project {
  min-width: 0;
}

.calx-monthbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.calx-monthbar .portal-icon-btn {
  font-size: 22px;
  line-height: 1;
}

.calx-monthbar-title {
  text-align: center;
  min-width: 0;
}

.calx-monthbar-title h2 {
  margin: 0;
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: 800;
  color: var(--saff-navy);
}

.calx-monthbar-title span {
  font-size: 12px;
  color: var(--muted);
}

.calx-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s;
}

.calx-weekday {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.calx-day {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--hair);
  color: var(--saff-navy);
  min-height: 48px;
}

.calx-day.is-outside {
  background: #f8fafc;
  color: var(--muted);
}

.calx-day.is-outside .calx-daynum {
  color: var(--muted);
  font-weight: 500;
}

.calx-day.is-selected {
  background: var(--saff-sky);
  border: 2px solid var(--saff-navy);
}

.calx-day.is-today {
  border: 2px solid var(--saff-cyan);
}

.calx-day.is-today .calx-daynum {
  background: var(--saff-cyan);
  color: #ffffff;
}

.calx-daynum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--saff-navy);
}

.calx-overdue-mark {
  display: none;
}

.calx-dots {
  display: flex;
  gap: 3px;
  justify-content: center;
  min-height: 6px;
}

.calx-dots .calx-dot {
  width: 6px;
  height: 6px;
}

.calx-pill {
  display: block;
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  border-left: 3px solid var(--calx-type);
  background: #f1f5f9;
  color: var(--saff-navy);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calx-more {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
}

.calx-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0288b2;
}

.calx-day-title {
  margin: 4px 0 0;
  font-size: clamp(1.05rem, 4vw, 1.2rem);
  font-weight: 800;
  color: var(--saff-navy);
}

.calx-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--saff-navy);
}

.calx-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.calx-empty {
  margin: 0;
  padding: 20px 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.calx-event {
  padding: 12px 12px 12px 14px;
  background: #f8fafc;
  border-left: 4px solid var(--calx-type);
  border-radius: 0 10px 10px 0;
  min-width: 0;
}

.calx-event.is-cancelled {
  opacity: 0.6;
}

.calx-event.is-cancelled .calx-event-title {
  text-decoration: line-through;
}

.calx-event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.calx-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--saff-navy);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 11px;
}

.calx-type i {
  font-style: normal;
}

.calx-time {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.calx-event-title {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--saff-navy);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.calx-event-title:hover {
  color: #0288b2;
}

.calx-event-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.calx-flag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--saff-navy);
  font-size: 11px;
  font-weight: 700;
}

.calx-flag.is-overdue {
  background: #fdecec;
  color: #b42323;
}

.calx-event-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.calx-btn {
  flex: 1;
  min-height: 44px;
  padding: 0 14px;
  font-size: 13px;
  text-decoration: none;
  justify-content: center;
}

.calx-upcoming {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.calx-upcoming li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 13px;
  border-bottom: 1px solid var(--hair);
  min-width: 0;
}

.calx-upcoming li:last-child {
  border-bottom: 0;
}

.calx-upcoming a {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.calx-upcoming b {
  flex-shrink: 0;
  color: var(--saff-navy);
  font-size: 12px;
}

.calx-agenda {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calx-agenda-day {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 12px;
}

.calx-agenda-day.is-today {
  border-color: var(--saff-cyan);
  box-shadow: 0 0 0 1px var(--saff-cyan);
}

.calx-agenda-day header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.calx-agenda-date {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  flex-shrink: 0;
}

.calx-agenda-date b {
  font-size: 16px;
  line-height: 1;
}

.calx-agenda-date small {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
}

.calx-agenda-day .calx-list {
  margin-top: 10px;
}

.calx-timeline-head p {
  margin: -6px 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.calx-segment {
  display: inline-flex;
  padding: 3px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: #eef2f7;
  max-width: 100%;
}

.calx-segment button {
  min-height: 44px;
  min-width: 96px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.calx-segment button.is-active {
  background: #ffffff;
  color: var(--saff-navy);
  box-shadow: 0 1px 3px rgba(7, 43, 95, 0.12);
}

.viz-table-toggle {
  margin-top: 14px;
}

.viz-table-toggle summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
  color: var(--saff-navy);
  cursor: pointer;
}

.gantt {
  min-width: 0;
}

.gantt-scroll {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  min-width: 0;
  padding-bottom: 6px;
}

.gantt-canvas {
  position: relative;
  min-width: 100%;
}

.gantt-months {
  position: relative;
  height: 22px;
  border-bottom: 1px solid var(--hair);
}

.gantt-months span {
  position: absolute;
  top: 2px;
  padding-left: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.gantt-body {
  position: relative;
  padding-top: 22px;
}

.gantt-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #eef2f7;
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--saff-navy);
  z-index: 2;
}

.gantt-today em,
.gantt-marker em {
  position: absolute;
  top: 2px;
  left: 4px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--saff-navy);
  background: #ffffff;
  padding: 0 3px;
  border-radius: 3px;
}

.gantt-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed #898781;
  z-index: 1;
}

.gantt-marker i {
  display: none;
}

.gantt-marker em {
  color: #5b5a56;
}

.gantt-marker.is-deadline {
  border-left-color: #d03b3b;
}

.gantt-marker.is-deadline em {
  color: #b42323;
}

.gantt-today em {
  top: auto;
  bottom: 0;
}

.gantt-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.gantt-row {
  position: relative;
  height: 74px;
}

.gantt-row-label,
.gantt-row-dates {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  white-space: nowrap;
  font-size: 12px;
}

.gantt-row-label {
  top: 6px;
  z-index: 3;
}

.gantt-row-title {
  font-weight: 700;
  color: var(--saff-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.gantt-row-status {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--muted);
}

.gantt-row-status.is-overdue {
  color: #b42323;
}

.gantt-row-status.is-done {
  color: #0a7f0a;
}

.gantt-bar {
  position: absolute;
  top: 28px;
  height: 18px;
  border-radius: 4px;
  background: #dbe9f1;
  overflow: hidden;
  display: block;
  z-index: 2;
  box-shadow: 0 0 0 2px #ffffff;
}

a.gantt-bar:hover,
a.gantt-bar:focus-visible {
  outline: 2px solid var(--saff-navy);
  outline-offset: 1px;
}

.gantt-bar.is-overdue {
  background: #f9d6d6;
  box-shadow: 0 0 0 2px #ffffff, inset 0 0 0 1px #d03b3b;
}

.gantt-bar.is-estimated {
  background: repeating-linear-gradient(135deg, #e6eef3 0 6px, #f6f9fb 6px 12px);
  box-shadow: 0 0 0 2px #ffffff, inset 0 0 0 1px #9fb4c3;
}

.gantt-bar-fill {
  display: block;
  height: 100%;
}

.gantt-row-dates {
  top: 50px;
  color: var(--muted);
  font-size: 11px;
}

.gantt-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.gantt-unscheduled {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

.gantt-unscheduled > span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.gantt-unscheduled ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.gantt-unscheduled li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  align-items: center;
  font-size: 13px;
  color: var(--saff-navy);
  border-bottom: 1px solid var(--hair);
}

.gantt-unscheduled li:last-child {
  border-bottom: 0;
}

.gantt-unscheduled small {
  color: var(--muted);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .calx-filters {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .calx-chips {
    flex-wrap: wrap;
    overflow: visible;
  }

  .calx-chip {
    min-height: 36px;
  }

  .calx-project {
    width: 280px;
    flex-shrink: 0;
  }

  .calx-day {
    min-height: 92px;
  }

  .calx-dots {
    display: none;
  }

  .calx-overdue-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d03b3b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
  }

  .calx-event-actions {
    justify-content: flex-start;
  }

  .calx-btn {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .calx-agenda-day {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }

  .calx-agenda-day header {
    align-items: flex-start;
  }

  .calx-agenda-day .calx-list {
    margin-top: 0;
  }

  .calx-segment button {
    min-height: 36px;
  }

  .gantt-hint {
    text-align: left;
  }
}

.wl-kpis {
  margin-bottom: 12px;
}

.wl-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wl-kpi span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.wl-kpi b {
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  font-weight: 800;
  color: var(--saff-navy);
  line-height: 1.15;
}

.wl-kpi small {
  font-size: 12px;
  color: var(--muted);
}

.wl-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}

.wl-search {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}

.wl-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.wl-toolbar .calx-segment {
  margin-bottom: 0;
  align-self: flex-start;
}

.wl-toolbar .calx-chip:not(.is-on) {
  text-decoration: none;
}

.wl-link {
  border: 0;
  background: none;
  padding: 0;
  min-height: 28px;
  color: #0277a0;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.wl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.wl-card {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.wl-card.is-over {
  border-color: #f2b8b8;
  box-shadow: inset 4px 0 0 #d03b3b;
}

.wl-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.wl-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wl-card-who {
  flex: 1 1 140px;
  min-width: 0;
}

.wl-card-who h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.wl-card-who p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wl-you {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--saff-navy);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.wl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.wl-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.wl-meter-head b {
  color: var(--saff-navy);
  font-weight: 700;
  text-align: right;
}

.wl-meter-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
}

.wl-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.wl-meter-cap {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--saff-navy);
  border-radius: 1px;
}

.wl-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.wl-stats div {
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  min-width: 0;
}

.wl-stats dt {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wl-stats dd {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--saff-navy);
}

.wl-stats .is-alert {
  background: #fdecec;
}

.wl-stats .is-alert dd {
  color: #b42323;
}

.wl-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.wl-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wl-card-actions .btn-saff-ghost {
  flex: 1 1 140px;
  min-height: 44px;
  justify-content: center;
  font-size: 13px;
}

.wl-detail {
  border-top: 1px solid var(--hair);
  padding-top: 10px;
}

.wl-detail h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.wl-detail h4:not(:first-child) {
  margin-top: 12px;
}

.wl-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wl-tasks li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
  min-width: 0;
}

.wl-tasks li:last-child {
  border-bottom: 0;
}

.wl-tasks a {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: var(--saff-navy);
  font-weight: 600;
  text-decoration: none;
}

.wl-tasks li > span {
  font-size: 12px;
  color: var(--muted);
}

.wl-tasks li > span.is-overdue {
  color: #b42323;
  font-weight: 700;
}

.wl-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wl-project {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wl-modal {
  padding: 20px;
}

.wl-modal .wl-hint {
  margin: 4px 0 14px;
}

.workload-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e0f2fe;
  color: var(--saff-navy);
  font-size: 13px;
  line-height: 1.45;
}

.workload-note.is-over {
  background: #fdecec;
  color: #8f1c1c;
}

.workload-note-icon {
  flex-shrink: 0;
  font-weight: 800;
}

.workload-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.workload-inline.is-over {
  color: #b42323;
}

.workload-inline.is-busy {
  color: #8a5a00;
}

@media (min-width: 768px) {
  .wl-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px 220px;
    align-items: center;
  }

  .wl-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .wl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .wl-card-actions .btn-saff-ghost {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .wl-tasks li {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .wl-tasks li > span {
    flex-shrink: 0;
  }
}

@media (min-width: 1280px) {
  .wl-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tpl-pick-grid,
.tpl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.tpl-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 44px;
  padding: 16px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  min-width: 0;
}

.tpl-pick:hover,
.tpl-pick:focus-visible {
  border-color: var(--saff-cyan);
  box-shadow: 0 6px 18px rgba(7, 43, 95, 0.08);
}

.tpl-pick:active {
  transform: scale(0.99);
}

.tpl-pick.is-blank {
  border-style: dashed;
  background: #f8fafc;
}

.tpl-pick strong {
  font-size: 15px;
  color: var(--saff-navy);
}

.tpl-pick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-size: 20px;
  flex-shrink: 0;
}

.tpl-pick-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.tpl-pick-meta {
  margin-top: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--saff-navy);
}

.tpl-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--saff-navy);
  font-size: 11px;
  font-weight: 700;
}

.tpl-pick-foot {
  margin: 14px 0 0;
  font-size: 13px;
  text-align: center;
}

.tpl-pick-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #0277a0;
  font-weight: 700;
}

.tpl-selected {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--saff-cyan);
  background: #f0f9ff;
}

.tpl-selected.is-blank {
  border-color: var(--hair);
  background: #f8fafc;
}

.tpl-selected-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.tpl-selected-main strong {
  display: block;
  font-size: 15px;
  color: var(--saff-navy);
}

.tpl-selected-main small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.tpl-selected-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #0277a0;
}

.tpl-selected-actions {
  display: flex;
  gap: 8px;
}

.tpl-selected-actions .btn-saff-ghost {
  flex: 1;
  min-height: 44px;
  justify-content: center;
}

.tpl-selected-preview {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
}

.tpl-preview {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tpl-preview > li {
  border-left: 2px solid var(--saff-sky);
  padding-left: 12px;
  margin-left: 13px;
}

.tpl-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: -26px;
  min-width: 0;
}

.tpl-preview-head strong {
  font-size: 14px;
  color: var(--saff-navy);
  min-width: 0;
  overflow-wrap: anywhere;
}

.tpl-preview-head small {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.tpl-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--saff-navy);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.tpl-step.is-task {
  background: #eef2f7;
  color: var(--saff-navy);
}

.tpl-preview-body {
  padding: 4px 0 2px;
  font-size: 13px;
  color: var(--ink);
}

.tpl-preview-body p {
  margin: 0 0 4px;
  color: var(--muted);
}

.tpl-preview-body ul {
  margin: 0;
  padding-left: 18px;
}

.tpl-preview-body li {
  padding: 2px 0;
}

.tpl-preview-body small {
  color: var(--muted);
}

.tpl-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 16px;
  min-width: 0;
}

.tpl-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.tpl-card-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.tpl-card-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.tpl-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}

.tpl-stats dd {
  font-size: 15px;
}

.tpl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tpl-tags span,
.tpl-tag-remove {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--saff-navy);
  font-size: 12px;
  font-weight: 600;
}

.tpl-tag-remove {
  min-height: 32px;
  border: 0;
  cursor: pointer;
}

.tpl-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tpl-card-actions .btn-saff-primary {
  flex: 1 1 100%;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}

.tpl-card-actions .btn-saff-ghost {
  flex: 1 1 0;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}

.tpl-section {
  padding: 18px 16px;
  margin-bottom: 14px;
}

.tpl-section-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.tpl-section-head span {
  font-size: 12px;
  color: var(--muted);
}

.tpl-section-title {
  margin: 0 0 12px;
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  font-weight: 800;
  color: var(--saff-navy);
}

.tpl-section-head .tpl-section-title {
  margin-bottom: 0;
}

.tpl-edit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tpl-edit-item {
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: #fbfcfe;
  min-width: 0;
}

.tpl-edit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tpl-edit-tools {
  display: flex;
  gap: 6px;
}

.tpl-edit-tools .portal-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tpl-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 12px;
}

.tpl-add {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  justify-content: center;
  border-style: dashed;
}

.tpl-add-inline {
  width: 100%;
  min-height: 44px;
  justify-content: center;
  font-size: 13px;
}

.tpl-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.tpl-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--saff-cyan);
}

@media (min-width: 768px) {
  .tpl-pick-grid,
  .tpl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .tpl-selected {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .tpl-selected-main {
    flex: 1 1 400px;
  }

  .tpl-selected-actions .btn-saff-ghost {
    flex: 0 0 auto;
    min-height: 38px;
  }

  .tpl-selected-preview {
    flex: 1 1 100%;
  }

  .tpl-section {
    padding: 22px 24px;
  }

  .tpl-section-head {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .tpl-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tpl-add-inline {
    width: auto;
    min-height: 38px;
  }

  .tpl-card-actions .btn-saff-primary {
    flex: 1 1 auto;
  }
}

@media (min-width: 1280px) {
  .tpl-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tpl-pick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.progress-ring > svg {
  position: absolute;
  inset: 0;
}

.progress-ring-core {
  position: relative;
  z-index: 1;
}

.progress-ring-core svg {
  position: static;
  display: block;
  flex-shrink: 0;
  color: #ffffff;
  stroke: #ffffff;
}

.progress-ring-arc {
  transition: stroke-dasharray 0.6s ease;
}

.progress-ring-core {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(7, 43, 95, 0.18);
}

.deadline-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: #f1f5f9;
  color: var(--saff-navy);
  border: 1px solid transparent;
}

.deadline-chip.is-compact {
  padding: 2px 8px;
  font-size: 11px;
  align-self: flex-start;
}

.deadline-chip.is-overdue {
  background: #fdecec;
  color: #b42323;
  border-color: #f5c2c2;
}

.deadline-chip.is-today {
  background: #fde9e0;
  color: #9a3a14;
}

.deadline-chip.is-soon {
  background: #fff6e0;
  color: #8a5a00;
}

.deadline-chip.is-done {
  background: #e8f7e8;
  color: #0a7f0a;
}

.cover-picker {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.cover-picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cover-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.cover-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px var(--hair);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s, box-shadow 0.15s;
}

.cover-swatch.is-on {
  box-shadow: 0 0 0 2px var(--saff-navy);
  transform: scale(1.08);
}

.cover-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}

.cover-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--saff-navy);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, border-color 0.15s;
}

.cover-icon.is-on {
  background: var(--saff-navy);
  border-color: var(--saff-navy);
  color: #ffffff;
}

.empty-art {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  animation: empty-art-float 4s ease-in-out infinite;
}

@keyframes empty-art-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.skel {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 90%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
}

@keyframes skel-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.skel-tab {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 14px;
}

.skel-card.is-kpi {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.skel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skel-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.skel-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skel-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skel-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.skel-tab-gate ~ * {
  display: none !important;
}

@media (min-width: 768px) {
  .skel-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .skel,
  .empty-art,
  .progress-ring-arc {
    animation: none;
    transition: none;
  }
}

.qa-fab {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(145deg, #03a1d0, #0288b2);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(2, 136, 178, 0.35), 0 2px 6px rgba(7, 43, 95, 0.2);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-radius 0.2s ease;
}

.qa-fab:active {
  transform: scale(0.94);
}

.qa-fab svg {
  transition: transform 0.25s ease;
}

.qa-fab.is-open {
  border-radius: 50%;
  background: var(--saff-navy);
}

.qa-fab.is-open svg {
  transform: rotate(45deg);
}

.portal-app.has-running-timer .qa-fab {
  bottom: calc(148px + env(safe-area-inset-bottom, 0px));
}

.qa-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(7, 43, 95, 0.4);
  display: flex;
  align-items: flex-end;
  animation: qa-fade 0.18s ease-out;
}

.qa-sheet {
  width: 100%;
  max-height: 82vh;
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px rgba(7, 43, 95, 0.18);
  animation: qa-up 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.qa-handle {
  display: block;
  width: 40px;
  height: 5px;
  margin: 2px auto 8px;
  border-radius: 999px;
  background: #cbd5e1;
}

.qa-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.qa-head h2 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--saff-navy);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qa-head .portal-icon-btn {
  font-size: 22px;
  line-height: 1;
}

.qa-head-spacer {
  width: 44px;
  flex-shrink: 0;
}

.qa-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.qa-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 6px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.qa-list li:last-child .qa-item {
  border-bottom: 0;
}

.qa-item:active {
  background: #f1f5f9;
}

.qa-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qa-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.qa-item-text strong {
  font-size: 15px;
  color: var(--saff-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qa-item-text small {
  font-size: 12px;
  color: var(--muted);
}

.qa-chevron {
  font-size: 22px;
  color: #94a3b8;
}

.qa-projects {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.qa-search {
  min-height: 44px;
  font-size: 16px;
}

.qa-empty {
  margin: 0;
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

@keyframes qa-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes qa-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .qa-fab,
  .qa-backdrop {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qa-fab,
  .qa-fab svg,
  .qa-backdrop,
  .qa-sheet {
    animation: none;
    transition: none;
  }
}

.device-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--saff-navy);
}

.device-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
}

.device-row:last-of-type {
  border-bottom: 0;
}

.device-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.device-text strong {
  font-size: 14px;
  color: var(--saff-navy);
}

.device-text span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.device-switch {
  position: relative;
  width: 52px;
  height: 32px;
  min-width: 52px;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.2s ease;
  touch-action: manipulation;
}

.device-switch::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.device-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.device-switch.is-on {
  background: #0288b2;
}

.device-switch.is-on span {
  transform: translateX(20px);
}

.device-switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.device-action,
.device-install {
  min-height: 44px;
  justify-content: center;
}

.device-action {
  width: 100%;
  margin: 4px 0 8px;
}

.device-install {
  flex-shrink: 0;
}

.device-message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: #e0f2fe;
  color: var(--saff-navy);
}

.device-message.is-error {
  background: #fdecec;
  color: #8f1c1c;
}

@media (min-width: 768px) {
  .device-action {
    width: auto;
  }
}

.scroll-tabs {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.task-toolbar > .scroll-tabs {
  flex: 1 1 auto;
}

.scroll-tabs > .portal-pill-scroll {
  scroll-behavior: smooth;
  padding-left: 2px;
  padding-right: 2px;
}

.scroll-tabs.has-end > .portal-pill-scroll {
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%);
}

.scroll-tabs.has-start > .portal-pill-scroll {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 48px, #000 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 48px, #000 100%);
}

.scroll-tabs.has-start.has-end > .portal-pill-scroll {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
}

.scroll-tabs-arrow {
  display: none;
}

.scroll-tabs-arrow[hidden] {
  display: none !important;
}

@media (min-width: 768px) {
  .scroll-tabs-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-top: -20px;
    border: 1px solid var(--hair);
    border-radius: 50%;
    background: #ffffff;
    color: var(--saff-navy);
    box-shadow: 0 4px 12px rgba(7, 43, 95, 0.16);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  }

  .scroll-tabs-arrow:hover {
    background: var(--saff-navy);
    color: #ffffff;
  }

  .scroll-tabs-arrow:active {
    transform: scale(0.94);
  }

  .scroll-tabs-arrow.is-prev {
    left: -6px;
  }

  .scroll-tabs-arrow.is-next {
    right: -6px;
  }

  .scroll-tabs.has-end > .portal-pill-scroll,
  .scroll-tabs.has-start > .portal-pill-scroll {
    cursor: grab;
  }

  .scroll-tabs.has-end > .portal-pill-scroll:active,
  .scroll-tabs.has-start > .portal-pill-scroll:active {
    cursor: grabbing;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-tabs > .portal-pill-scroll {
    scroll-behavior: auto;
  }
}

.task-board {
  align-items: start;
}

.task-board .kanban-col {
  max-height: max(360px, calc(100vh - 240px));
  max-height: max(360px, calc(100dvh - 240px));
  min-height: 0;
  overflow: hidden;
}

.task-board .kanban-col-head {
  flex-shrink: 0;
}

.task-board .kanban-col-body {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  margin-right: -8px;
  padding: 2px 8px 6px 0;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  scroll-padding-block: 8px;
}

.task-board .kanban-col-body::-webkit-scrollbar {
  width: 6px;
}

.task-board .kanban-col-body::-webkit-scrollbar-track {
  background: transparent;
}

.task-board .kanban-col-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.task-board .kanban-col-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.task-board .task-card {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .task-board .kanban-col {
    max-height: max(440px, calc(100vh - 200px));
    max-height: max(440px, calc(100dvh - 200px));
  }

  .task-board .kanban-col-body {
    min-height: 180px;
  }
}

.task-chip-personal {
  background: #eef2f7;
  color: #475569;
}

.tasks-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.tasks-filter-search {
  min-width: 0;
}

.tasks-filter-search .user-form-input {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}

.tasks-filter-reset {
  min-height: 44px;
  justify-content: center;
}

.tasks-view-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tasks-view-controls .task-view-toggle {
  flex: 1 1 auto;
}

.tasks-truncated {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff6e0;
  color: #8a5a00;
  font-size: 13px;
}

@media (min-width: 768px) {
  .tasks-filters {
    grid-template-columns: minmax(220px, 1.4fr) minmax(200px, 1fr) minmax(180px, 1fr) auto;
    align-items: center;
  }

  .tasks-view-controls {
    flex-wrap: nowrap;
  }

  .tasks-view-controls .task-view-toggle {
    flex: 0 0 auto;
  }
}

.tk-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.tk-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tk-new {
  flex: 1;
  min-height: 44px;
  justify-content: center;
}

.tk-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  background: #eef2f7;
  flex-shrink: 0;
}

.tk-seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.tk-seg button.is-on {
  background: #ffffff;
  color: var(--saff-navy);
  box-shadow: 0 1px 3px rgba(7, 43, 95, 0.14);
}

.tk-tabs {
  gap: 6px;
}

.tk-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: #ffffff;
  color: var(--saff-navy);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.tk-tab:hover {
  border-color: #c9d6e6;
}

.tk-tab.is-on {
  background: var(--saff-navy);
  border-color: var(--saff-navy);
  color: #ffffff;
}

.tk-n {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tk-tab.is-on .tk-n {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.tk-n.is-on {
  background: var(--saff-sky);
  color: var(--saff-navy);
}

.tk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  min-width: 0;
}

.tk-search {
  position: relative;
  flex: 1 1 100%;
  min-width: 0;
}

.tk-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.tk-search .user-form-input {
  width: 100%;
  min-height: 44px;
  padding-left: 38px;
  font-size: 16px;
}

.tk-ftog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  flex: 1 1 auto;
  justify-content: center;
}

.tk-filter {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
}

.tk-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-basis: 100%;
}

.tk-dates .user-form-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
}

.tk-dates span {
  color: var(--muted);
}

.tk-clear {
  min-height: 44px;
  flex: 1 1 100%;
  justify-content: center;
}

.tk-keep {
  display: flex;
  gap: 8px;
  flex: 1 1 100%;
  min-width: 0;
}

.tk-keep .tk-group {
  flex: 1;
}

.tk-cols-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  flex-shrink: 0;
}

.tk-bar:not(.is-open) > .tk-filter,
.tk-bar:not(.is-open) > .tk-clear {
  display: none;
}

.tk-bulk {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(3, 161, 208, 0.25);
  background: #f0f9ff;
  color: var(--saff-navy);
}

.tk-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tk-bulk-actions .btn-saff-ghost {
  min-height: 44px;
}

.tk-bulk-due {
  display: flex;
  gap: 6px;
  flex: 1 1 100%;
}

.tk-bulk-due .user-form-input {
  flex: 1;
  min-height: 44px;
  font-size: 16px;
}

.tk-danger {
  color: #b42323 !important;
}

.tk-table-wrap {
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(7, 43, 95, 0.04), 0 12px 28px -18px rgba(7, 43, 95, 0.25);
  overflow: hidden;
}

.tk-table {
  width: 100%;
  border-collapse: collapse;
}

.tk-table th {
  text-align: left;
  padding: 12px 14px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--hair);
}

.tk-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
  vertical-align: middle;
  color: var(--ink);
}

.tk-row {
  cursor: pointer;
  transition: background 0.12s;
}

.tk-row:hover td {
  background: #f8fbff;
}

.tk-row.is-selected td {
  background: #eef8fd;
}

.tk-row.is-done .tk-title-btn {
  color: var(--muted);
  text-decoration: line-through;
}

.tk-check {
  width: 44px;
}

.tk-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--saff-navy);
  cursor: pointer;
}

.tk-title {
  min-width: 0;
}

.tk-title-btn {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  font-weight: 700;
  color: var(--saff-navy);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.tk-title-btn:hover {
  color: #0277a0;
}

.tk-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.tk-badges:empty {
  display: none;
}

.tk-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.tk-badge.is-late {
  background: #fdecec;
  color: #b42323;
}

.tk-badge.is-today {
  background: #fff6e0;
  color: #8a5a00;
}

.tk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: #f8fafc;
  color: var(--saff-navy);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tk-chip i,
.tk-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tk-chip.is-personal {
  background: #eef2f7;
  color: #475569;
}

.tk-prio {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.tk-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.tk-mini > span {
  display: block;
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tk-mini i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #0288b2;
}

.tk-person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 180px;
}

.tk-av {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--saff-navy);
  color: #ffffff;
  font-weight: 800;
}

.tk-av.is-sm {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.tk-due {
  white-space: nowrap;
  font-weight: 600;
  color: var(--saff-navy);
}

.tk-due.is-late {
  color: #b42323;
  font-weight: 800;
}

.tk-due.is-today {
  color: #8a5a00;
  font-weight: 800;
}

.tk-project {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 200px;
  min-width: 0;
}

.tk-project b {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--saff-navy);
  background: var(--saff-sky);
  border-radius: 6px;
  padding: 1px 6px;
}

.tk-project .rsp-ellipsis {
  font-size: 13px;
  color: var(--muted);
}

.tk-phase {
  display: inline-block;
  max-width: 180px;
  font-size: 13px;
  color: var(--muted);
}

.tk-time {
  white-space: nowrap;
  font-size: 13px;
  color: var(--saff-navy);
}

.tk-time.is-over {
  color: #b42323;
  font-weight: 700;
}

.tk-muted {
  color: #94a3b8;
  font-size: 13px;
}

.tk-nowrap {
  white-space: nowrap;
}

.tk-group-head td {
  padding: 0;
  background: #f4f7fb;
  border-bottom: 1px solid var(--hair);
}

.tk-group-body + .tk-group-body .tk-group-head td {
  border-top: 6px solid #f8fafc;
}

.tk-group-head button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--saff-navy);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.tk-group-head button > svg {
  color: var(--muted);
  transition: transform 0.2s;
}

.tk-group-head button[aria-expanded="false"] > svg {
  transform: rotate(-90deg);
}

.tk-group-head small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.tk-empty {
  padding: 44px 20px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: #ffffff;
  text-align: center;
}

.tk-empty h3 {
  margin: 10px 0 6px;
  font-size: 16px;
  color: var(--saff-navy);
}

.tk-empty p {
  margin: 0 auto 14px;
  max-width: 420px;
  font-size: 13px;
  color: var(--muted);
}

.tk-sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  background: rgba(7, 43, 95, 0.4);
  animation: qa-fade 0.18s ease-out;
}

.tk-sheet {
  width: 100%;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  animation: qa-up 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.tk-sheet-handle {
  display: block;
  width: 40px;
  height: 5px;
  margin: 2px auto 10px;
  border-radius: 999px;
  background: #cbd5e1;
}

.tk-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tk-sheet-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--saff-navy);
}

.tk-sheet-head small {
  font-size: 12px;
  color: var(--muted);
}

.tk-col-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 4px;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
  font-weight: 600;
  color: var(--saff-navy);
}

.tk-col-row.is-locked {
  color: var(--muted);
}

.tk-col-row.is-locked small {
  font-size: 12px;
  font-weight: 500;
}

.tk-col-row .grow {
  flex: 1;
  min-width: 0;
}

.tk-col-label {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.tk-col-move {
  display: flex;
  gap: 2px;
}

.tk-col-move button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: #ffffff;
  color: var(--saff-navy);
  cursor: pointer;
}

.tk-col-move button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tk-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.tk-switch input {
  position: absolute;
  inset: -9px;
  width: calc(100% + 18px);
  height: calc(100% + 18px);
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.tk-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s;
}

.tk-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.tk-switch input:checked + span {
  background: #0288b2;
}

.tk-switch input:checked + span::after {
  transform: translateX(18px);
}

.tk-switch input:focus-visible + span {
  outline: 2px solid var(--saff-navy);
  outline-offset: 2px;
}

.tk-sheet-foot {
  display: flex;
  gap: 8px;
  padding-top: 14px;
}

.tk-sheet-foot button {
  flex: 1;
  min-height: 44px;
  justify-content: center;
}

@media (max-width: 767.98px) {
  .tk-table-wrap {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .tk-table,
  .tk-table tbody,
  .tk-table tr,
  .tk-table td {
    display: block;
    width: 100%;
  }

  .tk-table thead {
    display: none;
  }

  .tk-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
  }

  .tk-row {
    position: relative;
    display: block;
    padding: 12px 12px 10px 48px;
    border: 1px solid var(--hair);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(7, 43, 95, 0.04);
  }

  .tk-row td {
    padding: 2px 0;
    border: 0;
    background: transparent !important;
  }

  .tk-row .tk-check {
    position: absolute;
    left: 6px;
    top: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .tk-row .tk-title {
    margin-bottom: 6px;
  }

  .tk-row td[data-label] {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 26px;
  }

  .tk-row td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 82px;
    font-size: 12px;
    color: var(--muted);
  }

  .tk-row.is-selected {
    border-color: #0288b2;
    background: #f0f9ff;
  }

  .tk-group-head {
    display: block;
  }

  .tk-group-head td {
    border-radius: 12px;
    border: 1px solid var(--hair);
  }

  .tk-group-body + .tk-group-body .tk-group-head td {
    border-top: 1px solid var(--hair);
  }

  .tk-person,
  .tk-project {
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  .tk-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .tk-new {
    flex: 0 0 auto;
  }

  .tk-seg button {
    min-height: 36px;
  }

  .tk-tab {
    min-height: 38px;
  }

  .tk-search {
    flex: 1 1 260px;
    max-width: 360px;
  }

  .tk-ftog {
    display: none;
  }

  .tk-bar:not(.is-open) > .tk-filter,
  .tk-bar:not(.is-open) > .tk-clear {
    display: block;
  }

  .tk-bar:not(.is-open) > .tk-clear {
    display: inline-flex;
  }

  .tk-filter {
    flex: 0 1 190px;
  }

  .tk-f-project {
    flex-basis: 220px;
  }

  .tk-f-sm {
    flex-basis: 160px;
  }

  .tk-dates {
    flex: 0 1 300px;
  }

  .tk-dates .user-form-input {
    min-height: 40px;
    font-size: 14px;
  }

  .tk-clear,
  .tk-keep {
    flex: 0 0 auto;
  }

  .tk-keep {
    margin-left: auto;
  }

  .tk-keep .tk-group {
    flex: 0 0 180px;
  }

  .tk-cols-btn,
  .tk-clear {
    min-height: 40px;
  }

  .tk-bulk {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .tk-bulk-actions {
    margin-left: auto;
  }

  .tk-bulk-actions .btn-saff-ghost {
    min-height: 38px;
  }

  .tk-bulk-due {
    flex: 0 0 auto;
  }

  .tk-bulk-due .user-form-input {
    min-height: 38px;
    font-size: 14px;
  }

  .tk-sheet-scrim {
    align-items: center;
    justify-content: center;
  }

  .tk-sheet {
    width: 380px;
    border-radius: 18px;
    padding: 14px 16px 16px;
    animation: qa-fade 0.18s ease-out;
  }

  .tk-sheet-handle {
    display: none;
  }

  .tk-sheet-foot button {
    min-height: 38px;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .tk-c-phase,
  .tk-c-creator,
  .tk-c-created {
    display: none;
  }
}

@media (min-width: 768px) {
  .kanban-board.task-board {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(270px, 1fr);
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  .kanban-board.task-board > .kanban-col {
    scroll-snap-align: start;
    min-width: 0;
  }

  .kanban-board.task-board::-webkit-scrollbar {
    height: 8px;
  }

  .kanban-board.task-board::-webkit-scrollbar-track {
    background: #eef2f7;
    border-radius: 999px;
  }

  .kanban-board.task-board::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
  }

  .kanban-board.task-board::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
}

.tk-bar > .tk-dates {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
}

.tk-bar:not(.is-open) > .tk-dates {
  display: none;
}

.tk-dates .user-form-input {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
}

.tk-dates span {
  flex: 0 0 auto;
  line-height: 1;
}

@media (min-width: 768px) {
  .tk-bar:not(.is-open) > .tk-dates,
  .tk-bar > .tk-dates {
    display: flex;
  }

  .tk-bar > .tk-dates {
    flex: 0 1 320px;
    gap: 6px;
  }

  .tk-bar .tk-dates .user-form-input {
    height: 44px;
    min-height: 44px;
    padding: 0 10px;
    font-size: 14px;
  }
}

.dp-wrapper {
  min-width: 0;
}

.dp-trigger-row {
  position: relative;
}

.dp-trigger {
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
}

.dp-trigger .custom-select-value {
  flex: 1;
  text-align: left;
}

.dp-trigger.has-clear {
  padding-right: 44px;
}

.dp-icon {
  flex-shrink: 0;
  color: #0288b2;
}

.dp-inline-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.dp-inline-clear::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.dp-inline-clear:hover {
  background: #eef2f7;
  color: var(--saff-navy);
}

.dp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 43, 95, 0.4);
  animation: qa-fade 0.18s ease-out;
}

.dp-panel {
  position: fixed;
  z-index: 10000;
  background: #ffffff;
  color: var(--saff-navy);
  font-family: inherit;
}

.dp-panel.is-popover {
  width: 316px;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  box-shadow: 0 18px 40px -12px rgba(7, 43, 95, 0.28), 0 4px 10px -4px rgba(7, 43, 95, 0.1);
  animation: dp-pop 0.14s ease-out;
}

.dp-panel.is-sheet {
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(7, 43, 95, 0.18);
  animation: qa-up 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.dp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 800;
}

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dp-title {
  display: flex;
  gap: 4px;
  min-width: 0;
}

.dp-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--saff-navy);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.dp-title-btn:hover {
  background: #f1f5f9;
}

.dp-title-btn.is-on {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.3);
}

.dp-nav {
  display: flex;
  gap: 4px;
}

.dp-nav button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: #ffffff;
  color: var(--saff-navy);
  cursor: pointer;
}

.dp-nav button:hover {
  background: var(--saff-navy);
  border-color: var(--saff-navy);
  color: #ffffff;
}

.dp-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.dp-weekday {
  padding: 4px 0 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.dp-day {
  position: relative;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--saff-navy);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.dp-day:hover:not(:disabled) {
  background: #eef6fb;
}

.dp-day.is-outside {
  color: #b6c2d1;
  font-weight: 500;
}

.dp-day.is-today {
  box-shadow: inset 0 0 0 1.5px #0288b2;
  color: #0277a0;
  font-weight: 800;
}

.dp-day.is-selected,
.dp-day.is-selected:hover {
  background: var(--saff-navy);
  color: #ffffff;
  box-shadow: 0 4px 10px -4px rgba(7, 43, 95, 0.5);
}

.dp-day:disabled {
  color: #d3dae4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.dp-day:focus-visible,
.dp-cell:focus-visible,
.dp-title-btn:focus-visible,
.dp-nav button:focus-visible,
.dp-chip:focus-visible {
  outline: 2px solid #0288b2;
  outline-offset: 2px;
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px 0;
}

.dp-cell {
  height: 52px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #ffffff;
  color: var(--saff-navy);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.dp-cell:hover:not(:disabled) {
  border-color: #0288b2;
  background: #f0f9ff;
}

.dp-cell.is-today {
  color: #0277a0;
  border-color: rgba(2, 136, 178, 0.45);
}

.dp-cell.is-selected {
  background: var(--saff-navy);
  border-color: var(--saff-navy);
  color: #ffffff;
}

.dp-cell:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
}

.dp-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.dp-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: #ffffff;
  color: var(--saff-navy);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.dp-chip:hover:not(:disabled) {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.35);
}

.dp-chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dp-clear {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #b42323;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

@keyframes dp-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 767.98px) {
  .dp-day {
    height: 46px;
    font-size: 15px;
  }

  .dp-cell {
    height: 56px;
    font-size: 15px;
  }

  .dp-title-btn,
  .dp-nav button {
    min-height: 44px;
    height: 44px;
  }

  .dp-nav button {
    width: 44px;
  }

  .dp-chip,
  .dp-clear {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dp-panel,
  .dp-backdrop {
    animation: none;
  }
}

.tk-dates .dp-wrapper,
.tk-bulk-due .dp-wrapper {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.tk-dates .dp-trigger,
.tk-bulk-due .dp-trigger {
  padding-left: 10px;
  gap: 8px;
  font-size: 14px;
}

.dp-trigger .custom-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .tk-bar > .tk-dates {
    flex: 0 1 340px;
  }

  .tk-bulk-due {
    width: 260px;
  }
}

.tb-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(7, 43, 95, 0.04), 0 4px 12px -8px rgba(7, 43, 95, 0.18);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s;
  min-width: 0;
}

.tb-card:hover {
  border-color: #c9d6e6;
  box-shadow: 0 2px 4px rgba(7, 43, 95, 0.05), 0 10px 22px -12px rgba(7, 43, 95, 0.28);
}

.tb-card:focus-visible {
  outline: 2px solid #0288b2;
  outline-offset: 2px;
}

.tb-card.is-movable {
  cursor: grab;
}

.tb-card.is-movable:active {
  cursor: grabbing;
}

.tb-card.is-dragging {
  opacity: 0.4;
  transform: scale(0.98);
}

.tb-card.is-overdue {
  border-left: 3px solid #d03b3b;
  padding-left: 11px;
}

.tb-card.is-done .tb-title {
  color: #94a3b8;
  text-decoration: line-through;
}

.tb-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--saff-navy);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.tb-context {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: -2px;
}

.tb-project {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.tb-project.is-personal {
  background: #eef2f7;
  color: #475569;
}

.tb-phase {
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 12px;
}

.tb-prio {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.tb-due,
.tb-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.tb-due.is-late {
  color: #b42323;
  font-weight: 800;
}

.tb-due.is-today {
  color: #8a5a00;
  font-weight: 800;
}

.tb-time.is-over {
  color: #b42323;
}

.tb-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.tb-mini > span {
  display: block;
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tb-mini i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #0288b2;
}

.tb-assignee {
  margin-left: auto;
  display: inline-flex;
}

.tb-av {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--saff-navy);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 0 0 1px var(--hair);
}

.tb-av.is-empty {
  background: #eef2f7;
  color: #94a3b8;
}

.task-board .kanban-col-body {
  gap: 8px;
}

.tb-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.tb-hint-desktop {
  display: none;
}

@media (min-width: 768px) {
  .tb-hint-desktop {
    display: inline;
  }

  .tb-hint-mobile {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .tb-card {
    padding: 14px;
  }

  .tb-card.is-overdue {
    padding-left: 12px;
  }

  .tb-title {
    font-size: 15px;
  }
}

.client-name-link {
  color: var(--saff-navy);
  text-decoration: none;
}

.client-name-link:hover {
  color: #0277a0;
  text-decoration: underline;
}

.portal-pass-generate {
  align-self: flex-start;
  min-height: 36px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px dashed rgba(2, 136, 178, 0.5);
  border-radius: 999px;
  background: #f0f9ff;
  color: #0277a0;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.portal-pass-generate:hover {
  background: var(--saff-sky);
}

.portal-pass-hint {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.project-archived-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13.5px;
}

.project-archived-banner span {
  flex: 1 1 220px;
  min-width: 0;
}

.project-archived-banner .btn-saff-ghost {
  min-height: 40px;
}

.project-archived-banner.is-suggest {
  background: #f8fafc;
  border-style: dashed;
}

.cl-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: 14px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}

.cl-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--hair);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(7, 43, 95, 0.04), 0 12px 28px -20px rgba(7, 43, 95, 0.25);
}

.cl-hero-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}

.cl-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--saff-navy), #0288b2);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.cl-hero-text {
  min-width: 0;
}

.cl-hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cl-hero-title .portal-board-title {
  margin: 0;
  overflow-wrap: anywhere;
}

.cl-status {
  padding: 2px 10px;
  border-radius: 999px;
  background: #e8f7e8;
  color: #0a7f0a;
  font-size: 12px;
  font-weight: 800;
}

.cl-status.is-off {
  background: #eef2f7;
  color: #475569;
}

.cl-hero-sub {
  margin: 4px 0 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.cl-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.cl-contacts a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  max-width: 100%;
  color: var(--saff-navy);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.cl-contacts a svg {
  flex-shrink: 0;
  color: #0288b2;
}

.cl-contacts a:hover {
  color: #0277a0;
  text-decoration: underline;
}

.cl-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cl-hero-actions > * {
  flex: 1 1 140px;
  min-height: 44px;
  justify-content: center;
  text-decoration: none;
}

.cl-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.cl-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: #ffffff;
}

.cl-stat span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.cl-stat b {
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 800;
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.cl-stat small {
  font-size: 12px;
  color: var(--muted);
}

.cl-stat.is-danger {
  border-color: #f5c2c2;
  background: #fff7f7;
}

.cl-stat.is-danger b {
  color: #b42323;
}

.cl-stat.is-warn b {
  color: #8a5a00;
}

.cl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.cl-main,
.cl-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.cl-card {
  padding: 16px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: #ffffff;
  min-width: 0;
}

.cl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cl-card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--saff-navy);
}

.cl-card-head a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0277a0;
  text-decoration: none;
}

.cl-empty {
  padding: 16px 0;
  text-align: center;
}

.cl-empty p,
.cl-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.cl-projects,
.cl-invoices,
.cl-people,
.cl-activity {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cl-projects li + li,
.cl-invoices li + li,
.cl-people li + li {
  border-top: 1px solid var(--hair);
}

.cl-projects li.is-archived {
  opacity: 0.65;
}

.cl-project,
.cl-invoice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 4px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  flex-wrap: wrap;
}

.cl-project:hover,
.cl-invoice:hover {
  background: #f8fbff;
}

.cl-project-text,
.cl-invoice-ref,
.cl-person-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 160px;
  min-width: 0;
}

.cl-project-text b,
.cl-invoice-ref b,
.cl-person-text b {
  font-size: 14px;
  color: var(--saff-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cl-project-text small,
.cl-invoice-ref small,
.cl-person-text small {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cl-project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cl-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.cl-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.cl-pill.is-on {
  background: #e8f7e8;
  color: #0a7f0a;
}

.cl-invoice-amount {
  font-weight: 800;
  color: var(--saff-navy);
  white-space: nowrap;
}

.cl-invoice-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.cl-invoice-status small {
  font-size: 11.5px;
  color: var(--muted);
}

.cl-people li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  flex-wrap: wrap;
}

.cl-person-av {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-size: 12px;
  font-weight: 800;
}

.cl-detail + .cl-detail {
  margin-top: 10px;
}

.cl-detail span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.cl-detail p {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.cl-activity li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
}

.cl-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #0288b2;
}

.cl-dot.is-client {
  background: #eb6834;
}

.cl-activity-text {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}

.cl-activity-text b {
  color: var(--saff-navy);
}

.cl-activity-text small {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.cl-activity-text small a {
  color: #0277a0;
  font-weight: 700;
  text-decoration: none;
}

@media (min-width: 768px) {
  .cl-hero {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    padding: 22px;
  }

  .cl-avatar {
    width: 64px;
    height: 64px;
    font-size: 20px;
  }

  .cl-hero-actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .cl-hero-actions > * {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .cl-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cl-project,
  .cl-invoice {
    flex-wrap: nowrap;
  }

  .cl-invoice-status {
    align-items: flex-end;
    min-width: 150px;
  }
}

@media (min-width: 1100px) {
  .cl-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .cl-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  }
}

.cl-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.cl-link-btn {
  min-height: 40px;
  padding: 0 12px;
  border: 1px dashed rgba(2, 136, 178, 0.5);
  border-radius: 999px;
  background: #f0f9ff;
  color: #0277a0;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.cl-link-btn:hover {
  background: var(--saff-sky);
}

.cl-people li {
  align-items: flex-start;
  padding: 10px 0;
}

.cl-people li.is-off .cl-person-text b,
.cl-people li.is-off .cl-person-av {
  opacity: 0.55;
}

.cl-person-text small + small {
  margin-top: 1px;
  font-size: 11.5px;
}

.cl-person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.cl-person-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.cl-person-actions .btn-saff-ghost {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
}

.pl-modal {
  width: min(560px, 100%);
}

.pl-modal .user-form-group {
  margin-bottom: 12px;
}

@media (max-width: 767.98px) {
  .cl-person-tags {
    flex-basis: 100%;
    padding-left: 46px;
  }

  .cl-person-actions {
    flex-basis: 100%;
    padding-left: 46px;
    margin-left: 0;
  }

  .cl-person-actions .btn-saff-ghost {
    flex: 1;
    min-height: 44px;
  }

  .cl-link-btn {
    min-height: 44px;
  }
}

.project-toolbar .project-toolbar-search {
  min-width: 0;
}

.project-export-btn {
  justify-content: center;
  width: 100%;
  min-height: 44px;
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .project-toolbar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .project-toolbar .project-toolbar-search {
    flex: 1 1 260px;
    width: auto;
    max-width: 360px;
  }

  .project-toolbar .portal-toolbar-filter {
    flex: 0 1 200px;
  }

  .project-export-btn {
    width: auto;
    margin-left: auto;
  }
}

.ts-approver-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ts-approver-bar .ts-reopen-btn {
  justify-content: center;
  width: 100%;
  min-height: 44px;
}

.ts-unlock-intro {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.ts-unlock-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  font-weight: 600;
}

.ts-unlock-intro + .ts-unlock-note,
.ts-unlock-intro {
  overflow-wrap: anywhere;
}

#ts-unlock-reason {
  font-size: 16px;
}

@media (min-width: 640px) {
  .ts-approver-actions {
    flex-direction: row;
    align-items: center;
  }

  .ts-approver-bar .ts-reopen-btn {
    width: auto;
  }
}

.pg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.pg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--hair);
  border-top: 3px solid var(--pg-accent, #03a1d0);
  background: #ffffff;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.pg-card:hover,
.pg-card:focus-within {
  border-color: rgba(3, 161, 208, 0.45);
  box-shadow: 0 10px 24px rgba(7, 43, 95, 0.1);
}

.pg-card.is-archived {
  background: #f8fafc;
}

.pg-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.pg-card-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.pg-card-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pg-code {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pg-priority {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pg-priority span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pg-card-link {
  color: var(--saff-navy);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.pg-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.pg-card-link:focus-visible {
  outline: none;
}

.pg-card:has(.pg-card-link:focus-visible) {
  outline: 2px solid var(--saff-cyan);
  outline-offset: 2px;
}

.pg-client {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pg-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pg-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.pg-progress {
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.pg-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--pg-accent, #03a1d0);
}

.pg-progress-text {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: -6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.pg-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

.pg-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pg-avatars {
  display: inline-flex;
  flex-shrink: 0;
}

.pg-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
}

.pg-avatar:first-child {
  margin-left: 0;
}

.pg-avatar.is-more {
  background: #e2e8f0;
  color: var(--saff-navy);
}

.pg-team-text,
.pg-team-empty {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pg-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.pg-action {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.pg-action:hover {
  background: var(--saff-sky);
  color: var(--saff-navy);
}

.pg-action.is-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.pg-view-toggle {
  display: none;
}

@media (min-width: 768px) {
  .pg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .pg-view-toggle {
    display: inline-flex;
    flex-shrink: 0;
    padding: 2px;
    border-radius: 12px;
    border: 1px solid var(--hair);
    background: #ffffff;
  }

  .pg-view-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  .pg-view-toggle button.is-active {
    background: var(--saff-navy);
    color: #ffffff;
  }
}

@media (min-width: 1200px) {
  .pg-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.inv-email-note {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.qt-row-title {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.qt-line-tools {
  display: flex;
  gap: 4px;
}

.qt-doc-title {
  margin: 4px 0 14px;
  color: var(--saff-navy);
  font-size: clamp(1.05rem, 3.6vw, 1.3rem);
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.inv-banner.qt-banner-info {
  background: var(--saff-sky);
  color: var(--saff-navy);
}

.inv-banner.qt-banner-expired {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.inv-banner.qt-banner-accepted {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.inv-banner.qt-banner-rejected {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.inv-banner[class*="qt-banner"] {
  overflow-wrap: anywhere;
}

.qt-decision-text {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

#qt-decision-note,
#qt-title,
#qt-notes,
#qt-terms {
  font-size: 16px;
}

.qt-convert-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(3, 161, 208, 0.35);
  background: #f0f9ff;
}

.qt-convert-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.qt-convert-head strong {
  display: block;
  color: var(--saff-navy);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.qt-convert-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.qt-convert-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #ffffff;
  font-size: 20px;
}

.qt-convert-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.qt-convert-banner .portal-toggle-sub {
  overflow-wrap: anywhere;
}

.inv-row-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.inv-row-balance {
  color: #6d28d9;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.inv-totals .inv-balance {
  margin-top: 6px;
}

.inv-totals .inv-balance.is-clear strong {
  color: #047857;
}

.pay-history {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--hair);
  background: #ffffff;
}

.pay-list {
  display: flex;
  flex-direction: column;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.pay-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--hair);
}

.pay-item:first-child {
  border-top: 0;
}

.pay-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 220px;
}

.pay-item-main strong {
  color: #047857;
  font-size: 15px;
}

.pay-item-main span {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pay-item-main small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pay-note {
  font-style: italic;
}

.pay-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pay-item-actions .btn-saff-ghost {
  min-height: 44px;
}

.pay-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

@media (max-width: 767.98px) {
  .pay-item-actions {
    width: 100%;
  }

  .pay-item-actions .btn-saff-ghost {
    flex: 1;
    justify-content: center;
  }
}

.exp-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.exp-card {
  padding: 16px;
  min-width: 0;
}

.exp-card-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.exp-card-head .btn-saff-primary,
.exp-card-head .btn-saff-ghost {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.exp-title {
  margin: 0;
  color: var(--saff-navy);
  font-size: clamp(1.05rem, 3.6vw, 1.2rem);
  font-weight: 800;
}

.exp-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.exp-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.exp-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: #f8fafc;
}

.exp-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.exp-tile strong {
  color: var(--saff-navy);
  font-size: clamp(1rem, 4vw, 1.25rem);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.exp-tile small {
  color: var(--muted);
  font-size: 11.5px;
}

.exp-tile.is-good {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.exp-tile.is-good strong {
  color: #047857;
}

.exp-tile.is-danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.exp-tile.is-danger strong {
  color: #b91c1c;
}

.exp-warn {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
}

.exp-hint {
  display: block;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.exp-mini-title {
  margin: 16px 0 6px;
  color: var(--saff-navy);
  font-size: 13px;
  font-weight: 800;
}

.exp-people {
  margin: 0;
  padding: 0;
  list-style: none;
}

.exp-people li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
  font-size: 13px;
}

.exp-person-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.exp-person-hours {
  color: var(--muted);
}

.exp-person-cost {
  font-weight: 700;
  text-align: right;
}

.exp-person-cost em {
  color: #b45309;
  font-style: normal;
  font-size: 12px;
}

.exp-filter {
  margin-bottom: 12px;
}

.exp-cats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.exp-cats li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  font-size: 13px;
}

.exp-cat-bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
  order: 3;
}

.exp-cat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--saff-cyan);
}

.exp-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.exp-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--hair);
}

.exp-item:first-child {
  border-top: 0;
}

.exp-item-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.exp-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exp-item-top small,
.exp-item-meta {
  color: var(--muted);
  font-size: 12px;
}

.exp-item-desc {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.exp-item-amount {
  color: var(--saff-navy);
  font-size: 15px;
  white-space: nowrap;
  align-self: start;
}

.exp-item-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
}

.exp-current-receipt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.exp-file {
  height: auto;
  padding-top: 10px;
  padding-bottom: 10px;
}

#exp-desc,
#exp-amount,
#exp-vendor {
  font-size: 16px;
}

.hc-list {
  margin: 0;
  padding: 4px 16px;
  list-style: none;
}

.hc-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--hair);
}

.hc-row:first-child {
  border-top: 0;
}

.hc-row.is-off {
  opacity: 0.6;
}

.hc-person {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hc-person strong {
  color: var(--saff-navy);
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

.hc-person small {
  color: var(--muted);
  font-size: 12.5px;
}

.hc-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hc-input {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 200px;
  min-width: 0;
}

.hc-input input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
}

.hc-prefix,
.hc-suffix {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.hc-form .btn-saff-primary {
  flex: 1 1 100%;
  min-height: 44px;
  justify-content: center;
}

.hc-error {
  flex-basis: 100%;
}

.viz-head-link {
  min-height: 44px;
}

.viz-note-warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
}

.viz-neg {
  color: #b91c1c;
  font-weight: 800;
}

.viz-pos {
  color: #047857;
  font-weight: 800;
}

@media (min-width: 768px) {
  .exp-card {
    padding: 20px;
  }

  .exp-card-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .exp-card-head .btn-saff-primary,
  .exp-card-head .btn-saff-ghost {
    width: auto;
  }

  .exp-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .exp-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .exp-item-actions {
    grid-column: auto;
  }

  .hc-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hc-form {
    flex-wrap: nowrap;
    flex: 0 1 420px;
  }

  .hc-form .btn-saff-primary {
    flex: 0 0 auto;
  }
}

.exp-scope {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.exp-scope.is-company {
  background: #f5f3ff;
  color: #6d28d9;
}

.exp-repeat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #0277a0;
  font-size: 12px;
  font-weight: 700;
}

.exp-subs {
  margin-bottom: 16px;
  border-color: rgba(3, 161, 208, 0.35);
}

.exp-stop {
  min-height: 44px;
  width: 100%;
  justify-content: center;
}

.exp-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.exp-filters .task-search {
  min-width: 0;
}

.viz-overheads {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 10px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  font-size: 13px;
}

.viz-overheads small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.viz-overheads strong {
  color: #6d28d9;
  text-align: right;
}

.viz-overheads a {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}

@media (min-width: 768px) {
  .exp-filters {
    grid-template-columns: repeat(3, minmax(0, 200px)) minmax(0, 1fr);
  }

  .exp-stop {
    width: auto;
  }

  .viz-overheads {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .viz-overheads a {
    grid-column: auto;
  }
}

.lead-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.lead-toolbar .task-search {
  min-width: 0;
}

.lead-toolbar .portal-pill-tab {
  min-height: 44px;
  justify-content: center;
}

.lead-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

.lead-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-board {
  display: none;
}

.lead-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  border-left: 3px solid transparent;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.lead-card:hover,
.lead-card:focus-visible {
  border-color: rgba(3, 161, 208, 0.45);
  box-shadow: 0 6px 16px rgba(7, 43, 95, 0.08);
}

.lead-card.is-overdue {
  border-left-color: #dc2626;
}

.lead-card.is-today {
  border-left-color: #f59e0b;
}

.lead-card[draggable="true"] {
  cursor: grab;
}

.lead-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.lead-card-name {
  min-width: 0;
  color: var(--saff-navy);
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.lead-avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--saff-navy);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
}

.lead-card-contact {
  color: var(--muted);
  font-size: 12.5px;
}

.lead-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-source {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.lead-value {
  color: #047857;
  font-size: 13px;
}

.lead-follow {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.lead-follow.is-overdue {
  color: #b91c1c;
}

.lead-follow.is-today {
  color: #b45309;
}

.lead-lost-reason,
.lead-client {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.lead-client {
  color: #047857;
  font-weight: 700;
}

.lead-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px dashed transparent;
}

.lead-col.is-over {
  border-color: var(--saff-cyan);
  background: #f0f9ff;
}

.lead-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--saff-navy);
  font-size: 13px;
}

.lead-col-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.lead-col-total {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.lead-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.lead-col-empty {
  margin: 0;
  padding: 18px 8px;
  border-radius: 10px;
  border: 1px dashed var(--hair);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.lead-title {
  overflow-wrap: anywhere;
}

.lead-actions .btn-saff-ghost {
  min-height: 44px;
}

.lead-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.lead-main,
.lead-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.lead-card-box {
  padding: 16px;
  min-width: 0;
}

.lead-card-box .exp-title {
  margin-bottom: 10px;
}

.lead-stages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lead-stage-btn,
.lead-type-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.lead-stage-btn.is-active {
  font-weight: 800;
}

.lead-type-btn.is-active {
  background: var(--saff-navy);
  border-color: var(--saff-navy);
  color: #ffffff;
}

.lead-follow-form,
.lead-log-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-follow-form .btn-saff-primary,
.lead-log-foot .btn-saff-primary,
.lead-side-actions .btn-saff-primary,
.lead-side-actions .btn-saff-ghost,
.lead-wa {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.lead-log-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead-log-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lead-timeline li {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--hair);
}

.lead-timeline li:first-child {
  border-top: 0;
}

.lead-tl-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f1f5f9;
  font-size: 14px;
}

.lead-timeline li.is-stage .lead-tl-icon,
.lead-timeline li.is-system .lead-tl-icon {
  background: var(--saff-sky);
}

.lead-tl-body {
  min-width: 0;
}

.lead-tl-body p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.lead-timeline li.is-stage .lead-tl-body p,
.lead-timeline li.is-system .lead-tl-body p {
  color: var(--muted);
  font-size: 13px;
}

.lead-tl-body small {
  color: var(--muted);
  font-size: 12px;
}

.lead-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0 0 12px;
  font-size: 13.5px;
}

.lead-facts dt {
  color: var(--muted);
  font-weight: 700;
}

.lead-facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.lead-facts a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.lead-req {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.lead-client-line {
  margin: 0 0 10px;
  font-weight: 700;
}

.lead-quotes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.lead-quotes li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  font-size: 13px;
}

.lead-quotes li strong {
  grid-column: 1 / -1;
  color: var(--saff-navy);
}

.lead-side-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#lead-company,
#lead-contact,
#lead-email,
#lead-phone,
#lead-website,
#lead-value {
  font-size: 16px;
}

@media (min-width: 768px) {
  .lead-toolbar {
    grid-template-columns: minmax(0, 1fr) 200px 180px auto;
  }

  .lead-stages {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .lead-log-foot {
    flex-direction: row;
    align-items: flex-end;
  }

  .lead-log-foot > :first-child {
    flex: 1;
  }

  .lead-log-foot .btn-saff-primary {
    width: auto;
  }
}

@media (min-width: 1024px) {
  .lead-mobile {
    display: none;
  }

  .lead-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .lead-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

.tkt-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.tkt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tkt-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--hair);
  border-left: 3px solid transparent;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}

.tkt-row:hover,
.tkt-row:focus-visible {
  border-color: rgba(3, 161, 208, 0.45);
  box-shadow: 0 6px 16px rgba(7, 43, 95, 0.08);
}

.tkt-row.is-breached {
  border-left-color: #dc2626;
}

.tkt-row-top,
.tkt-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tkt-num {
  color: var(--saff-navy);
  font-size: 13px;
}

.tkt-prio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.tkt-prio span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.tkt-row-title {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tkt-row-meta {
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.tkt-sla {
  font-size: 12px;
  font-weight: 700;
}

.tkt-sla.is-danger { color: #b91c1c; }
.tkt-sla.is-warn { color: #b45309; }
.tkt-sla.is-info { color: var(--muted); }
.tkt-sla.is-good { color: #047857; }

.tkt-sla-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  background: #f8fafc;
  color: var(--muted);
}

.tkt-sla-banner.is-danger { background: #fef2f2; color: #b91c1c; }
.tkt-sla-banner.is-warn { background: #fffbeb; color: #92400e; }
.tkt-sla-banner.is-good { background: #ecfdf5; color: #047857; }

.tkt-amc-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.tkt-amc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(3, 161, 208, 0.35);
  background: #f0f9ff;
}

.tkt-amc strong {
  display: block;
  color: var(--saff-navy);
}

.tkt-amc small,
.tkt-usage-text {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.tkt-amc-usage {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink);
}

.tkt-meter {
  display: block;
  height: 8px;
  margin: 6px 0;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tkt-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--saff-cyan);
}

.tkt-meter span.is-over {
  background: #dc2626;
}

.tkt-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tkt-msg {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: #ffffff;
  min-width: 0;
}

.tkt-msg.is-client {
  background: #f8fafc;
}

.tkt-msg.is-staff {
  background: #f0f9ff;
  border-color: rgba(3, 161, 208, 0.3);
}

.tkt-msg.is-internal {
  background: #fffbeb;
  border-style: dashed;
  border-color: #fcd34d;
}

.tkt-msg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  margin-bottom: 6px;
}

.tkt-msg-head strong {
  color: var(--saff-navy);
  font-size: 13.5px;
}

.tkt-msg-head small {
  color: var(--muted);
  font-size: 12px;
}

.tkt-msg-body {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.tkt-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tkt-thumb {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--hair);
}

.tkt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tkt-file {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: #ffffff;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.tkt-priority-pick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.tkt-prio-btn {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.tkt-prio-btn.is-active {
  background: var(--saff-navy);
  border-color: var(--saff-navy);
  color: #ffffff;
}

.tkt-prio-btn.is-urgent.is-active {
  background: #dc2626;
  border-color: #dc2626;
}

.tkt-time-list {
  display: flex;
  flex-direction: column;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tkt-time-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
  font-size: 13px;
}

.tkt-time-list small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

#tkt-title,
#tkt-desc,
#amc-name {
  font-size: 16px;
}

.amc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.amc-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  min-width: 0;
}

.amc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.amc-client {
  display: block;
  color: var(--saff-navy);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.amc-name {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.amc-usage {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.amc-over {
  color: #b91c1c;
  font-weight: 700;
}

.amc-left {
  color: #047857;
  font-weight: 700;
}

.amc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.amc-actions .btn-saff-ghost,
.amc-actions .btn-saff-primary {
  flex: 1 1 140px;
  min-height: 44px;
  justify-content: center;
}

@media (min-width: 768px) {
  .tkt-filter-row {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .tkt-priority-pick {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tkt-amc {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .tkt-amc-usage {
    min-width: 260px;
  }

  .amc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .amc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.leave-balances {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.leave-balance {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--hair);
  border-top: 3px solid var(--leave-color, #03a1d0);
  background: #ffffff;
}

.leave-balance-name {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.leave-balance strong {
  color: var(--saff-navy);
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  font-weight: 800;
  line-height: 1.1;
}

.leave-balance small {
  color: var(--muted);
  font-size: 12px;
}

.leave-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: middle;
}

.leave-type-tag {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}

.leave-year {
  display: flex;
  align-items: center;
  gap: 8px;
}

.leave-estimate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: 12px;
  background: var(--saff-sky);
  color: var(--saff-navy);
}

.leave-estimate strong {
  font-size: 18px;
}

.leave-estimate span {
  font-size: 12.5px;
}

.leave-estimate.is-short {
  background: #fffbeb;
  color: #92400e;
}

.leave-decide .btn-saff-primary,
.leave-decide .btn-saff-ghost {
  flex: 1;
  min-height: 44px;
  justify-content: center;
}

.leave-holiday-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hair);
}

.leave-holiday-form .btn-saff-primary {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.leave-past {
  opacity: 0.55;
}

.wl-leave {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f5f3ff;
  color: #6d28d9;
  font-size: 13px;
  font-weight: 700;
}

#hol-name,
#leave-reason {
  font-size: 16px;
}

@media (min-width: 768px) {
  .leave-balances {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .leave-holiday-form {
    flex-direction: row;
    align-items: flex-end;
  }

  .leave-holiday-form > * {
    flex: 1;
  }

  .leave-holiday-form .btn-saff-primary {
    flex: 0 0 auto;
    width: auto;
  }

  .leave-decide {
    width: auto;
  }
}

.rec-amount {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rec-amount strong {
  color: var(--saff-navy);
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  font-weight: 800;
}

.rec-amount span {
  color: var(--muted);
  font-size: 12.5px;
}

.rec-paused {
  opacity: 0.7;
}

#rec-name,
#rec-notes {
  font-size: 16px;
}

.audit-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.audit-filters .task-search {
  min-width: 0;
}

.audit-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  background: #ffffff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.audit-stat[aria-pressed="true"] {
  border-color: var(--saff-cyan);
  box-shadow: 0 0 0 2px rgba(3, 161, 208, 0.15);
}

.audit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--hair);
}

.audit-row:first-child {
  border-top: 0;
}

.audit-row.is-alert .audit-desc {
  color: #b91c1c;
}

.audit-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  font-size: 15px;
}

.audit-body {
  min-width: 0;
  flex: 1;
}

.audit-desc {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.audit-meta {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.audit-meta strong {
  color: var(--saff-navy);
}

.audit-more {
  margin-top: 6px;
}

.audit-details {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.audit-details p {
  margin: 0 0 4px;
}

@media (min-width: 768px) {
  .audit-filters {
    grid-template-columns: 180px 200px 240px minmax(0, 1fr);
  }
}

.inv-paid-line strong {
  white-space: nowrap;
}

.lead-facts dt,
.lead-facts dd {
  align-self: center;
}

.lead-toolbar .task-search,
.exp-filters .task-search,
.audit-filters .task-search,
.tkt-filter-row .task-search {
  grid-column: auto;
  width: auto;
}

.amc-actions .btn-saff-ghost,
.amc-actions .btn-saff-primary {
  flex: 1 1 calc(50% - 4px);
}

.tkt-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (max-width: 767.98px) {
  .portal-board-actions {
    flex-wrap: wrap;
  }

  .portal-board-actions .btn-saff-primary,
  .portal-board-actions .btn-saff-ghost {
    flex: 1 1 140px;
    white-space: nowrap;
  }
}

@media (min-width: 768px) {
  .exp-filters {
    grid-template-columns: 170px 240px 200px minmax(0, 1fr);
  }
}

@media (min-width: 1024px) {
  .lead-board {
    grid-template-columns: repeat(5, minmax(170px, 1fr));
  }
}

.today-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
  min-width: 0;
}

.today-card {
  min-width: 0;
}

.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.today-title {
  margin: 0;
  color: var(--saff-navy);
  font-size: clamp(1rem, 4vw, 1.125rem);
  font-weight: 700;
}

.today-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  margin-right: auto;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12.5px;
  font-weight: 800;
}

.today-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--saff-cyan);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.today-clear {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #047857;
  font-size: 13.5px;
  font-weight: 700;
}

.today-tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.today-tile {
  --tile: #0369a1;
  --tile-bg: #f0f9ff;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--hair);
  border-left: 4px solid var(--tile);
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.today-tile:hover,
.today-tile:focus-visible {
  box-shadow: 0 6px 16px rgba(7, 43, 95, 0.1);
}

.today-tile.is-danger { --tile: #dc2626; --tile-bg: #fef2f2; }
.today-tile.is-warn { --tile: #d97706; --tile-bg: #fffbeb; }
.today-tile.is-good { --tile: #059669; --tile-bg: #ecfdf5; }
.today-tile.is-info { --tile: #0277a0; --tile-bg: #f0f9ff; }

.today-tile-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--tile-bg);
  color: var(--tile);
}

.today-tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.today-tile-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.today-tile-num {
  color: var(--tile);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.today-tile-label {
  min-width: 0;
  color: var(--saff-navy);
  font-size: 13.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.today-tile-sub {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.today-tile-go {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 16px;
}

.today-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.today-money {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.today-money-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--hair);
}

.today-money-item span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.today-money-item strong {
  color: var(--saff-navy);
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.today-money-item small {
  color: var(--muted);
  font-size: 12px;
}

.today-money-item small a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--saff-cyan);
  font-weight: 700;
  text-decoration: none;
}

.today-money-item.is-main {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.today-money-item.is-main strong {
  color: #047857;
}

.today-trend {
  font-weight: 700;
}

.today-trend.is-good { color: #047857 !important; }
.today-trend.is-bad { color: #b91c1c !important; }

.today-holiday {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 13px;
  font-weight: 700;
}

.today-muted {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.today-off,
.today-busy {
  display: flex;
  flex-direction: column;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.today-off li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
  font-size: 13px;
}

.today-off li:first-child,
.today-busy li:first-child {
  border-top: 0;
}

.today-off li strong {
  color: var(--saff-navy);
}

.today-off li span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.today-sub-title {
  margin: 10px 0 4px;
  color: var(--saff-navy);
  font-size: 13px;
  font-weight: 800;
}

.today-busy li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
  font-size: 13px;
}

.today-busy-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.today-busy-count {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.today-busy-count em {
  color: #b91c1c;
  font-style: normal;
  font-weight: 700;
}

@media (min-width: 768px) {
  .today-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-money {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-money-item.is-main {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1200px) {
  .today-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .today-row {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

.gs-trigger {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 12px 0 36px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--faint);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.gs-trigger:hover,
.gs-trigger:focus-visible {
  background: #ffffff;
  border-color: var(--saff-cyan);
  box-shadow: var(--focus);
  outline: none;
}

.gs-trigger .portal-search-icon {
  display: flex;
}

.gs-trigger .portal-search-icon svg {
  width: 100%;
  height: 100%;
}

.gs-trigger-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.portal-topbar-btn.gs-mobile-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  background: #ffffff;
  animation: gs-fade 0.15s ease-out;
}

.gs-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  background: #ffffff;
  padding-top: env(safe-area-inset-top);
}

.gs-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hair);
}

.gs-head-icon {
  display: flex;
  color: var(--saff-cyan);
  flex-shrink: 0;
  padding-left: 4px;
}

.gs-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--saff-navy);
}

.gs-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.gs-spinner {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid #e0f2fe;
  border-top-color: var(--saff-cyan);
  border-radius: 50%;
  animation: gs-spin 0.7s linear infinite;
}

.gs-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--saff-cyan);
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
}

.gs-close-desktop {
  display: none;
}

.gs-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 8px calc(16px + env(safe-area-inset-bottom));
}

.gs-group + .gs-group {
  margin-top: 4px;
}

.gs-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gs-clear {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--saff-cyan);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.gs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.gs-item.active {
  background: #e0f2fe;
}

.gs-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--saff-navy);
  flex-shrink: 0;
}

.gs-item.active .gs-item-icon {
  background: #ffffff;
}

.gs-type-invoices,
.gs-type-quotations {
  color: #0369a1;
}

.gs-type-tickets {
  color: #b45309;
}

.gs-type-leads {
  color: #15803d;
}

.gs-item-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.gs-item-title,
.gs-item-sub {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gs-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--saff-navy);
}

.gs-item-sub {
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
}

.gs-item mark {
  background: rgba(3, 161, 208, 0.18);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.gs-badge {
  flex-shrink: 0;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.gs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.gs-empty strong {
  font-size: 15px;
  color: var(--saff-navy);
}

.gs-foot {
  display: none;
}

@keyframes gs-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes gs-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 481px) {
  .portal-topbar-btn.gs-mobile-trigger {
    display: none;
  }
}

@media (min-width: 769px) {
  .gs-trigger {
    padding: 0 70px 0 44px;
  }

  .gs-overlay {
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 16px 16px;
    background: rgba(7, 43, 95, 0.32);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .gs-panel {
    max-width: 640px;
    height: auto;
    max-height: 72vh;
    padding-top: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(7, 43, 95, 0.25);
    animation: gs-pop 0.16s ease-out;
  }

  .gs-head {
    padding: 10px 14px;
  }

  .gs-close-desktop {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--hair);
    border-radius: 6px;
    font-size: 11px;
    color: var(--faint);
  }

  .gs-close-mobile {
    display: none;
  }

  .gs-body {
    padding-bottom: 10px;
  }

  .gs-foot {
    display: flex;
    gap: 18px;
    padding: 10px 16px;
    border-top: 1px solid var(--hair);
    font-size: 12px;
    color: var(--muted);
  }

  .gs-foot kbd {
    display: inline-block;
    min-width: 20px;
    margin-right: 2px;
    padding: 1px 6px;
    border: 1px solid var(--hair);
    border-radius: 5px;
    background: #f8fafc;
    font-size: 11px;
    text-align: center;
  }
}

@keyframes gs-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.et-tabs,
.et-pane-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: #f1f5f9;
  border-radius: 12px;
  width: 100%;
}

.et-tabs button,
.et-pane-tabs button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.et-tabs button.active,
.et-pane-tabs button.active {
  background: #ffffff;
  color: var(--saff-navy);
  box-shadow: 0 1px 3px rgba(7, 43, 95, 0.12);
}

.et-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.et-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(7, 43, 95, 0.04);
}

.et-card.is-off {
  background: #f8fafc;
}

.et-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.et-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #e0f2fe;
  font-size: 18px;
}

.et-card-main {
  flex: 1;
  min-width: 0;
}

.et-card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--saff-navy);
}

.et-card-when {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.et-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}

.et-subject {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  min-width: 0;
}

.et-subject span,
.et-preview-subject span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.et-subject strong,
.et-preview-subject strong {
  font-size: 14px;
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.et-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}

.et-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.et-chip.is-on {
  background: #dcfce7;
  color: #15803d;
}

.et-chip.is-off {
  background: #fee2e2;
  color: #b91c1c;
}

.et-card-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
}

.et-card-foot small {
  font-size: 12px;
  color: var(--muted);
}

.et-edit-btn {
  width: 100%;
  justify-content: center;
  min-height: 44px;
}

.et-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 14px;
}

.et-log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.et-log-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--hair);
}

.et-log-row:last-child {
  border-bottom: 0;
}

.et-status {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.et-status.sent {
  background: #dcfce7;
  color: #15803d;
}

.et-status.failed {
  background: #fee2e2;
  color: #b91c1c;
}

.et-log-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.et-log-subject {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--saff-navy);
  overflow-wrap: anywhere;
}

.et-log-meta {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.et-log-error {
  font-size: 12px;
  color: #b91c1c;
  overflow-wrap: anywhere;
}

.et-resend {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.et-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.et-pager .btn-saff-ghost {
  min-height: 44px;
}

.et-back {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--saff-cyan);
  text-decoration: none;
}

.et-onoff {
  width: 100%;
  min-height: 52px;
}

.et-editor {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.et-editor.show-edit .et-preview,
.et-editor.show-preview .et-form {
  display: none;
}

.et-form,
.et-preview {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 16px;
}

.et-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}

.et-tool {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: #ffffff;
  color: var(--saff-navy);
  font-size: 14px;
  cursor: pointer;
}

.et-tool:hover {
  border-color: var(--saff-cyan);
}

.et-attr {
  flex: 1 1 100%;
  min-width: 0;
}

.et-attr .user-form-group {
  margin: 0;
}

.et-body {
  min-height: 280px;
  height: auto;
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}

.et-form .user-form-input {
  font-size: 16px;
}

.et-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.et-actions button {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.et-danger {
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
  background: #fef2f2 !important;
}

.et-preview-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.et-preview-subject {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.et-preview-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.et-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #f1f5f9;
}

.et-seg button {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.et-seg button.active {
  background: #ffffff;
  color: var(--saff-navy);
  box-shadow: 0 1px 3px rgba(7, 43, 95, 0.12);
}

.et-device {
  display: none;
}

.et-frame-wrap {
  width: 100%;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--hair);
}

.et-frame {
  display: block;
  width: 100%;
  min-height: 420px;
  border: 0;
  background: #f1f5f9;
}

.wm-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
}

.wm-check input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--saff-cyan);
}

.wm-check span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wm-check strong {
  font-size: 14px;
  color: var(--saff-navy);
}

.wm-check small {
  font-size: 12px;
  color: var(--muted);
}

@media (min-width: 768px) {
  .et-tabs {
    width: auto;
    display: inline-flex;
  }

  .et-tabs button {
    flex: 0 0 auto;
    padding: 0 18px;
  }

  .et-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .et-card-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .et-edit-btn {
    width: auto;
    padding: 0 22px;
  }

  .et-filters {
    grid-template-columns: 200px 240px minmax(0, 1fr);
  }

  .et-log-row {
    flex-wrap: nowrap;
    align-items: center;
  }

  .et-resend {
    width: auto;
  }

  .et-onoff {
    width: auto;
    min-width: 220px;
  }

  .et-attr {
    flex: 1 1 260px;
  }

  .et-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .et-actions button {
    width: auto;
    padding: 0 20px;
  }

  .et-preview-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .et-device {
    display: inline-flex;
  }

  .et-frame-wrap.is-phone {
    max-width: 390px;
  }
}

@media (min-width: 1100px) {
  .et-pane-tabs {
    display: none;
  }

  .et-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .et-editor {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .et-editor.show-edit .et-preview,
  .et-editor.show-preview .et-form {
    display: flex;
  }

  .et-preview {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }

  .et-preview-head {
    flex-direction: column;
  }
}

.et-section + .et-section {
  margin-top: 22px;
}

.et-section-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.et-info-banner {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #075985;
}

.et-section.portal-card {
  padding: 6px 0 4px;
  margin-bottom: 14px;
  overflow: hidden;
}

.et-section + .et-section {
  margin-top: 0;
}

.et-section .et-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 16px 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--saff-navy);
  border-bottom: 1px solid var(--hair);
}

.et-section-count {
  margin-left: auto;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.et-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.et-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  border-bottom: 1px solid var(--hair);
}

.et-row:last-child {
  border-bottom: 0;
}

.et-row.is-off .et-row-name {
  color: var(--muted);
}

.et-row-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  min-height: 64px;
  padding: 12px 8px 12px 16px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}

a.et-row-link:hover,
a.et-row-link:focus-visible {
  background: #f8fafc;
  outline: none;
}

.et-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.et-row-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--saff-navy);
}

.et-row-when {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.et-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.et-row-sent {
  font-size: 12px;
  color: var(--faint);
}

.et-row-chevron {
  display: flex;
  flex-shrink: 0;
  color: var(--faint);
}

.et-chip.is-system {
  background: #eef2f7;
  color: #072b5f;
}

.et-chip.is-custom {
  background: #ede9fe;
  color: #6d28d9;
}

.et-new-btn {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.et-new-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.et-new-modal .user-form-input {
  font-size: 16px;
}

.et-optional {
  font-weight: 400;
  color: var(--faint);
}

.et-send {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  margin-bottom: 14px;
  border-left: 4px solid var(--saff-cyan);
}

.et-send-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--saff-navy);
}

.et-send-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.et-send-seg {
  display: flex;
  width: 100%;
}

.et-send-seg button {
  flex: 1;
  min-height: 44px;
}

.et-send-btn {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.et-danger-soft {
  color: #b91c1c;
}

.et-frame {
  min-height: 200px;
}

@media (min-width: 768px) {
  .et-new-btn {
    width: auto;
  }

  .et-send {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
  }

  .et-send-seg {
    width: auto;
  }

  .et-send-seg button {
    flex: 0 0 auto;
  }

  .et-send-btn {
    width: auto;
    padding: 0 20px;
  }
}

@media (min-width: 1100px) {
  .et-preview {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

.hl-field {
  position: relative;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.hl-field:focus-within {
  background: #ffffff;
  border-color: var(--saff-cyan);
  box-shadow: var(--focus);
}

.hl-field.has-error {
  border-color: #ef4444;
}

.hl-field.is-disabled {
  opacity: 0.7;
}

.hl-backdrop,
.hl-input {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  border: 0;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: normal;
  word-spacing: normal;
  tab-size: 4;
  text-transform: none;
}

.hl-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--saff-navy);
}

.hl-content {
  min-height: 100%;
}

.hl-field.is-multi .hl-content {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}

.hl-field.is-single .hl-content {
  white-space: pre;
  width: max-content;
  min-width: 100%;
}

.hl-input {
  position: relative;
  display: block;
  background: transparent;
  color: transparent;
  caret-color: var(--saff-navy);
  outline: none;
  resize: none;
  -webkit-text-fill-color: transparent;
}

.hl-field.is-multi .hl-input {
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}

.hl-field.is-single .hl-input {
  height: 48px;
  white-space: pre;
}

.hl-input::placeholder {
  color: var(--faint);
  -webkit-text-fill-color: var(--faint);
}

.hl-input::selection {
  background: rgba(3, 161, 208, 0.28);
  -webkit-text-fill-color: transparent;
}

.hl-attr,
.hl-attr-bad {
  border-radius: 4px;
  font-style: normal;
}

.hl-attr {
  background: #e0f2fe;
  color: #0369a1;
  box-shadow: 0 0 0 1px #bae6fd;
}

.hl-attr-bad {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 0 0 1px #fca5a5;
  text-decoration: underline wavy #ef4444;
}

.hl-bold {
  color: #7c3aed;
  font-style: normal;
}

.hl-bullet {
  color: #d97706;
  font-style: normal;
}

.hl-link {
  color: #047857;
  text-decoration: underline;
  font-style: normal;
}

.hl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.hl-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hl-legend i {
  padding: 0 3px;
  font-size: 12px;
}

.et-button-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--hair);
  border-radius: 14px;
  background: #fcfdfe;
}

.et-button-box .user-form-group {
  margin: 0;
}

.et-button-box-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hl-button {
  background: #072b5f;
  color: #ffffff;
  border-radius: 5px;
  box-shadow: 0 0 0 1px #072b5f;
  font-style: normal;
}

.hl-button .hl-attr,
.hl-button .hl-attr-bad {
  background: transparent;
  color: #7dd3fc;
  box-shadow: none;
}

.et-inline-warn {
  margin-top: 8px;
  font-size: 13px;
}

.et-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(7, 43, 95, 0.4);
  animation: gs-fade 0.15s ease-out;
}

.et-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(7, 43, 95, 0.2);
  animation: et-sheet-up 0.2s ease-out;
}

.et-sheet .portal-modal-title,
.et-sheet .portal-modal-desc {
  margin: 0;
}

.et-sheet .user-form-group {
  margin: 0;
}

.et-sheet .user-form-input {
  font-size: 16px;
}

.et-sheet-handle {
  align-self: center;
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: #cbd5e1;
}

.et-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.et-sheet-picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.et-sheet-picks-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.et-sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.et-sheet-chip {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--saff-navy);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.et-sheet-chip.active {
  border-color: var(--saff-cyan);
  background: #e0f2fe;
  color: #0369a1;
}

.et-sheet-preview {
  display: flex;
  justify-content: center;
  padding: 14px;
  border-radius: 12px;
  background: #f1f5f9;
}

.et-sheet-preview span {
  display: inline-block;
  max-width: 100%;
  padding: 12px 22px;
  border-radius: 10px;
  background: var(--saff-navy);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.et-sheet-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

.et-sheet-actions button {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

@keyframes et-sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (min-width: 768px) {
  .et-sheet-backdrop {
    align-items: center;
    padding: 16px;
  }

  .et-sheet {
    max-width: 480px;
    padding: 22px 24px;
    border-radius: 18px;
  }

  .et-sheet-handle {
    display: none;
  }

  .et-sheet-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .et-sheet-actions button {
    width: auto;
    padding: 0 22px;
  }
}

.et-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.et-head-text {
  flex: 1;
  min-width: 0;
}

.et-head-text .portal-board-title {
  margin: 0;
}

.et-head-text .portal-board-sub {
  margin: 4px 0 0;
}

.et-head .et-new-btn {
  flex-shrink: 0;
  width: auto;
  min-height: 44px;
  padding: 0 16px;
  gap: 6px;
}

.et-new-long {
  display: none;
}

@media (min-width: 768px) {
  .et-head {
    margin-bottom: 20px;
  }

  .et-head .et-new-btn {
    padding: 0 20px;
  }

  .et-new-long {
    display: inline;
  }

  .et-new-short {
    display: none;
  }
}

.re {
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: #ffffff;
  min-width: 0;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.re:focus-within {
  border-color: var(--saff-cyan);
  box-shadow: var(--focus);
}

.re.has-error {
  border-color: #ef4444;
}

.re.is-disabled {
  opacity: 0.7;
}

.re-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid var(--hair);
  background: #f8fafc;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.re-tool {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--saff-navy);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.re-tool:hover {
  background: #ffffff;
  border-color: var(--hair);
}

.re-tool.is-on {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

.re-tool:disabled {
  opacity: 0.5;
  cursor: default;
}

.re-tool-wide {
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.re-b {
  font-weight: 800;
}

.re-i {
  font-style: italic;
  font-family: Georgia, serif;
}

.re-u {
  text-decoration: underline;
}

.re-s {
  text-decoration: line-through;
}

.re-sep {
  flex-shrink: 0;
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: var(--hair);
}

.re-toolbar-end {
  margin-left: auto;
  padding-left: 6px;
  flex-shrink: 0;
}

.re-html {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border-color: var(--hair);
  background: #ffffff;
}

.re-extra {
  padding: 8px;
  border-bottom: 1px solid var(--hair);
  background: #fcfdfe;
}

.re-extra .user-form-group {
  margin: 0;
}

.re-content {
  min-height: 280px;
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.6;
  color: #334155;
  outline: none;
  overflow-wrap: break-word;
}

.re-content:empty::before {
  content: attr(data-placeholder);
  color: var(--faint);
}

.re-content p,
.re-content div {
  margin: 0 0 14px;
}

.re-content h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.3;
  color: var(--saff-navy);
}

.re-content h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
  color: var(--saff-navy);
}

.re-content ul,
.re-content ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.re-content li {
  margin: 0 0 6px;
}

.re-content blockquote {
  margin: 0 0 14px;
  padding: 8px 14px;
  border-left: 3px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.re-content hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 18px 0;
}

.re-content a {
  color: #0369a1;
  text-decoration: underline;
  cursor: text;
}

.re-content a[data-button] {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--saff-navy);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.re-content .re-chip {
  display: inline;
  padding: 0 2px;
  border-radius: 5px;
  font-size: 0.95em;
  white-space: nowrap;
  user-select: all;
}

.re-content a[data-button] .re-chip {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: none;
}

.re .hl-field {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #0f172a;
}

.re .hl-field.is-code .hl-backdrop,
.re .hl-field.is-code .hl-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
}

.re .hl-field.is-code .hl-backdrop {
  color: #e2e8f0;
}

.re .hl-field.is-code .hl-input {
  caret-color: #ffffff;
}

.hl-tag {
  color: #f472b6;
}

.hl-entity {
  color: #fbbf24;
}

.re .hl-field.is-code .hl-attr {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  box-shadow: none;
}

@media (min-width: 768px) {
  .re-content {
    padding: 18px 22px;
  }
}

.re-content h2,
.re-content h3 {
  font-weight: 700;
}

.re-content ul {
  list-style: disc;
}

.re-content ol {
  list-style: decimal;
}

.re-content li {
  display: list-item;
}

.re-content strong,
.re-content b {
  font-weight: 700;
}

.re-content em,
.re-content i {
  font-style: italic;
}

.re-content u {
  text-decoration: underline;
}

.re-content s,
.re-content strike {
  text-decoration: line-through;
}

.re-toolbar {
  flex-wrap: wrap;
  overflow: visible;
  row-gap: 4px;
}

.re-tool {
  min-width: 44px;
  height: 44px;
}

.re-sep {
  display: none;
}

@media (min-width: 768px) {
  .re-sep {
    display: inline-block;
  }
}

.ap-sheet {
  gap: 12px;
  height: 88vh;
  overflow: hidden;
  padding-bottom: 0;
}

.ap-search {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ap-search svg {
  position: absolute;
  left: 14px;
  color: var(--faint);
  pointer-events: none;
}

.ap-search-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 16px;
  color: var(--saff-navy);
  outline: none;
}

.ap-search-input:focus {
  background: #ffffff;
  border-color: var(--saff-cyan);
  box-shadow: var(--focus);
}

.ap-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -16px;
  padding: 0 10px calc(16px + env(safe-area-inset-bottom));
}

.ap-group + .ap-group {
  margin-top: 6px;
}

.ap-group-title {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 8px 6px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ap-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.ap-item.active {
  background: #e0f2fe;
  border-color: #bae6fd;
}

.ap-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.ap-item-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--saff-navy);
}

.ap-item-token {
  padding: 1px 7px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ap-item.active .ap-item-token {
  background: #ffffff;
}

.ap-item-desc {
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
}

.ap-item-sample {
  font-size: 12px;
  color: var(--faint);
  overflow-wrap: anywhere;
}

.ap-item-sample em {
  font-style: normal;
  color: var(--muted);
}

.ap-empty {
  padding: 24px 8px;
  text-align: center;
  color: var(--muted);
}

.re-tool-attr {
  color: #0369a1;
  background: #e0f2fe;
  border-color: #bae6fd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.re-tool-attr:hover {
  background: #bae6fd;
}

.et-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.et-field-head .user-form-label {
  margin-bottom: 0;
}

.et-insert-attr {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.et-insert-attr:hover {
  background: #bae6fd;
}

@media (min-width: 768px) {
  .ap-sheet {
    max-width: 620px;
    height: 80vh;
    padding-bottom: 0;
  }

  .ap-list {
    margin: 0 -24px;
    padding: 0 16px 18px;
  }
}

.br-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.br-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
  min-width: 0;
}

.br-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hair);
}

.br-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.br-section .user-form-group {
  margin: 0;
}

.br-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--saff-navy);
}

.br-logo-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.br-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px dashed var(--hair);
  border-radius: 12px;
  background: repeating-conic-gradient(#f8fafc 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
}

.br-logo-box img {
  max-width: 100%;
  height: auto;
}

.br-logo-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.br-logo-actions {
  display: flex;
  gap: 8px;
}

.br-logo-actions .btn-saff-ghost {
  flex: 1;
  min-height: 44px;
  justify-content: center;
}

.br-seg {
  display: flex;
  width: 100%;
}

.br-seg button {
  flex: 1;
  min-height: 44px;
}

.br-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.br-color {
  display: flex;
  align-items: center;
  gap: 10px;
}

.br-color input[type="color"] {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  padding: 3px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

.br-color .user-form-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  text-transform: lowercase;
}

.br-company {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--hair);
  font-size: 13px;
  color: var(--muted);
}

.br-company strong {
  font-size: 14px;
  color: var(--saff-navy);
}

.br-form .user-form-input {
  font-size: 16px;
}

.br-note {
  min-height: 84px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
}

.br-preview {
  padding: 16px;
}

@media (min-width: 768px) {
  .br-logo-row {
    flex-direction: row;
    align-items: center;
  }

  .br-logo-box {
    flex: 1;
  }

  .br-logo-actions {
    flex-direction: column;
  }

  .br-seg {
    width: auto;
    display: inline-flex;
  }

  .br-seg button {
    flex: 0 0 auto;
    padding: 0 18px;
  }

  .br-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .br-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .br-preview {
    position: sticky;
    top: 88px;
  }
}

.et-preview-as {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.et-preview-as .user-form-group {
  margin: 0;
}

.et-test {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}

.et-test .user-form-label {
  margin: 0;
}

.et-test-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.et-test-row .user-form-input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
}

.et-test-row .btn-saff-primary {
  min-height: 46px;
  justify-content: center;
}

@media (min-width: 480px) {
  .et-test-row {
    flex-direction: row;
  }

  .et-test-row .btn-saff-primary {
    flex-shrink: 0;
    padding: 0 18px;
  }
}

.dl-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: #fcfdfe;
}

.dl-panel .user-form-group {
  margin: 0;
}

.dl-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.dl-chip {
  min-height: 34px;
  padding: 0 10px;
  border: 1px dashed #bae6fd;
  border-radius: 999px;
  background: #ffffff;
  color: #0369a1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  cursor: pointer;
}

.dl-chip.is-on {
  border-style: solid;
  background: #e0f2fe;
}

.dl-attach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dl-attach-head .user-form-label {
  margin: 0;
}

.dl-attach-count {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.dl-files {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dl-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #ffffff;
  min-width: 0;
}

.dl-file.is-missing {
  border-color: #fca5a5;
  background: #fef2f2;
}

.dl-file-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.dl-file-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.dl-file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--saff-navy);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

a.dl-file-name:hover {
  color: #0369a1;
  text-decoration: underline;
}

.dl-file-main small {
  font-size: 12px;
  color: var(--muted);
}

.dl-file-remove {
  flex-shrink: 0;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.dl-file-remove:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.dl-file-remove.is-confirm {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.dl-add {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  border-style: dashed;
}

.et-log-meta + .et-log-meta {
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .dl-add {
    width: auto;
    padding: 0 18px;
  }
}

.bp-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.bp-head-text {
  min-width: 0;
}

.bp-head-text .portal-board-title {
  margin: 0;
}

.bp-head-text .portal-board-sub {
  margin: 6px 0 0;
}

.bp-head-actions .btn-saff-ghost {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.bp-status {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.bp-status.is-draft {
  background: #f1f5f9;
  color: #475569;
}

.bp-status.is-scheduled {
  background: #fef3c7;
  color: #92400e;
}

.bp-status.is-live {
  background: #dcfce7;
  color: #15803d;
}

.bp-status.is-archived {
  background: #ede9fe;
  color: #6d28d9;
}

.bp-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.bp-main,
.bp-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.bp-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 16px;
}

.bp-card .user-form-group {
  margin: 0;
}

.bp-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--saff-navy);
}

.bp-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.bp-card .user-form-input,
.bp-card .bp-slug input {
  font-size: 16px;
}

.bp-title {
  font-size: 18px !important;
  font-weight: 700;
}

.bp-textarea {
  min-height: 84px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
  height: auto;
}

.bp-counter {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
}

.bp-counter.is-ok {
  color: #15803d;
}

.bp-counter.is-warn {
  color: #b45309;
}

.bp-counter.is-bad {
  color: #b91c1c;
}

.bp-slug {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}

.bp-slug.has-error {
  border-color: #ef4444;
}

.bp-slug:focus-within {
  border-color: var(--saff-cyan);
  box-shadow: var(--focus);
  background: #ffffff;
}

.bp-slug span {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  max-width: 55%;
  padding: 0 4px 0 12px;
  color: var(--faint);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
  text-align: left;
}

.bp-slug input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 12px 0 0;
  border: 0;
  background: transparent;
  color: var(--saff-navy);
  outline: none;
}

.bp-sub-label {
  margin-top: 10px;
}

.bp-cover {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-cover img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--hair);
}

.bp-cover-actions {
  display: flex;
  gap: 8px;
}

.bp-cover-actions .btn-saff-ghost {
  flex: 1;
  min-height: 44px;
  justify-content: center;
}

.bp-cover-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 26px 16px;
  border: 2px dashed var(--hair);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--saff-navy);
  cursor: pointer;
}

.bp-cover-empty span {
  font-size: 28px;
}

.bp-cover-empty small {
  color: var(--muted);
}

.bp-faq {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #fcfdfe;
}

.bp-faq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.bp-og {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bp-og img {
  width: 96px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--hair);
}

.bp-og-empty {
  font-size: 13px;
  color: var(--muted);
}

.bp-og .btn-saff-ghost {
  min-height: 40px;
}

.bp-when {
  gap: 10px;
}

.bp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-actions button {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.bp-preview-link {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.bp-preview-link input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: #f8fafc;
  font-size: 12px;
  color: var(--muted);
}

.bp-preview-link .btn-saff-ghost {
  flex-shrink: 0;
  min-height: 40px;
}

.bp-danger-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
}

.bp-link-btn {
  min-height: 44px;
  padding: 0 4px;
}

.bp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.bp-tag {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bp-tag.is-new {
  border-style: dashed;
}

.bp-newtag {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.bp-newtag .user-form-input {
  flex: 1;
  min-width: 0;
}

.bp-newtag .btn-saff-ghost {
  flex-shrink: 0;
  min-height: 46px;
}

.seo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.seo-score {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.seo-score.is-good {
  background: #dcfce7;
  color: #15803d;
}

.seo-score.is-ok {
  background: #fef3c7;
  color: #92400e;
}

.seo-score.is-low {
  background: #fee2e2;
  color: #b91c1c;
}

.seo-snippet {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #ffffff;
  min-width: 0;
}

.seo-snippet small {
  color: #15803d;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.seo-snippet strong {
  color: #1a0dab;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.seo-snippet p {
  margin: 0;
  color: #4d5156;
  font-size: 13px;
  line-height: 1.5;
}

.seo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seo-list li {
  display: flex;
  gap: 10px;
  font-size: 13px;
}

.seo-list li > span {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
}

.seo-list li.is-ok > span {
  background: #16a34a;
}

.seo-list li.is-warn > span {
  background: #f59e0b;
}

.seo-list li.is-bad > span {
  background: #ef4444;
}

.seo-list strong {
  display: block;
  font-weight: 600;
  color: var(--saff-navy);
}

.seo-list small {
  color: var(--muted);
}

.seo-foot {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
}

.rbe-table-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--hair);
  background: #eff6ff;
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
}

.rbe-content {
  min-height: 360px;
}

.rbe-content h2 {
  margin: 26px 0 12px;
  padding-left: 14px;
  border-left: 4px solid #2563eb;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

.rbe-content h3 {
  margin: 22px 0 10px;
  padding-left: 14px;
  border-left: 4px solid #93c5fd;
  font-size: 19px;
  font-weight: 700;
  color: #1a1a2e;
}

.rbe-content h4 {
  margin: 18px 0 8px;
  font-size: 17px;
  font-weight: 700;
}

.rbe-content blockquote {
  border-left-color: #7c3aed;
  background: #f8f7ff;
  font-style: italic;
}

.rbe-content figure {
  margin: 18px 0;
  cursor: pointer;
  border-radius: 12px;
  outline: 2px solid transparent;
  transition: outline-color 0.15s;
}

.rbe-content figure:hover {
  outline-color: #bae6fd;
}

.rbe-content figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.rbe-content figcaption {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.rbe-video {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
}

.rbe-video-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.75;
}

.rbe-video-thumb--vimeo {
  background: linear-gradient(135deg, #1ab7ea, #0f172a);
}

.rbe-video-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.rbe-content table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.rbe-content th {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 12px;
  text-align: left;
  min-width: 90px;
}

.rbe-content td {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  min-width: 90px;
}

.rbe-content [data-cta] {
  margin: 20px 0;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0b1329 0%, #1e293b 100%);
  color: #cbd5e1;
}

.rbe-content [data-cta] h2,
.rbe-content [data-cta] h3,
.rbe-content [data-cta] h4 {
  color: #ffffff;
  border-left: 0;
  padding-left: 0;
  margin-top: 0;
}

.rbe-content [data-cta] a[data-button] {
  background: #2563eb;
}

.rbe-modal-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--hair);
}

.ml {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.ml-sheet {
  height: 90vh;
}

.ml-sheet .ml {
  flex: 1;
  overflow: hidden;
}

.ml-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ml-search {
  position: relative;
  display: flex;
  align-items: center;
}

.ml-search svg {
  position: absolute;
  left: 12px;
  color: var(--faint);
}

.ml-search input {
  width: 100%;
  height: 46px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 16px;
  outline: none;
}

.ml-search input:focus {
  border-color: var(--saff-cyan);
  background: #ffffff;
}

.ml-upload {
  min-height: 46px;
  justify-content: center;
}

.ml-error {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}

.ml-body {
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
}

.ml-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ml-item {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #f1f5f9;
  overflow: hidden;
  cursor: pointer;
}

.ml-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ml-item.is-selected {
  border-color: var(--saff-cyan);
  box-shadow: 0 0 0 3px rgba(3, 161, 208, 0.25);
}

.ml-flag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
}

.ml-empty {
  grid-column: 1 / -1;
  padding: 30px 10px;
  text-align: center;
  color: var(--muted);
}

.ml-more {
  width: 100%;
  margin-top: 10px;
  min-height: 44px;
  justify-content: center;
}

.ml-detail {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: #fcfdfe;
}

.ml-detail-img {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 10px;
}

.ml-detail-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ml-detail-name {
  font-size: 14px;
  color: var(--saff-navy);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ml-detail-main small {
  color: var(--muted);
  font-size: 12px;
}

.ml-detail-main .user-form-input {
  font-size: 16px;
}

.ml-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ml-detail-actions > * {
  min-height: 44px;
  justify-content: center;
}

.ml-page {
  padding: 16px;
}

.bl-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.bl-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: #ffffff;
  color: var(--saff-navy);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.bl-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.bl-tabs button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bl-tabs button span {
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 11px;
}

.bl-tabs button.active {
  border-color: var(--saff-navy);
  background: var(--saff-navy);
  color: #ffffff;
}

.bl-tabs button.active span {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.bl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bl-row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.bl-row-link:hover {
  border-color: #bae6fd;
}

.bl-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #f1f5f9;
  overflow: hidden;
  font-size: 20px;
}

.bl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bl-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.bl-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--saff-navy);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}

.bl-slug {
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 16px;
  text-align: center;
}

.bl-empty span {
  font-size: 34px;
}

.bl-empty p {
  margin: 0;
  color: var(--muted);
}

.bs-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hair);
}

.bs-row:last-child {
  border-bottom: 0;
}

.bs-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 100%;
  min-width: 0;
}

.bs-main strong {
  font-size: 15px;
  color: var(--saff-navy);
}

.bs-main small {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.bs-row .et-section-count {
  margin-left: 0;
  margin-right: auto;
}

.bs-btn {
  min-height: 40px;
  min-width: 44px;
  justify-content: center;
}

.bs-photo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bs-photo img,
.bs-photo > span {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  font-size: 24px;
}

.bs-photo .btn-saff-ghost {
  min-height: 40px;
}

@media (min-width: 768px) {
  .bp-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .bp-head-actions .btn-saff-ghost {
    width: auto;
    padding: 0 18px;
  }

  .bp-card {
    padding: 20px;
  }

  .ml-bar {
    flex-direction: row;
  }

  .ml-search {
    flex: 1;
  }

  .ml-upload {
    flex-shrink: 0;
    padding: 0 18px;
  }

  .ml-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .ml-sheet {
    max-width: 820px;
    height: 84vh;
  }

  .bs-main {
    flex: 1 1 auto;
  }

  .bs-row .et-section-count {
    margin-right: 0;
  }
}

@media (min-width: 1100px) {
  .bp-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }

  .bp-side {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-bottom: 8px;
  }
}

.bp-slug span {
  flex-shrink: 0;
  max-width: none;
  padding: 0 2px 0 12px;
  direction: ltr;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.rv-sheet {
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
}

.rv-back {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--saff-navy);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.rv-empty {
  padding: 18px 4px;
  color: var(--muted);
  font-size: 15px;
}

.rv-list {
  list-style: none;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
}

.rv-item {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.rv-item:hover,
.rv-item:focus-visible {
  border-color: var(--saff-cyan);
  background: var(--saff-sky-light);
}

.rv-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rv-item-main strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.rv-item-main span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.rv-current {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--emerald-bg);
  color: #047857 !important;
  font-size: 11px !important;
  font-weight: 700;
}

.rv-item-go {
  flex-shrink: 0;
  color: var(--faint);
  font-size: 22px;
}

.rv-detail-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.rv-detail-head span {
  color: var(--muted);
  font-size: 13px;
}

.rv-preview {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding: 14px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--saff-sky-light);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.rv-preview h2 {
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  margin-bottom: 8px;
}

.rv-excerpt {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.rv-body {
  font-size: 14px;
  line-height: 1.65;
}

.rv-body > * + * {
  margin-top: 8px;
}

.rv-body h2,
.rv-body h3,
.rv-body h4 {
  font-size: 15px;
  margin-top: 14px;
}

.rv-body ul,
.rv-body ol {
  padding-left: 20px;
}

.rv-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.rv-body table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 13px;
}

.rv-body th,
.rv-body td {
  border: 1px solid var(--hair);
  padding: 4px 8px;
}

.rv-body [data-cta] {
  padding: 12px;
  border-radius: 10px;
  background: var(--saff-navy);
  color: #fff;
}

.rv-body figure[data-video]::before {
  content: "▶ Video";
  display: block;
  padding: 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
}

.rv-open {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
}

.rv-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.rv-banner .btn-saff-ghost {
  min-height: 40px;
}

.vw-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.vw-tile {
  min-width: 0;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--saff-sky-light);
  text-align: center;
}

.vw-tile strong {
  display: block;
  color: var(--saff-navy);
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: 800;
  line-height: 1.2;
}

.vw-tile span {
  color: var(--muted);
  font-size: 12px;
}

.vw-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 84px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--hair);
}

.vw-bar {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.vw-bar span {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--saff-cyan);
  transition: background 0.15s;
}

.vw-bar span.is-zero {
  background: var(--hair);
}

.vw-bar.is-active span,
.vw-bar:focus-visible span {
  background: var(--saff-navy);
}

.vw-axis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--faint);
  font-size: 12px;
}

.vw-readout {
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}

.sb-head-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.sb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
}

.sb-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-row-main strong {
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.sb-row-main span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.sb-pill {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--emerald-bg);
  color: #047857;
}

.sb-pill.is-off {
  background: var(--rose-bg);
  color: #b91c1c;
}

.sb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.sb-actions > * {
  min-height: 44px;
}

@media (max-width: 767px) {
  .sb-actions > * {
    flex: 1 1 100%;
    justify-content: center;
  }
}

.sb-row {
  flex-wrap: wrap;
}

.sb-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.sb-row-actions .bp-link-btn {
  min-height: 44px;
}

@media (max-width: 767px) {
  .sb-row-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
.be-page {
  --be-bar-h: 112px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding-bottom: 88px;
}

.be-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: -16px -14px 0;
  padding: 10px 14px 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hair);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.be-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.be-back {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: #ffffff;
  color: var(--saff-navy);
  transition: background 0.15s, border-color 0.15s;
}

.be-back:hover {
  background: var(--saff-sky);
  border-color: rgba(3, 161, 208, 0.35);
}

.be-bar-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.be-bar-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: clamp(0.95rem, 3.6vw, 1.15rem);
  font-weight: 800;
}

.be-bar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}

.be-save-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.be-save-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.be-save-state.is-saved::before {
  background: var(--emerald);
}

.be-save-state.is-dirty {
  color: #b45309;
}

.be-save-state.is-dirty::before {
  background: var(--amber);
}

.be-save-state.is-busy::before {
  background: var(--saff-cyan);
  animation: be-pulse 0.9s ease-in-out infinite;
}

@keyframes be-pulse {
  50% {
    opacity: 0.3;
  }
}

.be-bar-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.be-preview {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  justify-content: center;
}

.be-preview span,
.be-desktop-actions {
  display: none;
}

.be-tabs {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.be-tabs::-webkit-scrollbar {
  display: none;
}

.be-tab {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.be-tab:hover {
  color: var(--saff-navy);
}

.be-tab.active {
  color: var(--saff-navy);
  border-bottom-color: var(--saff-cyan);
}

.be-tab.has-error {
  color: #b91c1c;
}

.be-tab-long {
  display: none;
}

.be-tab-badge {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--saff-sky);
  color: var(--saff-navy);
  font-size: 11px;
  text-align: center;
}

.be-tab-badge.is-good {
  background: var(--emerald-bg);
  color: #047857;
}

.be-tab-badge.is-ok {
  background: var(--amber-bg);
  color: #b45309;
}

.be-tab-badge.is-low {
  background: var(--rose-bg);
  color: #b91c1c;
}

.be-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
}

.be-write,
.be-narrow {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.be-title-input {
  width: 100%;
  min-height: 52px;
  padding: 6px 2px;
  border: 0;
  border-bottom: 2px solid var(--hair);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  outline: none;
  transition: border-color 0.15s;
}

.be-title-input:focus {
  border-bottom-color: var(--saff-cyan);
}

.be-title-input.has-error {
  border-bottom-color: var(--rose);
}

.be-title-input::placeholder {
  color: #b6c3d4;
}

.be-slug-line {
  margin-top: -8px;
  min-width: 0;
}

.be-slug-view {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.be-slug-url {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 13px;
}

.be-slug-edit-btn {
  flex-shrink: 0;
  color: var(--saff-cyan);
  font-size: 13px;
  font-weight: 700;
}

.be-slug-edit {
  margin: 0;
}

.be-cover {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--saff-sky-light);
}

.be-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: #e2e8f0;
}

.be-cover-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.be-cover-actions {
  display: flex;
  gap: 8px;
}

.be-cover-actions .btn-saff-ghost {
  flex: 1;
  min-height: 44px;
  justify-content: center;
}

.be-cover-empty {
  min-height: 120px;
}

.be-words {
  margin-left: auto;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}

.be-page .user-form-label:has(.be-words) {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.be-page .re.rbe {
  overflow: visible;
}

.be-page .re.rbe .re-toolbar {
  position: sticky;
  top: var(--be-bar-h);
  z-index: 30;
  border-radius: 14px 14px 0 0;
}

.be-page .rbe-table-bar {
  position: sticky;
  top: calc(var(--be-bar-h) + 52px);
  z-index: 29;
}

.be-page .rbe-content {
  min-height: 55vh;
  font-size: 17px;
  line-height: 1.75;
}

.be-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(3, 161, 208, 0.45);
  border-radius: 14px;
  background: var(--saff-sky-light);
  color: var(--ink);
  font-weight: 700;
}

.be-next > span {
  width: 100%;
}

.be-next .btn-saff-ghost {
  flex: 1 1 200px;
  min-height: 44px;
  justify-content: center;
}

.be-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.be-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.be-advanced {
  border-top: 1px solid var(--hair);
  padding-top: 6px;
}

.be-advanced summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--saff-navy);
  font-weight: 700;
  cursor: pointer;
}

.be-advanced[open] summary {
  margin-bottom: 10px;
}

.be-advanced .user-form-group {
  margin-bottom: 12px;
}

.be-danger {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

.be-danger .btn-saff-ghost {
  flex: 1 1 140px;
  min-height: 44px;
  justify-content: center;
}

.be-mobile-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hair);
  box-shadow: 0 -6px 20px rgba(7, 43, 95, 0.08);
}

.be-mobile-actions button {
  flex: 1;
  min-height: 48px;
  justify-content: center;
}

@media (min-width: 769px) {
  .be-mobile-actions {
    display: none;
  }

  .be-page {
    padding-bottom: 24px;
  }

  .be-desktop-actions {
    display: inline-flex;
    gap: 8px;
  }

  .be-desktop-actions button {
    min-height: 44px;
    padding: 0 20px;
    white-space: nowrap;
  }

  .be-preview span {
    display: inline;
  }

  .be-bar {
    margin: -30px -28px 0;
    padding: 14px 28px 0;
  }

  .be-tab-long {
    display: inline;
  }

  .be-tab-short {
    display: none;
  }

  .be-cover {
    flex-direction: row;
    align-items: flex-start;
  }

  .be-cover img {
    width: 260px;
    flex-shrink: 0;
  }

  .be-cover-side {
    flex: 1;
  }

  .be-cover-actions .btn-saff-ghost {
    flex: 0 0 auto;
    padding: 0 18px;
  }

  .be-next > span {
    width: auto;
    margin-right: 6px;
  }

  .be-next .btn-saff-ghost {
    flex: 0 0 auto;
    padding: 0 16px;
  }
}

@media (min-width: 1024px) {
  .be-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

body:has(.be-page) {
  overflow-x: clip;
  overflow-y: visible;
}
@media (max-width: 768px) {
  .be-page .re.rbe .re-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .be-page .re.rbe .re-toolbar::-webkit-scrollbar {
    display: none;
  }

  .be-page .re.rbe .re-toolbar .re-tool,
  .be-page .re.rbe .re-toolbar .re-sep,
  .be-page .re.rbe .re-toolbar-end {
    flex-shrink: 0;
  }

  .be-page .rbe-table-bar {
    top: calc(var(--be-bar-h) + 58px);
  }

  .be-tab {
    flex: 1 0 auto;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
    font-size: 13px;
  }

  .be-tab-badge {
    min-width: 0;
    padding: 1px 5px;
  }
}
.be-cover-zoom {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  overflow: hidden;
  cursor: zoom-in;
}

.be-cover .be-cover-zoom img {
  width: 100%;
  transition: transform 0.25s ease;
}

.be-cover-zoom:hover img,
.be-cover-zoom:focus-visible img {
  transform: scale(1.03);
}

.be-cover-zoom:focus-visible {
  box-shadow: var(--focus);
}

.be-cover-zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(7, 43, 95, 0.82);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.lb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(4, 27, 61, 0.88);
  animation: lb-in 0.18s ease-out;
}

@keyframes lb-in {
  from {
    opacity: 0;
  }
}

.lb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s;
}

.lb-close:hover,
.lb-close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(1200px, 100%);
  max-height: 100%;
  margin: 0;
  min-width: 0;
}

.lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: lb-zoom 0.2s ease-out;
}

@keyframes lb-zoom {
  from {
    transform: scale(0.96);
  }
}

.lb-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  max-width: 100%;
  color: #e2e8f0;
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

.lb-actions .btn-saff-ghost {
  min-height: 44px;
  padding: 0 18px;
}

@media (min-width: 769px) {
  .be-cover-zoom {
    width: 260px;
    flex-shrink: 0;
  }
}