:root {
  color-scheme: light;
  --bg: #f7fbff;
  --surface: #ffffff;
  --surface-2: #f6faff;
  --ink: #0f1f33;
  --muted: #5b6b7d;
  --line: #e2edf7;
  --line-strong: #cfe0ee;
  --brand: #16a085;
  --brand-rgb: 22, 160, 133;
  --brand-strong: #107971;
  --brand-lift: #25b99d;
  --brand-lift-rgb: 37, 185, 157;
  --brand-2: #00d4ff;
  --brand-3: #ffd23f;
  --brand-soft: #e6f7f3;
  --brand-soft-strong: #d4f0e9;
  --brand-text: #0f766e;
  --success: #00a870;
  --success-soft: #dcffef;
  --warning: #c97a00;
  --warning-soft: #fff0c2;
  --danger: #c32b46;
  --danger-soft: #fde9ed;
  --violet: #6e48aa;
  --ring: 0 0 0 4px rgba(var(--brand-rgb), 0.24);
  --shadow-sm: 0 1px 2px rgba(15, 31, 51, 0.05), 0 2px 8px rgba(15, 31, 51, 0.05);
  --shadow: 0 16px 38px rgba(15, 31, 51, 0.1);
  --shadow-lg: 0 28px 64px rgba(15, 31, 51, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 12% -8%, rgba(var(--brand-rgb), 0.14), transparent 60%),
    radial-gradient(1100px 480px at 100% -4%, rgba(0, 212, 255, 0.2), transparent 58%),
    linear-gradient(180deg, #ffffff, var(--bg) 440px),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-feature-settings: "cv01", "cv03", "ss01";
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 260ms cubic-bezier(0.22, 1, 0.36, 1) 120ms;
}

.app-shell.shell-compact {
  grid-template-columns: 88px minmax(0, 1fr);
}

.app-shell.shell-compact:has(.sidebar:hover) {
  grid-template-columns: 220px minmax(0, 1fr);
}

.app-shell.shell-compact .brand {
  align-items: center;
}

.app-shell.shell-compact:has(.sidebar:hover) .brand {
  grid-template-columns: 38px minmax(0, 1fr);
  justify-content: start;
  align-items: center;
}

.app-shell.shell-compact .brand {
  grid-template-columns: 38px;
  justify-content: center;
}

.app-shell.shell-compact .brand-name,
.app-shell.shell-compact .brand-subtitle,
.app-shell.shell-compact .nav-text,
.app-shell.shell-compact .nav-badge,
.app-shell.shell-compact .nav-section-label,
.app-shell.shell-compact .sidebar-footer {
  display: none;
}

.app-shell.shell-compact:has(.sidebar:hover) .brand-name,
.app-shell.shell-compact:has(.sidebar:hover) .brand-subtitle,
.app-shell.shell-compact:has(.sidebar:hover) .nav-text,
.app-shell.shell-compact:has(.sidebar:hover) .nav-badge,
.app-shell.shell-compact:has(.sidebar:hover) .sidebar-footer {
  display: block;
}

.app-shell.shell-compact:has(.sidebar:hover) .nav-section-label {
  display: flex;
}

.app-shell.shell-compact .nav-button {
  grid-template-columns: 1fr;
  justify-items: center;
}

.app-shell.shell-compact .deal-subnav {
  display: none;
}

.app-shell.shell-compact:has(.sidebar:hover) .nav-button {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  justify-items: stretch;
}

.app-shell.shell-compact:has(.sidebar:hover) .deal-subnav {
  display: grid;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(720px 320px at 18% 0%, rgba(var(--brand-rgb), 0.12), transparent 62%),
    radial-gradient(680px 300px at 92% 10%, rgba(0, 212, 255, 0.14), transparent 58%),
    linear-gradient(180deg, #f8fcff, #eef6fb);
}

.login-panel {
  width: min(100%, 460px);
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 22px 52px rgba(15, 31, 51, 0.12);
}

.login-panel .panel-head {
  display: block;
  min-height: 0;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.login-panel .panel-head h1 {
  margin-bottom: 0;
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
}

.login-form label {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px;
  color: var(--muted);
}

.login-form label:has(:is(input, select, textarea)[required])::after {
  display: inline-block;
  order: 1;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: start;
}

.login-form label > :is(input, .password-row) {
  order: 2;
  grid-column: 1 / -1;
}

.login-form input {
  min-height: 46px;
  border-radius: 11px;
  background: #f8fbff;
  font-weight: 650;
}

.login-form input:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(var(--brand-rgb), 0.48);
}

.password-row {
  position: relative;
  display: block;
  min-width: 0;
}

.password-row input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover,
.password-toggle.active {
  background: var(--brand-soft);
  color: var(--ink);
}

.password-toggle svg {
  width: 19px;
  height: 19px;
}

.login-form .actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.login-form .btn {
  min-width: 112px;
}

.login-check-option {
  grid-template-columns: 18px minmax(0, 1fr) !important;
  padding: 2px 0;
  color: var(--ink);
}

.login-form .login-check-option input {
  order: 0;
  grid-column: auto;
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
}

.login-check-option span {
  order: 0;
  grid-column: auto;
  grid-row: auto;
}

.mfa-login-actions {
  justify-content: space-between;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82));
  backdrop-filter: blur(16px);
  box-shadow: 1px 0 0 rgba(15, 31, 51, 0.02);
  transition: box-shadow 220ms ease, background-color 220ms ease;
}

.brand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 4px 6px 0;
}

.brand-icon {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-name {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.brand-subtitle {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-section {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.nav-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.nav-tools {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.nav-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  padding: 0 10px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.nav-button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 170ms ease, color 170ms ease, box-shadow 170ms ease;
}

.nav-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-button.active {
  background: linear-gradient(180deg, var(--brand-soft), var(--brand-soft-strong));
  color: var(--ink);
  font-weight: 750;
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), 0.22);
}

.nav-button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.nav-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(15, 31, 51, 0.04);
  transition: background-color 170ms ease, color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-button:hover .nav-icon {
  background: var(--brand-soft);
}

.nav-button.active .nav-icon {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  box-shadow: 0 8px 18px rgba(var(--brand-rgb), 0.28);
}

.nav-badge {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.nav-button.active .nav-badge {
  background: #fff;
  color: var(--brand-strong);
}

.deal-subnav {
  display: grid;
  gap: 4px;
  margin: -1px 0 4px 43px;
}

.subnav-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.subnav-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.subnav-button.active {
  background: var(--brand-soft);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), 0.22);
}

.subnav-badge {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.subnav-button.active .subnav-badge {
  background: #fff;
  color: var(--brand);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  box-shadow: var(--shadow-sm);
}

.role-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.role-option {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.role-option.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  background-clip: padding-box;
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.24);
}

.deal-mobile-list {
  display: none;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

.search-help-wrap {
  display: grid;
  grid-template-columns: minmax(0, 620px) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.topbar-notification {
  position: absolute;
  top: calc(100% + 8px);
  right: 26px;
  z-index: 30;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: min(320px, calc(100vw - 52px));
  padding: 10px 14px;
  border: 1px solid rgba(0, 168, 112, 0.28);
  border-radius: 12px;
  background: rgba(220, 255, 239, 0.96);
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.notification-undo {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(0, 168, 112, 0.28);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.undo-panel {
  margin-bottom: 18px;
}

.search-wrap {
  position: relative;
  max-width: 620px;
}

.section-title-with-help,
.heading-with-help {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.section-title-with-help h1,
.heading-with-help h2,
.heading-with-help h3 {
  margin-bottom: 0;
}

.context-help {
  position: relative;
  z-index: 8;
  flex: 0 0 auto;
}

.action-with-help {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.field-label-help {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.field-context-help {
  display: inline-flex;
}

.field-context-help > .context-help-trigger {
  width: 18px;
  height: 20px;
  font-size: 13px;
}

.context-help-trigger {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  list-style: none;
  cursor: help;
}

.context-help-trigger:hover,
.context-help-trigger:focus-visible {
  color: var(--ink);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.context-help-panel {
  display: none !important;
}

.context-help-floating {
  position: fixed;
  z-index: 1000;
  display: block;
  width: min(330px, calc(100vw - 32px));
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
  text-align: left;
  pointer-events: none;
}

.context-help-floating[hidden] {
  display: none;
}

.context-help-panel strong,
.context-help-floating strong {
  display: block;
  margin-bottom: 5px;
}

.context-help-copy,
.context-help-floating .context-help-copy {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
}

.manual-back-top,
.manual-toc button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 800;
  text-align: left;
}

.manual-back-top:hover,
.manual-back-top:focus-visible,
.manual-toc button:hover,
.manual-toc button:focus-visible {
  color: var(--brand-strong);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.manual-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.manual-toc {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 104px);
  padding: 16px;
  overflow: auto;
}

.manual-search {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.manual-search input {
  width: 100%;
  min-height: 40px;
  text-transform: none;
}

.manual-toc nav {
  display: grid;
  gap: 10px;
}

.manual-toc button {
  font-size: 13px;
  line-height: 1.35;
}

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

.manual-intro {
  margin: 0;
}

.manual-article {
  scroll-margin-top: 84px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.manual-article[hidden],
.manual-toc button[hidden] {
  display: none;
}

.manual-article > header p:last-child {
  max-width: 900px;
  color: var(--muted);
  line-height: 1.55;
}

.manual-figure {
  margin: 18px 0;
}

.manual-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.manual-figure figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

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

.manual-block {
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-2);
}

.manual-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.manual-back-top {
  margin-top: 16px;
}

.search {
  position: relative;
  display: block;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  overflow: hidden;
}

.search:focus-within {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px rgba(var(--brand-rgb), 0.34), var(--shadow-sm);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.search input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0 14px 0 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
  box-shadow: none;
}

.search input:focus {
  box-shadow: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.search-results-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.search-results-head strong {
  color: var(--ink);
  font-size: 13px;
}

.api-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.api-status-connected {
  border-color: rgba(var(--brand-rgb), 0.32);
  background: var(--brand-soft);
  color: var(--brand-text);
}

.api-status-empty,
.api-status-fallback {
  border-color: #f4d58a;
  background: #fff8de;
  color: #9a6500;
}

.api-status-loading {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.search-result:hover,
.search-result:focus-visible {
  border-color: rgba(var(--brand-rgb), 0.38);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.search-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.search-type-deal {
  border-color: rgba(0, 168, 112, 0.24);
  background: #dcffef;
  color: var(--brand-text);
}

.search-type-person {
  border-color: rgba(30, 94, 255, 0.22);
  background: #e8efff;
  color: #174ea6;
}

.search-type-company {
  border-color: rgba(148, 91, 255, 0.24);
  background: #f0e9ff;
  color: #6f35c5;
}

.search-type-soleProprietor {
  border-color: rgba(0, 128, 128, 0.26);
  background: #ddf8f5;
  color: #007a76;
}

.search-type-financier {
  border-color: rgba(5, 150, 105, 0.24);
  background: #ddfbea;
  color: #047857;
}

.search-type-creditProduct {
  border-color: rgba(14, 165, 233, 0.25);
  background: #e0f2fe;
  color: #0369a1;
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.search-result small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.search-empty {
  margin: 0;
}

.quick-role {
  display: none;
}

.admin-alert {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(160, 123, 30, 0.28);
  border-radius: 999px;
  background: #fff8e8;
  color: #7a570e;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-alert span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand-3);
  color: #fff;
}

.user-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.24);
}

.user-meta {
  min-width: 0;
}

.user-meta strong,
.user-meta span {
  display: block;
  overflow: hidden;
  max-width: 180px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta strong {
  font-size: 13px;
}

.user-meta span {
  color: var(--muted);
  font-size: 12px;
}

.content {
  width: min(1640px, 100%);
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 6px;
  font-size: 31px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.6px;
}

h2 {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.section-summary {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  font-size: 15px;
}

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

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease,
    background-color 150ms ease, box-shadow 150ms ease;
}

.btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.btn.primary {
  border-color: rgba(var(--brand-rgb), 0.44);
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  background-clip: padding-box;
  color: #fff;
  box-shadow: 0 10px 24px rgba(var(--brand-rgb), 0.28);
}

.btn.primary:hover {
  border-color: rgba(var(--brand-lift-rgb), 0.54);
  background: linear-gradient(135deg, var(--brand-lift), var(--brand));
  background-clip: padding-box;
  color: #fff;
  box-shadow: 0 14px 30px rgba(var(--brand-rgb), 0.32);
}

.btn.danger {
  border-color: #f0b6c0;
  color: var(--danger);
}

.btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--surface-2);
}

.btn.small {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 13px;
}

.mobile-nav {
  display: none;
}

.mobile-nav-wrap,
.mobile-tool-nav {
  display: none;
}

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

.stat {
  position: relative;
  overflow: hidden;
  min-height: 122px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease,
    border-color 200ms ease;
}

.stat::before {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--brand-strong), var(--brand-lift));
  opacity: 0.78;
}

.stat:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

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

.stat strong {
  display: block;
  margin-top: 12px;
  color: var(--brand-strong);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.8px;
}

.stat small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12.5px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.65fr);
  gap: 14px;
  align-items: start;
}

.workspace > * {
  min-width: 0;
}

.record-workspace,
.deal-workspace {
  min-height: 0;
  height: auto;
  align-items: start;
}

.financier-workspace {
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.7fr);
}

.record-workspace > .panel:first-child,
.deal-workspace > .panel:first-child {
  position: static;
  display: flex;
  flex-direction: column;
  align-self: start;
  max-height: none;
  overflow: visible;
}

.record-workspace > .panel:first-child .list,
.deal-workspace > .panel:first-child .list {
  flex: none;
  min-height: 0;
  overflow: visible;
}

.record-workspace > .panel:nth-child(2),
.deal-workspace > .panel:nth-child(2) {
  position: sticky;
  top: 98px;
  align-self: start;
  max-height: calc(100vh - 116px);
  overflow: auto;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 60px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fcfdff, #ffffff);
  border-radius: var(--radius) var(--radius) 0 0;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
}

.panel-body {
  padding: 16px;
}

.list {
  display: grid;
  gap: 14px;
  padding: 8px;
}

.record-workspace > .panel:first-child .toolbar.filters,
.deal-list-panel .toolbar.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.record-workspace > .panel:first-child .toolbar.filters label,
.deal-list-panel .toolbar.filters label {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.record-workspace > .panel:first-child .toolbar.filters select,
.deal-list-panel .toolbar.filters select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  font-size: 13px;
  text-transform: none;
}

.list-item {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-align: left;
  line-height: 1.35;
  overflow: visible;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease,
    transform 150ms ease;
}

.record-workspace > .panel:first-child .list-item,
.deal-list-panel .list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  row-gap: 6px;
  align-content: start;
  min-height: 92px;
  padding: 13px;
}

.list-item > span:first-child {
  display: block;
  min-width: 0;
}

.list-item > span:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  min-width: 0;
  margin-top: 3px;
}

.record-workspace > .panel:first-child .list-item > span,
.deal-list-panel .list-item > span {
  position: static;
  width: 100%;
  min-width: 0;
}

.list-item:hover,
.list-item.active {
  border-color: rgba(var(--brand-rgb), 0.44);
  background: var(--brand-soft);
  box-shadow: var(--shadow-sm);
}

.list-item:hover {
  transform: translateX(2px);
}

.list-title {
  display: block;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  font-weight: 750;
  line-height: 1.32;
  letter-spacing: -0.2px;
}

.list-meta {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-workspace > .panel:first-child .list-title,
.deal-list-panel .list-title,
.record-workspace > .panel:first-child .list-meta,
.deal-list-panel .list-meta {
  position: static;
}

.list-meta span {
  display: inline;
  min-width: 0;
  overflow-wrap: normal;
}

.list-meta span + span::before {
  content: " - ";
}


.pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.pager-size {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pager-size select {
  min-height: 32px;
  padding: 5px 26px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

.pager-range {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.pager-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.pager-page {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-action-button {
  border-color: #bfdbfe;
  background: #fff;
  color: #0f3f76;
  box-shadow: var(--shadow-sm);
}

.table-action-button:hover {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #0f3f76;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1px;
}

.pill.blue {
  background: #e6f1ff;
  color: #0967d2;
}

.pill.cyan {
  background: #e4f8fb;
  color: #087d8f;
}

.pill.product-credit {
  background: #e6f3f0;
  color: var(--brand-strong);
}

.pill.product-grant {
  background: #f9f1da;
  color: #7a5200;
}

.pill.product-insurance {
  background: #eef0ff;
  color: #4652b8;
}

.pill.product-guarantee {
  background: #e7f7f2;
  color: #0f8b68;
}

.pill.product-factoring {
  background: #f3e8ff;
  color: #7e22ce;
}

.deal-title-heading {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.deal-title-heading > span:last-child {
  min-width: 0;
}

.deal-title-heading .pill {
  min-height: 32px;
  padding: 6px 13px;
  font-size: 14px;
  font-weight: 900;
}

.pill.green {
  background: var(--success-soft);
  color: var(--success);
}

.pill.amber {
  background: var(--warning-soft);
  color: #844b00;
}

.pill.red {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill.violet {
  background: #eeeafb;
  color: var(--violet);
}

.pill.automation {
  background: #fde7f3;
  color: #b4236b;
}

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

.field {
  position: relative;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: auto;
  padding: 9px 0 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.field::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  content: "";
  opacity: 0.82;
}

.field span {
  display: block;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.35;
}

.field .field-label-with-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.info-tooltip {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(246, 250, 255, 0.72);
  box-shadow: none;
  color: #8ca0b5;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: none;
}

.info-tooltip:hover,
.info-tooltip:focus-visible {
  border-color: rgba(var(--brand-rgb), 0.52);
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.field .info-tooltip-panel {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 10px);
  display: none;
  width: min(320px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  transform: translateX(-50%);
}

.info-tooltip:hover .info-tooltip-panel,
.info-tooltip:focus-visible .info-tooltip-panel {
  display: block;
}

.field strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.35;
}

.inline-record-edit .panel-head > div:first-child,
.financier-inline-edit .panel-head > div:first-child {
  min-width: 0;
}

.inline-title-input {
  width: min(520px, 100%);
  min-height: 34px;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
  line-height: 1.15;
  outline: none;
}

.inline-title-input:focus {
  border-bottom-color: var(--brand);
  box-shadow: 0 2px 0 rgba(var(--brand-rgb), 0.14);
}

.inline-field :is(input, select),
.inline-record-edit [data-deal-client-field] :is(input, select),
.financier-inline-edit [data-deal-client-field] :is(input, select) {
  width: 100%;
  min-height: 30px;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 620;
  line-height: 1.35;
  outline: none;
}

.inline-field :is(input, select):focus,
.inline-record-edit [data-deal-client-field] :is(input, select):focus,
.financier-inline-edit [data-deal-client-field] :is(input, select):focus {
  border-bottom-color: var(--brand);
  box-shadow: 0 2px 0 rgba(var(--brand-rgb), 0.14);
}

.inline-checkbox-field input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.inline-knowledge-block textarea,
.inline-note-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 520;
  line-height: 1.45;
  outline: none;
}

.inline-knowledge-block textarea {
  padding: 12px 18px;
}

.inline-note-input {
  padding: 14px 18px;
}

.inline-knowledge-block textarea:focus,
.inline-note-input:focus {
  border-color: rgba(var(--brand-rgb), 0.52);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}

.inline-record-edit [data-deal-client-field] {
  position: relative;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: auto;
  padding: 9px 0 9px 10px;
  border-bottom: 1px solid var(--line);
}

.inline-record-edit [data-deal-client-field]::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  content: "";
  opacity: 0.82;
}

.inline-record-edit [data-deal-client-field] > span:first-child,
.inline-record-edit [data-deal-client-field] {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.inline-record-edit [data-deal-client-field] .input-action-row {
  text-transform: none;
  letter-spacing: 0;
}

/* Kattintható mezőérték (pl. ügylet fejléc Ügyfél -> cég/személy adatlap).
   Pontosan a .field strong tipográfiáját követi, hogy egy vonalban legyen a
   felirattal és balra igazodjon; a .btn helyett sima szöveg-link. */
.field-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.35;
  color: var(--success);
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: color 150ms ease;
}

.field-link:hover {
  color: var(--success);
  text-decoration: underline;
}

.field-link:focus-visible {
  outline: none;
  color: var(--success);
  text-decoration: underline;
  border-radius: var(--radius-sm);
  box-shadow: var(--ring);
}

/* Kattintható rekord-navigációs linkek (cég / személy / ügylet nevek) az egész
   portálon zöld színnel, hogy látszódjon: rákattintható és adatlapra visz. */
.btn[data-select-type] {
  color: #007a52;
  font-weight: 700;
}

.btn[data-select-type]:hover,
.btn[data-select-type]:focus-visible {
  color: #007a52;
  text-decoration: underline;
}

.field-action-value,
.input-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.field-action-value {
  justify-content: flex-start;
}

/* Az adószám értéke 14px legyen (mint a többi mezőérték), ne örökölje a
   .field span 11px-es, nagybetűs label stílust; tartalom-szélességű, hogy az
   "Adatok lekérése" gomb a szám MELLÉ férjen egy sorban, ne alá. */
.field .field-action-value > span {
  display: inline-block;
  width: auto;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 620;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.35;
}

/* Adatlap-mező: felirat és érték közös alapvonalon (egy sorban nézzen ki),
   a korábbi align-items: start helyett. */
.detail-grid .field {
  align-items: baseline;
}

.input-action-row input {
  flex: 1 1 180px;
  min-width: 0;
}

.deal-company-picker .btn,
.deal-person-picker .btn,
.deal-contact-person-picker .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(255, 92, 117, 0.16) !important;
}

.opten-button {
  white-space: nowrap;
}

.field-opten-button {
  width: fit-content;
  min-height: 34px;
  padding: 7px 12px;
  border-color: rgba(var(--brand-rgb), 0.4);
  background: var(--brand-soft);
  box-shadow: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.field-opten-button:hover,
.field-opten-button:focus-visible {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.field[class*="tone-"] {
  border-bottom-color: var(--line);
}

.field[class*="tone-"] span {
  color: var(--muted);
}

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

.dashboard-tasks-panel {
  min-width: 0;
  order: 1;
}

.dashboard-reminders-panel {
  min-width: 0;
  order: 2;
}

.dashboard-reminder-body {
  display: grid;
  gap: 18px;
}

.dashboard-mini-calendar {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.dashboard-mini-calendar-head,
.dashboard-mini-weekdays,
.dashboard-mini-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.dashboard-mini-calendar-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 10px;
  text-transform: capitalize;
}

.dashboard-mini-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.dashboard-mini-day {
  position: relative;
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.dashboard-mini-day:hover,
.dashboard-mini-day:focus-visible {
  border-color: var(--brand);
}

.dashboard-mini-day.outside {
  opacity: 0.42;
}

.dashboard-mini-day.weekend {
  background: #f1f4f5;
}

.dashboard-mini-day.today {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  color: var(--brand-strong);
  font-weight: 800;
}

.dashboard-mini-day small {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  min-width: 15px;
  height: 15px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
}

.dashboard-reminder-item.overdue {
  border-left: 3px solid var(--danger);
  background: #fff7f7;
}

.subsection {
  margin-top: 18px;
}

.subsection:first-child {
  margin-top: 0;
}

.subsection-head,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.subsection-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.subsection-head h3 {
  margin-bottom: 0;
}

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

.mini-table {
  width: 100%;
  border-collapse: collapse;
}

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

.mini-table td {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.mini-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.mini-table .btn.small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
}

.option-list-table :is(input, select) {
  min-width: 150px;
}

.option-list-table td:first-child input {
  min-width: 260px;
}

.settings-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.form-status {
  min-height: 20px;
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-status.pending {
  color: var(--brand-strong);
}

.form-status.danger {
  color: var(--danger);
}

.option-list-textarea-label {
  display: grid;
  gap: 8px;
}

.settings-subsection {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.settings-subsection h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.opten-verified-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(22, 163, 74, 0.24);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.11);
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.mini-table tr:last-child td {
  border-bottom: 0;
}

.email-send-log {
  margin-top: 16px;
}

.email-send-log .panel-body {
  overflow-x: auto;
}

.email-send-log .mini-table {
  min-width: 980px;
}

.mail-log-meta,
.mail-log-error {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.mail-log-error {
  color: var(--danger);
}

.dashboard-filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 280px));
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-task-filter-row {
  grid-template-columns: minmax(180px, 280px);
}

.dashboard-filter-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dashboard-filter-row select {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e6f1ff;
  color: #0967d2;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .dashboard-filter-row {
    grid-template-columns: 1fr;
  }

  .template-document-upload,
  .template-document-item {
    grid-template-columns: 1fr;
  }
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.timeline-format-toolbar {
  display: inline-flex;
  gap: 6px;
  order: 2;
  flex: 0 0 100%;
  margin-bottom: 6px;
}

.format-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.format-button.italic {
  font-style: italic;
}

.format-button:hover {
  border-color: var(--brand);
  box-shadow: var(--ring);
}

textarea,
input,
select,
.timeline-editor {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input,
select {
  min-width: 0;
  min-height: 40px;
  padding: 9px 12px;
}

select[multiple] {
  min-height: 124px;
  padding: 8px 10px;
}

textarea,
.timeline-editor {
  min-height: 96px;
  resize: vertical;
  padding: 11px 12px;
}

textarea:focus,
input:focus,
select:focus,
.timeline-editor:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.timeline-editor,
.timeline-text {
  font-size: 16px;
  line-height: 1.55;
}

.timeline-editor {
  order: 2;
  flex: 0 0 100%;
  max-width: 100%;
  overflow-y: auto;
  font-weight: 500;
}

.timeline-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-weight: 600;
}

.timeline-hidden {
  display: none !important;
}

label,
.timeline-field {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 5px;
  row-gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

label:has(:is(input, select, textarea)[required])::after {
  content: "*";
  display: inline-block;
  order: 1;
  color: var(--danger);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.modal-body label.manual-required:has(:is(input, select, textarea)[required])::after {
  content: none;
  display: none;
}

label > :is(input, select, textarea, .input-action-row) {
  display: block;
  order: 2;
  flex: 0 0 100%;
  min-width: 0;
  max-width: 100%;
}

label > .input-action-row {
  display: flex;
}

.toggle-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  color: var(--ink);
  text-transform: none;
}

.toggle-row::after {
  content: none !important;
}

.toggle-row > input[type="checkbox"] {
  position: relative;
  display: block;
  order: 0;
  flex: none;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #e8eef5;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.toggle-row > input[type="checkbox"]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  content: "";
  transition: transform 160ms ease;
}

.toggle-row > input[type="checkbox"]:checked {
  border-color: rgba(0, 201, 107, 0.55);
  background: var(--brand);
}

.toggle-row > input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.toggle-row > input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18);
}

.toggle-row > span {
  order: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

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

.form-grid > label {
  align-self: start;
  width: 100%;
}

.filter-panel {
  flex: 0 0 auto;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
}

.record-workspace > .panel:first-child .filter-grid,
.deal-list-panel .filter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.record-workspace > .panel:first-child .filter-summary,
.deal-list-panel .filter-summary {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.filter-grid label {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-grid select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  font-size: 13px;
}

.filter-grid select:focus {
  box-shadow: inset 0 0 0 2px rgba(var(--brand-rgb), 0.36);
}

.filter-checklist-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
}

.filter-checklist-label:has(.filter-checklist[open]) {
  z-index: 20;
}

.filter-label-text {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-checklist {
  position: relative;
  width: 100%;
  min-width: 0;
}

.filter-checklist summary {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  list-style: none;
  text-transform: none;
}

.filter-checklist summary::-webkit-details-marker {
  display: none;
}

.filter-checklist summary::after {
  content: "▾";
  position: absolute;
  right: 12px;
  color: var(--muted);
  font-size: 12px;
}

.filter-checklist[open] summary {
  box-shadow: inset 0 0 0 2px rgba(var(--brand-rgb), 0.36);
}

.filter-checklist-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 2px;
  max-height: 260px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.filter-checklist-items {
  display: grid;
  gap: 2px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.financier-contact-options {
  max-height: 260px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.financier-contact-options label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  text-transform: none;
}

.financier-contact-options label:hover {
  background: #eefbf6;
}

.financier-contact-field {
  align-self: start;
}

.financier-contact-field legend {
  font-size: 16px;
  font-weight: 900;
}

.financier-contact-picker {
  display: grid;
  gap: 10px;
}

.financier-contact-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.financier-contact-search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.financier-contact-search input {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
}

.financier-contact-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.financier-contact-selected-item {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.financier-contact-selected-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.financier-contact-selected-item input {
  min-height: 36px;
  border-radius: 9px;
  font-size: 13px;
}

.empty-inline {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.financier-contact-options {
  display: grid;
  gap: 3px;
  max-height: 238px;
  overflow: auto;
}

.financier-contact-option[hidden] {
  display: none !important;
}

.financier-contact-option > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.financier-contact-option strong,
.financier-contact-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.financier-contact-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.financier-contact-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.financier-branch-list,
.financier-branch-form-list {
  display: grid;
  gap: 12px;
}

.financier-branch-detail,
.financier-branch-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.financier-branch-detail-head,
.financier-branch-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.financier-branch-detail-head h4,
.financier-branch-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.financier-branch-detail-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.info-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.knowledge-block {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.knowledge-block h3 {
  margin: 0;
  font-size: 14px;
}

.knowledge-block .note-block,
.knowledge-block .empty {
  margin: 0;
}

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

.tag-list.compact {
  gap: 6px;
  margin-top: 7px;
}

.info-documents {
  display: grid;
  gap: 12px;
}

.info-document-groups {
  display: grid;
  gap: 14px;
}

.info-document-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.info-document-group .subsection-head {
  margin-bottom: 0;
}

.info-document-group .subsection-head h4 {
  margin: 0;
  font-size: 15px;
}

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

.info-document-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, auto);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.info-document-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.file-type-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #64748b;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.file-type-pdf {
  background: #c32b46;
}

.file-type-word {
  background: #2563eb;
}

.file-type-excel {
  background: #059669;
}

.file-type-image {
  background: #7c3aed;
}

.file-type-file {
  background: #64748b;
}

.info-document-main h4 {
  margin: 0 0 3px;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.info-document-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.info-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.info-document-actions form {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: min(100%, 320px);
}

.info-document-actions input[type="file"] {
  width: min(220px, 100%);
  min-height: 36px;
  padding: 6px;
  font-size: 12px;
}

.info-document-upload {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fbfdff;
}

.info-document-upload .btn {
  min-height: 42px;
}

.check-option,
.filter-grid .check-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  text-transform: none;
}

.check-option:hover {
  background: var(--brand-soft);
}

.check-option input {
  appearance: none;
  display: grid;
  place-content: center;
  order: 0;
  flex: 0 0 auto;
  width: 16px;
  min-width: 16px;
  max-width: none;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 2px solid #7b8794;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
}

.check-option input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.16);
}

.check-option input:checked {
  border-color: var(--brand);
  background-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7.1 5.7 10 11.2 3.8' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
}

.check-option span {
  order: 1;
  min-width: 0;
  overflow-wrap: normal;
}

.filter-checklist-actions {
  display: flex;
  justify-content: flex-end;
  padding: 8px 2px 2px;
  border-top: 1px solid var(--line);
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-height: 38px;
}

.sort-toggle {
  min-width: 64px;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.sort-toggle span {
  font-size: 12px;
  line-height: 1;
}

.form-wide,
.type-fields {
  grid-column: 1 / -1;
}

.type-fields {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.type-fields[hidden] {
  display: none;
}

.type-fields legend {
  padding: 0 7px;
  color: var(--brand-2);
  font-size: 13px;
  font-weight: 800;
}

.type-fields .form-grid {
  margin-top: 8px;
}

.credit-success-fee-rules {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.legacy-fee-terms {
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  background: #fff9e8;
}

.legacy-fee-terms span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legacy-fee-terms p {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.credit-success-fee-rules > .btn {
  justify-self: start;
}

.credit-success-fee-list {
  display: grid;
  gap: 8px;
}

.credit-success-fee-list:empty {
  display: none;
}

.credit-success-fee-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.45fr) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.credit-success-fee-row > label {
  min-width: 0;
}

.credit-success-fee-row > .btn {
  min-height: 42px;
  white-space: nowrap;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
}

.timeline-dot {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), 0.18);
}

.timeline-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.timeline-entry-completed {
  opacity: 0.68;
}

.timeline-entry-completed .timeline-dot {
  background: #edf3f1;
  color: #5c746e;
}

.timeline-completed-card {
  padding: 0;
  background: #f8faf9;
  box-shadow: none;
}

.timeline-completed-card summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}

.timeline-completed-card summary::-webkit-details-marker {
  display: none;
}

.timeline-completed-card summary::after {
  margin-left: auto;
  content: "Lenyitás";
  color: var(--brand);
  font-weight: 700;
}

.timeline-completed-card[open] summary::after {
  content: "Összecsukás";
}

.timeline-completed-card summary strong {
  color: var(--ink);
}

.timeline-completed-detail {
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}

.timeline-completed-detail .timeline-meta {
  margin-top: 10px;
}

.timeline-completion-result {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
}

.empty {
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  color: var(--muted);
}

.note-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: var(--shadow-sm);
}

.note-block p {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.create-panel {
  margin-bottom: 16px;
  border-left: 4px solid var(--brand-2);
}

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

.deal-filter {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.deal-view-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, auto));
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.deal-type-tabs {
  display: none;
  grid-template-columns: repeat(3, minmax(130px, auto));
  gap: 4px;
  margin: 0 10px 14px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.deal-type-tabs button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.deal-type-tabs button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  background-clip: padding-box;
  color: #fff;
  box-shadow: 0 8px 18px rgba(var(--brand-rgb), 0.2);
}

.deal-type-tabs span {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font-size: 12px;
}

.infotar-tabs {
  grid-template-columns: minmax(180px, auto);
}

.deal-view-tabs button {
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.deal-view-tabs button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  background-clip: padding-box;
  color: #fff;
  box-shadow: 0 8px 18px rgba(var(--brand-rgb), 0.2);
}

.deal-list-panel > .deal-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: none;
}

.deal-filter button,
.mini-filter button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.deal-filter button.active,
.mini-filter button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  background-clip: padding-box;
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.24);
}

.deal-filter span,
.mini-filter span {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
}

.mini-filter {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 4px;
  margin: 0 0 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.mini-filter button {
  min-height: 30px;
  padding: 5px 11px;
  font-size: 12px;
}

.flow-panel {
  overflow: hidden;
}

.flow-panel .panel-body {
  overflow-x: auto;
}

.lane {
  min-height: 220px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfdff, #f4f8fb);
}

.lane h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.deal-card {
  display: grid;
  gap: 7px;
  width: 100%;
  margin-bottom: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.deal-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

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

.admin-users-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.admin-users-panel .panel-body {
  overflow-x: auto;
}

.admin-users-table {
  min-width: 1080px;
  table-layout: fixed;
}

.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) {
  width: 21%;
}

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) {
  width: 13%;
}

.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) {
  width: 18%;
}

.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) {
  width: 12%;
}

.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) {
  width: 8%;
}

.admin-users-table th:nth-child(6),
.admin-users-table td:nth-child(6) {
  width: 8%;
}

.admin-users-table th:nth-child(7),
.admin-users-table td:nth-child(7) {
  width: 8%;
}

.admin-users-table th:nth-child(8),
.admin-users-table td:nth-child(8) {
  width: 15%;
}

.admin-users-table select[data-user-role] {
  width: 128px;
  max-width: 100%;
}

.notice {
  padding: 13px 14px;
  border: 1px solid rgba(var(--brand-rgb), 0.24);
  border-radius: 12px;
  background: var(--brand-soft);
  color: #0c4f4a;
}

.notice.danger {
  border-color: rgba(195, 43, 70, 0.28);
  background: var(--danger-soft);
  color: var(--danger);
}

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

.audit-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.audit-item strong {
  display: block;
  margin-bottom: 4px;
}

.audit-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.audit-item p {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 8px 0 10px;
}

.audit-item .btn[data-select-type] {
  max-width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.audit-item .list-meta {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

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

.request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.request-card.pending {
  border-color: rgba(160, 123, 30, 0.28);
  background: linear-gradient(180deg, #fff, #fffaf0);
}

.request-card h3 {
  margin: 8px 0 5px;
  font-size: 16px;
}

.request-card p {
  margin: 0 0 6px;
  color: var(--ink);
}

.request-card small {
  color: var(--muted);
  line-height: 1.45;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.permission-checks {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.permission-checks-inline {
  grid-template-columns: repeat(auto-fit, minmax(130px, max-content));
  align-items: center;
}

.compact-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  width: max-content;
  max-width: 100%;
  gap: 8px;
}

.compact-check > input {
  order: 0;
  grid-column: auto;
}

.compact-check > span {
  order: 0;
  min-width: 0;
  white-space: nowrap;
}

.template-editor-layout {
  align-items: start;
}

.compact-list {
  max-height: 620px;
  overflow: auto;
}

.template-edit-form {
  display: grid;
  gap: 14px;
}

.template-documents-panel,
.template-document-upload,
.template-document-list,
.template-attachment-picker {
  display: grid;
  gap: 12px;
}

.template-documents-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.template-document-upload {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
}

.template-document-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.template-document-item > div:first-child,
.template-attachment-option span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.template-document-item strong,
.template-attachment-option strong,
.template-attachment-option small {
  overflow-wrap: anywhere;
}

.template-attachment-picker {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.template-attachment-picker .check-list {
  display: grid;
  gap: 8px;
}

.template-attachment-option {
  width: 100%;
}

.compact-empty {
  margin: 0;
}

.settings-panel-area {
  display: grid;
  gap: 16px;
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px;
  width: 100%;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.settings-tabs button {
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.settings-tabs button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  box-shadow: 0 8px 18px rgba(var(--brand-rgb), 0.2);
}

.mfa-settings {
  display: grid;
  gap: 18px;
}

.mfa-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mfa-status-row > div:first-child {
  display: grid;
  gap: 5px;
}

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

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.session-item > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.session-item strong,
.session-item .list-meta {
  overflow-wrap: anywhere;
}

.mfa-enrollment-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.mfa-qr {
  width: 220px;
  height: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.mfa-enrollment-fields,
.mfa-confirm-form {
  display: grid;
  gap: 14px;
}

.mfa-enrollment-fields label,
.mfa-confirm-form label {
  display: grid;
  gap: 7px;
}

.mfa-enrollment-fields input {
  width: 100%;
}

.mfa-recovery {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mfa-recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.mfa-recovery-grid code {
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #f7fafc;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.mail-identity-block {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subsection-head h3 {
  margin: 0;
  font-size: 16px;
}

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

.mail-identity-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.mail-identity-user {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-bottom: 5px;
}

.mail-identity-user strong,
.mail-identity-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-identity-user strong {
  font-size: 13px;
}

.mail-identity-user span {
  color: var(--muted);
  font-size: 12px;
}

.mail-identity-imap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.mail-identity-sent-status {
  display: grid;
  gap: 6px;
  align-content: end;
  justify-items: start;
  color: var(--muted);
  font-size: 12px;
}

.placeholder-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.placeholder-select {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.placeholder-select span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.field-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.rich-editor {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.tool-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
}

.rich-surface {
  min-height: 300px;
  padding: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  outline: none;
}

.rich-surface:focus {
  box-shadow: inset 0 0 0 2px rgba(var(--brand-rgb), 0.36);
}

.rich-surface p,
.rich-surface ul,
.rich-surface ol {
  margin: 0 0 10px;
}

.rich-surface ul,
.rich-surface ol {
  padding-left: 22px;
}

.rich-hidden {
  display: none;
}

.admin-user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 112px;
}

.admin-user-actions .btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}

.compact-check {
  display: inline-grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.compact-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: var(--brand);
}

.lock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 20, 35, 0.4);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(620px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal:has(.relationship-role-picker[open]) {
  overflow: visible;
}

.quick-company-modal {
  width: min(920px, 100%);
}

.quick-person-modal {
  width: min(920px, 100%);
}

.quick-company-modal,
.quick-person-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: min(720px, calc(100vh - 36px));
  overflow: hidden;
}

.quick-company-modal > .modal-body,
.quick-person-modal > .modal-body {
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
  overflow: hidden;
}

.quick-company-modal > .modal-body > .form-grid,
.quick-person-modal > .modal-body > .form-grid {
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
}

.email-send-modal {
  width: min(920px, 100%);
}

.email-send-modal .rich-surface {
  min-height: 360px;
}

.modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin-bottom: 0;
}

.modal-body {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 20px;
}

.modal-body label {
  min-width: 0;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
}

.modal-body .password-row {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.modal-body .inline-required::after {
  display: none;
}

.relationship-role-field {
  position: relative;
  display: grid;
  gap: 5px;
  z-index: 2;
  min-width: 0;
}

.relationship-role-field:has(.relationship-role-picker[open]) {
  z-index: 100;
}

.relationship-role-picker {
  width: 100%;
}

.relationship-role-picker summary,
.relationship-role-options .check-option {
  font-weight: 500;
}

.relationship-role-options {
  z-index: 100;
  max-height: min(360px, calc(100vh - 220px));
}

.modal-body .relationship-role-options input {
  width: 16px;
}

.modal-inline-action {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.required-mark {
  color: var(--danger);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.modal-actions-end {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .brand {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
  }

  .brand-subtitle,
  .sidebar-footer {
    display: none;
  }

  .sidebar {
    padding-inline: 18px;
  }

  .nav-button {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

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

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

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .deal-mobile-list {
    display: block;
    margin-bottom: 14px;
  }

  .deal-workspace > .deal-list-panel {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    top: 0;
  }

  .search-wrap {
    max-width: none;
  }

  .search-help-wrap {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .search-results {
    position: static;
    margin-top: 8px;
  }

  .quick-role {
    display: grid;
  }

  .admin-alert {
    justify-content: center;
  }

  .user-chip {
    display: none;
  }

  .content {
    padding: 16px 14px 32px;
  }

  .workspace,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .record-workspace,
  .deal-workspace {
    height: auto;
  }

  .record-workspace > .panel:first-child,
  .deal-workspace > .panel:first-child,
  .record-workspace > .panel:nth-child(2),
  .deal-workspace > .panel:nth-child(2) {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .record-workspace > .panel:first-child .list,
  .deal-workspace > .panel:first-child .list {
    overflow: visible;
  }

  .section-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

  .mobile-nav-wrap {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
  }

  .mobile-nav-section {
    display: grid;
    gap: 7px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }

  .mobile-nav-section:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-tool-nav {
    display: grid;
    gap: 7px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .mobile-tool-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-nav-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
  }

  .mobile-nav .nav-button {
    min-height: 56px;
    padding: 8px 6px;
    font-size: 12px;
    text-align: center;
  }

  .mobile-nav .nav-text {
    display: inline;
  }

  .stats-grid,
  .detail-grid,
  .info-knowledge-grid,
  .info-document-upload,
  .split,
  .filter-grid,
  .form-grid,
  .mail-identity-row,
  .mail-identity-imap,
  .kanban {
    grid-template-columns: 1fr;
  }

  .manual-shell,
  .manual-blocks {
    grid-template-columns: 1fr;
  }

  .manual-toc {
    position: static;
    max-height: none;
  }

  .info-document-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .info-document-actions {
    justify-content: flex-start;
  }

  .info-document-actions form {
    width: 100%;
    flex-wrap: wrap;
  }

  .info-document-actions input[type="file"] {
    width: min(100%, 360px);
  }

  .financier-contact-selected-item {
    grid-template-columns: 1fr;
  }

  .financier-contact-search-row {
    grid-template-columns: 1fr;
  }

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

  .financier-branch-detail-head,
  .financier-branch-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .financier-branch-detail-head span {
    text-align: left;
    white-space: normal;
  }

  h1 {
    font-size: 25px;
  }

  .deal-type-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin-right: 0;
  }

  .panel-head,
  .request-card,
  .list-item {
    grid-template-columns: 1fr;
  }

  .mfa-enrollment-layout {
    grid-template-columns: 1fr;
  }

  .mfa-status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-item .actions,
  .session-item .btn {
    width: 100%;
  }

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

  .pager-range {
    text-align: left;
  }
}

.calendar-panel {
  overflow-x: auto;
  padding: 16px;
}

.calendar-toolbar,
.calendar-navigation,
.calendar-filters,
.calendar-view-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.calendar-navigation h2 {
  margin: 0 0 0 8px;
  text-transform: capitalize;
}

.calendar-filters label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calendar-filters select {
  min-width: 160px;
}

.calendar-grid {
  display: grid;
  gap: 1px;
  min-width: 980px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.calendar-view-month,
.calendar-view-week {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day {
  min-height: 166px;
  padding: 9px;
  background: var(--surface);
}

.calendar-view-week .calendar-day {
  min-height: 560px;
}

.calendar-grid.calendar-view-day {
  grid-template-columns: 1fr;
  min-width: 0;
}

.calendar-grid.calendar-view-day > .calendar-day {
  min-height: 520px;
}

.calendar-day.weekend {
  background: #f4f7f8;
}

.calendar-day.outside-month {
  opacity: 0.56;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.calendar-day-head,
.calendar-day-head > div,
.calendar-task-main,
.calendar-task-meta,
.calendar-task-actions {
  display: flex;
  align-items: center;
}

.calendar-day-head {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.calendar-day-head > div {
  gap: 6px;
}

.calendar-weekday,
.calendar-nonworking,
.calendar-empty-day {
  color: var(--muted);
  font-size: 11px;
}

.calendar-add-day {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
  cursor: pointer;
}

.calendar-day-tasks {
  display: grid;
  gap: 7px;
}

.calendar-task {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid #bfe4dd;
  border-left: 3px solid var(--brand);
  border-radius: 9px;
  background: #f0fbf8;
}

.calendar-task.overdue {
  border-color: #f4b9bd;
  border-left-color: var(--danger);
  background: #fff5f5;
}

.calendar-task.completed {
  opacity: 0.58;
  border-color: var(--line);
  border-left-color: #79938c;
  background: #f5f8f7;
}

.calendar-task-main {
  align-items: flex-start;
  gap: 6px;
}

.calendar-task-main strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.calendar-task-time {
  flex: none;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.calendar-task-meta {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.calendar-parent-link {
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.calendar-task-actions {
  flex-wrap: wrap;
  gap: 5px;
}

.calendar-task-actions .btn {
  min-height: 27px;
  padding: 4px 7px;
  font-size: 10px;
}

.task-related-record {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.task-related-record span {
  color: var(--muted);
  font-weight: 500;
}

.reminder-alert-backdrop {
  z-index: 45;
}

.reminder-alert-modal {
  width: min(560px, 100%);
  border-color: rgba(var(--brand-rgb), 0.55);
  box-shadow: 0 24px 70px rgba(8, 35, 44, 0.3);
}

.reminder-alert-modal .modal-head {
  background: linear-gradient(135deg, var(--brand-soft), #fff);
}

.reminder-alert-message {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.reminder-alert-actions {
  justify-content: flex-end;
}

@media (max-width: 620px) {
  .dashboard-mini-day {
    min-height: 34px;
    font-size: 12px;
  }

  .reminder-alert-actions,
  .reminder-alert-actions .btn {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .calendar-toolbar,
  .calendar-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-navigation {
    flex-wrap: wrap;
  }

  .calendar-navigation h2 {
    width: 100%;
    margin: 6px 0 0;
  }

  .calendar-view-switch .btn {
    flex: 1;
  }

  .calendar-filters label,
  .calendar-filters select {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .mobile-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deal-view-tabs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .settings-tabs,
  .placeholder-tools {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .mfa-qr {
    width: min(220px, 100%);
    height: auto;
    aspect-ratio: 1;
  }

  .mfa-recovery-grid {
    grid-template-columns: 1fr;
  }

  .deal-type-tabs {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .actions,
  .timeline-actions {
    width: 100%;
  }

  .mini-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .modal-actions,
  .modal-head {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sidebar,
  .topbar,
  .mobile-nav-wrap,
  .manual-toc,
  .section-head .actions,
  .context-help,
  .manual-back-top {
    display: none !important;
  }

  .app-shell,
  .manual-shell,
  .manual-blocks {
    display: block;
  }

  .content {
    width: 100%;
    padding: 0;
  }

  .manual-article {
    break-inside: avoid;
    margin-bottom: 16px;
    border-color: #d7dde5;
    box-shadow: none;
  }

  .manual-block {
    break-inside: avoid;
    margin-bottom: 10px;
  }
}

@media (max-width: 820px) {
  .credit-success-fee-row {
    grid-template-columns: 1fr;
  }

  .credit-success-fee-row > .btn,
  .credit-success-fee-rules > .btn {
    width: 100%;
  }

}

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

.runtime-error-notice {
  position: fixed;
  top: 76px;
  right: 18px;
  z-index: 10000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 12px;
  align-items: center;
  width: min(520px, calc(100vw - 36px));
  padding: 14px 12px 14px 16px;
  border: 1px solid #ef9a9a;
  border-radius: 8px;
  background: #fff7f7;
  color: #7f1d1d;
  box-shadow: 0 12px 32px rgba(127, 29, 29, 0.18);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.runtime-error-notice-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
}

.runtime-error-notice-close:hover,
.runtime-error-notice-close:focus-visible {
  background: #fee2e2;
  outline: 2px solid #dc2626;
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .runtime-error-notice {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
  }
}
