/**
 * SadiFlow Design System
 * Professional business UI — top navigation, no sidebar.
 * See design.md for token definitions.
 */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* SadiFlow brand — primary blue #0B57D0 + logo navy */
  --color-brand-blue: #0b57d0;
  --color-brand-blue-hover: #0948ad;
  --color-brand-blue-active: #083d9a;
  --color-brand-navy: #051221;
  --color-primary: var(--color-brand-blue);
  --color-primary-hover: var(--color-brand-blue-hover);
  --color-secondary: #5f6368;
  --color-accent-red: #c5221f;
  --color-accent-green: #188038;
  --color-accent-yellow: #b06000;
  --color-background: #f5f6f8;
  --color-surface: #ffffff;
  --sf-surface-elevated: #ffffff;
  --sf-surface-muted: #f3f4f6;
  --color-tint: #eef0f3;
  --color-tint-strong: #e6e8ec;
  --color-border: #e3e5ea;
  --color-text: #1a1f26;
  --color-text-muted: #4b5563;
  --color-text-inverse: #ffffff;

  /* Status colors */
  --status-planning: #5f6368;
  --status-active: #0b57d0;
  --status-on-hold: #b06000;
  --status-at-risk: #c5221f;
  --status-completed: #188038;
  --status-archived: #80868b;
  --status-backlog: #80868b;
  --status-todo: #0b57d0;
  --status-in-progress: #b06000;
  --status-in-review: #9334e6;
  --status-blocked: #c5221f;

  /* Typography */
  --font-family-base: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-size-base: 0.875rem;
  --font-size-sm: 0.8125rem;
  --font-size-xs: 0.75rem;
  --font-size-h1: 1.5rem;
  --font-size-h2: 1.25rem;
  --font-size-h3: 1.125rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --line-height-base: 1.5;

  /* Spacing (4px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.5rem;    /* 24px */
  --space-6: 2rem;      /* 32px */
  --space-7: 3rem;      /* 48px */
  --space-8: 4rem;      /* 64px */

  /* Borders & radius */
  --border-width: 1px;
  --border-color: var(--color-border);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(5, 18, 33, 0.06);
  --shadow-md: 0 4px 12px rgba(5, 18, 33, 0.08);
  --shadow-lg: 0 8px 24px rgba(5, 18, 33, 0.1);

  /* Layout */
  --content-max-width: 1280px;
  --navbar-height: 3.75rem;

  /* Breakpoints (for reference in media queries) */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;

  /* Bootstrap overrides */
  --bs-body-font-family: var(--font-family-base);
  --bs-body-font-size: var(--font-size-base);
  --bs-body-color: var(--color-text);
  --bs-body-bg: var(--color-background);
  --bs-primary: var(--color-primary);
  --bs-primary-rgb: 11, 87, 208;
  --bs-secondary-color: var(--color-text-muted);
  --bs-border-color: var(--color-border);
  --bs-border-radius: var(--radius-md);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-link-color: var(--color-primary);
  --bs-link-hover-color: var(--color-primary-hover);
  --bs-focus-ring-color: rgba(11, 87, 208, 0.35);
}

/* --------------------------------------------------------------------------
   Base & accessibility
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-background);
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.sf-skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 1100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  color: var(--color-primary);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

.sf-skip-link:focus {
  top: var(--space-2);
}

h1, .h1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
}

h2, .h2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
}

h3, .h3 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
}

.sf-text-muted {
  color: var(--color-text-muted);
}

.sf-page-header {
  margin-bottom: var(--space-4);
}

.sf-page-header h1 {
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
}

.sf-page-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.sf-dash-header h1 {
  font-size: 1.625rem;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.sf-main {
  flex: 1 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-5);
}

.sf-container {
  max-width: var(--content-max-width);
  margin-inline: auto;
}

.sf-container--wide {
  max-width: none;
  padding-inline: var(--space-4);
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */

.sf-navbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  background-color: var(--color-surface);
  border-bottom: var(--border-width) solid var(--color-border);
  min-height: var(--navbar-height);
  padding-block: 0;
}

.sf-site-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  isolation: isolate;
  flex-shrink: 0;
}

@media (min-width: 992px) {
  .sf-navbar .navbar-collapse,
  .sf-navbar .container-fluid,
  .sf-navbar .sf-container {
    overflow: visible;
  }
}

.sf-navbar .navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-block: var(--space-2);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.sf-navbar .navbar-brand:hover,
.sf-navbar .navbar-brand:focus {
  color: var(--color-text);
}

.sf-navbar .navbar-brand img.sf-brand-lockup__logo {
  height: auto;
  width: auto;
  max-height: 52px;
  max-width: min(220px, 52vw);
}

.sf-navbar .navbar-brand img.sf-brand-lockup__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 11px;
}

.sf-navbar .nav-link {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.sf-navbar .nav-link:hover,
.sf-navbar .nav-link:focus {
  color: var(--color-text);
  background-color: var(--color-tint);
}

.sf-navbar .nav-link.active {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  background-color: var(--color-tint-strong);
}

.sf-navbar .nav-link.sf-nav-link--badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.sf-nav-search-wrap {
  position: relative;
  min-width: 12rem;
  max-width: 16rem;
}

.sf-nav-search {
  min-width: 100%;
}

.sf-nav-search .form-control {
  font-size: var(--font-size-sm);
  padding: var(--space-1) var(--space-3);
}

.sf-nav-search-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 1300;
  max-height: 24rem;
  overflow: auto;
  background: var(--sf-surface-elevated, #fff);
  border: 1px solid var(--sf-border, rgba(0, 0, 0, 0.08));
  border-radius: var(--radius-md, 0.5rem);
  box-shadow: var(--sf-shadow-lg, 0 0.75rem 2rem rgba(15, 23, 42, 0.12));
}

.sf-nav-search-dropdown__group + .sf-nav-search-dropdown__group {
  border-top: 1px solid var(--sf-border, rgba(0, 0, 0, 0.08));
}

.sf-nav-search-dropdown__label {
  padding: 0.45rem 0.75rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sf-text-muted, #64748b);
}

.sf-nav-search-dropdown__item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}

.sf-nav-search-dropdown__item:hover,
.sf-nav-search-dropdown__item.is-active {
  background: var(--sf-surface-muted, rgba(15, 23, 42, 0.04));
}

.sf-nav-search-dropdown__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.sf-nav-search-dropdown__subtitle {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: var(--sf-text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-nav-search-dropdown__empty,
.sf-nav-search-dropdown__more {
  display: block;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
}

.sf-nav-search-dropdown__more {
  border-top: 1px solid var(--sf-border, rgba(0, 0, 0, 0.08));
  text-align: center;
  font-weight: 600;
}

.sf-search-result-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.sf-search-result-link:hover {
  color: var(--sf-primary, #2563eb);
}

.sf-search-results .list-group-item {
  transition: background-color 0.15s ease;
}

.sf-search-results .list-group-item:hover {
  background: var(--sf-surface-muted, rgba(15, 23, 42, 0.03));
}

.sf-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  position: relative;
}

.sf-nav-actions.dropdown.show {
  z-index: 1200;
}

.sf-profile-menu {
  --bs-dropdown-zindex: 1200;
  z-index: 1200 !important;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.sf-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  color: var(--color-text-inverse);
  background-color: var(--color-accent-red);
  border-radius: 999px;
}

.sf-nav-badge:empty,
.sf-nav-badge[data-count="0"] {
  display: none;
}

.sf-profile-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font-size: var(--font-size-base);
}

.sf-profile-toggle:hover,
.sf-profile-toggle:focus-visible {
  background-color: var(--color-background);
  border-color: var(--color-border);
}

.sf-profile-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background-color: var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  flex: 0 0 auto;
}

@media (max-width: 767.98px) {
  /* Avatar-only button on mobile: drop the caret and centre the initial. */
  .sf-profile-toggle {
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    justify-content: center;
    border-radius: var(--radius-md);
  }

  .sf-profile-toggle.dropdown-toggle::after {
    display: none;
  }

  .sf-profile-avatar {
    width: 2rem;
    height: 2rem;
    background-color: rgba(11, 87, 208, 0.12);
    color: var(--color-primary);
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 575.98px) {
  .sf-profile-toggle {
    width: 2.25rem;
    height: 2.25rem;
  }
}

/* --------------------------------------------------------------------------
   Messages / alerts
   -------------------------------------------------------------------------- */

.sf-messages {
  position: fixed;
  top: calc(var(--navbar-height) + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1400;
  width: min(28rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.sf-messages .alert {
  pointer-events: auto;
  font-size: var(--font-size-base);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-sm {
  font-size: var(--font-size-sm);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--color-primary);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--color-primary-hover);
  --bs-btn-hover-border-color: var(--color-primary-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--color-brand-blue-active);
  --bs-btn-active-border-color: var(--color-brand-blue-active);
  --bs-btn-focus-shadow-rgb: 11, 87, 208;
  --bs-btn-disabled-bg: var(--color-primary);
  --bs-btn-disabled-border-color: var(--color-primary);
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(11, 87, 208, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #fff;
  box-shadow: 0 2px 8px rgba(11, 87, 208, 0.35);
}

.btn-primary:active {
  background-color: var(--color-brand-blue-active);
  border-color: var(--color-brand-blue-active);
}

.btn-outline-primary {
  --bs-btn-color: var(--color-primary);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--color-primary);
  --bs-btn-hover-border-color: var(--color-primary-hover);
  --bs-btn-active-bg: var(--color-brand-blue-active);
  --bs-btn-active-border-color: var(--color-brand-blue-active);
  --bs-btn-focus-shadow-rgb: 11, 87, 208;
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--color-primary);
  border-color: var(--color-primary-hover);
  color: #fff;
}

.page-link {
  color: var(--color-primary);
}

.page-item.active .page-link {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.page-link:hover {
  color: var(--color-primary-hover);
}

.btn-secondary,
.btn-outline-secondary {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
  background-color: var(--color-background);
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-danger {
  background-color: var(--color-accent-red);
  border-color: var(--color-accent-red);
}

/* --------------------------------------------------------------------------
   Badges & status
   -------------------------------------------------------------------------- */

.sf-badge,
.badge.sf-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  border-radius: 999px;
  border: var(--border-width) solid transparent;
}

.sf-badge__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sf-badge--planning { color: var(--status-planning); background: rgba(95, 99, 104, 0.12); }
.sf-badge--active { color: var(--status-active); background: rgba(11, 87, 208, 0.12); }
.sf-badge--on-hold { color: var(--status-on-hold); background: rgba(176, 96, 0, 0.12); }
.sf-badge--at-risk { color: var(--status-at-risk); background: rgba(197, 34, 31, 0.12); }
.sf-badge--completed { color: var(--status-completed); background: rgba(24, 128, 56, 0.12); }
.sf-badge--archived { color: var(--status-archived); background: rgba(128, 134, 139, 0.12); }
.sf-badge--backlog { color: var(--status-backlog); background: rgba(128, 134, 139, 0.12); }
.sf-badge--todo { color: var(--status-todo); background: rgba(11, 87, 208, 0.12); }
.sf-badge--in-progress { color: var(--status-in-progress); background: rgba(176, 96, 0, 0.12); }
.sf-badge--in-review { color: var(--status-in-review); background: rgba(147, 52, 230, 0.12); }
.sf-badge--blocked { color: var(--status-blocked); background: rgba(197, 34, 31, 0.12); }

.badge.bg-light {
  background: var(--sf-surface-muted) !important;
  color: var(--color-text) !important;
  border: var(--border-width) solid var(--color-border) !important;
  border-radius: 999px;
  font-weight: var(--font-weight-medium);
}
.sf-badge--scheduled { color: var(--status-planning); background: rgba(95, 99, 104, 0.12); }
.sf-badge--live { color: var(--status-active); background: rgba(11, 87, 208, 0.12); }
.sf-badge--ended { color: var(--status-archived); background: rgba(128, 134, 139, 0.12); }

/* --------------------------------------------------------------------------
   View tabs (tasks)
   -------------------------------------------------------------------------- */

.sf-view-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1);
  background: rgba(5, 18, 33, 0.04);
  border-radius: var(--radius-lg);
}

.sf-view-tabs__item {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.sf-view-tabs__item:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.7);
}

.sf-view-tabs__item.is-active {
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(11, 87, 208, 0.35);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.sf-card,
.card.sf-card {
  background-color: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 20px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.sf-card .card-header {
  background-color: var(--sf-surface-muted, #f4f7fb);
  border-bottom: var(--border-width) solid var(--color-border);
  padding: 0.7rem var(--space-4);
  font-weight: var(--font-weight-semibold);
}

.sf-card .card-body {
  padding: var(--space-4);
  background-color: var(--color-surface);
}

.sf-card .card-footer {
  background-color: var(--sf-surface-muted, #f4f7fb);
  border-top: var(--border-width) solid var(--color-border);
  padding: var(--space-3) var(--space-4);
}

.sf-card .list-group,
.sf-card .sf-inset,
.sf-card .card {
  background: var(--sf-surface-muted, #f4f7fb);
  border-color: var(--color-border);
  box-shadow: none;
}

.sf-card .sf-table-wrap {
  background: #fff;
  box-shadow: none;
}

.sf-card .card {
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.sf-table-wrap {
  overflow-x: auto;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: #fff;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.03),
    0 6px 16px rgba(15, 23, 42, 0.04);
}

.sf-table,
.table.sf-table {
  margin-bottom: 0;
  font-size: var(--font-size-base);
  --bs-table-bg: #fff;
  --bs-table-color: var(--color-text);
  --bs-table-striped-bg: #fff;
  --bs-table-hover-bg: #f7f9fc;
  background-color: #fff;
}

.sf-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #fff;
  border-bottom: var(--border-width) solid var(--color-border);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
  padding: var(--space-2) var(--space-3);
}

.sf-table tbody td {
  padding: var(--space-2) var(--space-3);
  vertical-align: middle;
  border-bottom: var(--border-width) solid var(--color-border);
  background-color: #fff;
}

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

.sf-table--zebra tbody tr:nth-child(even),
.sf-table--zebra tbody tr:nth-child(even) td {
  background-color: #fff;
}

.sf-table tbody tr:hover,
.sf-table tbody tr:hover td {
  background-color: #f7f9fc;
}

.sf-row-title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  text-decoration: none;
}

.sf-row-title:hover {
  color: var(--color-primary);
}

.sf-toolbar {
  background: var(--sf-surface-muted, #f4f7fb);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem 0.35rem;
  margin-bottom: var(--space-4);
}

.sf-toolbar .form-control,
.sf-toolbar .form-select {
  background: var(--color-surface);
}

.sf-empty {
  text-align: center;
  padding: 2.75rem 1.25rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: transparent;
}

.sf-empty h2 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.sf-empty p {
  color: var(--color-text-muted);
  margin-bottom: 0.9rem;
}

.sf-meta-chip,
.sf-person {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--sf-surface-muted, #f4f7fb);
  border: var(--border-width) solid var(--color-border);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

a.sf-quiet,
.btn.sf-quiet {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

a.sf-quiet:hover,
.btn.sf-quiet:hover {
  color: var(--color-primary);
}

.sf-table th.sf-sortable {
  cursor: pointer;
  user-select: none;
}

.sf-table th.sf-sortable:hover {
  color: var(--color-text);
}

.sf-table th.sf-sortable::after {
  content: "";
  display: inline-block;
  width: 0.75rem;
  margin-left: var(--space-1);
  opacity: 0.35;
}

.sf-table th.sf-sortable.sf-sort-asc::after {
  content: "\25B2";
  opacity: 0.7;
}

.sf-table th.sf-sortable.sf-sort-desc::after {
  content: "\25BC";
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.sf-form .form-label {
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

.sf-form .form-label .sf-required {
  color: var(--color-accent-red);
  margin-left: var(--space-1);
}

.sf-form .form-control,
.sf-form .form-select,
.sf-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
.sf-form select,
.sf-form textarea {
  display: block;
  width: 100%;
  font-size: var(--font-size-base);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-surface);
  color: var(--color-text);
}

.sf-form .form-control:focus,
.sf-form .form-select:focus,
.sf-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):focus,
.sf-form select:focus,
.sf-form textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.2);
  outline: none;
}

.sf-form .invalid-feedback,
.sf-form .form-text {
  font-size: var(--font-size-sm);
}

.sf-form-error-summary {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background-color: rgba(197, 34, 31, 0.08);
  border: var(--border-width) solid rgba(197, 34, 31, 0.25);
  border-radius: var(--radius-sm);
  color: var(--color-accent-red);
}

.sf-form-error-summary ul {
  margin-bottom: 0;
  padding-left: var(--space-5);
}

.sf-field-error {
  font-size: var(--font-size-sm);
  color: var(--color-accent-red);
  margin-top: var(--space-1);
}

.sf-form-narrow {
  max-width: 28rem;
}

.sf-form-medium {
  max-width: 36rem;
}

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */

.sf-empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  background-color: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
}

.sf-empty-state h2 {
  font-size: var(--font-size-h3);
  margin-bottom: var(--space-2);
}

.sf-empty-state p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  max-width: 28rem;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Auth & landing pages
   -------------------------------------------------------------------------- */

.sf-auth-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--navbar-height) - var(--space-8));
  padding: var(--space-5) var(--space-4);
}

.sf-auth-card {
  width: 100%;
  max-width: 28rem;
  padding: var(--space-5);
  background-color: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
}

.sf-landing {
  padding: var(--space-7) var(--space-4);
}

.sf-landing__hero {
  max-width: 40rem;
  margin-bottom: var(--space-6);
}

.sf-landing__hero h1 {
  margin-bottom: var(--space-3);
}

.sf-landing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   Error pages
   -------------------------------------------------------------------------- */

.sf-error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--navbar-height) - var(--space-8));
  padding: var(--space-5) var(--space-4);
  text-align: center;
}

.sf-error-page__code {
  font-size: 3rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  line-height: 1;
  margin-bottom: var(--space-3);
}

.sf-error-page h1 {
  margin-bottom: var(--space-2);
}

.sf-error-page p {
  color: var(--color-text-muted);
  max-width: 28rem;
  margin-bottom: var(--space-4);
}

/* --------------------------------------------------------------------------
   Modals (subtle overrides)
   -------------------------------------------------------------------------- */

.modal-content {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.modal-header {
  border-bottom: var(--border-width) solid var(--color-border);
}

.modal-footer {
  border-top: var(--border-width) solid var(--color-border);
}

/* --------------------------------------------------------------------------
   HTMX loading indicator
   -------------------------------------------------------------------------- */

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}

.sf-loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: sf-spin 0.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sf-loading-spinner {
    animation: none;
    border-top-color: var(--color-primary);
  }
}

@keyframes sf-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Responsive utilities
   -------------------------------------------------------------------------- */

/* Always-visible nav cluster (messages, notifications, account).
   Sits outside .navbar-collapse so it stays usable on mobile. */
.sf-nav-cluster {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 992px) {
  /* The cluster precedes .navbar-collapse in the DOM so that mobile renders
     brand | cluster | toggler. Reorder it to the far right on desktop. */
  .sf-navbar .navbar-brand {
    order: 0;
  }

  .sf-navbar .navbar-collapse {
    order: 1;
  }

  .sf-navbar .sf-nav-cluster {
    order: 2;
    margin-left: var(--space-2);
  }

  .sf-navbar .navbar-nav .nav-link {
    padding-inline: var(--space-2);
  }
}

@media (max-width: 991.98px) {
  .sf-nav-cluster {
    margin-left: auto;
    margin-right: 0.25rem;
  }

  /* Toggler: square, aligned with the icon buttons next to it. */
  .sf-navbar .navbar-toggler {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    flex: 0 0 auto;
  }

  .sf-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.18);
  }

  .sf-navbar .navbar-toggler-icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* The collapse becomes a full-width sheet below the bar. */
  .sf-navbar .navbar-collapse {
    flex-basis: 100%;
  }

  /* Bootstrap leaves the open collapse as a block on mobile, so make it a
     flex column: that is what lets the order values below take effect. */
  .sf-navbar .navbar-collapse.show,
  .sf-navbar .navbar-collapse.collapsing {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-inline: -0.75rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--color-surface, #fff);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
    border-radius: 0 0 18px 18px;
    max-height: calc(100vh - var(--navbar-height) - 1rem);
    max-height: calc(100dvh - var(--navbar-height) - 1rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* Search first, then the links, then the primary action. */
  .sf-nav-search-wrap {
    max-width: none;
    width: 100%;
    order: 1;
    margin-bottom: 0.75rem;
  }

  .sf-navbar .navbar-collapse .navbar-nav {
    order: 2;
    flex-shrink: 0;
  }

  .sf-navbar .navbar-collapse .sf-nav-tools {
    order: 3;
  }

  .sf-nav-search-wrap .sf-nav-search {
    margin-right: 0 !important;
  }

  .sf-navbar .navbar-nav {
    width: 100%;
    gap: 0.125rem;
  }

  .sf-navbar .navbar-nav .nav-item {
    width: 100%;
  }

  /* Comfortable touch targets, and space for the badge on the right. */
  .sf-navbar .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    font-weight: var(--font-weight-medium);
  }

  .sf-navbar .nav-link.active {
    background-color: rgba(11, 87, 208, 0.1);
  }

  .sf-navbar .nav-link.btn-primary {
    justify-content: center;
    margin-top: 0.35rem;
    padding: 0.7rem 1rem;
  }

  /* "Meeting now" becomes a full-width primary action at the bottom. */
  .sf-nav-tools {
    border-left: none;
    padding-left: 0;
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
  }

  .sf-nav-meeting-form {
    width: 100%;
  }

  .sf-nav-tools .sf-btn-meeting-now {
    width: 100%;
    padding-block: 0.6rem;
  }
}

/* --------------------------------------------------------------------------
   Settings layout (account pages)
   -------------------------------------------------------------------------- */

.sf-settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-5);
  align-items: start;
}

.sf-settings-nav {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  position: sticky;
  top: var(--space-4);
}

.sf-settings-nav__profile {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-3);
  border-bottom: var(--border-width) solid var(--color-border);
}

.sf-settings-nav__avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  flex-shrink: 0;
}

.sf-settings-nav__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sf-settings-nav__name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
}

.sf-settings-nav__email {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.sf-settings-nav__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sf-settings-nav__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--font-size-base);
}

.sf-settings-nav__link:hover {
  background: var(--color-background);
  color: var(--color-text);
}

.sf-settings-nav__link.is-active {
  background: rgba(11, 87, 208, 0.1);
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

.sf-settings-nav__link--danger.is-active,
.sf-settings-nav__link--danger:hover {
  color: var(--color-accent-red);
  background: rgba(197, 34, 31, 0.08);
}

.sf-settings-main {
  min-width: 0;
}

.sf-profile-photo-preview img,
.sf-profile-photo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: var(--border-width) solid var(--color-border);
}

.sf-profile-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-background);
  font-size: 2rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
}

.sf-card--danger {
  border-color: rgba(197, 34, 31, 0.35);
}

/* --------------------------------------------------------------------------
   Stat cards (dashboard)
   -------------------------------------------------------------------------- */

.sf-stat-card {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}

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

.sf-stat-card__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.sf-stat-card__value {
  font-size: 1.75rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  color: var(--color-text);
}

.sf-stat-card__value--warning {
  color: var(--status-on-hold);
}

.sf-stat-card__value--danger {
  color: var(--color-accent-red);
}

/* --------------------------------------------------------------------------
   Split auth layout
   -------------------------------------------------------------------------- */

.sf-auth-layout--split {
  flex-direction: row;
  align-items: stretch;
  justify-content: stretch;
  min-height: calc(100vh - var(--navbar-height));
  padding: 0;
  max-width: none;
}

.sf-auth-panel--brand {
  flex: 1;
  background: linear-gradient(160deg, #0b57d0 0%, #0948ad 45%, #083d9a 100%);
  padding: var(--space-7) var(--space-6);
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.sf-auth-panel--form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--color-background);
}

.sf-auth-card--flat {
  max-width: 26rem;
  width: 100%;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.sf-auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sf-auth-features li {
  color: rgba(255, 255, 255, 0.85);
  padding: var(--space-2) 0;
  padding-left: var(--space-4);
  position: relative;
  font-size: var(--font-size-base);
}

.sf-auth-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.sf-profile-menu .dropdown-header {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.sf-profile-menu .dropdown-item {
  font-size: var(--font-size-base);
  padding: var(--space-2) var(--space-4);
}

@media (max-width: 991.98px) {
  .sf-settings-layout {
    grid-template-columns: 1fr;
  }

  .sf-settings-nav {
    position: static;
  }

  .sf-settings-nav__links {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* --------------------------------------------------------------------------
   Global UI polish
   -------------------------------------------------------------------------- */

.sf-navbar {
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95) !important;
}

.sf-navbar-brand {
  display: flex;
  align-items: center;
  padding: 0;
  text-decoration: none;
}

.sf-navbar-brand:hover,
.sf-navbar-brand:focus {
  text-decoration: none;
}

/* Brand lockup — official SadiFlow horizontal logo */
.sf-brand-lockup {
  display: inline-flex;
  align-items: center;
}

.sf-brand-lockup__logo {
  display: block;
  height: auto;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  flex-shrink: 0;
}

.sf-brand-lockup__icon {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.sf-brand-lockup--nav-icon .sf-brand-lockup__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 11px;
}

.sf-brand-lockup--icon-only {
  line-height: 0;
}

.sf-brand-lockup--sm .sf-brand-lockup__logo {
  max-height: 36px;
}

.sf-brand-lockup--nav .sf-brand-lockup__logo {
  max-height: 52px;
  max-width: min(220px, 52vw);
}

.sf-brand-lockup--md .sf-brand-lockup__logo,
.sf-brand-lockup:not([class*="--sm"]):not([class*="--lg"]):not([class*="--nav"]) .sf-brand-lockup__logo {
  max-height: 40px;
}

.sf-brand-lockup--lg .sf-brand-lockup__logo {
  max-height: 56px;
  max-width: min(280px, 90vw);
}

.sf-brand-lockup--inverse {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 0.85rem 1.15rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.sf-brand-lockup--inverse .sf-brand-lockup__logo {
  max-height: 52px;
  max-width: min(240px, 85vw);
}

.sf-nav-primary .nav-link {
  font-weight: var(--font-weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.sf-nav-primary .nav-link.active {
  background: rgba(11, 87, 208, 0.1);
  color: var(--color-primary);
}

/* Projects mega-link: hover opens on desktop, tap on mobile. */
.sf-nav-dropdown .dropdown-toggle::after {
  margin-left: 0.35em;
  vertical-align: 0.15em;
}

.sf-nav-dropdown__menu {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  min-width: 11.5rem;
}

.sf-nav-dropdown__menu .dropdown-item {
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-medium);
  padding: 0.45rem 0.75rem;
}

.sf-nav-dropdown__menu .dropdown-item.active,
.sf-nav-dropdown__menu .dropdown-item:active {
  background: rgba(11, 87, 208, 0.1);
  color: var(--color-primary);
}

@media (min-width: 992px) {
  .sf-nav-dropdown:hover > .dropdown-menu,
  .sf-nav-dropdown:focus-within > .dropdown-menu {
    display: block;
    margin-top: 0;
  }

  .sf-nav-dropdown:hover > .nav-link,
  .sf-nav-dropdown:focus-within > .nav-link {
    background: rgba(11, 87, 208, 0.08);
    color: var(--color-primary);
  }
}

@media (max-width: 991.98px) {
  .sf-nav-primary .nav-link { min-height: 48px; padding: 0.75rem; border-radius: 12px; text-align: left; }
  .sf-nav-dropdown > .dropdown-toggle[aria-expanded="true"] { background: var(--color-primary-light, #e8f0fe); color: var(--color-primary); }
  .sf-nav-dropdown > .dropdown-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
  .sf-nav-dropdown__menu .dropdown-item { min-height: 44px; display: flex; align-items: center; white-space: normal; padding: 0.65rem 0.85rem; }
  .sf-nav-dropdown__menu {
    position: static;
    float: none;
    width: calc(100% - 12px);
    margin: 0.25rem 0 0.5rem 12px;
    box-shadow: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--sf-surface-muted);
  }
}

.sf-nav-tools {
  margin-left: var(--space-2);
  padding-left: var(--space-3);
}

.sf-nav-tool-link {
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-3) !important;
  border-radius: var(--radius-sm);
}

.sf-nav-icon-tools {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.sf-nav-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sf-nav-icon-btn:hover,
.sf-nav-icon-btn:focus-visible {
  background: rgba(11, 87, 208, 0.08);
  color: var(--color-primary);
  text-decoration: none;
}

.sf-nav-icon-btn--messages.is-active,
.sf-nav-icon-btn--messages:hover,
.sf-nav-icon-btn--messages:focus-visible {
  background: rgba(11, 87, 208, 0.1);
  color: var(--color-primary);
}

.sf-nav-icon-btn--notifications.is-active,
.sf-nav-icon-btn--notifications:hover,
.sf-nav-icon-btn--notifications:focus-visible {
  background: rgba(147, 52, 230, 0.1);
  color: #7c3aed;
}

.sf-nav-icon-btn.is-active {
  font-weight: var(--font-weight-semibold);
}

.sf-nav-icon-btn .sf-nav-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.1rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  border: none;
  box-shadow: none;
}

.sf-btn-meeting-now {
  background: var(--color-primary);
  border: none;
  color: #fff !important;
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.9rem;
  box-shadow: 0 1px 3px rgba(11, 87, 208, 0.3);
  white-space: nowrap;
}

.sf-btn-meeting-now:hover {
  background: var(--color-primary-hover);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(11, 87, 208, 0.4);
}

.sf-nav-meet-form {
  margin: 0;
}

.sf-nav-meet-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.25rem;
  padding: 0 0.7rem;
  border: none;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(11, 87, 208, 0.3);
}

.sf-nav-meet-btn:hover,
.sf-nav-meet-btn:focus-visible {
  background: var(--color-primary-hover);
  color: #fff;
}

.sf-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  text-decoration: none;
}

.sf-icon-action + .sf-icon-action,
.sf-icon-action + form {
  margin-left: 0.2rem;
}

.sf-icon-action:hover,
.sf-icon-action:focus-visible {
  color: var(--color-primary);
  border-color: rgba(11, 87, 208, 0.35);
  text-decoration: none;
}

.sf-icon-action--danger:hover,
.sf-icon-action--danger:focus-visible {
  color: var(--color-accent-red);
  border-color: rgba(197, 34, 31, 0.35);
}

@media (max-width: 575.98px) {
  /* Tighten the cluster so brand, icons and toggler fit on narrow phones. */
  .sf-nav-cluster {
    gap: 0;
  }

  .sf-nav-meet-btn span {
    display: none;
  }

  .sf-nav-meet-btn {
    width: 2.5rem;
    padding: 0;
    justify-content: center;
  }

  .sf-nav-icon-btn {
    width: 2.25rem;
    height: 2.25rem;
  }

  .sf-navbar .navbar-brand img.sf-brand-lockup__icon {
    width: 2.125rem;
    height: 2.125rem;
  }
}

.sf-page-header h1 {
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.sf-admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.sf-admin-stat {
  padding: 0.95rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
}

.sf-admin-stat strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.sf-admin-stat span {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.sf-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sf-admin-tabs a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface);
}

.sf-admin-tabs a.is-active,
.sf-admin-tabs a:hover {
  border-color: rgba(11, 87, 208, 0.35);
  color: var(--color-primary);
  background: rgba(11, 87, 208, 0.06);
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sf-navbar a:hover,
.sf-conversation-item:hover,
.btn:hover {
  text-decoration: none;
}

.dropdown-menu {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-2);
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.dropdown-item:active {
  background-color: rgba(11, 87, 208, 0.1);
}

/* Notifications list */
.sf-notification-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sf-notification-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.sf-notification-item.is-unread {
  background: rgba(11, 87, 208, 0.04);
  border-color: rgba(11, 87, 208, 0.2);
}

.sf-notification-item__indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  margin-top: 6px;
  flex-shrink: 0;
}

.sf-notification-item.is-unread .sf-notification-item__indicator {
  background: var(--color-primary);
}

.sf-notification-item__content {
  flex: 1;
  min-width: 0;
}

.sf-notification-item__header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
  margin-bottom: var(--space-1);
}

.sf-notification-item__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.sf-notification-item__time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.sf-notification-item__message {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}

.sf-notification-item__actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.sf-live-toasts {
  position: fixed;
  top: calc(var(--navbar-height) + 0.75rem);
  right: 1rem;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.sf-live-toast {
  pointer-events: auto;
  display: block;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.sf-live-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sf-live-toast--message {
  border-color: rgba(11, 87, 208, 0.28);
}

.sf-live-toast--alert {
  border-color: rgba(147, 52, 230, 0.28);
}

.sf-live-toast__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.15rem;
}

.sf-live-toast--alert .sf-live-toast__label {
  color: #9334e6;
}

.sf-live-toast--comment {
  border-color: rgba(13, 148, 136, 0.28);
}

.sf-live-toast--comment .sf-live-toast__label {
  color: #0d9488;
}

.sf-live-toast__title {
  display: block;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  margin-bottom: 0.2rem;
}

.sf-live-toast__body {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.sf-task-status__select {
  min-width: 8.5rem;
  max-width: 11rem;
}

.sf-task-status__select--header {
  min-width: 9rem;
  font-weight: var(--font-weight-medium);
}

.sf-badge--low { color: #5f6368; background: rgba(95, 99, 104, 0.12); }
.sf-badge--medium { color: #0b57d0; background: rgba(11, 87, 208, 0.12); }
.sf-badge--high { color: #b06000; background: rgba(176, 96, 0, 0.12); }
.sf-badge--critical { color: #c5221f; background: rgba(197, 34, 31, 0.12); }

.sf-task-table .sf-task-row__title {
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.sf-task-table .sf-task-row__title:hover {
  text-decoration: underline;
}

.sf-task-row__desc {
  max-width: 28rem;
}

.sf-task-row__due--overdue {
  color: var(--color-accent-red, #c5221f);
  font-weight: var(--font-weight-semibold);
}

.sf-task-row--overdue,
.sf-task-row--overdue td {
  background: #fff7f7;
}

.sf-task-comment {
  background: var(--color-background);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

/* Single relative stamp; exact wall-clock lives in the title tooltip. */
.sf-comment-stamp {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.sf-comment-stamp time {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
  cursor: help;
}

.sf-comment-stamp__ago {
  display: none;
}

.sf-project-comment__time {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.sf-project-comment__time time {
  cursor: help;
  color: inherit;
}

body.sf-notification-drawer-open {
  overflow: hidden;
}

.sf-notification-drawer {
  position: fixed;
  inset: 0;
  z-index: 1090;
  pointer-events: none;
}

.sf-notification-drawer.is-open {
  pointer-events: auto;
}

.sf-notification-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 18, 33, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sf-notification-drawer.is-open .sf-notification-drawer__backdrop {
  opacity: 1;
}

.sf-notification-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(24rem, 100vw);
  height: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s ease;
}

.sf-notification-drawer.is-open .sf-notification-drawer__panel {
  transform: translateX(0);
}

.sf-notification-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.sf-notification-drawer__title {
  font-size: var(--font-size-h3);
  margin: 0;
}

.sf-notification-drawer__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.sf-notification-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.sf-notification-drawer__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
}

.sf-notification-drawer__list {
  display: flex;
  flex-direction: column;
}

.sf-notification-drawer__item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.15s ease;
}

.sf-notification-drawer__item:hover {
  background: var(--color-background);
}

.sf-notification-drawer__item.is-unread {
  background: rgba(11, 87, 208, 0.04);
}

.sf-notification-drawer__item.is-new {
  animation: sf-notification-flash 1.2s ease;
}

@keyframes sf-notification-flash {
  0% { background: rgba(13, 148, 136, 0.18); }
  100% { background: rgba(11, 87, 208, 0.04); }
}

.sf-notification-drawer__item-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.45rem;
  background: transparent;
  flex-shrink: 0;
}

.sf-notification-drawer__item.is-unread .sf-notification-drawer__item-indicator {
  background: var(--color-primary);
}

.sf-notification-drawer__item-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.sf-notification-drawer__item-type {
  font-size: 0.6875rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.sf-notification-drawer__item-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.sf-notification-drawer__item-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 0.2rem;
}

.sf-notification-drawer__item-message {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.sf-notification-drawer__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Site footer & legal links
   -------------------------------------------------------------------------- */

.sf-site-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 0.45rem 0;
}

.sf-site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--color-text-muted);
}

.sf-site-footer__dot {
  color: var(--color-border);
}

.sf-legal-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.sf-legal-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
}

.sf-legal-links a:hover,
.sf-legal-links a:focus {
  color: var(--color-primary);
  text-decoration: underline;
}

body.sf-messages-page .sf-site-footer,
body.sf-body--meeting-room .sf-site-footer {
  display: none;
}

body.sf-body--framed .navbar,
body.sf-body--framed .sf-site-footer,
body.sf-body--framed .sf-msg-dock,
body.sf-body--framed .sf-notif-dock {
  display: none !important;
}

body.sf-body--framed .sf-main {
  padding-top: var(--space-4);
}

body.sf-people-app .sf-empty-state {
  padding: 1.15rem 1rem;
}

body.sf-people-app .sf-empty-state h2 {
  font-size: 1.125rem;
}

body.sf-people-app .sf-empty-state p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Dashboard / login skeletons
   -------------------------------------------------------------------------- */

.sf-skel {
  background: linear-gradient(90deg, #e8eaed 0%, #f4f5f6 42%, #e8eaed 100%);
  background-size: 200% 100%;
  animation: sf-skel-shimmer 1.2s ease-in-out infinite;
  border-radius: 6px;
}

.sf-skel--label {
  height: 0.7rem;
  width: 55%;
  margin-bottom: 0.7rem;
}

.sf-skel--value {
  height: 1.45rem;
  width: 38%;
}

.sf-skel--title {
  height: 0.9rem;
  width: 8rem;
}

.sf-skel--link {
  height: 0.7rem;
  width: 4.5rem;
}

.sf-skel--line {
  height: 0.7rem;
  width: 100%;
  margin-bottom: 0.55rem;
}

.sf-skel--line-mid {
  width: 78%;
}

.sf-skel--line-short {
  width: 62%;
  margin-bottom: 0;
}

.sf-skel--pill {
  height: 0.7rem;
  width: 3.6rem;
  border-radius: 999px;
}

.sf-skel--icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.sf-skel--avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
}

.sf-skel--avatar-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  animation: none;
}

.sf-skel--dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.sf-skel-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.sf-skel-row:last-child {
  margin-bottom: 0;
}

.sf-skel-heat {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.sf-skel-heat__row {
  display: flex;
  gap: 0.28rem;
}

.sf-skel-heat__row span {
  flex: 1;
  height: 0.62rem;
  border-radius: 2px;
  background: #e8eaed;
  animation: sf-skel-shimmer 1.4s ease-in-out infinite;
}

.sf-skel-heat__row:nth-child(odd) span:nth-child(3n) {
  background: #d2e3fc;
}

.sf-skel-heat__row:nth-child(even) span:nth-child(4n) {
  background: #c5d8f8;
}

@keyframes sf-skel-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.sf-dash-welcome {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(11, 87, 208, 0.14);
  border-radius: 14px;
  background: linear-gradient(135deg, #e8f0fe 0%, #ffffff 58%);
  box-shadow: 0 8px 24px rgba(11, 87, 208, 0.06);
  animation: sf-welcome-in 0.45s ease;
}

.sf-dash-welcome__avatar {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.sf-dash-welcome__hello {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.sf-dash-welcome__sub {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.sf-dash-welcome__dots {
  display: flex;
  gap: 0.28rem;
  margin-left: auto;
}

.sf-dash-welcome__dots span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.28;
  animation: sf-welcome-dot 1.1s ease-in-out infinite;
}

.sf-dash-welcome__dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.sf-dash-welcome__dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes sf-welcome-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sf-welcome-dot {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.sf-login-skeleton {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: auto;
  background: var(--color-background);
}

.sf-login-skeleton__nav {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: var(--navbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(5, 18, 33, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sf-login-skeleton__nav .sf-container {
  min-height: calc(var(--navbar-height) - 2px);
}

.sf-login-skeleton__pills {
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  padding-left: 0.5rem;
}

.sf-login-skeleton__tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sf-login-skeleton__progress {
  height: 2px;
  background: rgba(11, 87, 208, 0.1);
  overflow: hidden;
}

.sf-login-skeleton__progress::after {
  content: "";
  display: block;
  height: 100%;
  width: 34%;
  background: var(--color-primary);
  animation: sf-skel-progress 1.15s ease-in-out infinite;
}

@keyframes sf-skel-progress {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(380%);
  }
}

body.sf-login-skeleton-active {
  overflow: hidden;
}

body.sf-login-skeleton-active .sf-site-footer,
body.sf-login-skeleton-active .sf-auth-legal,
body.sf-login-skeleton-active .sf-auth-footer,
body.sf-dash-loading .sf-site-footer {
  display: none !important;
}

body.sf-dash-loading .sf-main {
  padding-bottom: var(--space-4);
}

@media (max-width: 575.98px) {
  .sf-dash-skeleton__heat,
  .sf-dash-skeleton__cols {
    display: none;
  }

  .sf-dash-welcome {
    padding: 0.85rem 0.95rem;
  }

  .sf-dash-welcome__dots {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sf-skel,
  .sf-skel-heat__row span,
  .sf-dash-welcome,
  .sf-dash-welcome__dots span,
  .sf-login-skeleton__progress::after {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   AI writing helper on form fields
   -------------------------------------------------------------------------- */

.sf-ai-field {
  position: relative;
  overflow: visible;
}

.sf-ai-field > input,
.sf-ai-field > textarea {
  padding-right: 2.35rem;
}

.sf-ai-field__toggle {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sf-ai-field__toggle:hover,
.sf-ai-field__toggle:focus-visible {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  outline: none;
}

.sf-ai-field.is-busy .sf-ai-field__toggle {
  pointer-events: none;
  opacity: 0.55;
}

.sf-ai-field__menu {
  position: fixed;
  z-index: 1080;
  min-width: 11rem;
  padding: 0.25rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.sf-ai-field__menu[hidden] {
  display: none;
}

.sf-ai-field__menu button {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

@media (max-width: 767.98px) {
  .sf-ai-field > input,
  .sf-ai-field > textarea {
    padding-right: 3.1rem;
  }

  .sf-ai-field__toggle {
    top: 0.2rem;
    right: 0.2rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .sf-ai-field__menu button {
    min-height: 2.75rem;
  }
}

.sf-ai-field__menu button:hover,
.sf-ai-field__menu button:focus-visible {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  outline: none;
}
