:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-alt: #f8faf9;
  --ink: #17211f;
  --muted: #65736f;
  --line: #d9e3df;
  --line-strong: #b9cbc5;
  --accent: #0a756f;
  --accent-soft: #e5f3f0;
  --red: #b13742;
  --shadow: 0 10px 24px rgba(23, 33, 31, 0.06);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

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

button,
a.button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

.app-shell {
  min-height: 100vh;
  display: block;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef3f1;
}

.login-panel {
  width: min(100%, 390px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 5px 0 24px;
}

.login-panel > .button {
  width: 100%;
  margin-top: 16px;
}

.login-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.login-company-logo {
  display: block;
  width: 128px;
  height: auto;
}

.login-brand {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 900;
}

.login-brand-row .login-brand {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.login-email {
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 750;
}

.login-secondary-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.form-message {
  min-height: 19px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-message.error {
  color: var(--red);
}

.panel-header p,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 22px;
}

h2 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.content {
  min-width: 0;
  padding: 18px 28px;
}

.page-header,
.header-actions,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.page-header {
  margin-bottom: 10px;
}

.header-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-management-actions,
.header-account-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-management-actions .button.secondary {
  min-height: 34px;
  padding-inline: 9px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.header-management-actions .button.secondary:hover,
.header-management-actions .button.secondary:focus-visible {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.header-account-actions {
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.header-account-actions .button.secondary {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 13px;
}

.signed-in-user {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.title-block {
  min-width: 180px;
}

.title-block h2 {
  font-size: 22px;
}

.app-company-logo {
  display: block;
  width: 112px;
  height: auto;
  margin-bottom: 4px;
}

.title-block .eyebrow {
  margin-bottom: 2px;
  font-size: 11px;
}

.app-view-tabs {
  display: inline-flex;
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
}

.app-view-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.app-view-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
}

.button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
}

.button.secondary,
a.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.feedback-new-count:empty {
  display: none;
}

#manageFeedback {
  position: relative;
}

.feedback-new-count {
  position: absolute;
  top: -4px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.hidden {
  display: none !important;
}

.app-update-notice {
  position: fixed;
  inset: auto auto 24px 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  max-width: calc(100vw - 24px);
  padding: 6px 7px 6px 16px;
  border: 1px solid #7dbdb4;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(23, 33, 31, 0.2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.app-update-notice[hidden] {
  display: none;
}

.app-update-notice .button {
  min-height: 36px;
  padding: 0 14px;
  white-space: nowrap;
}

.floating-support-actions {
  position: fixed;
  inset: auto 24px 24px auto;
  z-index: 20;
  display: grid;
  justify-items: end;
  gap: 8px;
  width: max-content;
  height: max-content;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.floating-support-actions.collapsed {
  inset: auto 0 24px auto;
}

@media (max-height: 820px) {
  .column-settings-dialog[open] > .floating-support-actions {
    inset: auto auto 24px 24px;
  }

  .column-settings-dialog[open] > .floating-support-actions.collapsed {
    inset: auto auto 24px 0;
  }
}

@media (max-width: 760px) and (max-height: 820px) {
  .column-settings-dialog[open] > .floating-support-actions {
    inset: auto 12px 12px auto;
  }

  .column-settings-dialog[open] > .floating-support-actions.collapsed {
    inset: auto 0 12px auto;
  }
}

.support-launcher-row {
  display: grid;
  grid-template-columns: 20px repeat(3, 44px);
  gap: 6px;
  width: 178px;
  height: 52px;
  padding: 4px;
  border: 1px solid #b9d8d3;
  border-radius: 10px;
  background: #f1f8f7;
  box-shadow: var(--shadow);
  box-sizing: border-box;
}

.support-launcher-row[hidden],
.support-restore[hidden] {
  display: none;
}

.support-collapse {
  display: grid;
  place-items: center;
  width: 20px;
  height: 44px;
  padding: 0;
  border: 1px solid #9bc8c1;
  border-radius: 8px;
  background: #e6f3f1;
  color: #075f5a;
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.support-collapse:hover,
.support-collapse:focus-visible {
  border-color: var(--accent);
  background: #b8ddd7;
  color: #075f5a;
}

.support-collapse:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.support-restore:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.support-restore {
  display: grid;
  place-items: center;
  width: 24px;
  height: 44px;
  padding: 0;
  border: 1px solid #9bc8c1;
  border-radius: 8px 0 0 8px;
  background: #e6f3f1;
  box-shadow: var(--shadow);
  color: #075f5a;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.support-restore:hover,
.support-restore:focus-visible {
  border-color: var(--accent);
  background: #cfe8e4;
}

.support-icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #9bc8c1;
  border-radius: 8px;
  color: #075f5a;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.settings-launcher {
  background: #e6f3f1;
  font-size: 22px;
  font-weight: 800;
}

.feedback-launcher {
  background: #e6f3f1;
  font-size: 22px;
  font-weight: 800;
}

.help-launcher {
  background: #e6f3f1;
  color: #075f5a;
  font-size: 20px;
  font-weight: 900;
}

.settings-launcher:hover,
.settings-launcher:focus-visible,
.feedback-launcher:hover,
.feedback-launcher:focus-visible,
.help-launcher:hover,
.help-launcher:focus-visible {
  border-color: var(--accent);
  background: #cfe8e4;
}

.support-icon-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.support-icon-button:disabled {
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--muted);
  cursor: default;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(130px, 0.8fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.main-command-bar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.main-reload-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid #d8b76a;
  border-radius: 8px;
  background: #fff8e8;
  color: #664b12;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.main-reload-notice[hidden] {
  display: none;
}

.main-reload-notice .button {
  flex: 0 0 auto;
  min-height: 34px;
  white-space: nowrap;
}

.main-command-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.main-list-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: max-content;
}

.main-list-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.main-selection-actions {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 1;
  display: flex;
  width: min(60%, 680px);
  height: 34px;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px 0 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.main-command-top.has-selection > .main-list-summary {
  visibility: hidden;
  pointer-events: none;
}

.main-selection-actions p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-selection-actions > div {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.main-command-bar .main-selection-actions .button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
}

.main-selection-actions .icon-button {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  background: transparent;
  font-size: 20px;
}

.toolbar-filters {
  display: grid;
  grid-template-columns: auto minmax(330px, 1.8fr) minmax(105px, 0.65fr) minmax(145px, 0.8fr) minmax(95px, 0.55fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border-radius: 6px;
  background: var(--surface-alt);
}

.toolbar-filter-field {
  display: grid;
  grid-template-rows: 16px 34px;
  gap: 6px;
  align-self: end;
}

.toolbar-filter-field > :is(.field-label, span) {
  display: flex;
  align-items: center;
  min-height: 16px;
}

.toolbar-filter-field :is(.custom-select-button, .month-filter-button),
#searchInput {
  height: 34px;
}

.year-filter {
  min-width: max-content;
}

.column-search-field {
  min-width: 0;
}

.month-filter {
  position: relative;
  min-width: 132px;
}

.custom-select {
  position: relative;
  min-width: 0;
}

.custom-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.custom-select-button,
.month-filter-button {
  position: relative;
  width: 100%;
  min-height: 34px;
  padding: 6px 28px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.custom-select-button::after,
.month-filter-button::after {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: translateY(-70%) rotate(45deg);
}

.custom-select-button:focus-visible,
.month-filter-button:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 117, 111, 0.13);
}

.custom-select-menu,
.month-filter-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  display: grid;
  gap: 2px;
  max-height: 288px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.custom-select-menu {
  left: 0;
  width: max-content;
  min-width: 100%;
  max-width: min(360px, calc(100vw - 48px));
}

.month-filter-menu {
  right: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(344px, calc(100vw - 32px));
  overflow-x: hidden;
}

.custom-select-option,
.month-filter-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
}

.custom-select-option {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  white-space: nowrap;
}

.month-filter-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px 30px;
  justify-content: center;
  column-gap: 6px;
  white-space: nowrap;
}

.month-filter-option > .month-filter-native-check {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
}

.month-filter-label {
  text-align: center;
}

.custom-select-option:hover,
.custom-select-option:focus-visible,
.month-filter-option:hover {
  background: var(--accent-soft);
}

.custom-select-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.custom-select-option[aria-selected="true"],
.month-filter-option:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 850;
}

.custom-select-check {
  flex: 0 0 14px;
  width: 14px;
  visibility: hidden;
  color: var(--accent);
  font-weight: 900;
  text-align: center;
}

.custom-select-option[aria-selected="true"] .custom-select-check {
  visibility: visible;
}

.month-filter-check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #8d9997;
  border-radius: 4px;
  background: var(--surface);
  color: transparent;
  font-size: 13px;
  line-height: 1;
  visibility: visible;
}

.month-filter-option:has(input:checked) .month-filter-check {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.month-filter-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.owner-filter .month-filter-button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-filter-menu {
  left: 0;
  right: auto;
  grid-template-columns: minmax(0, 1fr);
  width: max-content;
  min-width: 100%;
  max-width: min(360px, calc(100vw - 32px));
}

.owner-filter-option {
  grid-template-columns: 18px minmax(0, 1fr);
  justify-content: start;
  white-space: normal;
  overflow-wrap: anywhere;
}

.owner-filter-all[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 850;
}

.column-search-controls {
  display: grid;
  grid-template-columns: minmax(120px, 0.75fr) minmax(170px, 1.25fr);
  gap: 6px;
  min-width: 0;
}

.filter-reset {
  align-self: end;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.filter-reset:hover,
.filter-reset:focus-visible {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.toolbar-filters .field-label,
.toolbar-filters label > span {
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0;
}

.toolbar-filters :is(input, select, button) {
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0;
}

.main-command-bar .year-filter .custom-select {
  min-width: 92px;
}

.toolbar-actions,
.toolbar-secondary-actions,
.main-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-actions {
  align-items: center;
  justify-content: flex-end;
}

.toolbar-secondary-actions {
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.toolbar-secondary-actions .button.secondary,
.toolbar-secondary-actions a.button.secondary {
  color: var(--muted);
}

.toolbar-secondary-actions .button.secondary:hover,
.toolbar-secondary-actions .button.secondary:focus-visible,
.toolbar-secondary-actions a.button.secondary:hover,
.toolbar-secondary-actions a.button.secondary:focus-visible {
  color: var(--ink);
}

#newRecord {
  min-width: 82px;
}

.main-meta {
  min-width: 64px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.main-command-bar .button,
.main-command-bar a.button {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 117, 111, 0.13);
}

.editable-combobox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  width: 100%;
  min-width: 0;
}

.editable-combobox > input {
  min-width: 0;
  border-radius: 8px 0 0 8px;
}

.editable-combobox-toggle {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--surface);
  color: var(--muted);
}

.editable-combobox-toggle::after {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
}

.editable-combobox-toggle:disabled {
  cursor: not-allowed;
}

.editable-combobox:focus-within > input,
.editable-combobox:focus-within .editable-combobox-toggle {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 117, 111, 0.13);
}

.editable-combobox:focus-within > input {
  box-shadow: 0 0 0 3px rgba(10, 117, 111, 0.13);
}

.editable-combobox:focus-within .editable-combobox-toggle {
  box-shadow: 3px 0 0 0 rgba(10, 117, 111, 0.13);
}

.editable-combobox-listbox {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 2px;
  box-sizing: border-box;
  max-height: min(280px, calc(100vh - 24px));
  margin: 0;
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editable-combobox-listbox[hidden] {
  display: none;
}

.editable-combobox-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.editable-combobox-option:hover,
.editable-combobox-option.active {
  background: var(--accent-soft);
}

.editable-combobox-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.editable-combobox-option[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 850;
}

.editable-combobox-empty {
  padding: 10px 9px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

input[type="checkbox"] {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #8d9997;
  border-radius: 4px;
  background: var(--surface);
  accent-color: var(--accent);
  cursor: pointer;
}

input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

input[type="checkbox"]::before {
  content: "✓";
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  transform: none;
}

input[type="checkbox"]:checked::before {
  opacity: 1;
}

input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 117, 111, 0.16);
}

.quote-checkbox-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-wrap tbody tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--accent-soft);
}

.quote-checkbox-cell input[type="checkbox"],
.quote-checkbox-cell .ag-checkbox-input-wrapper {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

textarea {
  resize: vertical;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#view-dashboard {
  max-width: 1440px;
  margin: 0 auto;
}

.dashboard-toolbar,
.dashboard-summary,
.dashboard-section {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.dashboard-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 10px 14px;
}

.dashboard-toolbar label {
  width: 120px;
}

.dashboard-toolbar p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-status.error {
  color: var(--red);
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-summary > div {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.dashboard-summary > div:last-child {
  border-right: 0;
}

.dashboard-summary span,
.dashboard-summary strong {
  display: block;
}

.dashboard-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-summary strong {
  margin-top: 4px;
  font-size: 24px;
}

.dashboard-section {
  padding: 18px;
}

.dashboard-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.dashboard-section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-legend {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(23, 33, 31, 0.08);
}

.legend-swatch.completed {
  background: var(--accent);
}

.legend-swatch.target {
  background: #b8c8c3;
}

.dashboard-chart {
  display: grid;
  gap: 4px;
}

.team-chart-row {
  display: grid;
  grid-template-columns: 88px minmax(160px, 1fr) 110px;
  align-items: center;
  gap: 12px;
  min-height: 38px;
}

.team-chart-value {
  display: grid;
  gap: 1px;
  text-align: right;
}

.team-chart-rate {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.team-chart-count {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.team-bar-track {
  position: relative;
  height: 18px;
  overflow: hidden;
  background: #edf1ef;
}

.team-bar-target,
.team-bar-completed {
  position: absolute;
  inset: 0 auto 0 0;
}

.team-bar-target {
  background: #b8c8c3;
}

.team-bar-completed {
  background: var(--accent);
}

.dashboard-table-wrap {
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.dashboard-table th:first-child {
  text-align: left;
}

.dashboard-table tbody tr {
  cursor: default;
}

.dashboard-empty {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

#view-customers,
#view-customer-detail {
  max-width: 1440px;
  margin: 0 auto;
}

.customer-command-bar {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-command-top,
.customer-detail-header,
.customer-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.customer-command-top {
  min-height: 52px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.customer-filters {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) repeat(3, minmax(140px, 0.42fr)) auto;
  align-items: end;
  gap: 8px;
  padding: 10px 12px;
}

.customer-filters label,
.customer-form-grid label,
.customer-assignment-row label,
.customer-note-form label,
.history-form label {
  display: grid;
  gap: 5px;
}

.customer-filters label > span,
.customer-form-grid label > span,
.customer-assignment-row label > span,
.customer-note-form label > span,
.history-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.customer-list-panel {
  overflow: hidden;
}

.customer-table-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  max-height: calc(100vh - 265px);
  overflow: hidden;
}

#customerGrid.ag-grid-shell {
  width: 100%;
  height: calc(100vh - 265px) !important;
  min-height: 420px !important;
}

#customerGrid .ag-header-cell-text {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
  word-break: keep-all;
}

#customerGrid .ag-header-cell-label {
  align-items: center;
  min-height: 100%;
  cursor: pointer;
}

#customerGrid .header-center .ag-header-cell-label,
#customerGrid .cell-center {
  justify-content: center;
  text-align: center;
}

#customerGrid .ag-cell {
  display: flex;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: var(--customer-grid-font-size, 13px);
}

#customerGrid .ag-header-cell {
  font-size: var(--customer-grid-header-font-size, 12px);
}

#customerGrid .ag-cell-value {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#customerGrid .cell-numeric {
  justify-content: flex-end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#customerGrid .cell-date {
  font-variant-numeric: tabular-nums;
}

.customer-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
}

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

.customer-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #f5f7f6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

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

.customer-table tbody tr:hover,
.customer-table tbody tr:focus-visible {
  outline: none;
  background: var(--accent-soft);
}

.customer-table td:first-child strong,
.customer-table td:first-child span {
  display: block;
}

.customer-table td:first-child strong {
  font-size: 13px;
}

.customer-table td:first-child span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.customer-count-cell,
.customer-date-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.customer-empty {
  margin: 0;
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

.customer-detail-shell {
  overflow: hidden;
}

.customer-detail-header {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 70px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  box-shadow: 0 5px 12px rgba(23, 33, 31, 0.05);
}

.customer-detail-shell.dirty .customer-detail-header {
  background: #fff8e6;
}

.customer-detail-header h3 {
  margin-top: 3px;
  font-size: 20px;
}

.customer-detail-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.customer-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customer-detail-tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #f8faf9;
}

.customer-detail-tabs button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.customer-detail-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.customer-detail-tabs span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 10px;
  background: #e8eeec;
  color: var(--muted);
  font-size: 10px;
}

.customer-tab-panel {
  display: none;
  min-height: calc(100vh - 245px);
  max-height: calc(100vh - 200px);
  overflow: auto;
}

.customer-tab-panel.active {
  display: block;
}

.customer-tab-panel[data-customer-panel="contacts"].active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.customer-form-section {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.customer-form-section:last-child {
  border-bottom: 0;
}

.customer-form-section > h4,
.customer-section-heading h4,
.customer-note-form h4,
.history-form h4 {
  margin: 0;
  font-size: 14px;
}

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

.customer-form-grid input,
.customer-form-grid textarea,
.customer-assignment-row input,
.customer-note-form input,
.customer-note-form textarea,
.history-form textarea {
  width: 100%;
}

.customer-form-wide {
  grid-column: 1 / -1;
}

.customer-boolean-field {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  align-self: end;
  min-height: 40px;
  grid-auto-flow: column;
  justify-content: start;
}

.customer-boolean-field input {
  width: 18px;
}

.customer-section-heading {
  align-items: flex-end;
}

.customer-section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.customer-assignment-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.customer-assignment-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.5fr) minmax(240px, 1fr) 36px;
  align-items: end;
  gap: 10px;
}

.customer-assignment-remove {
  width: 36px;
  height: 40px;
}

.customer-tab-heading {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.history-readonly-notice {
  margin: 0;
  padding: 9px 20px;
  border-bottom: 1px solid #cfe2dc;
  background: var(--accent-soft);
  color: #315d56;
  font-size: 12px;
  font-weight: 700;
}

.customer-contact-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(420px, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.customer-note-layout,
.history-note-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(420px, 1fr);
  min-height: calc(100vh - 315px);
}

.customer-contact-list,
.customer-note-list,
.history-list {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.customer-contact-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
}

.customer-contact-list button {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  text-align: left;
}

.customer-contact-list button:hover,
.customer-contact-list button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.customer-contact-list span,
.customer-contact-list small {
  color: var(--muted);
}

.customer-contact-editor {
  padding: 6px 22px 22px;
  min-height: 0;
  overflow-y: auto;
}

.customer-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.customer-contact-delete {
  margin-right: auto;
  color: var(--red);
}

.customer-note-form,
.history-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 22px 22px;
}

.record-editor-pane {
  min-width: 0;
  background: var(--surface);
}

.record-editor-empty {
  display: grid;
  min-height: 260px;
  place-content: center;
  gap: 5px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.record-editor-empty strong {
  color: var(--ink);
  font-size: 15px;
}

.record-editor-meta {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-attachment-section {
  display: grid;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.history-attachment-heading,
.history-attachment-heading > div,
.history-attachment-link,
.history-attachment-upload {
  display: flex;
  align-items: center;
}

.history-attachment-heading {
  justify-content: space-between;
  gap: 12px;
}

.history-attachment-heading > div {
  gap: 7px;
}

.history-attachment-heading strong {
  font-size: 12px;
}

.history-attachment-heading span {
  padding: 2px 6px;
  border-radius: 8px;
  background: #e8eeec;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.history-attachment-heading small,
.history-attachment-link small,
.history-attachment-empty {
  color: var(--muted);
  font-size: 11px;
}

.history-attachment-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.history-attachment-link {
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.history-attachment-link:hover,
.history-attachment-link:focus-visible {
  background: var(--accent-soft);
}

.history-attachment-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-attachment-link small {
  flex: 0 0 auto;
}

.history-attachment-empty {
  margin: 0;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.history-attachment-upload {
  gap: 8px;
}

.history-form .history-file-picker {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  gap: 8px;
  cursor: pointer;
}

.history-form .history-file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.history-form .history-file-picker .button {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
}

.history-form .history-file-picker > span:last-child {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-attachment-upload .button {
  flex: 0 0 auto;
}

.history-attachment-message {
  min-height: 16px;
  margin: 0;
}

.customer-note-list,
.history-list {
  display: grid;
  align-content: start;
  gap: 0;
  min-width: 0;
  padding-block: 8px 18px;
}

.record-list-item {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 14px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.record-list-item:hover,
.record-list-item:focus-visible {
  background: var(--surface-alt);
}

.record-list-item.selected {
  background: var(--accent-soft);
}

.record-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.record-delete-button {
  margin-right: auto;
  color: var(--red);
}

.customer-note-meta,
.history-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.customer-note-author {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
}

.customer-note-author strong {
  color: var(--ink);
  font-size: 12px;
}

.customer-note-author small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.record-list-item p,
.history-item-content {
  margin: 7px 0 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.customer-empty-state {
  margin: 0;
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

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

.panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 245px);
}

.grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.density-control {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.density-control button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-right-width: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.density-control button:first-of-type {
  border-radius: 7px 0 0 7px;
}

.density-control button:last-of-type {
  border-right-width: 1px;
  border-radius: 0 7px 7px 0;
}

.density-control button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

#mainGrid.ag-grid-shell {
  width: 100%;
  height: calc(100vh - 205px) !important;
  min-height: 520px !important;
}

#mainGrid .ag-header-cell-text {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
  word-break: keep-all;
}

#mainGrid .ag-header-cell-label {
  align-items: center;
  min-height: 100%;
  cursor: pointer;
}

#mainGrid .header-center .ag-header-cell-label {
  justify-content: center;
}

#mainGrid .ag-cell,
#mainGrid .ag-cell-value {
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

#mainGrid .ag-cell {
  display: flex;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
}

#mainGrid .ag-cell-value {
  width: 100%;
}

#mainGrid .recommendation-cell-editor {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: calc(100vw - 24px);
}

#mainGrid .recommendation-cell-editor .editable-combobox {
  position: relative;
  display: block;
  height: 100%;
  min-width: 0;
}

#mainGrid .recommendation-cell-editor-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 6px 30px 6px 8px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  outline: none;
}

#mainGrid .recommendation-cell-editor-input:focus {
  box-shadow: 0 0 0 3px rgba(10, 117, 111, 0.13);
}

#mainGrid .recommendation-cell-editor .editable-combobox-toggle {
  position: absolute;
  inset: 0 0 0 auto;
  width: 28px;
  min-width: 28px;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#mainGrid .recommendation-cell-editor .editable-combobox-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

#mainGrid .recommendation-cell-editor .editable-combobox:focus-within .editable-combobox-toggle {
  border-color: transparent;
  box-shadow: none;
}

#mainGrid .cell-numeric {
  justify-content: flex-end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#mainGrid .cell-center {
  justify-content: center;
  text-align: center;
}

#mainGrid .cell-center .ag-cell-value {
  text-align: center;
}

#mainGrid .cell-date,
#mainGrid .cell-identifier {
  font-variant-numeric: tabular-nums;
}

.table-wrap td {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap td.cell-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-wrap .header-center,
.table-wrap td.cell-center {
  text-align: center;
}

#mainGrid .ag-header-cell,
.table-wrap th {
  font-size: var(--main-grid-header-font-size, 12px);
}

#mainGrid .ag-cell,
.table-wrap td {
  font-size: var(--main-grid-font-size, 13px);
}

.ag-cell-inline-editing input,
.ag-cell-inline-editing textarea {
  min-height: 100%;
  border-radius: 0;
}

.status-done {
  color: #126344;
  font-weight: 800;
}

.status-stop {
  color: var(--red);
  font-weight: 800;
}

.status-adjust {
  color: #8a5a00;
  font-weight: 800;
}

.status-progress {
  color: #0a5e87;
  font-weight: 800;
}

.status-uncontracted {
  color: var(--ink);
  font-weight: 400;
}

.status-quote-rejected {
  color: #6b3f26;
  font-weight: 800;
}

.date-mismatch {
  background: #fff4d6;
  color: #7a4b00;
  font-weight: 800;
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: normal;
  word-break: break-word;
  font-size: 13px;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #edf8f5;
}

.sub-layout {
  display: grid;
  gap: 14px;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
}

.sub-sheet {
  overflow: visible;
}

.sub-sheet > .panel-header {
  position: sticky;
  top: 0;
  z-index: 4;
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  box-shadow: 0 5px 12px rgba(23, 33, 31, 0.05);
}

.sub-sheet.dirty .panel-header {
  background: #fff8e6;
}

.sub-header-identity {
  min-width: 0;
}

.sub-navigation-action {
  display: flex;
  align-items: center;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.sub-back-button {
  flex: 0 0 auto;
}

.sub-save-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-detail-save-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-save-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sub-save-status[data-state="dirty"] {
  color: #8a5a00;
}

.sub-save-status[data-state="saving"] {
  color: var(--accent);
}

.sub-save-status[data-state="error"] {
  color: var(--red);
}

.sub-save-actions .button:disabled {
  border-color: var(--line);
  background: #e9eeec;
  color: #7c8986;
  cursor: default;
}

.sub-detail-tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #f8faf9;
}

.sub-detail-tabs button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.sub-detail-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.sub-detail-tabs button:disabled {
  color: #9ca8a5;
  cursor: not-allowed;
  opacity: 0.65;
}

.sub-detail-tabs button > span:not(.sub-dirty-tab-status) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 10px;
  background: #e8eeec;
  color: var(--muted);
  font-size: 10px;
}

.sub-dirty-tab-status {
  margin-left: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #f7e6b6;
  color: #754f00;
  font-size: 10px;
}

.sub-tab-panel {
  display: none;
}

.sub-tab-panel.active {
  display: block;
}

.detail-flow {
  display: grid;
  padding: 0 22px 22px;
}

.alc-contacts-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.alc-contacts-heading .detail-group-title {
  margin: 0;
}

.alc-contact-row {
  display: grid;
  grid-template-columns: 110px minmax(90px, 0.7fr) minmax(120px, 1fr) minmax(170px, 1.3fr) minmax(200px, 2fr) auto;
  align-items: start;
  gap: 10px;
  margin-top: 12px;
}

.alc-contact-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

.alc-contact-field > input,
.alc-contact-field > select,
.alc-contact-field > textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
}

.alc-contact-field > textarea {
  resize: vertical;
}

.alc-contact-remove {
  margin-top: 23px;
}

@media (max-width: 1100px) {
  .alc-contact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
  .alc-contact-note {
    grid-column: 1 / -1;
  }
  .alc-contact-remove {
    margin-top: 0;
    justify-self: end;
    grid-column: 1 / -1;
  }
}

.detail-section {
  display: grid;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

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

.detail-group-title {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

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

.detail-year-grid {
  grid-template-columns: minmax(260px, 440px);
}

.detail-field {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
}

.detail-field > span {
  color: var(--muted);
  font-weight: 850;
}

.detail-field > .editable-combobox {
  position: relative;
  display: block;
  min-width: 0;
}

.detail-field > .editable-combobox > input {
  width: 100%;
  padding-right: 38px;
  border-radius: 8px;
}

.detail-field .editable-combobox-toggle {
  position: absolute;
  inset: 0 0 0 auto;
  width: 34px;
  min-width: 34px;
  min-height: 0;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: transparent;
  box-shadow: none;
}

.detail-field .editable-combobox:focus-within .editable-combobox-toggle,
.detail-field.field-readonly .editable-combobox-toggle:disabled {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.detail-field input,
.detail-field select,
.detail-field textarea {
  min-width: 0;
  background: #ffffff;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.detail-field.field-changed > span:first-child,
.customer-form-grid label.field-changed > span:first-child,
.customer-assignment-row label.field-changed > span:first-child {
  color: #805600;
}

.detail-field.field-changed > span:first-child::after,
.customer-form-grid label.field-changed > span:first-child::after,
.customer-assignment-row label.field-changed > span:first-child::after,
.customer-boolean-field.field-changed > span::after {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #f7e6b6;
  color: #754f00;
  content: "변경";
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  vertical-align: 1px;
}

.field-changed input,
.field-changed select,
.field-changed textarea {
  border-color: #cfaa4b;
  background: #fffaf0;
  box-shadow: 0 0 0 2px rgba(207, 170, 75, 0.1);
}

.detail-field input[readonly],
.detail-field textarea[readonly],
.amount-comparison-field input[readonly] {
  border-color: #e0e6e4;
  background: #f3f5f4;
  color: var(--muted);
  cursor: default;
}

.detail-field.field-readonly input:disabled,
.detail-field.field-readonly select:disabled,
.detail-field.field-readonly textarea:disabled,
.detail-field.field-readonly .editable-combobox-toggle:disabled,
.detail-field.field-readonly .custom-select-button:disabled {
  border-color: #e0e6e4;
  background: #f3f5f4;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

.iso-date-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  min-width: 0;
  gap: 6px;
}

.iso-date-control > input {
  min-width: 0;
}

.iso-date-picker {
  width: 40px;
  padding: 6px;
  color: transparent;
  cursor: pointer;
}

.iso-date-picker::-webkit-datetime-edit {
  display: none;
}

.iso-date-picker::-webkit-calendar-picker-indicator {
  width: 18px;
  height: 18px;
  margin: auto;
  cursor: pointer;
  opacity: 0.72;
}

.history-date-control {
  gap: 6px;
}

.field-warning {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid #b88200;
  background: #fff8e6;
  color: #744c00;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.5;
}

.detail-field input.invalid-value {
  border-color: #b88200;
  background: #fffdf6;
  box-shadow: 0 0 0 2px rgba(184, 130, 0, 0.12);
}

.iso-date-control input.invalid-value {
  border-color: var(--red);
  background: #fff7f7;
  box-shadow: 0 0 0 2px rgba(177, 55, 66, 0.12);
}

.detail-field textarea {
  min-height: 78px;
}

.amount-comparison {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.amount-comparison-head,
.amount-comparison-row {
  display: grid;
  grid-template-columns: 138px repeat(2, minmax(0, 1fr));
  align-items: center;
}

.amount-comparison-head {
  min-height: 36px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.amount-comparison-row {
  min-height: 54px;
  border-top: 1px solid var(--line);
}

.amount-row-label {
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.amount-comparison-field {
  position: relative;
  display: block;
  min-width: 0;
  padding: 8px 10px;
  border-left: 1px solid var(--line);
}

.amount-comparison-field input {
  width: 100%;
  min-width: 0;
  text-align: right;
}

.amount-comparison-field.field-changed::after {
  position: absolute;
  top: 3px;
  right: 13px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #f7e6b6;
  color: #754f00;
  content: "변경";
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
}

.amount-margin-row {
  background: #fafcfb;
}

.history-field {
  display: grid;
  min-width: 0;
}

.history-add-button {
  justify-self: end;
}

.history-item-meta-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.empty-text {
  color: var(--muted);
  font-size: 12px;
}

.history-item-content {
  color: var(--ink);
}

.history-list .empty-text {
  margin: 0;
  padding: 24px 0 6px;
  text-align: center;
}

.text-button {
  justify-self: stretch;
  align-self: stretch;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.text-button.neutral {
  padding: 7px 0;
  color: var(--accent);
}

.user-dialog {
  width: min(1120px, calc(100vw - 32px));
  height: min(800px, calc(100vh - 32px));
  height: min(800px, calc(100dvh - 32px));
  max-height: min(800px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(23, 33, 31, 0.2);
}

.user-dialog[open] {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.user-dialog > .dialog-header {
  grid-row: 1;
}

.user-add-panel {
  grid-row: 2;
}

.user-dialog > .form-message {
  grid-row: 3;
}

.user-list-toolbar {
  grid-row: 4;
}

.user-dialog::backdrop,
.copy-alc-dialog::backdrop,
.delete-alc-dialog::backdrop,
.column-settings-dialog::backdrop,
.help-dialog::backdrop,
.feedback-dialog::backdrop,
.feedback-admin-dialog::backdrop,
.audit-admin-dialog::backdrop {
  background: rgba(23, 33, 31, 0.48);
}

.copy-alc-dialog {
  width: min(500px, calc(100vw - 32px));
  height: min(400px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(23, 33, 31, 0.2);
}

.copy-alc-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.delete-alc-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(23, 33, 31, 0.2);
}

.delete-alc-form {
  display: grid;
  gap: 18px;
  padding: 20px 22px 22px;
}

.delete-alc-warning {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.delete-alc-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.delete-alc-summary > div {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
}

.delete-alc-summary dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.delete-alc-summary dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.delete-alc-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.button.danger {
  border-color: var(--red);
  background: var(--red);
}

@media (max-width: 520px) {
  .delete-alc-summary {
    grid-template-columns: 1fr;
  }
}

.copy-alc-form {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 20px 22px 22px;
  overflow: visible;
}

.copy-alc-source {
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.copy-alc-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-height: 480px) {
  .copy-alc-dialog,
  .copy-alc-dialog[open] {
    height: auto;
    max-height: calc(100vh - 32px);
    overflow: auto;
  }
}

.column-settings-dialog {
  width: min(1000px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(23, 33, 31, 0.2);
}

.column-settings-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.view-settings-shell {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  min-height: 0;
}

.view-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: var(--surface-alt);
}

.view-settings-nav button {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.view-settings-nav button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.view-settings-nav button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: inset 3px 0 var(--accent);
}

.view-settings-content,
.view-settings-panel {
  min-width: 0;
  min-height: 0;
}

.view-settings-content {
  overflow: hidden;
}

.view-settings-panel {
  height: 100%;
}

.view-settings-panel[hidden] {
  display: none !important;
}

.view-settings-appearance {
  padding: 22px;
  background: var(--surface);
  overflow: auto;
}

.view-settings-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.view-settings-section-heading h4 {
  margin: 0;
  font-size: 15px;
}

.view-settings-section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.view-settings-current-value {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.view-settings-font-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.view-settings-font-control strong,
.view-settings-font-control span {
  display: block;
}

.view-settings-font-control strong {
  font-size: 14px;
}

.view-settings-font-control > div:first-child span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.font-size-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.font-size-stepper .icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  font-size: 18px;
}

.font-size-stepper label {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.font-size-stepper input {
  width: 38px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.font-size-stepper input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.font-size-stepper input[type="number"]::-webkit-inner-spin-button,
.font-size-stepper input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.font-size-stepper input:focus {
  outline: none;
}

.font-size-preview {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto minmax(80px, 0.7fr) auto minmax(80px, 0.7fr);
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
  font-size: var(--preview-font-size, 13px);
  min-height: var(--preview-row-height, 44px);
}

.view-settings-row-spacing-control {
  margin-top: 10px;
}

.row-spacing-control {
  min-height: 34px;
}

.row-spacing-control button {
  min-width: 52px;
  min-height: 34px;
  padding: 0 12px;
}

.font-size-preview span {
  color: var(--muted);
  font-size: 0.85em;
  font-weight: 700;
}

.font-size-preview strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-settings-columns-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.recommendation-options-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.year-settings-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.year-settings-tools {
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.year-settings-heading {
  align-items: start;
}

.year-settings-heading .eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

#yearAddForm {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
}

#yearAddForm label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

#yearAddForm input {
  width: 104px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

#yearAddForm .button {
  min-height: 36px;
}

.year-settings-message {
  min-height: 18px;
  margin: 8px 0 0;
}

#yearSettingsList {
  min-height: 0;
  overflow: auto;
  padding: 0 22px;
  scrollbar-gutter: stable;
}

.year-settings-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
}

.year-settings-summary {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.year-settings-summary strong {
  font-size: 14px;
}

.year-settings-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.year-settings-status {
  min-width: 48px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e9f8ef;
  color: #177342;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.year-settings-status.archived {
  background: var(--surface-alt);
  color: var(--muted);
}

.year-settings-default-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.year-settings-default-control input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.year-settings-row-actions {
  display: flex;
  justify-content: end;
  gap: 5px;
}

.year-settings-row-actions .button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.year-settings-disabled-action,
.year-settings-disabled-default {
  cursor: not-allowed;
  opacity: 0.45;
}

.year-settings-disabled-default .year-settings-default-mark {
  display: inline-grid;
  width: 15px;
  height: 15px;
  place-items: center;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--surface);
  font-size: 11px;
  line-height: 1;
}

.year-settings-disabled-default[aria-checked="true"] .year-settings-default-mark {
  border-color: var(--accent);
  background: var(--accent);
}

.year-settings-disabled-action:focus-visible,
.year-settings-disabled-default:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.recommendation-options-heading {
  padding: 18px 22px 12px;
}

.recommendation-options-heading .eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.recommendation-field-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 22px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  overflow: hidden;
}

.recommendation-field-switcher button {
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.recommendation-field-switcher button:last-child {
  border-right: 0;
}

.recommendation-field-switcher button:hover,
.recommendation-field-switcher button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.recommendation-field-switcher button.active {
  box-shadow: inset 0 -3px var(--accent);
}

.recommendation-options-list {
  min-height: 0;
  overflow: auto;
  padding: 0 22px;
  border-top: 1px solid var(--line);
  scrollbar-gutter: stable;
}

.recommendation-option-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.recommendation-option-order {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.recommendation-option-row input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.recommendation-option-row input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.recommendation-option-row-actions {
  display: flex;
  gap: 4px;
}

.recommendation-option-row-actions .icon-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  background: transparent;
  font-size: 16px;
}

.recommendation-option-row-actions .icon-button:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
}

.recommendation-option-row-actions .icon-button.danger:hover:not(:disabled) {
  background: #fff0f0;
  color: var(--danger);
}

.recommendation-option-row-actions .icon-button:disabled {
  opacity: 0.3;
}

.recommendation-options-empty {
  display: grid;
  min-height: 150px;
  margin: 0;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.recommendation-options-actions {
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
}

.column-settings-section-heading {
  padding: 18px 22px 12px;
}

.column-settings-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px 14px;
  border-bottom: 1px solid var(--line);
}

.column-settings-view-field,
.column-settings-search-field {
  display: grid;
  gap: 6px;
}

.column-settings-view-field[hidden] {
  display: none !important;
}

.column-settings-view-field > span,
.column-settings-search-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.column-settings-view-control {
  display: flex;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

.column-settings-search-field {
  width: min(280px, 100%);
}

.column-settings-search-field input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

.column-settings-search-field input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.column-settings-list {
  min-height: 0;
  overflow: auto;
  padding: 0 22px 16px;
  scrollbar-gutter: stable;
}

.column-settings-empty {
  display: grid;
  min-height: 160px;
  margin: 0;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

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

.column-settings-group {
  min-width: 0;
  position: relative;
}

.column-settings-group + .column-settings-group {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.column-settings-head,
.column-setting-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 86px;
  align-items: center;
}

.column-settings-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 32px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 6px 8px -8px rgba(23, 33, 31, 0.45);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.column-settings-head span:first-child,
.column-settings-head span:last-child {
  text-align: center;
}

.column-setting-row {
  min-height: 40px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  transition: background-color 120ms ease, color 120ms ease;
}

.column-setting-row:hover {
  background: var(--accent-soft);
}

.column-setting-row.is-hidden {
  background: var(--surface-alt);
  color: var(--muted);
}

.column-setting-visibility,
.column-setting-pin {
  display: flex;
  align-items: center;
}

.column-setting-visibility {
  display: grid;
  grid-column: 1 / 3;
  grid-template-columns: 48px minmax(0, 1fr);
  align-self: stretch;
  cursor: pointer;
}

.column-setting-visibility input {
  justify-self: center;
}

.column-setting-name {
  min-width: 0;
  font-weight: 650;
}

.column-setting-pin {
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.column-setting-pin:has(input:checked) {
  color: var(--accent);
  font-weight: 700;
}

.column-setting-pin:has(input:disabled) {
  opacity: 0.48;
}

.column-setting-locked {
  justify-self: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.column-settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
}

.column-settings-footer .form-message {
  margin: 0;
}

.column-settings-footer [hidden] {
  display: none !important;
}

.column-settings-status {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.column-settings-status .text-button {
  flex: 0 0 auto;
}

.column-settings-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.help-dialog,
.feedback-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(23, 33, 31, 0.2);
}

.help-dialog {
  width: min(900px, calc(100vw - 32px));
}

.help-role-summary {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.help-dialog-body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  height: min(660px, calc(100vh - 130px));
  min-height: 420px;
  overflow: hidden;
}

.help-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: var(--surface-alt);
}

.help-nav button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.help-nav button:hover,
.help-nav button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.help-sections {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 0 26px;
  overflow-y: auto;
  scroll-behavior: smooth;
  outline: none;
}

.help-sections section {
  padding: 24px 0 26px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 0;
}

.help-sections section:last-child {
  border-bottom: 0;
}

.help-sections h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.help-sections h5 {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 13px;
}

.help-sections ul {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.help-sections li::marker {
  color: var(--accent);
}

.help-sections strong {
  color: var(--ink);
}

.help-sections p,
.feedback-admin-metadata p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.help-sections .help-lead {
  color: var(--ink-soft);
  font-size: 13px;
}

.feedback-form {
  display: grid;
  gap: 14px;
  padding: 20px 22px 22px;
}

.feedback-form label,
.feedback-admin-filters label,
.feedback-admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.feedback-form input[readonly],
.feedback-admin-form textarea[readonly] {
  background: #f3f5f4;
  color: var(--muted);
}

.feedback-content-field textarea {
  resize: vertical;
}

.feedback-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-form-footer .form-message {
  margin: 0;
}

.feedback-form-actions {
  display: flex;
  gap: 8px;
}

.feedback-admin-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(23, 33, 31, 0.2);
}

.feedback-admin-filters {
  display: flex;
  gap: 10px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.feedback-admin-filters label {
  grid-template-columns: auto minmax(130px, 1fr);
  align-items: center;
}

.feedback-admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(0, 3fr);
  height: min(620px, calc(100vh - 160px));
  min-height: 440px;
  max-height: 620px;
}

.feedback-admin-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface-alt);
}

.feedback-admin-state {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.feedback-admin-state.empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  text-align: center;
}

.feedback-admin-state.empty + .feedback-admin-list {
  margin-top: 0;
}

.feedback-admin-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 6px;
  margin-top: 12px;
  padding-right: 5px;
  overflow-y: auto;
}

.feedback-admin-pagination {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.feedback-admin-page-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.feedback-page-navigation,
.feedback-page-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.feedback-page-navigation button {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.feedback-page-navigation button[hidden] {
  display: none;
}

.feedback-page-navigation .feedback-page-jump {
  min-width: 34px;
}

.feedback-page-navigation button:hover:not(:disabled),
.feedback-page-navigation button:focus-visible {
  border-color: var(--accent);
  outline: none;
  color: var(--accent);
}

.feedback-page-navigation button[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.feedback-admin-row {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.feedback-admin-row:hover,
.feedback-admin-row:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.feedback-admin-row:focus-visible {
  box-shadow: 0 0 0 3px rgba(10, 117, 111, 0.13);
}

.feedback-admin-row[aria-pressed="true"] {
  border-color: var(--accent);
  background: #f1faf8;
  box-shadow: inset 3px 0 0 var(--accent);
}

.feedback-admin-row-top,
.feedback-admin-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feedback-admin-row-reference,
.feedback-admin-row-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.feedback-status {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
}

.feedback-status.new {
  background: #fff0f1;
  color: #9e303b;
}

.feedback-status.in-progress {
  background: #fff6df;
  color: #805600;
}

.feedback-status.resolved {
  background: var(--accent-soft);
  color: var(--accent);
}

.feedback-admin-row-category {
  font-size: 13px;
}

.feedback-admin-row-content {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.feedback-admin-row-meta time {
  white-space: nowrap;
}

.feedback-admin-detail-panel {
  min-width: 0;
  overflow: auto;
  background: var(--surface);
}

.feedback-admin-empty-detail {
  display: grid;
  min-height: 480px;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.feedback-admin-empty-detail[hidden] {
  display: none;
}

.feedback-admin-empty-detail strong {
  color: var(--ink);
  font-size: 15px;
}

.feedback-admin-empty-detail p {
  margin: 0;
  font-size: 12px;
}

.feedback-admin-form {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 18px 22px 22px;
}

.feedback-admin-metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.feedback-admin-metadata-grid div {
  min-width: 0;
}

.feedback-admin-metadata-grid dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.feedback-admin-metadata-grid dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-admin-form[hidden] {
  display: none !important;
}

.feedback-admin-metadata,
.feedback-admin-handler {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
}

.audit-admin-dialog {
  width: min(1320px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(23, 33, 31, 0.2);
}

.audit-admin-scope-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  min-height: 44px;
  padding: 0 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
}

.audit-admin-scope-tabs button {
  align-self: stretch;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.audit-admin-scope-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.audit-admin-filters {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(160px, 0.9fr) minmax(200px, 1.2fr) minmax(130px, 0.75fr) minmax(130px, 0.75fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.audit-admin-filters label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.audit-admin-filter-actions {
  display: flex;
  gap: 8px;
}

.audit-admin-filter-actions .button {
  min-width: 72px;
  white-space: nowrap;
}

.audit-admin-content {
  position: relative;
  min-height: 460px;
}

.audit-admin-state {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  min-height: 18px;
  margin: 0;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.audit-admin-state[hidden] {
  display: none;
}

.audit-admin-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(500px, 1.18fr);
  height: min(510px, calc(100vh - 285px));
  min-height: 410px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.audit-admin-list-panel,
.audit-admin-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.audit-admin-detail-panel {
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.audit-admin-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #f4f7f6;
}

.audit-admin-panel-heading h4,
.audit-admin-panel-heading span {
  margin: 0;
}

.audit-admin-panel-heading h4 {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.audit-admin-panel-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.audit-admin-list {
  min-height: 0;
  overflow-y: auto;
  background: #fbfcfc;
}

.audit-admin-list[hidden] {
  display: none;
}

.audit-admin-list-item {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 6px;
  padding: 12px 18px 12px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.audit-admin-list-item:hover {
  background: #f3f8f7;
}

.audit-admin-list-item[aria-selected="true"] {
  border-left-width: 4px;
  border-left-color: var(--accent);
  background: #e4f2ef;
  box-shadow: inset 0 0 0 1px rgba(13, 128, 116, 0.08);
}

.audit-admin-list-item:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.audit-list-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audit-list-item-top time,
.audit-list-item-top em {
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.audit-list-item-top time {
  color: var(--muted);
  white-space: nowrap;
}

.audit-list-item-top em {
  padding: 3px 8px;
  border-radius: 4px;
  background: #e9efed;
  color: var(--ink-soft);
}

.audit-list-item-top em[data-action="create"] {
  background: #e3f3ee;
  color: #126a55;
}

.audit-list-item-top em[data-action="delete"] {
  background: #fae9eb;
  color: #a93643;
}

.audit-admin-list-item > strong,
.audit-admin-list-item > span,
.audit-list-item-bottom > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-admin-list-item > strong {
  font-size: 12px;
  font-weight: 900;
}

.audit-list-item-meta {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.audit-list-item-summary {
  flex: 0 1 auto;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.audit-list-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audit-admin-detail-empty {
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 0;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.audit-admin-detail-empty[hidden],
.audit-admin-detail-content[hidden] {
  display: none;
}

.audit-admin-detail-empty strong {
  color: var(--ink-soft);
  font-size: 14px;
}

.audit-admin-detail-empty span {
  font-size: 12px;
}

.audit-admin-detail-content {
  min-height: 0;
  overflow-y: auto;
}

.audit-admin-detail-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.audit-admin-detail-header h4 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.audit-admin-detail-header > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.audit-admin-changes {
  display: grid;
  gap: 10px;
  padding: 16px 20px 22px;
}

.audit-change-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.audit-change-card h5 {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #f6f8f7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.audit-change-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.audit-change-values > div {
  min-width: 0;
  padding: 10px 12px 12px;
}

.audit-change-values > div + div {
  border-left: 1px solid var(--line);
  background: #f7fbfa;
}

.audit-change-card.is-long .audit-change-values {
  grid-template-columns: minmax(0, 1fr);
}

.audit-change-card.is-long .audit-change-values > div + div {
  border-top: 1px solid var(--line);
  border-left: 0;
}

.audit-change-values span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.audit-change-values p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .audit-admin-filters {
    grid-template-columns: minmax(200px, 1.3fr) minmax(160px, 1fr) minmax(190px, 1.2fr) repeat(2, minmax(120px, 0.7fr));
  }

  .audit-admin-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .audit-admin-layout {
    grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  }
}

.audit-admin-pagination {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 22px 14px;
}

.audit-admin-pagination p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audit-admin-pagination > p:last-child {
  justify-self: end;
}

.audit-page-navigation,
.audit-page-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.audit-page-navigation {
  justify-content: center;
}

.audit-page-navigation button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.audit-page-navigation button[hidden] {
  display: none;
}

.audit-page-navigation .audit-page-jump {
  width: 44px;
}

.audit-page-navigation button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.audit-page-navigation button:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 117, 111, 0.13);
}

.audit-page-buttons button[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

@media (max-width: 760px) {
  .feedback-admin-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .feedback-admin-list-panel {
    max-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

.user-add-form {
  display: grid;
  grid-template-columns: minmax(125px, 0.75fr) minmax(205px, 1.15fr) minmax(105px, 0.6fr) minmax(105px, 0.6fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 14px 22px;
}

.user-add-panel {
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}

.user-add-panel[hidden] {
  display: none;
}

.user-dialog > .form-message {
  min-height: 0;
  margin: 0;
  padding: 0 22px;
}

.user-dialog > .form-message:not(:empty) {
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.user-list-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 150px auto;
  align-items: end;
  gap: 10px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.user-list-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.user-summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--muted);
  line-height: 1.2;
}

.user-summary-count {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.user-filter-reset {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.user-filter-reset:hover,
.user-filter-reset:focus-visible {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  color: var(--ink);
}

.checkbox-field.compact {
  font-size: 12px;
}

.user-list-scroll {
  grid-row: 5;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.user-list {
  overflow: visible;
  padding: 0 22px;
}

.user-list-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(130px, 0.75fr) minmax(205px, 1.15fr) minmax(105px, 0.6fr) minmax(100px, 0.55fr) 72px 72px 68px;
  gap: 8px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 4px 8px rgba(23, 33, 31, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.user-list-head span:nth-child(n + 5) {
  text-align: center;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.75fr) minmax(205px, 1.15fr) minmax(105px, 0.6fr) minmax(100px, 0.55fr) 72px 72px 68px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.user-row:hover {
  background: #f7faf9;
}

.user-row:focus-within {
  background: #f7faf9;
}

.user-row .user-name {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.user-row .user-team-field select,
.user-row .user-role-field select {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.user-row:hover .user-name,
.user-row:hover .user-team-field select,
.user-row:hover .user-role-field select,
.user-row:focus-within .user-name,
.user-row:focus-within .user-team-field select,
.user-row:focus-within .user-role-field select {
  border-color: var(--line);
  background: var(--surface);
}

.user-row.dirty {
  margin: 0 -8px;
  padding: 6px 8px;
  background: #fff8e6;
  box-shadow: inset 3px 0 0 #d59618;
}

.user-row.saving {
  opacity: 0.65;
}

.user-empty {
  padding: 24px 0 10px;
  text-align: center;
}

.user-name {
  min-width: 0;
  font-size: 13px;
}

.user-email {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-team-field,
.user-role-field {
  min-width: 0;
}

.user-row .checkbox-field {
  justify-content: center;
}

.user-status-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  cursor: pointer;
}

.user-status-switch input {
  position: absolute;
  width: 1px;
  min-width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.user-switch-track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border: 1px solid #aeb9b6;
  border-radius: 999px;
  background: #dfe6e4;
  transition: border-color 140ms ease, background 140ms ease;
}

.user-switch-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(23, 33, 31, 0.24);
  content: "";
  transition: transform 140ms ease;
}

.user-status-switch input:checked + .user-switch-track {
  border-color: var(--accent);
  background: var(--accent);
}

.user-status-switch input:checked + .user-switch-track::after {
  transform: translateX(16px);
}

.user-status-switch input:focus-visible + .user-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.user-change-badge {
  justify-self: center;
  padding: 4px 7px;
  border-radius: 5px;
  background: #fff0c8;
  color: #815900;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.user-change-badge[hidden] {
  display: none;
}

.user-save-bar {
  grid-row: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 10px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  box-shadow: 0 -8px 20px rgba(23, 33, 31, 0.04);
  transition: background 140ms ease, border-color 140ms ease;
}

.user-save-bar.has-changes {
  border-top-color: #e3c56f;
  background: #fffaf0;
}

.user-save-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-save-bar > div {
  display: flex;
  gap: 8px;
}

@media (max-width: 1280px) {
  .sub-layout {
    max-width: none;
  }

  .header-actions,
  .toolbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .main-command-top {
    flex-wrap: wrap;
  }

}

@media (max-width: 1080px) {
  .toolbar-filters {
    grid-template-columns: auto minmax(300px, 1fr) repeat(3, minmax(105px, 0.5fr)) auto;
  }

  #mainGrid.ag-grid-shell {
    height: calc(100vh - 190px) !important;
  }
}

@media (max-width: 900px) {
  .toolbar-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .column-search-field {
    grid-column: span 3;
  }

  .detail-fields-grid {
    grid-template-columns: 1fr;
  }

  .customer-note-layout,
  .history-note-layout {
    grid-template-columns: minmax(270px, 0.42fr) minmax(360px, 1fr);
  }
}

@media (max-width: 760px) {
  .view-settings-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .view-settings-nav {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .view-settings-nav button.active {
    box-shadow: inset 0 -3px var(--accent);
  }

  .column-settings-toolbar,
  .view-settings-font-control {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

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

  .column-settings-search-field {
    width: 100%;
  }

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

  #yearAddForm {
    align-items: stretch;
    flex-direction: column;
  }

  #yearAddForm input,
  #yearAddForm .button {
    width: 100%;
  }

  .year-settings-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 10px 0;
  }

  .year-settings-row-actions {
    grid-column: 1 / -1;
    justify-content: start;
  }

  .recommendation-field-switcher button:nth-child(2) {
    border-right: 0;
  }

  .recommendation-field-switcher button:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .column-settings-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .column-settings-footer-actions {
    justify-content: flex-start;
  }

  .column-settings-status {
    min-height: 24px;
  }

  .font-size-preview {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .column-settings-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .column-settings-group + .column-settings-group {
    padding-left: 0;
    border-left: 0;
  }

  .content {
    padding: 18px;
  }

  .page-header,
  .header-actions,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-management-actions,
  .header-account-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .header-account-actions {
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .main-command-bar,
  .toolbar-filters,
  .history-form {
    grid-template-columns: 1fr;
  }

  .main-command-top {
    align-items: stretch;
    flex-direction: column;
  }

  .main-selection-actions > div {
    flex-wrap: wrap;
  }

  .toolbar-actions,
  .toolbar-secondary-actions,
  .main-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-secondary-actions {
    padding-right: 0;
    padding-bottom: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .column-search-field {
    grid-column: auto;
  }

  .column-search-controls {
    grid-template-columns: 1fr;
  }

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

  .dashboard-toolbar label {
    width: auto;
  }

  .dashboard-toolbar p {
    margin-bottom: 0;
  }

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

  .dashboard-summary > div:nth-child(even) {
    border-right: 0;
  }

  .dashboard-summary > div:last-child {
    grid-column: span 2;
  }

  .team-chart-row {
    grid-template-columns: 72px minmax(120px, 1fr) 64px;
    gap: 8px;
  }

  .density-control {
    justify-content: stretch;
  }

  .density-control button {
    flex: 1 1 0;
  }

  #mainGrid.ag-grid-shell {
    height: 560px !important;
  }

  .detail-flow {
    padding-inline: 14px;
  }

  .detail-field {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .amount-comparison-head,
  .amount-comparison-row {
    grid-template-columns: 94px repeat(2, minmax(0, 1fr));
  }

  .customer-note-form,
  .customer-note-list,
  .history-form,
  .history-list {
    padding-inline: 14px;
  }

  .customer-note-layout,
  .history-note-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-tab-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-note-list,
  .history-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .history-content-field {
    grid-column: auto;
  }

  .history-add-button {
    width: 100%;
  }

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

  .user-list-toolbar {
    grid-template-columns: minmax(220px, 1fr) 140px 140px auto;
  }

  .user-list-summary {
    white-space: normal;
  }

  .wide {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .main-selection-actions {
    width: 100%;
  }
}

@media (min-width: 761px) {
  body.main-viewport,
  body.customer-viewport {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.main-viewport .app-shell,
  body.customer-viewport .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body.main-viewport .content,
  body.customer-viewport .content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  body.main-viewport .page-header,
  body.main-viewport .main-command-bar,
  body.customer-viewport .page-header,
  body.customer-viewport .customer-command-bar {
    flex: 0 0 auto;
  }

  body.main-viewport #view-main.active {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  body.main-viewport #view-main > .panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  body.main-viewport #mainGrid.ag-grid-shell {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0 !important;
  }

  body.main-viewport #mainTableFallback {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
  }

  body.customer-viewport #view-customers.active {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    width: 100%;
  }

  body.customer-viewport .customer-list-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  body.customer-viewport .customer-table-wrap {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
  }

  body.customer-viewport #customerGrid.ag-grid-shell {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0 !important;
  }

  body.detail-viewport {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.detail-viewport .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body.detail-viewport .content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  body.detail-viewport .page-header {
    flex: 0 0 auto;
  }

  body.detail-viewport :is(#view-sub, #view-customer-detail).active {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
  }

  body.detail-viewport #view-sub .sub-layout {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    min-height: 0;
    width: 100%;
  }

  body.detail-viewport :is(.sub-sheet, .customer-detail-shell) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  body.detail-viewport :is(.sub-sheet > .panel-header, .customer-detail-header, .sub-detail-tabs, .customer-detail-tabs) {
    flex: 0 0 auto;
  }

  body.detail-viewport :is(.sub-tab-panel, .customer-tab-panel).active {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  body.detail-viewport .history-panel.active,
  body.detail-viewport .customer-tab-panel[data-customer-panel="contacts"].active,
  body.detail-viewport .customer-tab-panel[data-customer-panel="notes"].active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.detail-viewport :is(.history-note-layout, .customer-contact-layout, .customer-note-layout) {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body.detail-viewport :is(.history-list, .customer-contact-list, .customer-note-list, .record-editor-pane, .customer-contact-editor) {
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
}
