@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --background: #f4efe7;
  --surface: #fffaf4;
  --surface-alt: #f7efe5;
  --text: #1f1a15;
  --muted: #6d6359;
  --border: #ddcfbd;
  --accent: #b65a36;
  --accent-dark: #8e3f21;
  --shadow: rgba(53, 37, 24, 0.08);
  --sticky-top: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(182, 90, 54, 0.15), transparent 30%),
    linear-gradient(180deg, #f8f2ea 0%, var(--background) 100%);
  font-family: "Montserrat", sans-serif;
}

body.page-contacts,
body.page-contacts .main {
  background: #fffaf4;
}

body.page-pipeline,
body.page-pipeline .main {
  background: #fffaf4;
}

body.page-recurring,
body.page-recurring .main {
  background: #fffaf4;
}

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 22px;
  padding: 18px 12px 16px;
  background: rgba(255, 252, 248, 0.94);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.main {
  padding: 22px 26px 28px;
}

.topbar,
.panel-header,
.pipeline-header,
.panel-header-stack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header-stack {
  align-items: flex-start;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  margin: -22px -26px 18px;
  padding: 16px 26px 14px;
  background: rgba(255, 250, 244, 0.82);
  border-bottom: 1px solid rgba(221, 207, 189, 0.72);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.72rem;
}

h3 {
  font-size: 1.18rem;
}

.button {
  border-radius: 14px;
  transition: 160ms ease;
}

.button.is-busy,
.button[disabled] {
  opacity: 0.72;
  cursor: wait;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-privacy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(221, 207, 189, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.topbar-privacy-toggle:hover {
  border-color: rgba(182, 90, 54, 0.28);
  background: rgba(255, 247, 241, 0.98);
  color: var(--accent);
}

.topbar-privacy-toggle:focus-visible {
  outline: 2px solid rgba(182, 90, 54, 0.28);
  outline-offset: 2px;
}

.topbar-privacy-toggle.is-active {
  border-color: rgba(182, 90, 54, 0.36);
  background: rgba(255, 241, 235, 0.98);
  color: var(--accent);
  box-shadow: 0 10px 24px rgba(182, 90, 54, 0.12);
}

.topbar-privacy-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.topbar-privacy-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-privacy-label {
  white-space: nowrap;
}

.topbar-badge,
.topbar-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(221, 207, 189, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.topbar-badge {
  color: var(--accent);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid rgba(221, 207, 189, 0.96);
  background: #fffdfa;
  color: var(--text);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: inset 0 -1px 0 rgba(221, 207, 189, 0.8);
}

.sidebar-card,
.panel,
.stat-card,
.pipeline-card,
.pipeline-column,
.auth-card,
.error-card,
.alert {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 20px 50px var(--shadow);
}

.sidebar-card,
.panel,
.auth-card,
.error-card,
.alert {
  border-radius: 18px;
}

.sidebar-brand {
  width: 100%;
  display: grid;
  place-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(221, 207, 189, 0.7);
}

.sidebar-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 247, 241, 1), rgba(255, 239, 229, 0.96));
  box-shadow: 0 12px 28px rgba(53, 37, 24, 0.08);
}

.sidebar-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sidebar-nav,
.sidebar-nav-utility {
  width: 100%;
  display: grid;
  gap: 8px;
}

.sidebar-nav-link {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 20px;
  color: #6f7788;
  transition: 160ms ease;
}

.sidebar-nav-link:hover {
  background: rgba(255, 248, 242, 0.95);
  border-color: rgba(221, 207, 189, 0.85);
}

.sidebar-nav-link.is-active {
  background: linear-gradient(180deg, rgba(255, 244, 239, 0.98), rgba(255, 236, 226, 0.96));
  border-color: rgba(238, 199, 182, 0.8);
  color: var(--accent);
  box-shadow: 0 10px 22px rgba(182, 90, 54, 0.08);
}

.sidebar-nav-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.sidebar-nav-link.is-active .sidebar-nav-icon {
  background: rgba(255, 250, 246, 0.88);
}

.sidebar-nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
}

.sidebar-footer {
  width: 100%;
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.sidebar-user-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 6px auto 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff7c5f 0%, #ff6a62 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card-grid-dashboard {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-card {
  padding: 18px;
  border-radius: 18px;
}

.stat-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.7rem;
}

.stat-card span {
  color: var(--muted);
}

.panel {
  padding: 18px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.dashboard-hero h3 {
  margin-bottom: 6px;
}

.dashboard-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.dashboard-task-list,
.dashboard-compact-list {
  display: grid;
  gap: 10px;
}

.dashboard-task-card,
.dashboard-compact-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.86);
}

.dashboard-card-link {
  display: grid;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-card-link:hover {
  transform: translateY(-1px);
  border-color: rgba(182, 90, 54, 0.28);
  box-shadow: 0 16px 34px rgba(45, 34, 24, 0.08);
}

html.privacy-mode [data-sensitive],
html.privacy-mode .contact-card-avatar,
html.privacy-mode .contact-card h4,
html.privacy-mode .contact-card-line,
html.privacy-mode .contact-detail-avatar,
html.privacy-mode .pipeline-card > strong,
html.privacy-mode .pipeline-card-company,
html.privacy-mode .contact-activity-copy p,
html.privacy-mode [data-contact-field="full_name_with_company"],
html.privacy-mode [data-contact-field="first_name"],
html.privacy-mode [data-contact-field="last_name"],
html.privacy-mode [data-contact-field="company_name"],
html.privacy-mode [data-contact-field="email"],
html.privacy-mode [data-contact-field="phone"],
html.privacy-mode [data-contact-field="website"],
html.privacy-mode [data-contact-field="additional_info"],
html.privacy-mode [data-pipeline-field="full_name_with_company"],
html.privacy-mode [data-pipeline-field="company_name"],
html.privacy-mode [data-pipeline-field="email"],
html.privacy-mode [data-pipeline-field="phone"],
html.privacy-mode [data-pipeline-field="website"],
html.privacy-mode [data-pipeline-field="additional_info"],
html.privacy-mode input[data-sensitive-input],
html.privacy-mode textarea[data-sensitive-input] {
  filter: blur(10px);
  transition: filter 160ms ease;
  user-select: none;
}

html.privacy-mode .contact-card-avatar,
html.privacy-mode .contact-detail-avatar {
  box-shadow: none;
}

.dashboard-task-head,
.dashboard-task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-task-card p,
.dashboard-compact-item span,
.dashboard-task-meta,
.dashboard-compact-item small {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

.panel-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
}

.panel-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 4px;
}

.search-field {
  flex: 1;
  max-width: 420px;
}

.search-field label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.search-field input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.search-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.contacts-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 16px 0 8px;
  position: sticky;
  top: 78px;
  z-index: 16;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.97), rgba(255, 250, 244, 0.86));
  backdrop-filter: blur(10px);
}

.contacts-toolbar-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: center;
}

.contacts-toolbar-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.toolbar-hint {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.contacts-create-button {
  min-height: 58px;
  padding: 0 20px;
  white-space: nowrap;
}

.contacts-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.contact-search-bar,
.contact-sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(221, 207, 189, 0.9);
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.contact-search-icon,
.contact-sort-icon {
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
}

.contact-search-bar input,
.contact-sort-bar select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.contact-search-bar input::placeholder {
  color: #8b8178;
}

.contacts-directory-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  position: sticky;
  top: 156px;
  z-index: 15;
  padding: 0 0 8px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(255, 250, 244, 0.72));
  color: var(--muted);
  font-size: 0.88rem;
}

.contacts-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.contacts-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.contacts-directory {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 26, 21, 0.18);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
  z-index: 36;
}

.modal-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.create-modal {
  position: fixed;
  inset: 0;
  z-index: 37;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.create-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.create-modal-card {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(53, 37, 24, 0.16);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.create-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  position: sticky;
  top: -22px;
  z-index: 2;
  margin-left: -22px;
  margin-right: -22px;
  padding: 22px 22px 16px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.99), rgba(255, 250, 244, 0.94));
  border-bottom: 1px solid rgba(221, 207, 189, 0.72);
  backdrop-filter: blur(10px);
}

.create-modal-head h3 {
  margin-bottom: 6px;
}

.create-modal-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.create-modal-form {
  display: grid;
  gap: 18px;
}

.create-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.create-modal-grid label,
.create-modal-grid > div {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.create-modal-grid label.is-full,
.create-modal-grid > div.is-full {
  grid-column: 1 / -1;
}

.create-modal-grid input,
.create-modal-grid select {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(221, 207, 189, 0.9);
  border-radius: 14px;
  background: #fffdfa;
  color: var(--text);
  font: inherit;
}

.create-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.contact-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  align-items: start;
  width: min(60%, 860px);
  padding: 18px 20px;
  border: 1px solid rgba(221, 207, 189, 0.88);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(255, 248, 240, 0.94));
  box-shadow: 0 16px 38px rgba(53, 37, 24, 0.06);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.contact-card:hover,
.contact-card.is-active {
  border-color: rgba(182, 90, 54, 0.32);
  box-shadow: 0 20px 40px rgba(93, 54, 31, 0.12);
}

.contact-card:hover {
  transform: translateY(-2px);
}

.contact-card.is-active {
  background: linear-gradient(180deg, rgba(255, 248, 241, 1), rgba(255, 244, 235, 0.98));
}

.contact-card-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at top, rgba(255, 220, 213, 0.7), rgba(255, 240, 236, 0.92));
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.contact-card-body {
  min-width: 0;
}

.contact-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.contact-card-head h4 {
  margin: 0;
  font-size: clamp(1.04rem, 1.25vw, 1.24rem);
  line-height: 1.1;
}

.contact-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-status-pill {
  background: rgba(232, 228, 249, 0.9);
  color: #4763c9;
}

.contact-status-pill-client {
  background: rgba(229, 242, 227, 0.95);
  color: #2c7f4f;
}

.contact-status-pill-perdu {
  background: rgba(248, 232, 228, 0.98);
  color: #b34a39;
}

.contact-status-pill-non_qualifie {
  background: rgba(239, 232, 224, 0.95);
  color: #705f53;
}

.contact-status-pill-recommande {
  background: rgba(255, 241, 225, 0.98);
  color: #a06118;
}

.contact-card-company,
.contact-card-role,
.contact-card-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.contact-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(247, 239, 229, 0.95);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.mini-chip-accent {
  background: rgba(255, 240, 232, 0.98);
  color: var(--accent);
}

.contact-card-company {
  color: var(--text);
  font-weight: 600;
}

.contact-card-follow-up {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-card-next-action {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-card-next-action.is-missing {
  color: var(--accent);
}

.contact-card-phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

body.drawer-open {
  overflow: hidden;
}

.contact-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 26, 21, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 40;
}

.contact-drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.contact-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(560px, calc(100vw - 36px));
  height: 100vh;
  transform: translateX(104%);
  transition: transform 220ms ease;
  z-index: 45;
  pointer-events: none;
}

.contact-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.contact-drawer-shell {
  height: 100%;
  padding: 18px;
  border-left: 1px solid rgba(221, 207, 189, 0.9);
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.99), rgba(255, 247, 240, 0.97));
  box-shadow: -18px 0 44px rgba(53, 37, 24, 0.12);
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

.drawer-sticky-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  gap: 10px;
  margin: -18px -18px 0;
  padding: 18px 18px 10px;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.995), rgba(255, 247, 240, 0.95));
  border-bottom: 1px solid rgba(221, 207, 189, 0.7);
  backdrop-filter: blur(14px);
}

.contact-detail-topbar,
.contact-detail-title-row,
.contact-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contact-detail-close {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(221, 207, 189, 0.95);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.94);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.contact-detail-kicker {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-detail-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 3px;
  border: 1px solid rgba(221, 207, 189, 0.9);
  border-radius: 15px;
  background: rgba(246, 239, 231, 0.9);
}

.contact-detail-tab {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
}

.contact-detail-tab.is-active {
  background: #fffdf9;
  color: var(--accent);
  box-shadow: 0 10px 24px rgba(53, 37, 24, 0.05);
}

.contact-detail-content {
  display: grid;
  gap: 16px;
}

.contact-detail-header {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 14px;
  align-items: center;
}

.contact-detail-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at top, rgba(255, 220, 213, 0.76), rgba(255, 239, 233, 0.96));
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.contact-detail-identity h3,
.contact-detail-company,
.contact-detail-role {
  margin-bottom: 0;
}

.contact-detail-identity h3 {
  font-size: 1.45rem;
}

.contact-detail-company {
  margin-top: 8px;
  font-weight: 600;
  font-size: 0.96rem;
}

.contact-detail-role {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-detail-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.contact-action-button {
  min-width: 96px;
  gap: 8px;
}

.contact-action-button.is-disabled,
.button-secondary.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.mail-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

.mail-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-save-alert {
  padding: 11px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 600;
}

.contact-save-alert-success {
  background: #eefaf0;
  color: #2f7b44;
  border: 1px solid #cae5ce;
}

.contact-save-alert-error {
  background: #fff3f0;
  color: #b94936;
  border: 1px solid #ebc5be;
}

.contact-detail-grid,
.contact-detail-grid-single {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.contact-detail-card {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid rgba(221, 207, 189, 0.88);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.96);
}

.contact-detail-card strong,
.contact-detail-card p {
  margin-bottom: 0;
}

.contact-detail-card-full {
  width: 100%;
}

.contact-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-edit-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(221, 207, 189, 0.95);
  border-radius: 10px;
  background: rgba(255, 251, 246, 0.98);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  transition: 160ms ease;
}

.field-edit-button:hover {
  background: rgba(255, 244, 236, 0.98);
}

.field-display.is-hidden {
  display: none;
}

.field-editor {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.field-editor-static {
  margin-top: 0;
}

.choice-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-chip {
  position: relative;
  display: inline-flex;
}

.choice-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.choice-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(221, 207, 189, 0.92);
  border-radius: 999px;
  background: #fffdf9;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  transition: 160ms ease;
  cursor: pointer;
}

.choice-chip input:checked + span {
  border-color: rgba(182, 90, 54, 0.36);
  background: rgba(255, 242, 234, 0.98);
  color: var(--accent);
}

.choice-chip span:hover {
  border-color: rgba(182, 90, 54, 0.24);
  background: rgba(255, 247, 241, 0.98);
}

.field-editor input,
.field-editor select,
.field-editor textarea,
.date-picker-trigger {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(221, 207, 189, 0.95);
  border-radius: 12px;
  background: #fffdf9;
  color: var(--text);
  font: inherit;
}

.field-editor textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.field-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.date-picker {
  position: relative;
  display: grid;
  gap: 8px;
}

.date-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
}

.date-picker-clear {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.date-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 72px));
  padding: 16px;
  border: 1px solid rgba(221, 207, 189, 0.95);
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 16px 34px rgba(53, 37, 24, 0.12);
  z-index: 4;
}

.date-picker-header,
.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.date-picker-header {
  grid-template-columns: 40px 1fr 40px;
  margin-bottom: 12px;
}

.date-picker-header strong {
  text-align: center;
  text-transform: lowercase;
}

.date-picker-nav {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(221, 207, 189, 0.9);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
}

.date-picker-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.date-picker-day {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.date-picker-day:hover {
  background: rgba(255, 238, 232, 0.92);
}

.date-picker-day.is-selected {
  background: linear-gradient(180deg, #ff7260 0%, #ff5a54 100%);
  color: #fff;
}

.date-picker-day.is-muted {
  color: #c4b9ae;
  cursor: default;
}

.contact-detail-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-detail-notes {
  display: grid;
  gap: 10px;
}

.contact-activity-list {
  display: grid;
  gap: 12px;
}

.contact-activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 14px;
  align-items: start;
  padding: 0 0 0 4px;
}

.contact-activity-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: -16px;
  width: 1px;
  background: rgba(182, 90, 54, 0.2);
}

.contact-activity-item:last-child::before {
  display: none;
}

.contact-activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.contact-activity-copy {
  display: grid;
  gap: 6px;
}

.contact-activity-copy strong,
.contact-activity-copy p {
  margin-bottom: 0;
}

.contact-activity-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.contact-activity-empty {
  padding: 8px 0;
}

.contact-activity-empty strong {
  display: block;
  margin-bottom: 8px;
}

.contact-activity-empty p {
  margin-bottom: 0;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.table th,
.table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fffdfb;
  font-size: 0.92rem;
  font-weight: 700;
}

.button:hover {
  background: var(--accent-dark);
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.button-secondary:hover {
  background: #fff7f0;
  color: var(--text);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.meta-list {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
}

.meta-list div {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.meta-list dt {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.meta-list dd {
  margin: 0;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.settings-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.settings-activity-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.settings-activity-list li {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.settings-activity-list span,
.settings-activity-list small {
  color: var(--muted);
}

.alert {
  padding: 14px 16px;
  margin-bottom: 14px;
}

.alert-success {
  border-color: #bfd7bf;
  background: #f4fbf2;
}

.alert-error {
  border-color: #dfc2be;
  background: #fff5f2;
}

.empty-state {
  padding: 16px 0;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.pipeline-empty {
  grid-column: 1 / -1;
}

.is-hidden {
  display: none;
}

.pipeline-column {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 250, 244, 0.96);
}

.pipeline-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.pipeline-card p,
.pipeline-card span,
.pipeline-card small {
  color: var(--muted);
}

.pipeline-page {
  display: grid;
  gap: 16px;
}

.pipeline-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.pipeline-intro h3 {
  margin-bottom: 8px;
  font-size: 1.28rem;
}

.pipeline-intro p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.pipeline-intro-badge {
  display: grid;
  gap: 4px;
  min-width: 250px;
  padding: 14px 16px;
  border: 1px solid rgba(221, 207, 189, 0.9);
  border-radius: 18px;
  background: rgba(255, 251, 246, 0.94);
  box-shadow: 0 14px 30px rgba(53, 37, 24, 0.05);
}

.pipeline-intro-badge strong {
  font-size: 0.94rem;
}

.pipeline-intro-badge span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.pipeline-metrics {
  margin-bottom: 2px;
}

.pipeline-metric-card {
  padding: 16px;
}

.pipeline-metric-card strong {
  margin-bottom: 4px;
  font-size: 1.6rem;
}

.pipeline-metric-card-due {
  border-color: rgba(255, 186, 176, 0.9);
}

.pipeline-metric-card-no_follow_up {
  border-color: rgba(245, 214, 166, 0.9);
}

.pipeline-metric-card-nouveau_prospect {
  border-color: rgba(208, 197, 240, 0.95);
}

.pipeline-metric-card-attente_prospect {
  border-color: rgba(196, 223, 246, 0.95);
}

.pipeline-metric-card-gagne {
  border-color: rgba(143, 196, 155, 0.95);
}

.pipeline-metric-card-perdu {
  border-color: rgba(209, 195, 182, 0.95);
}

.pipeline-toolbar {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 78px;
  z-index: 16;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.97), rgba(255, 250, 244, 0.86));
  backdrop-filter: blur(10px);
}

.pipeline-toolbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.pipeline-toolbar .contact-search-bar {
  width: min(560px, 100%);
}

.pipeline-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pipeline-board-options {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 10px;
  position: sticky;
  top: 162px;
  z-index: 15;
  padding-bottom: 6px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(255, 250, 244, 0.72));
}

.pipeline-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(221, 207, 189, 0.88);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  transition: 160ms ease;
}

.pipeline-filter-chip strong {
  font-size: 0.78rem;
  color: var(--text);
}

.pipeline-filter-chip:hover,
.pipeline-filter-chip.is-active {
  border-color: rgba(182, 90, 54, 0.28);
  color: var(--accent);
  background: rgba(255, 244, 237, 0.98);
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  overflow-x: visible;
  align-items: start;
  padding: 2px 0 10px;
}

.pipeline-lane {
  display: grid;
  gap: 10px;
  min-height: 100%;
  align-content: start;
  padding: 14px 14px 16px;
  border: 1px solid rgba(221, 207, 189, 0.88);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(255, 246, 238, 0.96));
  box-shadow: 0 16px 34px rgba(53, 37, 24, 0.06);
}

.pipeline-lane-nouveau_prospect {
  border-top: 3px solid #d7c6f3;
}

.pipeline-lane-attente_prospect {
  border-top: 3px solid #95bee3;
}

.pipeline-lane-gagne {
  border-top: 3px solid #8fc49b;
}

.pipeline-lane-perdu {
  border-top: 3px solid #d1c3b6;
}

.pipeline-lane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0 0 8px;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.99), rgba(255, 246, 238, 0.96));
}

.pipeline-lane-head > div {
  display: grid;
  gap: 4px;
  align-content: start;
}

.pipeline-lane-head h4,
.pipeline-lane-head p {
  margin-bottom: 0;
}

.pipeline-lane-head p {
  color: var(--muted);
  font-size: 0.8rem;
}

.pipeline-lane-meta {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 238, 233, 0.96);
  color: #cb5b49;
  font-size: 0.72rem;
  font-weight: 700;
}

.pipeline-lane-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.pipeline-prospect-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 14px 14px 12px;
  border: 1px solid rgba(221, 207, 189, 0.86);
  background: rgba(255, 253, 249, 0.98);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.pipeline-prospect-card.is-hidden {
  display: none !important;
}

.pipeline-prospect-card.is-dragging {
  opacity: 0.52;
  transform: rotate(-1deg);
}

.pipeline-lane-list.is-drop-target {
  outline: 2px dashed rgba(182, 90, 54, 0.4);
  outline-offset: 4px;
  border-radius: 18px;
}

.pipeline-prospect-card:hover,
.pipeline-prospect-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(182, 90, 54, 0.32);
  box-shadow: 0 18px 34px rgba(53, 37, 24, 0.1);
}

.pipeline-prospect-card.is-due {
  border-color: rgba(255, 106, 98, 0.4);
  box-shadow: 0 14px 26px rgba(255, 106, 98, 0.1);
}

.pipeline-card-lines {
  display: grid;
  gap: 4px;
}

.pipeline-card-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.pipeline-card-dot {
  color: rgba(182, 90, 54, 0.45);
}

.pipeline-card-top,
.pipeline-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pipeline-prospect-card strong,
.pipeline-prospect-card p,
.pipeline-prospect-card small {
  margin-bottom: 0;
}

.pipeline-card-follow-up {
  display: block;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.45;
}

.pipeline-card-action {
  display: block;
  color: var(--text);
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.45;
}

.pipeline-card-action.is-missing {
  color: var(--accent);
}

.pipeline-prospect-card strong {
  font-size: 0.98rem;
  line-height: 1.32;
  color: var(--text);
}

.pipeline-card-company {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.pipeline-card-line {
  font-size: 0.84rem;
  line-height: 1.45;
}

.pipeline-card-meta {
  font-size: 0.76rem;
}

.pipeline-due-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 235, 231, 0.96);
  color: #d05545;
  font-size: 0.76rem;
  font-weight: 700;
}

.pipeline-empty-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed rgba(221, 207, 189, 0.9);
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.7);
}

.pipeline-empty-card strong,
.pipeline-empty-card p {
  margin-bottom: 0;
}

.pipeline-empty-card p {
  color: var(--muted);
  line-height: 1.55;
}

.pipeline-drawer-subline {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.pipeline-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pipeline-quick-action {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(221, 207, 189, 0.88);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  transition: 160ms ease;
}

.pipeline-quick-action:hover {
  border-color: rgba(182, 90, 54, 0.3);
  background: rgba(255, 243, 236, 0.96);
  color: var(--accent);
}

.pipeline-drawer {
  width: min(580px, calc(100vw - 36px));
}

.pipeline-drawer.is-activity-wide {
  width: min(50vw, 960px);
}

.recurring-page {
  display: grid;
  gap: 18px;
}

.recurring-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  overflow: hidden;
}

.recurring-hero-copy {
  max-width: 720px;
}

.recurring-hero-copy h3 {
  margin-bottom: 8px;
  font-size: 1.42rem;
}

.recurring-hero-total {
  min-width: 260px;
  padding: 18px 20px;
  border: 1px solid rgba(182, 90, 54, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(182, 90, 54, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(255, 247, 239, 0.98), rgba(255, 252, 248, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.recurring-hero-total span,
.recurring-client-total span,
.recurring-breakdown-card span,
.recurring-client-updated {
  color: var(--muted);
}

.recurring-hero-total strong {
  display: block;
  margin: 10px 0 8px;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1;
}

.recurring-hero-total small {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
}

.recurring-metrics {
  margin-bottom: 2px;
}

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

.recurring-metric-card {
  padding: 16px;
}

.recurring-metric-card strong {
  display: block;
  margin: 4px 0 6px;
  font-size: 1.42rem;
}

.recurring-metric-card span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.recurring-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.recurring-breakdown-card {
  display: grid;
  gap: 10px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(221, 207, 189, 0.86);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(255, 247, 241, 0.92));
  box-shadow: 0 14px 34px rgba(53, 37, 24, 0.05);
}

.recurring-breakdown-card strong {
  font-size: 1.18rem;
}

.recurring-chart-panel,
.recurring-events-panel {
  padding: 20px;
}

.recurring-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 250px;
  margin-top: 18px;
}

.recurring-chart-bar {
  display: grid;
  gap: 8px;
  align-items: end;
  justify-items: center;
}

.recurring-chart-track {
  display: flex;
  align-items: end;
  width: 100%;
  height: 158px;
  padding: 4px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(245, 236, 226, 0.85), rgba(255, 251, 246, 0.96));
  border: 1px solid rgba(221, 207, 189, 0.82);
}

.recurring-chart-fill {
  width: 100%;
  min-height: 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(220, 140, 103, 0.9), rgba(182, 90, 54, 0.98));
  box-shadow: 0 12px 26px rgba(182, 90, 54, 0.2);
}

.recurring-chart-bar.is-current .recurring-chart-fill {
  background: linear-gradient(180deg, rgba(136, 186, 153, 0.95), rgba(63, 126, 84, 0.98));
  box-shadow: 0 12px 26px rgba(63, 126, 84, 0.22);
}

.recurring-chart-value {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
}

.recurring-chart-bar small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.recurring-history-feed {
  display: grid;
  gap: 12px;
}

.recurring-history-feed-compact {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.recurring-history-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(221, 207, 189, 0.82);
  border-radius: 18px;
  background: rgba(255, 251, 246, 0.92);
}

.recurring-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.recurring-history-head strong {
  font-size: 0.92rem;
}

.recurring-history-head span,
.recurring-history-item p,
.recurring-history-item small,
.recurring-client-subline {
  color: var(--muted);
}

.recurring-history-item p,
.recurring-history-item small,
.recurring-client-subline {
  margin: 0;
  line-height: 1.5;
}

.recurring-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 78px;
  z-index: 16;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.97), rgba(255, 250, 244, 0.86));
  backdrop-filter: blur(10px);
}

.recurring-toolbar .contact-search-bar {
  width: min(620px, 100%);
}

.recurring-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.recurring-create-button {
  min-height: 46px;
  padding: 0 18px;
}

.recurring-client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.recurring-client-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(221, 207, 189, 0.86);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 247, 240, 0.94));
  box-shadow: 0 18px 40px rgba(53, 37, 24, 0.06);
}

.recurring-client-card-paused {
  opacity: 0.9;
  background: linear-gradient(180deg, rgba(249, 245, 240, 0.98), rgba(244, 239, 233, 0.96));
}

.recurring-client-head,
.recurring-client-headline,
.recurring-client-actions,
.recurring-services-head,
.recurring-service-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.recurring-client-headline {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.recurring-client-headline h3 {
  margin: 0;
  font-size: 1.16rem;
}

.recurring-client-total {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.recurring-client-total strong {
  font-size: 1.34rem;
  line-height: 1;
}

.recurring-status-pill-active {
  background: rgba(229, 242, 227, 0.95);
  color: #2c7f4f;
}

.recurring-status-pill-paused {
  background: rgba(243, 236, 228, 0.95);
  color: #7b6250;
}

.recurring-client-updated {
  margin: 0;
  font-size: 0.84rem;
}

.recurring-client-note {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.recurring-service-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recurring-service-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(221, 207, 189, 0.86);
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.96);
}

.recurring-service-pill span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.recurring-service-pill strong {
  font-size: 0.88rem;
}

.recurring-client-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.recurring-client-actions .button {
  min-height: 42px;
  padding: 0 14px;
}

.recurring-delete-button {
  border-color: rgba(235, 197, 190, 0.92);
  color: #b94936;
  background: rgba(255, 243, 240, 0.94);
}

.recurring-delete-button:hover {
  border-color: rgba(185, 73, 54, 0.28);
  background: rgba(255, 238, 234, 0.98);
}

.recurring-modal-card {
  width: min(760px, calc(100vw - 32px));
}

.recurring-form-grid textarea,
.recurring-service-row input,
.recurring-service-row select {
  width: 100%;
  border: 1px solid rgba(221, 207, 189, 0.9);
  border-radius: 14px;
  background: #fffdfa;
  color: var(--text);
  font: inherit;
}

.recurring-form-grid textarea {
  min-height: 108px;
  padding: 14px;
  resize: vertical;
}

.recurring-services-editor {
  display: grid;
  gap: 14px;
}

.recurring-services-head {
  align-items: center;
}

.recurring-services-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.recurring-service-rows {
  display: grid;
  gap: 12px;
}

.recurring-service-row {
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(221, 207, 189, 0.82);
  border-radius: 18px;
  background: rgba(255, 251, 246, 0.88);
  flex-wrap: wrap;
}

.recurring-service-row label {
  flex: 1 1 160px;
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.recurring-service-row input,
.recurring-service-row select {
  min-height: 46px;
  padding: 0 14px;
}

.recurring-custom-service.is-hidden {
  display: none;
}

.recurring-client-history-panel {
  display: grid;
  gap: 12px;
}

.recurring-remove-service {
  min-height: 46px;
  padding: 0 14px;
  white-space: nowrap;
}

.auth-card,
.error-card {
  width: min(520px, calc(100vw - 32px));
  margin: 8vh auto;
  padding: 28px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.auth-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  font: inherit;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .card-grid,
  .pipeline-grid,
  .settings-grid,
  .recurring-insights-grid,
  .recurring-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-grid-dashboard,
  .dashboard-grid,
  .recurring-client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-drawer {
    width: min(520px, calc(100vw - 24px));
  }

  .contact-card {
    width: min(78%, 860px);
  }

  .pipeline-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 20px;
  }

  .topbar {
    margin: -20px -20px 16px;
    padding: 14px 20px 12px;
  }

  .topbar,
  .panel-header,
  .pipeline-header,
  .panel-tools {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-hero,
  .dashboard-hero-actions,
  .recurring-hero,
  .recurring-toolbar,
  .recurring-service-row,
  .recurring-services-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .contacts-toolbar {
    grid-template-columns: 1fr;
    position: static;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .contacts-toolbar-main {
    grid-template-columns: 1fr;
  }

  .contacts-toolbar-side {
    justify-items: stretch;
  }

  .toolbar-hint {
    text-align: left;
  }

  .contacts-create-button {
    width: 100%;
  }

  .contacts-directory-meta {
    flex-direction: column;
    align-items: flex-start;
    position: static;
    padding: 0;
    background: transparent;
  }

  .create-modal-grid {
    grid-template-columns: 1fr;
  }

  .create-modal {
    display: block;
    padding: 12px;
  }

  .create-modal-card,
  .recurring-modal-card {
    width: 100%;
    max-height: calc(100vh - 24px);
    margin: 0;
    border-radius: 20px;
  }

  .pipeline-toolbar {
    display: grid;
    position: static;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .pipeline-toolbar-main {
    flex-direction: column;
    align-items: stretch;
  }

  .pipeline-board-options {
    justify-content: flex-start;
    position: static;
    padding: 0;
    background: transparent;
  }

  .contact-card {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
  }

  .recurring-breakdown,
  .recurring-insights-grid,
  .recurring-client-grid {
    grid-template-columns: 1fr;
  }

  .recurring-chart {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .recurring-toolbar {
    position: static;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .recurring-toolbar .contact-search-bar,
  .recurring-toolbar-actions,
  .recurring-hero-total,
  .recurring-client-total {
    width: 100%;
  }

  .recurring-client-total {
    justify-items: start;
    text-align: left;
  }

  .contact-drawer {
    width: 100vw;
  }

  .pipeline-drawer {
    width: 100vw;
  }

  .contact-drawer-shell {
    padding: 16px;
  }

  .drawer-sticky-head {
    margin: -16px -16px 0;
    padding: 16px 16px 10px;
  }

  .contact-detail-header,
  .contact-detail-grid {
    grid-template-columns: 1fr;
  }

  .contact-detail-topbar,
  .contact-detail-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .card-grid,
  .pipeline-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .card-grid-dashboard,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-board {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .table {
    display: block;
    overflow-x: auto;
  }
}
