:root {
  --brand: #ef8d2f;
  --brand-dark: #cc741f;
  --ink: #15181f;
  --muted: #68707c;
  --line: #dedede;
  --panel: #ffffff;
  --bg: #f7f7f5;
  --blue: #3f37f2;
  --green: #d4f4d1;
  --red: #fae0e0;
  --shadow: 0 10px 26px rgba(24, 28, 35, 0.08);
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  cursor: pointer;
}

a {
  color: #1515ee;
  text-decoration: none;
  cursor: pointer;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(320px, 820px) auto auto auto auto auto auto;
  gap: 12px;
  align-items: center;
  height: 58px;
  padding: 0 14px;
  background: var(--brand);
  color: #171008;
}

.topbar.is-sticky {
  position: sticky;
  top: 0;
  z-index: 90;
}

.mainnav {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  font-weight: 800;
  font-size: 20px;
}

.ui-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.active,
.icon-button:hover {
  background: rgba(0, 0, 0, 0.12);
}

.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 860px;
  height: 38px;
  padding: 0 14px;
  background: rgba(132, 70, 12, 0.25);
  border-radius: 7px;
}

.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #2c1909;
}

.add-button,
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  padding: 9px 14px;
  font-weight: 650;
}

button.primary,
.activity-actions button.primary {
  color: #fff;
}

.add-button {
  background: rgba(0, 0, 0, 0.08);
  border: 0;
  color: #171008;
}

.user-chip {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 160px;
  font-size: 14px;
}

.menu-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.user-menu {
  position: relative;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  z-index: 40;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.user-dropdown button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 6px;
}

.user-dropdown button:hover {
  background: #f3f5f8;
}

.lang-select {
  width: 85px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.1);
}

.user-chip span,
.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dec7f5;
  color: #241036;
  border: 0;
}

.user-chip small,
.contact-row small,
.muted {
  display: block;
  color: var(--muted);
}

.workspace {
  padding: 32px 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
}

.left-stack,
.right-stack {
  display: grid;
  gap: 24px;
  align-content: start;
}

.panel,
.main-panel,
.contact-card,
.activity-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04);
}

.panel {
  padding: 24px;
}

.panel-head,
.section-head,
.contact-actions,
.track-head,
.activity-actions,
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel h2,
.main-panel h1,
.contact-card h2 {
  margin: 0;
  font-weight: 500;
}

.panel-head button,
.track-head button,
.activity-actions button {
  padding: 7px 11px;
  color: var(--blue);
}

.button-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toolbar-button {
  padding: 8px 12px;
  border-radius: 7px;
}

.toolbar-input {
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.activity-body-rich {
  white-space: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mail-render {
  border: 1px solid #dde2ea;
  border-radius: 8px;
  background: #fcfdff;
  overflow: hidden;
}

.mail-meta {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid #e6ebf2;
  background: #f5f8fc;
}

.mail-meta-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 13px;
}

.mail-meta-row span {
  color: #5d6573;
  font-weight: 600;
}

.mail-meta-row strong {
  color: #1d2430;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.mail-content {
  padding: 10px 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.activity-body-rich > div {
  margin: 0 0 8px;
}

.activity-body-rich > div:last-child {
  margin-bottom: 0;
}

.activity-body-rich blockquote {
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 3px solid #b9bfca;
  background: #f7f8fb;
  color: #4f5867;
}

.mail-divider {
  border: 0;
  border-top: 1px dashed #cfd4dd;
  margin: 10px 0;
}

.view-settings-panel {
  margin: 20px 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.view-settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.settings-field {
  display: grid;
  gap: 6px;
}

.settings-field select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.contacts-board {
  padding: 28px;
}

.subnav-strip {
  display: flex;
  gap: 18px;
  margin: 10px 0 18px;
  border-bottom: 1px solid var(--line);
}

.subnav-strip button {
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.subnav-strip .active {
  border-bottom: 2px solid var(--blue);
  color: var(--blue);
  font-weight: 650;
}

.data-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.data-toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.results-line {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
}

.pagination-status {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
}

.pagination-status strong {
  color: var(--ink);
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.pagination-jump input {
  width: 92px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  text-align: left;
}

.pagination-jump span {
  min-width: 34px;
}

.pagination-limit {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.pagination-limit select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #efefef;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  background: #fcfcfc;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: #fbfbff;
}

.summary-cell {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
}

.summary-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.table-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.data-table td .toolbar-button {
  margin-right: 6px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.admin-status-grid > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafafa;
}

.admin-config-form {
  display: grid;
  gap: 6px;
}

.field.inline-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field.inline-checkbox input {
  width: 16px;
  min-height: 16px;
}

.detail-head {
  margin-bottom: 10px;
}

.main-panel {
  padding: 40px;
}

.main-panel.full {
  width: 100%;
}

.tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  margin: 26px 0 28px;
}

.tabs button {
  border: 0;
  border-radius: 0;
  padding: 0 0 13px;
  background: transparent;
}

.tabs button.active {
  border-bottom: 2px solid var(--blue);
  color: var(--ink);
  font-weight: 650;
}

.tabs.compact {
  gap: 22px;
  margin: 20px 0;
}

.tabs small {
  padding: 2px 6px;
  border-radius: 5px;
  background: #ececff;
}

.filters {
  justify-content: flex-start;
  margin-bottom: 24px;
}

.filters select {
  min-width: 92px;
  padding: 7px 34px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.day-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px dotted var(--line);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 116px;
  text-align: center;
  font-weight: 650;
}

.empty-state span {
  max-width: 330px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 400;
}

.empty-state.compact {
  min-height: 72px;
  color: var(--muted);
  font-weight: 400;
}

.goal-card {
  max-width: 220px;
  margin: 24px auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.progress {
  height: 7px;
  overflow: hidden;
  background: #ebe8df;
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #e4a11b, #47b881);
}

.split-list {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
}

.list-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 30px 24px;
  min-height: calc(100vh - 58px);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.tag-row button,
.chips span,
.status-pill {
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: #efefef;
  font-size: 13px;
}

.tag-row .active {
  background: #e7e5ff;
  color: var(--blue);
}

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

.contact-row {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  text-align: left;
  border-color: transparent;
}

.contact-row.selected,
.contact-row:hover {
  border-color: var(--line);
  background: #fbfbfb;
}

.contact-layout {
  display: grid;
  grid-template-columns: 296px minmax(620px, 1fr) 328px;
  gap: 0;
  padding: 0;
}

.contact-card {
  min-height: calc(100vh - 58px);
  padding: 26px 20px;
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
}

.avatar.large {
  width: 56px;
  height: 56px;
  background: var(--green);
  font-size: 23px;
}

.avatar.small {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 16px 0;
}

.contact-card h2 {
  margin-top: 18px;
}

.contact-card > p {
  margin: 8px 0;
}

.contact-methods {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.contact-methods a,
.contact-methods p {
  margin: 0;
}

.contact-methods small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.contact-icons {
  display: flex;
  gap: 10px;
  color: var(--muted);
  margin: 12px 0 28px;
}

.background-card {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 102px;
  padding: 16px;
  margin: 18px 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
}

.background-card a {
  color: var(--muted);
}

.edit-menu {
  position: relative;
  display: inline-flex;
}

.edit-menu > button {
  height: 32px;
  padding: 0 10px;
  border-radius: 7px 0 0 7px;
  background: #fff;
}

.edit-menu .menu-toggle {
  width: 32px;
  border-left: 0;
  border-radius: 0 7px 7px 0;
}

.menu-list {
  position: absolute;
  top: 36px;
  right: 0;
  z-index: 10;
  display: none;
  min-width: 174px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.edit-menu.open .menu-list {
  display: grid;
}

.menu-list button {
  padding: 9px 10px;
  border: 0;
  text-align: left;
  background: #fff;
}

.menu-list button:hover {
  background: #f5f5f5;
}

.menu-list .danger {
  color: #b10d0d;
}

.field-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  font-size: 13px;
}

.field-list div {
  display: grid;
  grid-template-columns: minmax(86px, 42%) 1fr;
  gap: 8px;
}

.field-list span {
  color: var(--muted);
}

.org-people {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.org-people h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.org-people button {
  display: grid;
  gap: 3px;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  text-align: left;
  border-color: var(--line);
  background: #fff;
}

.org-people button:hover {
  border-color: var(--blue);
}

.org-people span {
  color: var(--muted);
  font-size: 13px;
}

.activity-panel {
  min-height: calc(100vh - 58px);
  padding: 16px;
  border-radius: 0;
  border-top: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric small {
  grid-column: 2;
  color: var(--muted);
}

.activity-actions {
  justify-content: flex-end;
  padding: 18px 8px 22px;
  border-bottom: 1px dotted var(--line);
}

.activity-actions input {
  margin-right: auto;
  min-width: 275px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.activity-item {
  padding: 32px 8px;
  border-bottom: 1px dotted var(--line);
}

.activity-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.activity-body {
  display: flex;
  gap: 14px;
  max-width: 960px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-top: 14px;
  margin-left: 20px;
}

.activity-body > div {
  min-width: 0;
}

.activity-body h3 {
  margin: 12px 0;
  font-size: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.activity-body p {
  line-height: 1.48;
}

.activity-body-toggle {
  margin-top: 4px;
}

.activity-body-collapsible {
  position: relative;
}

.activity-body-collapsible.is-collapsed {
  max-height: 240px;
  overflow: hidden;
}

.activity-body-collapsible.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 62px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.98));
  pointer-events: none;
}

.activity-body-toggle-button {
  margin-top: 6px;
  padding: 0;
  font-weight: 600;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.file-grid,
.opportunity-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 24px 8px;
}

.attachments span {
  min-width: 142px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
}

.attachment {
  min-width: 142px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
}

.attachment small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.text-button {
  border: 0;
  color: var(--blue);
}

.right-stack {
  min-height: calc(100vh - 58px);
  padding: 16px;
  background: #fff;
  border-left: 1px solid var(--line);
}

.right-stack .panel {
  box-shadow: none;
  padding: 16px;
}

.status-pill {
  display: inline-block;
  margin: 8px 0;
  background: var(--red);
  color: #bd1010;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 16px;
}

.kanban-col {
  min-height: 480px;
  padding: 14px;
  background: #f2f2ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kanban-col h3 {
  display: flex;
  justify-content: space-between;
  margin-top: 0;
}

.opportunity-card,
.task-card {
  padding: 16px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.opportunity-card h4,
.task-card h3 {
  margin: 0 0 10px;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.task-card span {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 8px;
  background: #ececff;
  border-radius: 6px;
  color: var(--blue);
}

.task-card.overdue span {
  background: var(--red);
  color: #b10d0d;
}

.task-actions {
  margin-top: 14px;
}

.task-actions button {
  padding: 7px 10px;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-list article {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px dotted var(--line);
}

.mini-list span {
  color: var(--muted);
  font-size: 13px;
}

.panel-search-row {
  margin: 0 0 10px;
}

.panel-search-row .toolbar-input {
  width: 100%;
  min-width: 0;
}

.compact-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.compact-pagination select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}

.score-row span {
  padding: 5px 7px;
  border-radius: 6px;
  background: #f0f5ed;
  color: #315230;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(20, 24, 31, 0.32);
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(17, 20, 28, 0.28);
}

.modal:has(.contact-edit-form) {
  width: min(832px, 100%);
  padding: 0;
}

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

.edit-title {
  padding: 22px 24px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.contact-edit-form .edit-section {
  padding: 24px;
}

.contact-edit-form h3 {
  margin: 0 0 12px;
}

.contact-edit-form h4 {
  margin: 20px 0 8px;
  font-size: 13px;
  font-weight: 650;
}

.title-row {
  grid-template-columns: 120px 1fr 1fr;
}

.org-pill {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 41px;
  padding: 0 10px;
  border-radius: 20px;
  background: #ededed;
}

.org-pill input {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
}

.org-pill button {
  border: 0;
  background: transparent;
  color: #6b4b34;
}

.custom-fields-summary {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.custom-fields-summary summary {
  cursor: pointer;
}

.custom-fields-summary span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.section-divider {
  height: 1px;
  background: var(--line);
  margin-bottom: 18px;
}

.input-with-type {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
}

.input-with-type .field {
  margin-bottom: 0;
}

.input-with-type input {
  border-radius: 7px 0 0 7px;
}

.input-with-type select {
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  padding: 0 10px;
  background: #fff;
}

.text-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--blue);
}

.modal-head h2 {
  margin: 0;
  font-weight: 550;
}

.modal-head button {
  width: 34px;
  height: 34px;
  border: 0;
  font-size: 24px;
  background: transparent;
}

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

.excel-fields {
  max-height: 420px;
  overflow: auto;
  padding-right: 8px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.checkbox-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 39px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.field select[multiple] {
  min-height: 124px;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field.wide {
  margin-top: 4px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.modal-actions button {
  padding: 9px 14px;
}

.import-preview {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  max-height: 260px;
  overflow: auto;
}

.import-preview p {
  margin: 0 0 8px;
}

.import-preview details {
  margin-top: 8px;
}

.import-preview summary {
  cursor: pointer;
  font-weight: 600;
}

.import-preview ul,
.import-preview ol {
  margin: 8px 0 0;
  padding-left: 20px;
}

.import-preview pre {
  margin: 6px 0 0;
  padding: 8px;
  border-radius: 6px;
  background: #f0f1f4;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.import-preview.error {
  border-color: #c04747;
  color: #a02727;
  background: #fff3f3;
}

.import-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--ink);
}

.import-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  padding: 12px 16px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
}

.tag-manager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-manager span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #efefef;
}

.tag-manager button {
  padding: 3px 7px;
  color: #b10d0d;
}

.loading {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  color: var(--muted);
}

.loading.error {
  align-content: center;
  gap: 10px;
  color: var(--ink);
}

.login-page {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 10%, #f9e9d6, #f7f7f5 45%, #ececeb 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 8px;
}

.login-error {
  color: #b11616;
  margin: 4px 0 12px;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .topbar > .icon-button,
  .user-menu {
    display: none;
  }

  .dashboard-grid,
  .split-list,
  .contact-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .data-toolbar {
    flex-direction: column;
  }

  .toolbar-input,
  .data-toolbar select {
    width: 100%;
  }

  .contact-card,
  .activity-panel,
  .right-stack {
    min-height: auto;
    border-radius: 0;
  }

  .metrics,
  .kanban {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 14px;
  }

  .topbar {
    gap: 6px;
    padding: 0 8px;
  }

  .mainnav .icon-button:nth-child(n+3),
  .add-button {
    display: none;
  }

  .global-search {
    min-width: 0;
  }

  .main-panel,
  .panel {
    padding: 18px;
  }

  .activity-actions {
    display: grid;
  }

  .activity-actions input {
    min-width: 0;
    width: 100%;
  }
}
