@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/plus-jakarta-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f3f1ef;
  --surface: #fff;
  --rail: #171616;
  --ink: #242020;
  --muted: #645d58;
  --subtle: #746c67;
  --line: #e7e1dd;
  --primary: #ab1f1a;
  --primary-deep: #7a1410;
  --primary-soft: #f9eae7;
  --danger: #a02b25;
  --sidebar-width: 213px;
  --bar-height: 54px;
  font: 14px/1.5 "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .66; }
a { color: var(--primary-deep); }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
main:focus { outline: none; }
.muted { color: var(--muted); }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  padding: 8px 12px;
  color: #fff;
  background: var(--primary);
  border-radius: 6px;
}
.startup { display: grid; min-height: 100vh; place-items: center; color: var(--muted); }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky;
  inset-block-start: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 23px 14px 15px;
  background: var(--rail);
  border-right: 1px solid #302929;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: none;
  text-align: left;
}
.sidebar > .brand { margin: 2px 6px 33px; }
.brand-logo { display: block; width: 114px; height: auto; }
.brand-caption { padding-inline-start: 8px; border-inline-start: 1px solid #665856; color: #f0dfda; font-size: 10px; font-weight: 750; letter-spacing: .04em; }
.sidebar :is(button, a):focus-visible, .mobile-brand:focus-visible { outline-color: #f3927f; }
.side-nav { display: grid; gap: 5px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 45px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #d3c9c6;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 620;
}
.nav-item:hover { background: #2c2523; color: #fff; }
.nav-item.is-current { color: #fff4f0; background: #422322; border-color: #62312e; box-shadow: inset 3px 0 #df5a4d; }
.nav-item.is-current svg { color: #f39485; }
.nav-count {
  margin-inline-start: auto;
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 6px;
  color: #ffd4cb;
  background: #66312c;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
}
.sidebar-account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 13px 1px 0 4px;
  border-top: 1px solid #403736;
  color: #f7edeb;
}
.account-info { flex: 1; overflow: hidden; }
.account-info strong, .account-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-info strong { font-size: 12px; font-weight: 675; line-height: 1.35; }
.account-info small { margin-top: 2px; color: #beb0ac; font-size: 11px; }
.sidebar-account .icon-btn { color: #d4c4bf; }
.sidebar-account .icon-btn:hover { color: #fff; background: #422322; }
.sidebar-account .icon-btn { padding: 3px; min-width: 29px; min-height: 32px; }
.workspace { min-width: 0; }
.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--bar-height);
  padding: 0 clamp(21px, 2.35vw, 37px);
  border-bottom: 1px solid var(--line);
  background: #fbf9f8;
}
.breadcrumbs, .crumb-workspace, .workspace-meta, .workspace-date, .demo-label { display: flex; align-items: center; }
.breadcrumbs { gap: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.crumb-workspace { gap: 7px; }
.breadcrumbs strong { color: var(--ink); font-weight: 650; }
.workspace-meta { gap: 13px; }
.workspace-date { gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.workspace-date::first-letter { text-transform: uppercase; }
.demo-label {
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid #eadbd6;
  border-radius: 6px;
  color: #842d26;
  background: #f8ece9;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
}
.mobile-brand, .mobile-logout { display: none !important; }

.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.page-heading h1 { font-size: clamp(29px, 2.65vw, 40px); font-weight: 710; line-height: 1.15; letter-spacing: -.045em; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  background: #f6f2ef;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}
.btn-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-deep); border-color: var(--primary-deep); }
.btn-light { background: var(--surface); border-color: var(--line); }
.btn-light:hover:not(:disabled) { background: #f8f4f1; border-color: #d8cbc5; }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #8d2c40; }
.icon-btn {
  display: inline-grid;
  flex-shrink: 0;
  min-width: 33px;
  min-height: 33px;
  padding: 6px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: none;
}
.icon-btn:hover, .action-menu[open] > .icon-btn { color: var(--primary-deep); background: var(--primary-soft); }
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: var(--primary-deep);
  background: none;
  font-size: 12px;
  font-weight: 650;
}
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 5px;
  color: #635a54;
  background: #f1edea;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; opacity: .78; }
.status-prospect { color: #5b514a; background: #eee9e4; }
.status-supplier { color: #75541f; background: #f9efd8; }
.status-client { color: #226c53; background: #e5f2ec; }
.status-stop, .pill-overdue { color: #9a3028; background: #fae9e5; }
.avatar {
  display: inline-grid;
  align-content: center;
  justify-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #8c332a;
  background: #f3e9e4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.avatar-tone-0 { color: #554940; background: #efe8e2; }
.avatar-tone-1 { color: #9d352e; background: #f6e3df; }
.avatar-tone-2 { color: #34625c; background: #e6efeb; }
.avatar-tone-3 { color: #815629; background: #f5ebdd; }
.avatar-tone-4 { color: #4b5b69; background: #e8ecee; }
.account-avatar { width: 32px; height: 32px; border-radius: 50%; color: #ffddd6; background: #5b2f2a; }

.contacts-page { max-width: 1800px; margin-inline: auto; padding: 23px clamp(20px, 2.2vw, 35px) 24px; }
.contacts-heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 157px;
  margin-bottom: 17px;
  padding: 20px clamp(22px, 3vw, 40px);
  border-radius: 9px;
  color: #fff;
  background: #211b1a;
  box-shadow: inset 0 2px #a8342d;
}
.contacts-heading::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 36%;
  content: "";
  background-image: linear-gradient(#e69c9224 1px, transparent 1px), linear-gradient(90deg, #e69c9224 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(90deg, transparent, #000 85%);
  pointer-events: none;
}
.contacts-heading h1 { font-size: clamp(31px, 3.05vw, 46px); font-weight: 760; }
.contacts-heading p { margin-top: 4px; color: #e3d3ce; }
.primary-action { min-height: 37px; margin-top: 13px; padding-inline: 11px; background: #b52620; border-color: #cf4b3f; }
.contacts-heading :is(button, a):focus-visible { outline-color: #f69d8d; }
.followup-board { display: grid; grid-template-columns: repeat(2, minmax(91px, 1fr)); gap: 1px; border: 1px solid #69514b; border-radius: 7px; background: #6b5550; overflow: hidden; }
.followup-status { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 9px; align-items: center; padding: 12px 14px; border: 0; color: #faeee9; background: #2d2422; text-align: left; }
.followup-status strong { grid-column: 1 / -1; font-size: 27px; font-weight: 730; line-height: 1.03; font-variant-numeric: tabular-nums; }
.followup-status span { font-size: 11px; white-space: nowrap; }
.followup-status svg { color: #e8b6ad; }
.followup-status:hover, .followup-status:focus-visible { background: #4b302b; }
.followup-status:focus-visible { outline-offset: -3px; }
.followup-late strong { color: #ffac9c; }
.contacts-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(326px, 27.2vw, 420px);
  gap: 14px;
  align-items: stretch;
}
.directory, .detail-pane { min-width: 0; border: 1px solid #ded7d1; border-radius: 8px; background: var(--surface); }
.directory {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: max(420px, calc(100dvh - 276px));
  overflow: hidden;
}
.filter-tabs {
  display: flex;
  align-items: stretch;
  gap: clamp(10px, 1.25vw, 19px);
  min-height: 45px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0 0;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: none;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 620;
}
.filter-tab:hover { color: var(--primary-deep); }
.filter-tab[aria-pressed="true"] { color: var(--primary-deep); border-bottom-color: var(--primary); }
.filter-tab span { min-width: 18px; padding: 0 4px; border-radius: 4px; background: #f3eeea; color: var(--muted); text-align: center; font-size: 10px; }
.filter-tab[aria-pressed="true"] span { color: var(--primary-deep); background: var(--primary-soft); }
.archive-tab { margin-inline-start: auto; }
.filter-toolbar {
  display: flex;
  flex-shrink: 0;
  gap: 9px;
  min-height: 54px;
  padding: 11px 14px;
  align-items: center;
  justify-content: space-between;
}
.search-box {
  display: flex;
  flex: 1 1 170px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid #ded7d0;
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.search-box input:focus-visible { outline: none; }
.search-box input { flex: 1; width: 0; min-width: 0; padding: 7px 0; outline: 0; border: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #726761; }
.search-box kbd {
  display: inline-grid;
  width: 17px;
  height: 19px;
  place-items: center;
  border: 1px solid #e7e1db;
  border-radius: 4px;
  color: var(--muted);
  background: #f8f5f2;
  font: 11px/1 system-ui, sans-serif;
}
.filter-selects { display: flex; align-items: center; gap: 6px; min-width: 0; }
.filter-select { display: flex; position: relative; flex: 1 1 auto; min-width: 0; align-items: center; }
.filter-select select {
  appearance: none;
  max-width: 128px;
  min-height: 35px;
  padding: 6px 23px 6px 8px;
  border: 1px solid #e4ddd7;
  border-radius: 6px;
  background: var(--surface);
  color: #5b514b;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 620;
  cursor: pointer;
}
.filter-select svg { position: absolute; right: 7px; color: #706560; pointer-events: none; }
.filter-select select:hover, .filter-set select { border-color: #d8c6be; color: var(--primary-deep); background: #fcf1ed; }
.table-shell { flex: 1; min-width: 0; overflow: auto; }
.companies-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; text-align: left; }
.companies-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 35px;
  padding: 0 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8f5f2;
  color: #655b54;
  font-size: 11px;
  font-weight: 650;
}
.companies-table th button {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  white-space: nowrap;
}
.companies-table th button:hover, .companies-table th[aria-sort] { color: var(--primary-deep); }
.companies-table th[aria-sort="ascending"] svg { transform: rotate(180deg); }
.companies-table th[aria-sort="descending"] svg { transform: rotate(270deg); }
.companies-table td {
  height: 56px;
  padding: 0 8px;
  border-bottom: 1px solid #f0ebe7;
  color: #594f49;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  vertical-align: middle;
}
.companies-table tbody tr { cursor: pointer; }
.companies-table tbody tr:hover td { background: #f9f6f4; }
.companies-table tbody .selected-row td { border-bottom-color: #f0dfd9; background: #fcf2ee; }
.companies-table .selected-row td:first-child { box-shadow: inset 3px 0 var(--primary); }
.companies-table th:first-child, .companies-table td:first-child { padding-left: 14px; }
.column-name { width: 39%; }
.column-municipality { width: 20%; }
.column-status { width: 24%; }
.column-reminder { width: 17%; }
.companies-table .column-open { width: 26px; padding-inline: 2px 7px; color: #8e7d75; }
.company-select {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 2px 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.company-select > span:last-child { min-width: 0; }
.company-select strong, .company-select small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-select strong { font-size: 12px; font-weight: 750; }
.company-select small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.mobile-company-location { display: none; }
.selected-row strong { color: var(--primary-deep); }
.row-date { display: inline-flex; align-items: center; gap: 4px; }
.row-date svg { color: #77685f; }
.row-date.overdue, .row-date.overdue svg { color: #a0392e; }
.empty-cell { color: #81726a; }
.directory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 40px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fdfdfd;
  font-size: 11px;
}
.empty-state { display: grid; justify-items: center; gap: 7px; padding: 30px 18px; color: var(--muted); text-align: center; }
.empty-state > svg { margin: 0 0 4px; color: var(--primary); }
.empty-state > strong { color: var(--ink); font-size: 14px; font-weight: 670; }
.empty-state > span { max-width: 250px; font-size: 12px; }
.empty-state .btn { margin-top: 4px; }
.directory-empty, .detail-empty { margin-top: 65px; }

.detail-pane {
  overflow: auto;
  max-height: max(420px, calc(100dvh - 276px));
  scrollbar-color: #d7c7c1 transparent;
  scrollbar-width: thin;
}
.detail-header { padding: 12px 18px 14px; background: #fbf8f6; border-top: 3px solid var(--primary); }
.detail-banner, .detail-header-actions { display: flex; align-items: center; }
.detail-banner { justify-content: space-between; gap: 10px; }
.detail-header-actions { gap: 3px; margin-right: -4px; }
.detail-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #6a5b54;
  font-size: 11px;
  font-weight: 650;
}
.detail-label-icon {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid #e7ddd7;
  border-radius: 6px;
  color: #665a53;
  background: #fbf8f5;
}
.back-to-directory { display: none; }
.action-menu { position: relative; }
.action-menu summary { cursor: pointer; list-style: none; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-popover {
  position: absolute;
  z-index: 4;
  top: calc(100% + 3px);
  right: 0;
  min-width: 148px;
  padding: 4px;
  border: 1px solid #e6dbd5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px #42231a23;
}
.action-popover button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 5px;
  background: none;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}
.action-popover button:hover { background: #fbf1ed; }
.action-popover [data-action="archive-company"] { color: var(--danger); }
.company-identity { display: flex; align-items: center; gap: 10px; margin: 14px 0 9px; }
.company-identity > div { min-width: 0; }
.company-avatar {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  color: #922920;
  background: #f4dfda;
  font-size: 16px;
}
.company-identity h2 { overflow-wrap: anywhere; font-size: clamp(20px, 1.55vw, 26px); font-weight: 720; letter-spacing: -.035em; line-height: 1.2; }
.company-identity p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.meta-divider { display: inline-block; width: 3px; height: 3px; margin: 0 6px; border-radius: 50%; background: currentColor; vertical-align: middle; opacity: .65; }
.detail-metadata { display: flex; gap: 5px; margin: 0 0 0 55px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 5px 15px; margin-top: 14px; }
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  color: #5e5049;
  font-size: 11px;
  font-weight: 640;
  text-decoration: none;
}
.contact-links a:hover { color: var(--primary-deep); text-decoration: underline; text-underline-offset: 3px; }
.contact-links svg { color: #785e55; }
.detail-quick-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 13px; background: #fbf8f6; }
.detail-quick-actions .btn { min-height: 34px; }
.reminder-action { background: var(--primary-soft); border-color: #ebd4ce; color: var(--primary-deep); }
.reminder-action:hover:not(:disabled) { background: #f4e2dc; }
.record-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 17px 13px;
  padding: 8px;
  border-radius: 6px;
  color: #862e29;
  background: #faece8;
  font-size: 11px;
}
.detail-tabs {
  display: flex;
  gap: 18px;
  min-height: 43px;
  padding: 0 17px;
  border-top: 1px solid #f0eae6;
  border-bottom: 1px solid var(--line);
  background: #fcf9f7;
}
.detail-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 1px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: none;
  font-size: 12px;
  font-weight: 650;
}
.detail-tabs button:hover, .detail-tabs button[aria-pressed="true"] { color: var(--primary-deep); }
.detail-tabs button[aria-pressed="true"] { border-bottom-color: #ab1f1a; }
.detail-tabs button span { min-width: 16px; padding: 0 4px; border-radius: 4px; color: #695e58; background: #f1eae5; text-align: center; font-size: 10px; }
.detail-section { padding: 14px 17px 17px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.section-heading h3, .company-address h3 { font-size: 13px; font-weight: 700; line-height: 1.3; }
.section-heading > span:not(.pill) { color: var(--muted); font-size: 10px; }
.next-reminder, .next-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 59px;
  padding: 8px;
  border: 1px solid #edddd6;
  border-radius: 8px;
  color: #662c25;
  background: #fbf0ec;
  text-align: left;
}
.next-reminder:hover { border-color: #dcb8ab; background: #f8e7e1; }
.next-reminder > span:nth-child(2) { flex: 1; min-width: 0; }
.next-reminder strong, .next-reminder small { display: block; }
.next-reminder strong { overflow-wrap: anywhere; font-size: 12px; font-weight: 700; line-height: 1.4; }
.next-reminder small { margin-top: 3px; color: #76554b; font-size: 10px; line-height: 1.4; }
.next-icon { display: inline-grid; width: 32px; height: 32px; place-items: center; border-radius: 7px; color: #a9382d; background: #f4ded7; }
.reminder-overdue { color: #912d24; border-color: #eedbd6; background: #fcf0ec; }
.reminder-overdue:hover { border-color: #eebbae; background: #fbe8e1; }
.reminder-overdue small { color: #86483f; }
.reminder-overdue .next-icon { color: #a33428; background: #f5dad1; }
.next-empty { min-height: 40px; border-color: #efe9e4; color: var(--muted); background: #fafafa; font-size: 12px; }
.timeline-heading { margin-top: 18px; margin-bottom: 3px; }
.timeline { position: relative; display: grid; margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 8px 0 3px; }
.timeline-item:not(:last-child)::before {
  position: absolute;
  inset: 32px auto -8px 12px;
  width: 1px;
  background: #e8ded8;
  content: "";
}
.timeline-icon { display: inline-grid; width: 25px; height: 25px; place-items: center; border: 1px solid #ece2dd; border-radius: 50%; color: #815b4d; background: #f7eeea; }
.timeline-call { color: #525f69; background: #edf0f1; border-color: #e5e9eb; }
.timeline-visit { color: #3d7466; background: #eaf3ef; border-color: #e6f0eb; }
.timeline-event, .timeline-done { color: #4f7665; background: #eef4f0; border-color: #e6f0eb; }
.timeline-content { min-width: 0; padding: 0 1px 8px 0; border-bottom: 1px solid #f0ebe7; }
.timeline-item:last-child .timeline-content { border-bottom: 0; }
.timeline-title { display: flex; min-height: 19px; align-items: center; justify-content: space-between; gap: 5px; }
.timeline-title strong { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.timeline-edit { min-width: 23px; min-height: 23px; margin: -2px -3px -2px 0; padding: 3px; }
.timeline-meta { margin-top: 1px; color: var(--muted); font-size: 10px; }
.timeline-body { margin-top: 4px; color: #514742; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 11.5px; line-height: 1.42; }
.timeline-source { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.people-list { display: grid; margin: 0; padding: 0; list-style: none; }
.person-row { display: flex; align-items: flex-start; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.person-record { display: grid; flex: 1; min-width: 0; gap: 2px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.person-record strong { color: var(--ink); font-size: 12px; }
.person-record a { display: inline-flex; align-items: baseline; gap: 4px; text-decoration: none; }
.person-record a:hover, .company-address a:hover { text-decoration: underline; }
.company-address { margin-top: 16px; }
.company-address h3 { margin-bottom: 8px; }
.company-address p { display: flex; align-items: center; gap: 7px; margin-top: 5px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.company-address a { text-decoration: none; }

.auth-page { display: grid; min-height: 100dvh; place-items: center; padding: 24px; background: var(--canvas); }
.auth-panel {
  width: min(100%, 400px);
  padding: 29px;
  border: 1px solid #e4d9d2;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 15px 50px #42231a13;
}
.auth-brand { width: fit-content; margin-bottom: 22px; padding: 10px 13px; border-radius: 6px; background: var(--rail); }
.auth-panel h1 { margin-bottom: 6px; font-size: 27px; line-height: 1.15; letter-spacing: -.035em; }
.auth-panel > .btn { margin-top: 14px; }
.auth-form { display: grid; gap: 13px; margin-top: 22px; }
.auth-form .btn { min-height: 41px; }
.field { display: grid; min-width: 0; align-content: start; gap: 5px; color: var(--ink); font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  padding: 7px 9px;
  border: 1px solid #ddd4ce;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 450;
}
.field input::placeholder, .field textarea::placeholder { color: var(--subtle); }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.field-wide { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-error { margin: 0; padding: 7px 9px; border: 1px solid #eed4cc; border-radius: 6px; color: #942d25; background: #fcf0ed; font-size: 12px; }
#dialog {
  width: min(500px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 36px);
  margin: auto;
  padding: 0;
  border: 1px solid #e4d7d0;
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 20px 62px #2d211c3b;
}
#dialog::backdrop { background: #231a1765; }
.modal-form { display: flex; max-height: calc(100dvh - 39px); flex-direction: column; }
.modal-header, .modal-footer { display: flex; flex-shrink: 0; align-items: center; padding: 13px 17px; }
.modal-header { justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 18px; font-weight: 720; letter-spacing: -.02em; line-height: 1.25; }
.modal-header p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.modal-body { display: grid; gap: 12px; overflow: auto; padding: 15px 17px 17px; }
.modal-body > p:not(.form-error):not([class]) { color: var(--muted); font-size: 13px; }
.modal-footer { justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #fcf9f7; }
.checkbox-field { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 640; }
.checkbox-field input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.note-follow-up { padding: 9px; border: 1px solid #eee3dc; border-radius: 6px; background: #faf4f0; }
.follow-up-fields { min-width: 0; margin: 8px 0 0; padding: 0; border: 0; }
.toast {
  position: fixed;
  z-index: 30;
  right: 17px;
  bottom: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 34px);
  padding: 10px 13px;
  border: 1px solid #5a4139;
  border-radius: 8px;
  color: #fff9f5;
  background: #372620;
  box-shadow: 0 8px 22px #2c1d182b;
  font-size: 13px;
}
.toast svg { color: #ffc0b0; }

@media (max-width: 1250px) {
  :root { --sidebar-width: 184px; }
  .companies-table .column-municipality { width: 18%; }
  .companies-table .column-status { width: 23%; }
  .companies-table .column-name { width: 42%; }
  .companies-table th:first-child, .companies-table td:first-child { padding-left: 10px; }
  .company-select { gap: 6px; }
}

@media (max-width: 1080px) {
  :root { --sidebar-width: 158px; }
  .sidebar { padding-inline: 10px; }
  .sidebar > .brand { margin-inline: 3px; }
  .brand { gap: 7px; }
  .sidebar .brand-logo { width: 92px; }
  .filter-tabs { padding-inline: 9px; }
  .filter-toolbar { padding-inline: 9px; gap: 5px; }
  .filter-selects { gap: 4px; }
  .filter-select select { padding-left: 5px; max-width: 99px; }
  .search-box { gap: 5px; padding-inline: 5px; }
  .search-box kbd { display: none; }
  .companies-table td, .companies-table th { padding-inline: 5px; }
  .companies-table .column-open { width: 19px; }
}

@media (max-width: 980px) {
  .contacts-workspace { grid-template-columns: minmax(0, 1fr); }
  .directory { max-height: none; min-height: 380px; }
  .detail-pane { display: none; }
  .mobile-company-open > .contacts-heading, .mobile-company-open .directory { display: none; }
  .mobile-company-open .detail-pane { display: block; max-height: none; }
  .mobile-company-open .detail-label { display: none; }
  .back-to-directory { display: inline-flex; min-height: 36px; }
  .companies-table .column-name { width: 40%; }
  .companies-table .column-municipality { width: 23%; }
  .companies-table .column-status { width: 21%; }
  .companies-table .column-reminder { width: 16%; }
  .companies-table th:first-child, .companies-table td:first-child { padding-left: 14px; }
  .filter-tabs, .filter-toolbar { padding-inline: 14px; }
  .search-box { gap: 8px; padding-inline: 8px; }
  .company-identity h2 { font-size: 26px; }
}

@media (max-width: 640px) {
  :root { --bar-height: 54px; }
  .app-shell { display: block; min-height: 100dvh; padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .sidebar {
    position: fixed;
    z-index: 5;
    inset: auto 0 0;
    display: block;
    width: 100%;
    height: auto;
    padding: 3px 6px calc(3px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #4a3431;
    border-right: 0;
    background: var(--rail);
  }
  .sidebar > .brand, .sidebar-account { display: none; }
  .side-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-item { position: relative; flex-direction: column; gap: 3px; min-height: 49px; padding: 4px 2px; border-radius: 5px; font-size: 11px; }
  .nav-item.is-current { box-shadow: inset 0 2px #df5a4d; }
  .nav-count { position: absolute; top: 1px; left: calc(50% + 9px); }
  .workspace-bar { padding-inline: 13px; color: #f8eae6; background: var(--rail); border-color: #433533; }
  .breadcrumbs, .workspace-date { display: none; }
  .mobile-brand { display: flex !important; }
  .mobile-brand .brand-logo { width: 95px; }
  .mobile-logout { display: inline-grid !important; color: #e8cfca; }
  .workspace-meta { gap: 3px; }
  .contacts-page { padding: 11px 10px 18px; }
  .contacts-heading { gap: 8px; min-height: 122px; margin: 0 0 10px; padding: 13px 12px; }
  .contacts-heading h1 { font-size: 31px; }
  .contacts-heading p { display: none; }
  .primary-action { width: auto; min-height: 44px; margin-top: 8px; padding-inline: 7px; font-size: 11px; }
  .primary-action > svg { width: 16px; height: 16px; }
  .followup-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .followup-status { min-height: 55px; gap: 2px; padding: 7px 6px; }
  .followup-status strong { font-size: 21px; }
  .followup-status span { font-size: 9px; }
  .followup-status svg { display: none; }
  .directory, .detail-pane { border-radius: 9px; }
  .filter-tabs { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-inline: 10px; overflow: visible; }
  .filter-tab { min-height: 35px; font-size: 11px; gap: 3px; }
  .filter-tab span { min-width: 15px; padding: 0 3px; font-size: 9px; }
  .archive-tab svg { display: none; }
  .archive-tab { margin-inline-start: 0; }
  .filter-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); min-height: auto; padding: 8px; gap: 6px; }
  .search-box { width: 100%; min-height: 39px; }
  .search-box input { font-size: 16px; }
  .search-box input::placeholder { font-size: 13px; }
  .filter-selects { justify-content: stretch; gap: 5px; }
  .filter-select select { width: 100%; max-width: none; min-height: 36px; padding-left: 7px; font-size: 12px; }
  .companies-table .column-municipality, .companies-table .column-reminder { display: none; }
  .companies-table .column-name { width: auto; }
  .companies-table .column-status { width: 105px; }
  .companies-table .column-open { width: 20px; }
  .companies-table th:first-child, .companies-table td:first-child { padding-left: 9px; }
  .companies-table tbody .selected-row td { border-bottom-color: #f0ebe7; background: transparent; }
  .companies-table .selected-row td:first-child { box-shadow: none; }
  .company-select { gap: 7px; }
  .company-select strong { font-size: 13px; }
  .company-select small { font-size: 11px; }
  .mobile-company-location { display: inline; }
  .selected-row strong { color: var(--ink); }
  .mobile-company-open { padding: 0; }
  .mobile-company-open .detail-pane { min-height: calc(100dvh - 115px); border: 0; border-radius: 0; }
  .detail-header { padding: 9px 14px 12px; }
  .detail-banner .icon-btn, .person-row .icon-btn { min-width: 42px; min-height: 42px; }
  .company-identity h2 { font-size: 25px; }
  .company-identity p { font-size: 12px; }
  .contact-links { gap: 6px; }
  .contact-links a {
    min-height: 41px;
    padding-inline: 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: 12px;
  }
  .detail-quick-actions { padding-inline: 14px; }
  .detail-quick-actions .btn { min-height: 41px; }
  .detail-tabs, .detail-section { padding-inline: 14px; }
  .detail-tabs button { min-height: 43px; }
  .timeline-title strong, .timeline-body, .next-reminder strong { font-size: 13px; }
  .timeline-meta, .next-reminder small { font-size: 11px; }
  .timeline-edit { min-width: 31px; min-height: 31px; }
  .modal-header, .modal-footer { padding-inline: 12px; }
  .modal-header .icon-btn { min-width: 40px; min-height: 40px; }
  .modal-footer .btn { min-height: 43px; }
  .modal-body { padding: 12px; }
  .field input, .field select, .field textarea { padding: 6px; font-size: 16px; }
  .toast { inset: auto 10px calc(65px + env(safe-area-inset-bottom, 0px)); max-width: none; }
}

@media (max-width: 360px) {
  .filter-tabs { column-gap: 9px; }
  .contacts-heading { padding-inline: 9px; }
  .filter-tab { font-size: 10px; }
  .filter-tab span { font-size: 9px; }
  .companies-table .column-status { width: 99px; }
  .status-stop { font-size: 10px; }
  .company-select { gap: 6px; }
  .company-select .avatar { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
