:root {
  /* ---- Brand & surface ---- */
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --border: #e4e7f0;
  --ink: #171b2e;
  --ink-soft: #6b7280;
  --ink-faint: #9aa0b4;

  --brand: #184c70;
  --brand-600: #123a56;
  --brand-400: #2f7aa8;
  --brand-100: #e3ecf1;

  --accent: #f0a63a;
  --accent-600: #d98f22;
  --accent-100: #fceacb;

  /* ---- Lead source identity colors ---- */
  --src-website: #12a594;
  --src-website-bg: #e3f7f4;
  --src-google: #3e7bfa;
  --src-google-bg: #e7effe;
  --src-meta: #7c5cfc;
  --src-meta-bg: #efeafe;

  /* ---- Status ---- */
  --success: #1ca57d;
  --success-bg: #e1f6ee;
  --danger: #e4483f;
  --danger-bg: #fce7e5;
  --warning: #e0a214;
  --warning-bg: #fcf2d9;
  --indigo: #6366f1;
  --indigo-bg: #ececfe;
  --rose: #e0518f;
  --rose-bg: #fde8f0;

  /* ---- Type ---- */
  --font-display: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  /* ---- Layout ---- */
  --sidebar-w: 90px;
  --sidebar-w-expanded: 244px;
  --header-h: 64px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-1:
    0 1px 3px rgba(23, 27, 46, 0.06), 0 1px 2px rgba(23, 27, 46, 0.04);
  --shadow-2:
    0 8px 24px rgba(23, 27, 46, 0.08), 0 2px 6px rgba(23, 27, 46, 0.04);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Dark mode ----
   Almost the entire UI is built on these variables, so overriding just the
   neutrals/surfaces here re-themes cards, tables, inputs, dropdowns, toasts
   and modals automatically. Brand/accent/status colors are intentionally
   left as-is — they're used as small tinted chips/icons and read fine on
   dark surfaces too. The sidebar and login screen are already dark-navy by
   design, so they need no separate dark-mode treatment. */
html[data-theme="dark"] {
  --bg: #0e1220;
  --surface: #161b2c;
  --surface-2: #1c2236;
  --border: #2b3350;
  --ink: #eef1f8;
  --ink-soft: #a2a8c3;
  --ink-faint: #6d7492;

  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.36), 0 2px 6px rgba(0, 0, 0, 0.24);
}
html[data-theme="dark"] .login-visual::after,
html[data-theme="dark"] .premium-hero::after {
  opacity: 0.6;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
.display {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}
/* .text-mono { 
  font-family: var(--font-mono);
} */
a {
  text-decoration: none;
  color: inherit;
}
::selection {
  background: var(--brand-100);
}

/* Visible focus ring for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--brand);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: width var(--transition);
  overflow: hidden;
}
html.sidebar-expanded .app-sidebar {
  width: var(--sidebar-w-expanded);
}

.sidebar-brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 25px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--surface);
}
.sidebar-brand .mark {
  position: relative;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--bg);
}

.sidebar-brand .mark .mark-toggle-btn {
  display: flex;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 16px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 9px;
  transition: background var(--transition);
}

.sidebar-brand .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  opacity: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: opacity var(--transition);
}
.sidebar-brand .name .name-logo {
  height: 35px;
}
html.sidebar-expanded .sidebar-brand .name {
  opacity: 1;
}

.sidebar-nav {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  /* Collapsed sidebar: scroll still works, scrollbar stays invisible */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Expanded sidebar: show the slim scrollbar again (more room, less visually tight) */
html.sidebar-expanded .sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
html.sidebar-expanded .sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
html.sidebar-expanded .sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
html.sidebar-expanded .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
html.sidebar-expanded .sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Group divider — replaces the old text nav-label between menu groups */
.sidebar-nav .nav-divider {
  height: 1px;
  margin: 10px 8px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  display: none;
}
.sidebar-nav .nav-divider:first-child {
  display: none;
}

.side-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  transition:
    background var(--transition),
    color var(--transition),
    padding var(--transition),
    transform 120ms ease;
  position: relative;
}
.side-link i {
  font-size: 19px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: font-size var(--transition);
}
.side-link span {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  max-width: 100%;
  white-space: normal;
  opacity: 1;
  transition:
    font-size var(--transition),
    opacity var(--transition);
}
.side-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(-1px);
}
.side-link.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.side-link.active i {
  color: var(--accent);
}
.side-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  display: none;
}

/* Expanded sidebar: icon + label sit side-by-side again */
html.sidebar-expanded .side-link {
  flex-direction: row;
  justify-content: flex-start;
  gap: 14px;
  padding: 11px 12px;
  text-align: left;
}
html.sidebar-expanded .side-link i {
  font-size: 17px;
}
html.sidebar-expanded .side-link span {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
html.sidebar-expanded .side-link.active::before {
  display: block;
}
html.sidebar-expanded .side-link.active i {
  color: inherit;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px;
  /* background: #ffffff; */
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-foot-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border-radius: var(--radius-sm);
  color: #fff;
  transition: background var(--transition);
  flex: 1;
  min-width: 0;
}

.sidebar-profile .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 12px;
  font-family: var(--font-display);
}
.sidebar-profile .who {
  line-height: 1.25;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-width var(--transition),
    opacity var(--transition);
  white-space: nowrap;
}
html.sidebar-expanded .sidebar-profile .who {
  max-width: 150px;
  opacity: 1;
}
.sidebar-profile .who .name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.sidebar-profile .who .role {
  display: block;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.62);
}

.sidebar-logout-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
  transition:
    background var(--transition),
    color var(--transition);
}
.sidebar-logout-btn:hover {
  background: rgba(228, 72, 63, 0.35);
  color: #fff;
}

/* Sidebar footer brand logo (Keyword India) — crossfades between the
   favicon mark (collapsed rail) and the full wordmark (expanded rail).
   The sidebar-foot area is always light/white, so the mark and wordmark
   sit directly on it without any extra background box. */
.sidebar-foot-brand {
  justify-content: center;
  padding: 2px;
}
.sidebar-foot-logo-wrap {
  position: relative;
  width: 100%;
  height: 48px;
  overflow: hidden;
  background: #ffffff;
  box-sizing: border-box;
  border-radius: 6px;
}
.sidebar-foot-logo-icon,
.sidebar-foot-logo-full {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: translate(-50%, -50%) scale(1);
  transition:
    opacity var(--transition),
    transform var(--transition);
}
.sidebar-foot-logo-icon {
  width: auto;
  height: 45px;
  opacity: 1;
}
.sidebar-foot-logo-full {
  width: calc(100% - 8px);
  max-width: 140px;
  height: auto;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
}
html.sidebar-expanded .sidebar-foot-logo-icon {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
}
html.sidebar-expanded .sidebar-foot-logo-full {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ---- Header ---- */
.app-header {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-w);
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  z-index: 30;
  transition: left var(--transition);
  padding-left: 0px;
}
html.sidebar-expanded .app-header {
  left: var(--sidebar-w-expanded);
}

@media (min-width: 993px) {
  html.sidebar-expanded .app-header .header-brand {
    display: none;
  }
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-right: 4px;
}
.header-brand-logo {
  /* width: 32px; */
  height: 35px;
  border-radius: 0;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  display: none;
  border: none;
  background: var(--surface-2);
  color: var(--ink-soft);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background var(--transition),
    color var(--transition);
}
.sidebar-toggle-btn:hover {
  background: var(--brand-100);
  color: var(--brand);
}

.header-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}
.header-search input {
  width: 100%;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0 16px 0 38px;
  font-size: 13.5px;
  color: var(--ink);
}
.header-search input::placeholder {
  color: var(--ink-faint);
}
.header-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 14px;
}

.header-spacer {
  flex: 1;
}

.header-profile {
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition);
}

.header-profile .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.header-profile .who {
  line-height: 1.2;
}
.header-profile .who .role {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
}
.header-profile .who .name {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

/* Header icon buttons (theme toggle / notification bell) */
.header-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}
.header-icon-btn:hover {
  background: var(--brand-100);
  color: var(--brand);
  border-color: var(--brand-100);
}
.header-notif-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}

/* Short "Premium Member" tagline shown next to the logo in the topbar,
   only while the logged-in company's plan is active. */
.header-premium-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #6b4a10;
  background: linear-gradient(120deg, var(--accent-100), #ffe9bc);
  border: 1px solid rgba(240, 166, 58, 0.4);
  text-decoration: none;
  white-space: nowrap;
  transition: filter var(--transition);
}
.header-premium-tag:hover {
  filter: brightness(0.97);
}
.header-premium-tag i {
  font-size: 12px;
  color: var(--accent-600);
}

/* Header live clock — simple flat pill, pinned to the exact horizontal
   center of the topbar (independent of sidebar collapsed/expanded width,
   since .app-header's own left edge already accounts for that). */
.header-clock {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  position: absolute;
  left: 46%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.header-clock-icon {
  font-size: 13px;
  flex-shrink: 0;
}
.header-clock-time {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.header-clock-time .blink {
  animation: clockColonBlink 1s steps(1) infinite;
}
@keyframes clockColonBlink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.15;
  }
}
.header-clock-seconds {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  margin-left: 1px;
}
.header-clock-ampm {
  font-weight: 400;
  letter-spacing: 0.03em;
  font-size: 13px;
}
.header-clock-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}
.header-clock-date {
  letter-spacing: 0.01em;
  font-size: 13px;
}

/* Notification dropdown */
.dropdown-menu-notif {
  width: 340px;
  padding: 0;
  overflow: hidden;
}
.dropdown-menu-notif .dd-head {
  padding: 14px 16px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-2);
}
.dd-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dd-unread-count {
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.dd-unread-count:empty,
.dd-unread-count[data-count="0"] {
  display: none;
}
.dd-mark-read-btn {
  border: none;
  background: none;
  color: var(--brand-400);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.dd-mark-read-btn:hover {
  text-decoration: underline;
}
.notif-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  position: relative;
  transition:
    background var(--transition),
    transform var(--transition);
}
.notif-item:hover {
  background: var(--surface-2);
  transform: translateX(2px);
}
.notif-item.unread .notif-text {
  font-weight: 600;
}
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.notif-body {
  min-width: 0;
  flex: 1;
}
.notif-text {
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.45;
}
.notif-time {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 3px;
}
.notif-item-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 3px;
}
.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-400);
  flex-shrink: 0;
}
.notif-item:not(.unread) .notif-unread-dot {
  visibility: hidden;
}
.notif-item .bi-chevron-right {
  font-size: 11px;
  color: var(--ink-faint);
  opacity: 0;
  transform: translateX(-3px);
  transition:
    opacity var(--transition),
    transform var(--transition);
}
.notif-item:hover .bi-chevron-right {
  opacity: 1;
  transform: translateX(0);
}
.notif-empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
  display: none;
}
.notif-empty.show {
  display: block;
}
.notif-empty i {
  font-size: 24px;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 8px;
}

/* ---- Content area ---- */
.app-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 20px 20px 60px;
  width: 100%;
  transition: margin-left var(--transition);
}
html.sidebar-expanded .app-content {
  margin-left: var(--sidebar-w-expanded);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 7px;
  transition:
    color 0.15s ease,
    gap 0.15s ease;
}
.back-link:hover {
  color: var(--brand);
  gap: 9px;
}
.back-link i {
  font-size: 13px;
}
.page-head .eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-400);
  margin-bottom: 4px;
}
.page-head h1 {
  font-size: 18px;
  font-weight: 600;
}
.page-head p.sub {
  color: var(--ink-soft);
  margin-top: 4px;
  font-size: 13.5px;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card-body {
  padding: 20px 22px;
}
.card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-head h3 {
  font-size: 15px;
  font-weight: 500;
}

/* Stat card */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  box-shadow: var(--shadow-1);
}
.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.stat-card > div:not(.stat-icon):not(.stat-delta) {
  min-width: 0;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
  word-break: break-word;
}
.stat-card .stat-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.stat-card .stat-delta {
  font-size: 11.5px;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}
.stat-card .stat-delta.up {
  color: var(--success);
}
.stat-card .stat-delta.down {
  color: var(--danger);
}
.btn-outline.logout-btn {
  color: var(--danger);
  border-color: var(--danger-bg);
}
.btn-outline.logout-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}
/* Source badges — consistent across dashboard, leads, reports */
.src-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.src-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: none;
}
.src-badge.website {
  color: var(--src-website);
  background: var(--src-website-bg);
}
.src-badge.website::before {
  background: var(--src-website);
}
.src-badge.google {
  color: var(--src-google);
  background: var(--src-google-bg);
}
.src-badge.google::before {
  background: var(--src-google);
}
.src-badge.meta {
  color: var(--src-meta);
  background: var(--src-meta-bg);
}
.src-badge.meta::before {
  background: var(--src-meta);
}

/* Sidebar-foot badge collapses to just the dot+icon when sidebar is collapsed */
.sidebar-foot .src-badge {
  padding: 8px;
  gap: 0;
}
.sidebar-foot .src-badge .label {
  display: none;
}
html.sidebar-expanded .sidebar-foot .src-badge {
  padding: 4px 10px 4px 8px;
  gap: 6px;
}
html.sidebar-expanded .sidebar-foot .src-badge .label {
  display: inline;
}

/* Lead-source assignment checkboxes (company add/edit) */
.source-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition);
}
.source-check:hover {
  border-color: var(--brand-400);
}
.source-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--brand);
}
.source-check .src-badge {
  pointer-events: none;
  flex: 1;
  justify-content: flex-start;
  padding: 6px 10px;
}
.source-check:has(input:checked) {
  border-color: var(--brand-400);
  background: var(--brand-100);
}
.source-hint {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: -4px 0 4px;
}
.source-badge-muted {
  opacity: 0.45;
  filter: grayscale(0.3);
}

/* Reports — status/source breakdown bars */
.metric-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
}
.metric-row .metric-label {
  width: 118px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.metric-row .metric-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.metric-row .metric-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.metric-row .metric-fill {
  height: 100%;
  border-radius: 999px;
}
.metric-row .metric-value {
  width: 78px;
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.metric-row .metric-value strong {
  color: var(--ink);
  font-size: 13px;
}

/* Reports — conversion % coloring */
.pct-good {
  color: var(--success);
  font-weight: 700;
}
.pct-mid {
  color: var(--warning);
  font-weight: 700;
}
.pct-low {
  color: var(--danger);
  font-weight: 700;
}

/* Reports — ranked mini list (top companies / top sources) */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.rank-item:last-child {
  border-bottom: none;
}
.rank-item .rank-no {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-no {
  background: var(--accent-100);
  color: var(--accent-600);
}
.rank-item .rank-name {
  flex: 1;
  font-weight: 600;
  font-size: 13.5px;
}
.rank-item .rank-sub {
  font-size: 11.5px;
  color: var(--ink-faint);
}
.rank-item .rank-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}

/* Connected accounts / integration rows (company details) */
.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.integration-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.integration-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.integration-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-badge.active {
  color: var(--success);
  background: var(--success-bg);
}
.status-badge.inactive {
  color: var(--danger);
  background: var(--danger-bg);
}
.status-badge.new {
  color: var(--brand-400);
  background: var(--brand-100);
}
.status-badge.pending {
  color: var(--warning);
  background: var(--warning-bg);
}
.status-badge.approved {
  color: var(--success);
  background: var(--success-bg);
}
.status-badge.rejected {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-600);
}
.btn-accent {
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-accent:hover {
  background: var(--accent-600);
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
.btn-outline:hover {
  border-color: var(--brand-400);
  color: var(--brand-400);
}
.btn-facebook {
  background: #1877f2;
  color: #fff;
}
.btn-facebook:hover {
  background: #1461d1;
  color: var(--bg);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #c93a32;
}
.btn-approve {
  background: var(--success-bg);
  color: var(--success);
}
.btn-approve:hover {
  background: var(--success);
  color: #fff;
}
.btn-reject {
  background: var(--danger-bg);
  color: var(--danger);
}
.btn-reject:hover {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}
.pr-change-status-btn {
  font-size: 16px;
}
/* Forms */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  display: block;
}
.form-label .req {
  color: var(--danger);
}
.form-control,
.form-select {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 14px;
  font-size: 13.5px;
  color: var(--ink);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 38px;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9.5L12 14.5L17 9.5'/%3E%3C/svg%3E");
}
.form-select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232A3374' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9.5L12 14.5L17 9.5'/%3E%3C/svg%3E");
}
.form-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234C56A6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9.5L12 14.5L17 9.5'/%3E%3C/svg%3E");
}
textarea.form-control {
  height: auto;
  padding: 10px 14px;
  min-height: 90px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
  outline: none;
}
.form-control.is-invalid {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.invalid-feedback {
  display: none;
  color: var(--danger);
  font-size: 12px;
  margin-top: 5px;
}
.form-control.is-invalid ~ .invalid-feedback,
.was-validated-field .invalid-feedback {
  display: block;
}
.form-group {
  margin-bottom: 18px;
}
.input-with-icon {
  position: relative;
}
.input-with-icon input {
  padding-left: 40px;
}
.input-with-icon i,
.input-with-icon svg.icon-svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
}
.input-with-icon svg.icon-svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.input-with-icon .toggle-eye {
  left: auto;
  right: 14px;
  cursor: pointer;
}

/* Toggle switch (status active/inactive) */
.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-block;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch .track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-switch .track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked ~ .track {
  background: var(--success);
}
.toggle-switch input:checked ~ .track::before {
  transform: translateX(18px);
}

/* Table */
.table-wrap {
  overflow-x: auto;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data-table thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}
table.data-table tbody tr:hover {
  background: var(--surface-2);
}
table.data-table tbody tr:last-child td {
  border-bottom: none;
}
.lead-id {
  font-family: var(--font-mono);
  color: var(--ink-soft);
  font-size: 12.5px;
}

/* Recent leads list (dashboard) */
.recent-leads-list {
  display: flex;
  flex-direction: column;
}
.lead-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.lead-row:first-child {
  padding-top: 2px;
}
.lead-row:last-child {
  padding-bottom: 2px;
  border-bottom: none;
}
.lead-row:hover {
  background: var(--surface-2);
}
.lead-row-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lead-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lead-row-top {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.lead-row-main > .cell-primary {
  font-size: 13.5px;
}
.lead-row-id {
  font-size: 11.5px;
  color: var(--ink-faint);
}
.lead-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.lead-row-sub {
  font-size: 12px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lead-row-sub i {
  font-size: 11px;
  color: var(--ink-faint);
}
.lead-row-end {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.lead-row-date {
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.lead-row-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  min-width: 96px;
}
.lead-row-col-source {
  min-width: 122px;
}
.lead-row-col-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
@media (max-width: 860px) {
  .lead-row-col {
    display: none;
  }
}
@media (max-width: 576px) {
  .lead-row {
    align-items: flex-start;
  }
  .lead-row-end {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }
  .lead-row-date {
    display: none;
  }
}
.cell-primary {
  font-weight: 600;
}
a.cell-primary {
  display: inline-block;
  color: var(--brand-400);
}
a.cell-primary:hover {
  text-decoration: underline;
}
.cell-sub {
  font-size: 12px;
  color: var(--ink-faint);
}

/* Filters bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.filter-bar .form-control,
.filter-bar .form-select {
  height: 38px;
  width: auto;
  min-width: 150px;
}
.filter-bar .input-with-icon.filter-search {
  min-width: 200px;
}
.filter-bar .search-filter {
  min-width: 280px;
}
.filter-bar .input-with-icon.filter-daterange {
  width: 230px;
  flex: 0 0 230px;
}
.filter-refresh-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--surface);
}
.filter-refresh-btn i {
  transition: transform var(--transition);
}
.filter-refresh-btn.spinning i {
  animation: spinOnce 0.6s ease;
}
@keyframes spinOnce {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Multi-select dropdown with search (Company filter etc.) */
.ms-dropdown {
  position: relative;
}
.ms-toggle {
  display: flex;
  align-items: center;
  text-align: left;
  cursor: pointer;
}
.ms-toggle .ms-toggle-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-dropdown.open .ms-toggle {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.ms-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  z-index: 40;
  display: none;
  overflow: hidden;
}
.ms-dropdown.open .ms-panel {
  display: block;
}
.ms-search {
  position: relative;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.ms-search i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 13px;
}
.ms-search-input {
  width: 100%;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0 12px 0 30px;
  font-size: 13px;
  color: var(--ink);
}
.ms-search-input:focus {
  outline: none;
  border-color: var(--brand-400);
}
.ms-options {
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
}
.ms-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink);
}
.ms-option:hover {
  background: var(--surface-2);
}
.ms-option input[type="checkbox"] {
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.ms-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.ms-clear {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}
.ms-clear:hover {
  color: var(--danger);
}
.ms-apply {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
}
.ms-apply:hover {
  background: var(--brand-600);
}

/* Selected companies chip row (shown below the filter bar when >1 selected) */
.ms-chips-row {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -8px 0 16px;
}
.ms-chips-row .ms-chips-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-right: 2px;
}
.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-100);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
}
.ms-chip .ms-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}
.ms-chip .ms-chip-remove:hover {
  background: rgba(0, 0, 0, 0.16);
}
/* Tabs (company leads module) */
.source-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.source-tabs .tab-btn {
  border: none;
  background: transparent;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition);
}
.source-tabs .tab-btn .count {
  font-size: 11px;
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 700;
}
.source-tabs .tab-btn.active {
  color: var(--ink);
  border-bottom-color: var(--brand);
}
.source-tabs .tab-btn.active .count {
  background: var(--brand-100);
  color: var(--brand);
}
.source-tabs .tab-btn[data-tab="all"].active {
  border-bottom-color: var(--ink);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Chart container */
.chart-box {
  position: relative;
  height: 260px;
  height: 100%;
}
.legend-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
  justify-content: center;
}
.legend-row .legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.legend-row .legend-item .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.legend-row .legend-item .legend-count {
  color: var(--ink);
  font-weight: 700;
  margin-left: 2px;
}

/* Convergence signature strip (used on login + dashboard header) */
/* .convergence-strip {
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--src-website),
    var(--src-google) 50%,
    var(--src-meta)
  );
} */

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.pagination-bar .info {
  font-size: 12.5px;
  color: var(--ink-soft);
}
.pager {
  display: flex;
  gap: 6px;
}
.pager button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12.5px;
}
.pager button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Info grid (e.g. Profile → Account Info): 2 columns on tablet/desktop, 1 on mobile */
.info-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}
@media (max-width: 576px) {
  .info-grid-2col {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Toast */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 340px;
}
.toast-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  padding: 13px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: toastIn 220ms ease-out;
}
.toast-item.success {
  border-left-color: var(--success);
}
.toast-item.error {
  border-left-color: var(--danger);
}
.toast-item.warning {
  border-left-color: var(--warning);
}
.toast-item i.status-icon {
  font-size: 17px;
  margin-top: 1px;
}
.toast-item.success i.status-icon {
  color: var(--success);
}
.toast-item.error i.status-icon {
  color: var(--danger);
}
.toast-item.warning i.status-icon {
  color: var(--warning);
}
.toast-item .msg {
  flex: 1;
  font-size: 13px;
}
.toast-item .msg strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.toast-item .close-x {
  cursor: pointer;
  color: var(--ink-faint);
  font-size: 13px;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}
.toast-item.hide {
  animation: toastOut 200ms ease-in forwards;
}

/* Header dropdowns (profile / notifications) */
.dropdown-wrap {
  position: relative;
}
.dropdown-menu-custom {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  width: 250px;
  padding: 8px;
  z-index: 60;
  display: none;
}
.dropdown-menu-custom#notifPanel {
  width: 400px;
}
.dropdown-menu-custom.show {
  display: block;
}
.dropdown-menu-custom .dd-head {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.dropdown-menu-custom .dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--transition);
}
.dropdown-menu-custom .dd-item:hover {
  background: var(--surface-2);
}
.dropdown-menu-custom .dd-item i {
  color: var(--ink-soft);
  width: 18px;
  text-align: center;
}
.dropdown-menu-custom .dd-item.danger {
  color: var(--danger);
}
.dropdown-menu-custom .dd-item.danger i {
  color: var(--danger);
}
.dropdown-menu-custom hr {
  border-color: var(--border);
  margin: 6px 4px;
}
/* Modal (used for e.g. delete confirm) */
.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 30, 0.5);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop-custom.show {
  display: flex;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-2);
  padding: 24px;
}
.modal-box-form {
  position: relative;
  width: 420px;
  text-align: center;
}
.fb-modal-box {
  width: 440px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.modal-close-btn:hover {
  background: var(--brand-100);
  color: var(--brand);
}
.modal-icon {
  width: 52px;
  height: 52px;
  margin: 4px auto 16px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.modal-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}
.modal-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 22px;
}
.modal-box-form .form-group {
  text-align: left;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.modal-actions .btn {
  flex: 1;
}
.modal-icon-success {
  background: var(--success-bg);
  color: var(--success);
}
.modal-icon-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Upload Quotes popup — no-JS "dropzone" look, built from a styled native
   file input (::file-selector-button) so the browser's own "filename"
   readout keeps working without any script. */
.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 18px;
  text-align: center;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.upload-dropzone:hover {
  border-color: var(--brand-400);
  background: var(--brand-100);
}
.upload-dropzone i {
  font-size: 25px;
  color: var(--brand);
  margin-bottom: 6px;
  display: inline-block;
}
.upload-dropzone-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.upload-dropzone-hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 3px 0 16px;
}
.upload-dropzone-input {
  width: 100%;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.upload-dropzone-input::file-selector-button {
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  margin-right: 12px;
  background: var(--brand-100);
  color: var(--brand);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.upload-dropzone-input::file-selector-button:hover {
  background: var(--brand);
  color: #fff;
}
.upload-sample-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.upload-sample-link:hover {
  text-decoration: underline;
}

/* Info-style modal (e.g. "View request") — left aligned, wider, scrolls if tall */
.modal-box-info {
  position: relative; /* anchors .modal-close-btn to this box, not the backdrop */
  width: 480px;
  max-width: 92vw;
  max-height: 86vh;
  overflow-y: auto;
  text-align: left;
}
.pr-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 26px 18px 0;
}
.pr-detail-head .reqid {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 4px;
}
.pr-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-bottom: 16px;
}
.pr-detail-item .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.pr-detail-item .value {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
}
.pr-message-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 4px;
}

/* Payload mapping panel — slides in from the right, full page height, responsive */
.side-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 30, 0.5);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}
.side-panel-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 640px;
  max-width: 100vw;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.side-panel-backdrop.show .side-panel {
  transform: translateX(0);
}
/* Lock page scroll behind the panel so only .side-panel-body scrolls */
html.side-panel-open,
html.side-panel-open body {
  overflow: hidden;
}
.side-panel .modal-close-btn {
  position: absolute;
  top: 18px;
  right: 20px;
}
.side-panel-header {
  padding: 24px 56px 18px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.side-panel-title {
  font-size: 16px;
  font-weight: 600;
}
.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}
.side-panel-footer {
  padding: 16px 28px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--surface);
}
.side-panel-footer .btn {
  min-width: 96px;
}

.payload-breadcrumb {
  font-size: 12.5px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.payload-breadcrumb i {
  font-size: 10px;
}
.payload-map-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.payload-map-head,
.payload-map-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 34px;
  gap: 10px;
  align-items: center;
}
.payload-map-head {
  padding: 10px 14px;
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.payload-map-rows {
  display: flex;
  flex-direction: column;
}
.payload-map-row {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.payload-map-row .form-control,
.payload-map-row .form-select {
  height: 38px;
  font-size: 13px;
}
.payload-row-delete {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
  justify-self: center;
  color: var(--danger);
}
.payload-row-delete:hover {
  background: var(--danger-bg);
}
.payload-add-btn {
  margin-top: 14px;
}

/* Tablet: narrower panel, keep 3-column grid */
@media (max-width: 900px) {
  .side-panel {
    width: 440px;
  }
}

/* Mobile: full-screen panel, stack each row's fields vertically */
@media (max-width: 640px) {
  .side-panel {
    width: 100vw;
    border-radius: 0;
  }
  .side-panel-header {
    padding: 20px 52px 16px 20px;
  }
  .side-panel-body {
    padding: 16px 20px;
  }
  .side-panel-footer {
    padding: 14px 20px 18px;
  }
  .payload-map-head {
    display: none;
  }
  .payload-map-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
    position: relative;
  }
  .payload-map-row .payload-row-delete {
    position: absolute;
    top: 10px;
    right: 10px;
  }
}

/* ==========================================================================
   FACEBOOK LEAD ADS INTEGRATION PAGE
   ========================================================================== */
.fb-integration-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.fb-pages-col {
  flex: 0 0 35%;
  width: 35%;
  min-width: 0;
}
.fb-forms-col {
  flex: 1;
  width: 65%;
  min-width: 0;
}
.fb-pages-col .card,
.fb-forms-col .card {
  height: 100%;
}
.fb-page-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fb-page-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    color var(--transition);
}
.fb-page-pill:hover {
  border-color: var(--brand-400);
  background: var(--surface-2);
}
.fb-page-pill.active {
  border-color: var(--brand);
  background: var(--brand-100);
  color: var(--brand-600);
}
.fb-page-pill-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.fb-page-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--src-meta-bg);
  color: var(--src-meta);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.fb-page-pill.active .fb-page-avatar {
  background: var(--brand);
  color: #fff;
}
.fb-page-pill > .bi-chevron-right {
  color: var(--ink-faint);
  font-size: 12px;
  flex-shrink: 0;
}
.fb-page-pill.active > .bi-chevron-right {
  color: var(--brand);
}
@media (max-width: 1100px) {
  .fb-integration-layout {
    flex-direction: column;
  }
  .fb-pages-col,
  .fb-forms-col {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* OTP verification (Forgot Password) */
.otp-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.otp-box {
  width: 52px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.otp-box:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.otp-box.is-invalid {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.otp-resend {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 16px 0 4px;
}
.otp-resend a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.otp-resend a:hover {
  text-decoration: underline;
}

/* Company logo upload (Add/Edit Company) */
.logo-upload-preview {
  width: 110px;
  height: 110px;
  margin: 0 auto;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 34px;
  color: var(--ink-faint);
}
.logo-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

/* Company logo shown on the Company Details page header */
.company-logo-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--ink-faint);
  overflow: hidden;
  flex-shrink: 0;
}
.company-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

/* Utility */
.text-soft {
  color: var(--ink-soft);
}
.text-faint {
  color: var(--ink-faint);
}
.mt-0 {
  margin-top: 0 !important;
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bg);
}
.login-visual {
  flex: 1.1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: 48px 52px;
  color: #fff;
}
.login-visual .pitch,
.login-visual .lead-flow-art,
.login-visual .visual-copyright {
  position: relative;
  z-index: 1;
}

.login-card .card-logo {
  height: 48px;
  width: auto;
  margin-bottom: 48px;
  display: block;
}
.login-visual .pitch h2 {
  font-size: 34px;
  color: #fff;
  line-height: 1.22;
  max-width: 440px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.login-visual .pitch h2 .accent {
  color: var(--accent);
}
.login-visual .pitch p {
  color: rgba(255, 255, 255, 0.68);
  margin-top: 14px;
  max-width: 380px;
  font-size: 14.5px;
  line-height: 1.6;
}

/* Copyright line — pinned to the bottom-left, pulls the rest of the
   panel content back up toward the top via the flex auto-margin. */
.visual-copyright {
  margin-top: auto;
  padding-top: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

/* Lead-flow illustration: channels flowing into a funnel, caught by the team */
.lead-flow-art {
  position: relative;
  margin-top: 26px;
  height: 238px;
}

.flow-art-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.art-orbit-1 {
  animation: art-orbit-spin 50s linear infinite;
  transform-origin: 200px 150px;
}
.art-orbit-2 {
  animation: art-orbit-spin 75s linear infinite reverse;
  transform-origin: 200px 150px;
}
@keyframes art-orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

.art-flow-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.4;
  stroke-dasharray: 3 6;
}

.art-origin-dot {
  opacity: 0.85;
}
.art-origin-dot[data-source="meta"] {
  fill: var(--src-meta);
}
.art-origin-dot[data-source="google"] {
  fill: var(--src-google);
}
.art-origin-dot[data-source="website"] {
  fill: var(--src-website);
}

.art-sparkle {
  opacity: 0;
  animation: art-sparkle-twinkle 3.4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes art-sparkle-twinkle {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 0.65;
  }
}

.art-label {
  font-family: var(--font-body, inherit);
  font-size: 9.5px;
  font-weight: 600;
  fill: rgba(255, 255, 255, 0.6);
}
.art-team-label {
  fill: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.art-team-card {
  fill: rgba(255, 255, 255, 0.07);
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
}

.art-funnel-edge {
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.3;
  stroke-linecap: round;
}
.art-funnel-shine {
  fill: rgba(255, 255, 255, 0.14);
}

.art-spout-glow {
  opacity: 0.16;
  transform-origin: 200px 206px;
  animation: art-spout-pulse 3s ease-in-out infinite;
}
@keyframes art-spout-pulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.12;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.24;
  }
}

.art-flow-dot {
  offset-rotate: 0deg;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
.art-flow-dot[data-source="meta"] {
  fill: var(--src-meta);
  offset-path: path("M 68 46 C 100 46, 140 90, 176 118");
  animation-name: art-flow-move;
  animation-duration: 2.6s;
  animation-delay: 0s;
}
.art-flow-dot[data-source="google"] {
  fill: var(--src-google);
  offset-path: path("M 200 34 C 200 60, 200 90, 200 118");
  animation-name: art-flow-move;
  animation-duration: 2.2s;
  animation-delay: 0.6s;
}
.art-flow-dot[data-source="website"] {
  fill: var(--src-website);
  offset-path: path("M 332 46 C 300 46, 260 90, 224 118");
  animation-name: art-flow-move;
  animation-duration: 2.4s;
  animation-delay: 1.2s;
}
@keyframes art-flow-move {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

.art-funnel {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.2;
}

.art-bubble[data-source="meta"] circle {
  stroke: var(--src-meta);
  stroke-width: 2;
  stroke-opacity: 0.55;
}
.art-bubble[data-source="google"] circle {
  stroke: var(--src-google);
  stroke-width: 2;
  stroke-opacity: 0.55;
}
.art-bubble[data-source="website"] circle {
  stroke: var(--src-website);
  stroke-width: 2;
  stroke-opacity: 0.55;
}
.art-bubble-icon,
.art-avatar-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.art-bubble-icon[data-source="meta"] {
  color: var(--src-meta);
}
.art-bubble-icon[data-source="google"] {
  color: var(--src-google);
}
.art-bubble-icon[data-source="website"] {
  color: var(--src-website);
}
.art-bubble {
  animation: art-bob 4.5s ease-in-out infinite;
}
.art-bubble[data-source="google"] {
  animation-delay: 0.4s;
}
.art-bubble[data-source="website"] {
  animation-delay: 0.9s;
}
@keyframes art-bob {
  0%,
  100% {
    transform: translate(var(--tx, 0), var(--ty, 0));
  }
  50% {
    transform: translate(var(--tx, 0), calc(var(--ty, 0) - 5px));
  }
}
.art-bubble[data-source="meta"] {
  --tx: 68px;
  --ty: 46px;
}
.art-bubble[data-source="google"] {
  --tx: 200px;
  --ty: 34px;
}
.art-bubble[data-source="website"] {
  --tx: 332px;
  --ty: 46px;
}

.art-avatar-icon {
  color: var(--brand);
  font-size: 10px;
}
.art-avatar-back {
  opacity: 0.85;
}

/* Floating stat card — a small decorative chart, not a live widget */
.flow-art-card {
  position: absolute;
  left: 6%;
  bottom: 6px;
  width: 132px;
  padding: 12px 13px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
  transform: rotate(-4deg);
  animation: art-card-float 5s ease-in-out infinite;
}
@keyframes art-card-float {
  0%,
  100% {
    transform: rotate(-4deg) translateY(0);
  }
  50% {
    transform: rotate(-4deg) translateY(-6px);
  }
}
.flow-art-card-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand-600);
  margin-bottom: 8px;
}
.flow-art-card-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 30px;
  margin-bottom: 8px;
}
.flow-art-card-chart span {
  flex: 1;
  height: var(--h);
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--brand));
  opacity: 0.45;
}
.flow-art-card-chart span:last-child {
  opacity: 0.65;
}

/* Small floating badge for extra illustrative depth */
.flow-art-badge {
  position: absolute;
  right: 2%;
  top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--brand-600);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  transform: rotate(3deg);
  animation: art-badge-float 4.2s ease-in-out infinite;
}
.flow-art-badge i {
  color: #1ca57d;
}
@keyframes art-badge-float {
  0%,
  100% {
    transform: rotate(3deg) translateY(0);
  }
  50% {
    transform: rotate(3deg) translateY(-5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .art-orbit-1,
  .art-orbit-2,
  .art-flow-dot,
  .art-bubble,
  .art-sparkle,
  .art-spout-glow,
  .flow-art-card,
  .flow-art-badge {
    animation: none;
  }
  .art-sparkle {
    opacity: 0.35;
  }
}

.login-visual::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 14%), #0000000f 70%);
}

.fb-visual {
  background: linear-gradient(160deg, #1877f2 0%, #0d5cd1 100%);
}
.fb-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: #1877f2;
  margin-bottom: 28px;
}

.login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.1);
  padding: 40px 36px;
}
.login-card .top-note {
  font-size: 12.5px;
  color: var(--brand-400);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.login-card h1 {
  font-size: 20px;
  margin-bottom: 20px;
}
.login-card p.hint {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin-bottom: 26px;
}
.login-card .form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 20px;
  font-size: 13px;
}
.login-card .link {
  color: var(--brand-400);
  font-weight: 600;
}
.login-card .btn {
  width: 100%;
  height: 44px;
  margin-top: 4px;
}
.login-card .divider-note {
  text-align: center;
  color: var(--ink-faint);
  font-size: 12px;
  margin-top: 26px;
}
.role-demo-note {
  margin-top: 18px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--ink-soft);
}

@media (max-width: 860px) {
  .login-visual {
    display: none;
  }
}

/* ==========================================================================
   FLATPICKR THEME OVERRIDES (match KIA CRM tokens)
   ========================================================================== */
.flatpickr-calendar {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-2) !important;
  font-family: var(--font-body) !important;
}
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
  border-bottom-color: var(--border) !important;
}
.flatpickr-months .flatpickr-month {
  background: transparent !important;
  color: var(--ink) !important;
  border-radius: var(--radius) var(--radius) 0 0;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  color: var(--ink) !important;
  font-weight: 600 !important;
}
.flatpickr-weekdays {
  background: transparent !important;
}
span.flatpickr-weekday {
  color: var(--ink-faint) !important;
  font-weight: 600 !important;
  font-size: 11px !important;
}
.flatpickr-day {
  color: var(--ink) !important;
  border-radius: var(--radius-sm) !important;
}
.flatpickr-day.flatpickr-disabled {
  color: var(--ink-faint) !important;
}
.flatpickr-day.today {
  border-color: var(--brand-400) !important;
}
.flatpickr-day:hover {
  background: var(--brand-100) !important;
  border-color: var(--brand-100) !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}
.flatpickr-day.inRange {
  background: var(--brand-100) !important;
  border-color: var(--brand-100) !important;
  box-shadow: none !important;
}
.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
  fill: var(--brand) !important;
}
.flatpickr-prev-month svg,
.flatpickr-next-month svg {
  fill: var(--ink-soft) !important;
}
.numInputWrapper span.arrowUp:after {
  border-bottom-color: var(--ink-soft) !important;
}
.numInputWrapper span.arrowDown:after {
  border-top-color: var(--ink-soft) !important;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 30, 0.5);
  z-index: 39;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition);
}
.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 992px) {
  html.sidebar-mobile-open,
  html.sidebar-mobile-open body {
    overflow: hidden;
  }

  /* Header hamburger toggle only shows on mobile/tablet — see base rule. */
  .sidebar-toggle-btn {
    display: flex;
  }

  /* Sidebar always renders in its "expanded" (icon + label) visual style on
     mobile/tablet, but sits off-screen until opened — regardless of the
     desktop collapsed/expanded preference. */
  .app-sidebar {
    width: min(var(--sidebar-w-expanded), 82vw);
    transform: translateX(-100%);
    box-shadow: var(--shadow-2);
    transition: transform var(--transition);
  }
  html.sidebar-mobile-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-brand .name {
    opacity: 1;
  }
  .side-link {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 11px 12px;
    text-align: left;
  }
  .side-link i {
    font-size: 17px;
  }
  .side-link span {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
  }
  .side-link.active::before {
    display: block;
  }
  .side-link.active i {
    color: inherit;
  }
  .sidebar-profile .who {
    max-width: 150px;
    opacity: 1;
  }
  .sidebar-foot .src-badge {
    padding: 4px 10px 4px 8px;
    gap: 6px;
  }
  .sidebar-foot .src-badge .label {
    display: inline;
  }

  /* Content/header never shift on mobile/tablet — drawer floats above them */
  .app-header,
  .app-content,
  html.sidebar-expanded .app-header,
  html.sidebar-expanded .app-content {
    margin-left: 0;
    left: 0;
  }

  .header-search {
    display: none;
  }
  .header-clock-date {
    display: none;
  }
  .header-clock {
    padding: 7px 12px;
  }
  .app-content {
    padding: 22px 20px 50px;
  }
}

@media (max-width: 768px) {
  /* Filters: every input / select / dropdown in a .filter-bar stacks and
     goes full width on mobile & tablet, instead of shrinking/wrapping
     side-by-side. Covers plain inputs, <select>, the custom multi-select
     (.ms-dropdown + its .form-select.ms-toggle button), and the date-range
     field. The refresh button stays compact and right-aligned. */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar .form-control,
  .filter-bar .form-select,
  .filter-bar .input-with-icon,
  .filter-bar .input-with-icon.filter-search,
  .filter-bar .input-with-icon.filter-daterange,
  .filter-bar .search-filter,
  .filter-bar .ms-dropdown,
  .filter-bar .ms-dropdown .ms-toggle {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }
  .filter-bar .ms-panel {
    width: 100%;
  }
  .filter-bar .filter-refresh-btn {
    width: 36px;
    align-self: flex-end;
  }

  .app-header {
    padding: 0 16px;
    gap: 10px;
  }
  .header-profile .who {
    display: none;
  }
  .header-profile {
    padding: 6px;
  }
  .page-head h1 {
    font-size: 18px;
  }
  /* Any inner row of buttons/badges inside .page-head (e.g. "Change
     Password" + "Logout", or the premium page's two CTAs) needs to wrap —
     otherwise forcing each .btn to width:100% below just squeezes them
     side-by-side instead of stacking them full-width. */
  .page-head > div {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .page-head .btn {
    width: 100%;
    justify-content: center;
  }
  .stat-card {
    padding: 15px 16px;
  }
  .card-body {
    padding: 16px 18px;
  }
  .card-head {
    padding: 14px 18px;
  }
}

@media (max-width: 600px) {
  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .stat-card .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .stat-card .stat-value {
    font-size: 20px;
  }
  .stat-card .stat-delta {
    margin-left: 0;
  }
}

@media (max-width: 576px) {
  .app-content {
    padding: 18px 14px 44px;
  }
  .header-clock {
    display: none;
  }
  .header-premium-tag {
    display: none;
  }
  .page-head {
    align-items: flex-start;
  }
  .page-head > div {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .dropdown-menu-custom {
    width: min(280px, calc(100vw - 24px));
    right: -6px;
  }
  .toast-stack {
    left: 16px;
    right: 16px;
    width: auto;
  }
  .filter-bar {
    padding: 12px 14px;
  }
  .metric-row {
    flex-wrap: wrap;
  }
  .metric-row .metric-label {
    width: 100%;
  }
  .metric-row .metric-value {
    width: auto;
    margin-left: auto;
  }
  .login-form-side {
    padding: 24px 18px;
  }
  .modal-box {
    padding: 18px;
  }
  .integration-row {
    flex-wrap: wrap;
  }
  .integration-actions {
    width: 100%;
    padding-left: 48px;
  }
}

/* ==========================================================================
   SIDEBAR — PREMIUM NAV ITEM
   ========================================================================== */
.side-link-premium {
  position: relative;
}
.side-link-premium i {
  color: var(--accent);
}
.side-link-premium .pro-chip {
  position: absolute;
  top: 4px;
  right: 6px;
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #221604;
  background: linear-gradient(135deg, #ffd77a 0%, var(--accent) 100%);
  padding: 1px 5px;
  border-radius: 999px;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
html.sidebar-expanded .side-link-premium {
  flex-direction: row;
  justify-content: flex-start;
}
html.sidebar-expanded .side-link-premium .pro-chip {
  position: static;
  margin-left: auto;
  padding: 2px 7px;
  font-size: 9px;
  box-shadow: none;
}
.side-link-premium.active i {
  color: var(--accent);
}

/* ==========================================================================
   PREMIUM PAGE
   ========================================================================== */

/* ---- Hero banner ---- */
.premium-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    150deg,
    var(--brand) 0%,
    var(--brand-600) 55%,
    #0c2233 100%
  );
  color: #fff;
  padding: 38px 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  box-shadow: var(--shadow-2);
  margin-bottom: 20px;
}
.premium-hero-sm {
  padding: 22px 30px;
}
.premium-hero-sm .premium-plan-chip {
  margin-bottom: 10px;
  padding: 4px 12px;
  font-size: 11px;
}
.premium-hero-sm h1 {
  font-size: 21px;
  margin-bottom: 6px;
  max-width: 775px;
}
.premium-hero-sm p {
  font-size: 13px;
  max-width: 775px;
}
.premium-hero-sm .premium-hero-actions {
  margin-top: 14px;
}
.premium-hero-sm .premium-hero-art {
  width: 84px;
  height: 84px;
}
.premium-hero-sm .premium-hero-art i {
  font-size: 30px;
}
.premium-hero::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(240, 166, 58, 0.22),
    transparent 70%
  );
}
.premium-hero::after {
  content: "";
  position: absolute;
  left: -70px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08),
    transparent 70%
  );
}
.premium-hero-content {
  position: relative;
  z-index: 1;
  max-width: 775px;
}
.premium-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #221604;
  background: linear-gradient(135deg, #ffd77a 0%, var(--accent) 100%);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.premium-hero h1 {
  font-size: 24px;
  color: #fff;
  line-height: 1.28;
  margin-bottom: 12px;
}
.premium-hero p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14.5px;
  line-height: 1.65;
  max-width: 775px;
}
.premium-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.premium-hero-actions .btn-ghost-light {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.premium-hero-actions .btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.18);
}
.premium-hero-art {
  position: relative;
  z-index: 1;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.premium-hero-art::before {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.premium-hero-art i {
  color: var(--accent);
  filter: drop-shadow(0 4px 10px rgba(240, 166, 58, 0.35));
}

/* ---- Section headings ---- */
.premium-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 14px;
}
.premium-section-label h2 {
  font-size: 17px;
}
.premium-section-label .line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.premium-section-label .count-pill {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-600);
  background: var(--accent-100);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---- Premium facilities (white card grid) ---- */
/* ---- Premium Facilities grid — icon tile + title + copy + "Learn more",
   each facility sits on its own white card with a creative hover effect. ---- */
.premium-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 24px;
}
.premium-feature-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 320ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* Diagonal light sweep that glides across the card on hover */
.premium-feature-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    115deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  transform: skewX(-18deg);
  transition: left 650ms ease;
  pointer-events: none;
  z-index: 2;
}
html[data-theme="dark"] .premium-feature-tile::before {
  background: linear-gradient(
    115deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
}
/* Gradient accent bar that grows in from the left along the bottom edge */
.premium-feature-tile::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 380ms ease;
}
.premium-feature-tile:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-2);
  border-color: var(--accent);
}
.premium-feature-tile:hover::before {
  left: 130%;
}
.premium-feature-tile:hover::after {
  width: 100%;
}
.premium-feature-tile .feature-icon-tile {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--brand-100);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  flex-shrink: 0;
  margin-bottom: 18px;
  transition:
    transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
    background 320ms ease,
    color 320ms ease;
}
.premium-feature-tile:hover .feature-icon-tile {
  transform: scale(1.08) rotate(-4deg);
  background: var(--brand);
  color: #fff;
}
.premium-feature-tile h4 {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.3;
}
.premium-feature-tile p {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.65;
  margin: 0 0 0;
}
.premium-feature-tile .feature-actions-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.premium-feature-tile .feature-learn-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--src-google);
  text-decoration: none;
}
.premium-feature-tile .feature-learn-more i {
  font-size: 12px;
  transition: transform var(--transition);
}
.premium-feature-tile:hover .feature-learn-more i {
  transform: translateX(3px);
}
.feature-badge-wrap {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 7px;
  gap: 2px;
}
.feature-badge-new {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
}
/* Small dismiss control shared by the "NEW" badge and the "Learn more"
   link — quiet by default, revealed once the card is hovered so the
   layout stays clean until the user actually wants to remove one. */
.feature-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 200ms ease,
    transform 200ms ease,
    background 150ms ease,
    color 150ms ease;
}
.premium-feature-tile:hover .feature-remove-btn {
  opacity: 1;
  transform: scale(1);
}
.feature-remove-btn:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.feature-badge-wrap .feature-remove-btn {
  margin-left: 2px;
}
.premium-feature-tile.facility-removing {
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

/* ---- Connect to Us ---- */
.connect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.connect-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow-1);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}
.connect-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: var(--brand-400);
}
.connect-card .connect-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  margin: 0 auto 14px;
}
.connect-card h4 {
  font-size: 14.5px;
  margin-bottom: 6px;
}
.connect-card p {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 16px;
  line-height: 1.55;
}
.connect-card .btn {
  width: 100%;
}

/* ---- Contact form section ---- */
.premium-contact-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 18px;
  align-items: stretch;
}
.premium-contact-info {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.premium-contact-info::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08),
    transparent 70%
  );
}
.premium-contact-info h3 {
  color: #fff;
  font-size: 19px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.premium-contact-info p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}
.premium-contact-info ul {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.premium-contact-info li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}
.premium-contact-info li i {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.contact-method-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.contact-method-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition:
    background var(--transition),
    transform var(--transition);
}
.contact-method-list li:hover {
  background: rgba(255, 255, 255, 0.13);
  transform: translateX(2px);
}
.contact-method-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  color: #fff;
}
.contact-method-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.contact-method-text .label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.55);
}
.contact-method-text a {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  word-break: break-word;
}
.contact-method-text a:hover {
  color: var(--accent);
}
.premium-contact-info .response-note {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
}
.premium-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.premium-form-grid .form-group.full {
  grid-column: 1 / -1;
}

/* ---- Crown icon (brand premium mark) ----
   Bootstrap Icons has no built-in crown glyph, so this fills that gap the
   same way: use it exactly like any other icon — <i class="bi bi-crown"></i>.
   Size follows font-size, color follows currentColor, just like bi-*. */
.bi-crown::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='3.4' r='1.7'/%3E%3Ccircle cx='3.6' cy='7' r='1.5'/%3E%3Ccircle cx='20.4' cy='7' r='1.5'/%3E%3Cpath d='M3.6 9.6c-.5 0-.9.44-.8.95l1.9 9.1c.16.78.85 1.35 1.65 1.35h11.3c.8 0 1.49-.57 1.65-1.35l1.9-9.1c.1-.51-.3-.95-.8-.95-.32 0-.61.18-.75.47l-3.05 6.03-3.29-6.5a.85.85 0 0 0-1.52 0l-3.29 6.5-3.05-6.03a.84.84 0 0 0-.75-.47Z'/%3E%3Crect x='6.3' y='20.6' width='11.4' height='2.1' rx='1.05'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='3.4' r='1.7'/%3E%3Ccircle cx='3.6' cy='7' r='1.5'/%3E%3Ccircle cx='20.4' cy='7' r='1.5'/%3E%3Cpath d='M3.6 9.6c-.5 0-.9.44-.8.95l1.9 9.1c.16.78.85 1.35 1.65 1.35h11.3c.8 0 1.49-.57 1.65-1.35l1.9-9.1c.1-.51-.3-.95-.8-.95-.32 0-.61.18-.75.47l-3.05 6.03-3.29-6.5a.85.85 0 0 0-1.52 0l-3.29 6.5-3.05-6.03a.84.84 0 0 0-.75-.47Z'/%3E%3Crect x='6.3' y='20.6' width='11.4' height='2.1' rx='1.05'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.premium-hero-art .bi-crown::before {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 4px 10px rgba(240, 166, 58, 0.35));
}
.premium-hero-sm .premium-hero-art .bi-crown::before {
  width: 32px;
  height: 32px;
}
.side-link-premium .bi-crown {
  font-size: 19px;
  color: var(--accent);
}

/* ---- Locked / premium-gated feature pattern ----
   Wrap any card's body in .premium-lock-wrap, put the real content in
   .locked-content (it gets blurred + disabled), and drop a
   .premium-lock-overlay on top with a short pitch + upgrade CTA. */
.premium-lock-wrap {
  position: relative;
}
.premium-lock-wrap .locked-content {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
}
.premium-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(1px);
  border-radius: 0 0 var(--radius) var(--radius);
}
.premium-lock-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd77a 0%, var(--accent) 100%);
  color: #221604;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(240, 166, 58, 0.35);
  margin-bottom: 2px;
}
.premium-lock-icon .bi-crown::before {
  width: 20px;
  height: 20px;
}
.premium-lock-overlay h4 {
  font-size: 14px;
  margin: 0;
}
.premium-lock-overlay p {
  font-size: 12px;
  color: var(--ink-soft);
  max-width: 260px;
  margin: 0;
  line-height: 1.5;
}
.premium-lock-overlay .btn {
  margin-top: 4px;
}
.bg-accent {
  background-color: var(--accent);
  color: #221604;
}
/* Small inline "Premium" tag — use next to a feature name, menu item, or button */
.premium-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #221604;
  background: linear-gradient(135deg, #ffd77a 0%, var(--accent) 100%);
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.premium-tag .bi-crown {
  font-size: 10px;
}

/* ---- Premium plan status banner — shown on a company's own dashboard
   once their plan is active, in place of the "Upgrade to Premium" CTA. ---- */
.plan-status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-1);
}
.plan-status-premium {
  background: linear-gradient(120deg, #241705 0%, #573b0c 55%, #7a5412 100%);
  border: 1px solid rgba(240, 166, 58, 0.35);
}
.plan-status-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffd77a 0%, var(--accent) 100%);
  color: #221604;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(240, 166, 58, 0.35);
}
.plan-status-body {
  flex: 1;
  min-width: 0;
}
.plan-status-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
}
.plan-status-days {
  font-size: 11px;
  font-weight: 700;
  color: #221604;
  background: var(--accent);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.plan-status-sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.68);
  margin-top: 3px;
}
.plan-status-action {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}
.plan-status-action:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Duration progress bar — .plan-progress is the light variant for use
   inside a plain white card; add .plan-progress-invert for use on a dark
   surface like .plan-status-banner above. */
.plan-progress {
  margin-top: 10px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent-100);
  overflow: hidden;
  max-width: 320px;
}
.plan-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd77a, var(--accent-600));
}
.plan-progress-invert {
  background: rgba(255, 255, 255, 0.16);
}

/* Subtle premium accent carried onto a company's own dashboard stat cards */
.stat-card {
  border-left: 3px solid var(--accent);
}

/* Compact dashboard/reports upgrade banner */
.premium-teaser-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-600) 100%);
  border-radius: var(--radius);
  padding: 16px 22px;
  color: #fff;
  margin-bottom: 18px;
}
.premium-teaser-banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(240, 166, 58, 0.28),
    transparent 70%
  );
}
.premium-teaser-left {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.premium-teaser-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.premium-teaser-icon .bi-crown {
  font-size: 19px;
  color: var(--accent);
}
.premium-teaser-text strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.premium-teaser-text span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
}
.premium-teaser-banner .btn-accent {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* ---- Quote of the Day banner ---- */
.quote-of-day-banner {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(120deg, #4338ca 0%, #7c5cfc 48%, #c24cdb 100%);
  border-radius: var(--radius);
  padding: 16px 24px;
  color: #fff;
  margin-bottom: 18px;
}
.quote-of-day-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(
      circle at 88% -30%,
      rgba(255, 255, 255, 0.28),
      transparent 55%
    ),
    radial-gradient(
      circle at -8% 130%,
      rgba(255, 255, 255, 0.2),
      transparent 55%
    );
  pointer-events: none;
}
.qod-decor {
  position: absolute;
  right: 16px;
  top: 4px;
  z-index: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 100px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.14);
  pointer-events: none;
  user-select: none;
}
.qod-icon {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: qodPulse 2.6s ease-in-out infinite;
}
.qod-icon i {
  font-size: 20px;
  color: #fff;
}
@keyframes qodPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}
.qod-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.qod-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 10px;
  border-radius: 100px;
}
.qod-eyebrow i {
  color: #ffd873;
  font-size: 11px;
}
.qod-body strong {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(4px);
  animation: qodFadeIn 0.5s ease forwards 0.1s;
}
.qod-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  opacity: 0;
  animation: qodFadeIn 0.5s ease forwards 0.28s;
}
@keyframes qodFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 640px) {
  .qod-decor {
    display: none;
  }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .premium-contact-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .connect-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 900px) {
  .premium-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .premium-features-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .premium-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 26px;
  }
  .premium-hero-sm {
    padding: 20px 22px;
  }
  .premium-hero-art {
    display: none;
  }
}
@media (max-width: 560px) {
  .connect-grid {
    grid-template-columns: 1fr;
  }
  .premium-form-grid {
    grid-template-columns: 1fr;
  }
  .premium-contact-info,
  .premium-form-card .card-body {
    padding: 22px 18px;
  }
  .premium-hero h1 {
    font-size: 23px;
  }
}

/* Extra-narrow phones (iPhone SE / small Android, ~320–400px): the header
   icon cluster (brand + theme toggle + notification bell + profile avatar)
   is the tightest fit in the whole layout, so trim it a bit further here. */
@media (max-width: 400px) {
  .app-header {
    padding: 0 10px;
    gap: 6px;
  }
  .header-brand-logo {
    height: 28px;
  }
  .header-icon-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
  .header-profile {
    padding: 5px;
  }
  .dropdown-menu-notif,
  .dropdown-menu-custom {
    width: calc(100vw - 20px);
    right: -4px;
  }
}

html[data-role="admin"] [data-role-only="company"] {
  display: none !important;
}
html[data-role="company"] [data-role-only="admin"] {
  display: none !important;
}

/* ---------- Premium Requests table: responsive tweaks ---------- */
.pr-status-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Change-status popup: fixed position, positioned via JS near the icon,
   so it isn't clipped by the table's horizontal scroll container, and is
   hidden on scroll/resize so it never drifts away from the icon. */
.pr-status-popup {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  width: 150px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  z-index: 500;
}
.pr-status-popup.show {
  display: block;
}
.pr-status-popup .dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.pr-status-popup .dd-item:hover {
  background: var(--surface-2);
}
.pr-status-popup .dd-item i {
  color: var(--ink-soft);
  width: 16px;
  text-align: center;
}
.pr-status-popup .dd-item.danger {
  color: var(--danger);
}
.pr-status-popup .dd-item.danger i {
  color: var(--danger);
}

@media (max-width: 768px) {
  #prTable thead th,
  #prTable tbody td {
    padding: 10px 10px;
    font-size: 12.5px;
  }
  #prTable .cell-primary {
    font-size: 13px;
  }
  #prTable .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
  }
}
@media (max-width: 576px) {
  #prTable thead th,
  #prTable tbody td {
    padding: 8px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* ---- Premium Member view ----
   Shown on premium.php in place of the sales/upgrade hero once a company's
   plan is already active — same shell as .premium-hero, dressed in the
   gold "member" palette instead of navy, with a status ring instead of a
   plain crown. ---- */
.premium-member-hero {
  background: linear-gradient(150deg, #573b0c 0%, #2e1e07 55%, #140c03 100%);
}
.premium-member-hero::before {
  background: radial-gradient(circle, rgba(255, 215, 122, 0.28), transparent 70%);
}
.premium-member-hero .member-chip {
  background: linear-gradient(135deg, #ffe7ad 0%, #ffd77a 45%, var(--accent) 100%);
}
.premium-member-hero h1 i.bi-stars {
  color: var(--accent);
}

/* Circular renewal-progress ring, drawn with a conic-gradient donut and a
   solid center cut-out so it reads as "days left" at a glance. */
.member-ring-wrap {
  background: transparent;
  border: none;
}
.member-ring-wrap::before {
  display: none;
}
.member-ring {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    var(--accent) calc(var(--ring-percent, 0) * 1%),
    rgba(255, 255, 255, 0.14) 0
  );
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.member-ring::before {
  content: none;
}
.member-ring-inner {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #2b1c07;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.member-ring-inner strong {
  font-family: var(--font-display);
  font-size: 24px;
  color: #fff;
  line-height: 1.1;
}
.member-ring-inner span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

/* "Active" ribbon + usage pill on a Premium Benefits tile the company has
   already unlocked — swaps the marketing "Learn more" pattern for proof
   that the feature is actually in use. */
.premium-feature-tile.benefit-tile-active {
  border-color: var(--accent-100);
}
.benefit-ribbon {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--success);
  background: var(--success-bg);
  padding: 3px 10px;
  border-radius: 999px;
}
@media (max-width: 900px) {
  .member-ring-wrap {
    width: 108px;
    height: 108px;
  }
  .member-ring {
    width: 108px;
    height: 108px;
  }
  .member-ring-inner {
    width: 84px;
    height: 84px;
  }
  .member-ring-inner strong {
    font-size: 20px;
  }
}

.error{
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
}
.is-invalid{
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
}
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{
  font-size: 0.85rem;
}
.flatpickr-current-month .flatpickr-monthDropdown-months, .flatpickr-current-month input.cur-year{
  font-size: 16px;
}

/*21-Sept*/

#current_passwordSubmit .input-with-icon > i,
#companyForm .input-with-icon > i {
    top: 21px;
}

#current_passwordSubmit .input-with-icon > span.is-invalid,
#companyForm .input-with-icon > span.is-invalid {
    display: block;
}

#current_passwordSubmit .input-with-icon .form-control.is-invalid,
#companyForm .input-with-icon .form-control.is-invalid {
    margin-top: 0;
    font-size: 13.5px;
}

.premium-hero::selection,
.premium-hero *::selection,
.app-sidebar::selection,
.app-sidebar *::selection,
.login-visual::selection,
.login-visual *::selection,.qod-body span::selection, .qod-body strong::selection {
    background: rgba(255, 255, 255, 0.28);   
    color: #fff;                              
}


/* ---- Premium renewal reminder popup ----
   A once-a-day modal shown on the company dashboard when the Premium plan
   is close to expiry — a gold "banner" header with a days-left progress
   ring straddling into a plain white body, so the countdown reads as the
   focal point rather than another line of text. ---- */
.premium-reminder-box {
  width: 400px;
  max-width: 92vw;
  padding: 0;
  overflow: hidden;
  text-align: center;
}
.premium-reminder-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #573b0c 0%, #2e1e07 60%, #140c03 100%);
  padding: 30px 24px 58px;
}
.premium-reminder-banner::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 215, 122, 0.3),
    transparent 70%
  );
}
.premium-reminder-banner::after {
  content: "";
  position: absolute;
  left: -50px;
  bottom: -60px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08),
    transparent 70%
  );
}
.premium-reminder-banner .premium-plan-chip {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  background: linear-gradient(
    135deg,
    #ffe7ad 0%,
    #ffd77a 45%,
    var(--accent) 100%
  );
}
.premium-reminder-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.premium-reminder-close:hover {
  background: rgba(255, 255, 255, 0.26);
}
.premium-reminder-ring-wrap {
  position: relative;
  z-index: 2;
  width: 112px;
  height: 112px;
  margin: -56px auto 0;
}
.premium-reminder-ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    var(--accent) calc(var(--ring-percent, 0) * 1%),
    rgba(255, 255, 255, 0.18) 0
  );
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}
.premium-reminder-ring-inner {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.premium-reminder-ring-inner strong {
  font-family: var(--font-display);
  font-size: 27px;
  color: var(--ink);
  line-height: 1;
}
.premium-reminder-ring-inner span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 3px;
}
.premium-reminder-body {
  padding: 14px 26px 26px;
}
.premium-reminder-body h4 {
  font-size: 16.5px;
  margin: 14px 0 8px;
}
.premium-reminder-body p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 20px;
}
.premium-reminder-actions {
  display: flex;
  gap: 10px;
}
.premium-reminder-actions .btn {
  flex: 1;
}
