:root {
  color-scheme: light;
  --page: #f1f4f7;
  --panel: #ffffff;
  --panel-alt: #f8fafc;
  --ink: #23282d;
  --muted: #666666;
  --line: #d9e1e8;
  --line-strong: #c5d1dd;
  --utility: #202529;
  --nav: #ffffff;
  --nav-dark: #222831;
  --nav-soft: #f4f6f8;
  --orange: #f58220;
  --orange-dark: #cc6613;
  --blue: #1f5f8f;
  --blue-dark: #16466a;
  --danger: #a83a3a;
  --success: #1b7555;
  --shadow: 0 12px 30px rgba(32, 37, 41, 0.1);
  --radius: 6px;
}
* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  overflow-x: hidden;
}


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

button {
  min-height: 34px;
  max-width: 100%;
  border: 1px solid var(--orange-dark);
  background: var(--orange);
  color: #fff;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
}

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

button:disabled {
  border-color: var(--line);
  background: #f7f9fb;
  color: #8a98a8;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(244, 122, 32, 0.45);
  outline-offset: 1px;
}

.app-header {
  background: #fff;
  border-bottom: 1px solid var(--line-strong);
}

.utility-bar {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 6px 48px;
  background: var(--utility);
  color: #fff;
}

.utility-title {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-row {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 48px;
  background: #fff;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(178px, 24vw, 236px);
  height: auto;
}

.brand-system {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-transform: uppercase;
}

.brand-system strong {
  color: var(--blue-dark);
  font-size: 13px;
}

.topbar-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  align-items: center;
  gap: 6px 14px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.status { color: #e6edf3; text-align: right; overflow-wrap: anywhere; }
.status.ok { color: #ffffff; }
.status.error { color: #ffb4a8; }

.primary-nav {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 24px;
  min-height: 48px;
  padding: 0 48px;
  background: var(--nav);
  border-top: 1px solid #edf1f4;
  box-shadow: 0 3px 12px rgba(32, 37, 41, 0.08);
}

.nav-item {
  min-height: 48px;
  min-width: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #333333;
  padding: 0;
  text-transform: uppercase;
}

.nav-item:hover {
  background: transparent;
  color: var(--orange-dark);
  border-bottom-color: rgba(245, 130, 32, 0.45);
}

.nav-item.active {
  background: transparent;
  color: var(--orange-dark);
  border-bottom-color: var(--orange);
}


.hidden {
  display: none !important;
}

.dashboard-view {
  min-height: calc(100vh - 160px);
  padding: 22px 48px 28px;
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.dashboard-header h1 {
  margin: 0;
  color: var(--nav-dark);
  font-size: 26px;
  line-height: 1.2;
}

.dashboard-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

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

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

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

.metric-value {
  margin-top: 6px;
  color: var(--blue-dark);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

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

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.dashboard-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.dashboard-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.dashboard-row:hover {
  background: #fff8f0;
  border-color: rgba(245, 130, 32, 0.45);
}

.dashboard-row-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dashboard-row-meta {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}

.dashboard-row-date {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.status-count-list {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.status-count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #eef3f7;
  padding-bottom: 7px;
}

.status-count-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-count-name {
  color: var(--ink);
  font-weight: 700;
}

.status-count-value {
  color: var(--blue-dark);
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 160px);
  padding: 22px 48px 28px;
}

.search-pane,
.detail-pane {
  min-width: 0;
}

.search-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel,
.detail-pane,
.merchant-item,
.section,
.note,
.empty-state,
.loading,
.error-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel { box-shadow: 0 8px 20px rgba(15, 79, 123, 0.06); }

.panel-heading,
.section h3 {
  margin: 0;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.search-form {
  display: grid;
  gap: 10px;
  padding: 0 15px 15px;
}

.search-form .panel-heading { margin: 0 -15px 2px; }
.search-form > label,
.filter-row label,
.edit-field span,
.followup-row label {
  color: #25364b;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.filter-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 400;
}

.checkbox-row input { width: auto; }

.results-meta {
  color: var(--blue-dark);
  font-weight: 800;
  text-transform: uppercase;
}

.merchant-list {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.merchant-item {
  width: 100%;
  color: var(--ink);
  text-align: left;
  padding: 11px 12px;
  box-shadow: none;
}

.merchant-item:hover,
.merchant-item.active {
  border-color: #8fb3cf;
  background: #f3f9fe;
}

.merchant-title {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
  font-weight: 800;
}

.merchant-subtitle,
.merchant-meta {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
  font-weight: 400;
}

.badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f2f9;
  color: var(--blue-dark);
  border: 1px solid #c8ddeb;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.pager {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

#pageLabel,
#userPageLabel { text-align: center; color: var(--muted); font-weight: 700; }

.detail-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.detail-header {
  min-height: 104px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: #0c63d4;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.detail-header p {
  margin: 6px 0 0;
  color: var(--muted);
}


.detail-header-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.secondary-button {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--blue-dark);
}

.secondary-button:hover {
  border-color: var(--orange);
  background: #fff8f0;
  color: var(--orange-dark);
}

.header-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.tabs {
  display: flex;
  max-width: 100%;
  gap: 4px;
  padding: 9px 14px 0;
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
  overflow-x: auto;
}

.tab {
  border: 1px solid transparent;
  flex: 0 0 auto;
  border-bottom: 0;
  background: transparent;
  color: var(--blue-dark);
  border-radius: 7px 7px 0 0;
  padding: 9px 12px;
}

.tab:hover,
.tab.active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.detail-content {
  min-width: 0;
  padding: 16px;
  overflow: auto;
  background: #fff;
}

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

.section {
  overflow: hidden;
}

.field-list {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 0;
  padding: 10px 14px 14px;
}

.field-label,
.field-value {
  min-height: 32px;
  padding: 7px 0;
  border-bottom: 1px solid #eef3f7;
}

.field-label { color: var(--muted); font-weight: 700; }
.field-value { overflow-wrap: anywhere; }

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}


.data-table th {
  color: var(--blue-dark);
  font-weight: 800;
  background: #f5f8fb;
  text-transform: uppercase;
  font-size: 12px;
}

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

.note {
  border-left: 4px solid var(--orange);
  padding: 10px 12px;
  background: #fffaf5;
}

.modern-note {
  border-left-color: var(--blue);
  background: #f6fbff;
}

.note-meta {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}

.note-body {
  white-space: pre-wrap;
  line-height: 1.45;
}

.empty-state,
.loading,
.error-state {
  color: var(--muted);
  padding: 20px;
}

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

.link-button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: #0c63d4;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
}

.link-button:hover,
.link-button:focus-visible {
  color: #073d84;
  text-decoration: underline;
  background: transparent;
}

.user-summary-panel { grid-column: 1 / -1; }

.note-form,
.overview-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-status { color: var(--muted); font-weight: 700; }

.followup-row {
  display: grid;
  grid-template-columns: 80px minmax(180px, 260px);
  align-items: center;
  gap: 8px;
}

.status-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.edit-field {
  display: grid;
  gap: 4px;
}

.edit-field textarea { resize: vertical; }
.edit-field.wide { grid-column: 1 / -1; }

.contact-editor {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.contact-row {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto auto;
  gap: 8px;
  align-items: center;
}

.new-contact { margin-bottom: 10px; }

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

.danger-button:hover { background: #812929; }

@media (max-width: 1100px) {
  .utility-bar,
  .brand-row,
  .primary-nav,
  
.hidden {
  display: none !important;
}

.dashboard-view {
  min-height: calc(100vh - 160px);
  padding: 22px 48px 28px;
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.dashboard-header h1 {
  margin: 0;
  color: var(--nav-dark);
  font-size: 26px;
  line-height: 1.2;
}

.dashboard-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

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

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

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

.metric-value {
  margin-top: 6px;
  color: var(--blue-dark);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

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

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.dashboard-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.dashboard-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.dashboard-row:hover {
  background: #fff8f0;
  border-color: rgba(245, 130, 32, 0.45);
}

.dashboard-row-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dashboard-row-meta {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}

.dashboard-row-date {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.status-count-list {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.status-count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #eef3f7;
  padding-bottom: 7px;
}

.status-count-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-count-name {
  color: var(--ink);
  font-weight: 700;
}

.status-count-value {
  color: var(--blue-dark);
  font-weight: 800;
}

.workspace { padding-left: 22px; padding-right: 22px; }
  
.hidden {
  display: none !important;
}

.dashboard-view {
  min-height: calc(100vh - 160px);
  padding: 22px 48px 28px;
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.dashboard-header h1 {
  margin: 0;
  color: var(--nav-dark);
  font-size: 26px;
  line-height: 1.2;
}

.dashboard-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

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

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

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

.metric-value {
  margin-top: 6px;
  color: var(--blue-dark);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

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

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.dashboard-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.dashboard-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.dashboard-row:hover {
  background: #fff8f0;
  border-color: rgba(245, 130, 32, 0.45);
}

.dashboard-row-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dashboard-row-meta {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}

.dashboard-row-date {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.status-count-list {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.status-count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #eef3f7;
  padding-bottom: 7px;
}

.status-count-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-count-name {
  color: var(--ink);
  font-weight: 700;
}

.status-count-value {
  color: var(--blue-dark);
  font-weight: 800;
}

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

@media (max-width: 860px) {
  .merchant-list { grid-template-columns: 1fr; }
  
.detail-header-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.secondary-button {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--blue-dark);
}

.secondary-button:hover {
  border-color: var(--orange);
  background: #fff8f0;
  color: var(--orange-dark);
}

.header-grid { grid-template-columns: 1fr; }
  .header-grid .badge,
  .detail-header-actions { justify-self: start; }
  .detail-header-actions { justify-items: start; }
  .detail-header h2 { font-size: 24px; }
}

@media (max-width: 760px) {
  body { font-size: 13px; }
  .utility-bar { align-items: start; flex-direction: column; gap: 4px; padding-top: 8px; padding-bottom: 8px; }
  .brand-row { align-items: start; flex-direction: column; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .brand-logo { width: 188px; }
  .brand-system { justify-items: start; text-align: left; }
  .topbar-status { width: 100%; justify-content: start; font-size: 12px; }
  .status { text-align: left; }
  .primary-nav { flex-wrap: wrap; overflow: visible; align-items: stretch; gap: 6px; padding-top: 8px; padding-bottom: 8px; }
  .nav-item { flex: 1 1 calc(33.333% - 6px); min-width: 96px; min-height: 38px; border: 1px solid #e7edf2; border-radius: 4px; background: #fff; }
  
.hidden {
  display: none !important;
}

.dashboard-view {
  min-height: calc(100vh - 160px);
  padding: 22px 48px 28px;
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.dashboard-header h1 {
  margin: 0;
  color: var(--nav-dark);
  font-size: 26px;
  line-height: 1.2;
}

.dashboard-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

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

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

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

.metric-value {
  margin-top: 6px;
  color: var(--blue-dark);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

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

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.dashboard-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.dashboard-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.dashboard-row:hover {
  background: #fff8f0;
  border-color: rgba(245, 130, 32, 0.45);
}

.dashboard-row-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dashboard-row-meta {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}

.dashboard-row-date {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.status-count-list {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.status-count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #eef3f7;
  padding-bottom: 7px;
}

.status-count-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-count-name {
  color: var(--ink);
  font-weight: 700;
}

.status-count-value {
  color: var(--blue-dark);
  font-weight: 800;
}

.workspace { gap: 12px; padding: 14px; }
  .search-row,
  .filter-row,
  .pager { grid-template-columns: 1fr; }
  #pageLabel,
  #userPageLabel { order: -1; }
  .section-grid,
  .edit-grid { grid-template-columns: 1fr; }
  .field-list { grid-template-columns: 1fr; padding: 8px 12px 12px; }
  .field-label { border-bottom: 0; padding-bottom: 0; }
  .followup-row,
  .contact-row,
  .status-form-grid { grid-template-columns: 1fr; }
  .contact-row .form-status { min-height: 20px; }
  .data-table { min-width: 620px; }
  .detail-content { padding: 12px; }
  .note-form,
  .overview-form { padding: 12px; }
}


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

.badge.muted {
  background: #eef1f4;
  color: #5f6f7e;
  border-color: #d4dde6;
}


.app-shell.hidden,
.login-view.hidden {
  display: none;
}

.utility-button {
  min-height: 28px;
  border-color: rgba(255, 255, 255, 0.24);
  background: transparent;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
}

.utility-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 46vw) 1fr;
  background: #eef2f7;
}

.login-brand-panel {
  display: grid;
  align-content: space-between;
  gap: 48px;
  min-height: 100vh;
  padding: 60px 7vw;
  background: #202529;
  color: #fff;
}

.login-logo {
  width: min(260px, 70vw);
  padding: 12px 16px;
  background: #fff;
  border-radius: 6px;
}

.login-brand-panel h1 {
  margin: 16px 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}

.login-brand-panel p:not(.eyebrow) {
  max-width: 520px;
  color: #d8e1ea;
  font-size: 18px;
  line-height: 1.55;
}

.login-card {
  align-self: center;
  justify-self: center;
  width: min(520px, calc(100vw - 48px));
  padding: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 6px 0 24px;
  color: var(--ink);
  font-size: 30px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form button {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: auto;
    padding: 28px 24px;
    gap: 24px;
  }

  .login-brand-panel p:not(.eyebrow) {
    font-size: 15px;
  }

  .login-card {
    margin: 24px 0 48px;
  }
}



.profile-circle {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: #f58220;
  color: #fff;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.profile-circle:hover,
.profile-circle:focus-visible {
  background: #cc6613;
  color: #fff;
  text-decoration: none;
}


.inline-heading {
  margin: -14px -14px 4px;
}

.role-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px 14px;
}

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

@media (max-width: 700px) {
  .role-checkbox-grid { grid-template-columns: 1fr; }
}


.dashboard-followup-row {
  grid-template-columns: 1fr;
  gap: 8px;
}

.dashboard-row-main {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.dashboard-row-main:hover,
.dashboard-row-main:focus-visible {
  background: transparent;
  color: var(--ink);
}

.dashboard-followup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid #eef3f7;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-header-row h3 {
  margin-bottom: 0;
}

.compact-select {
  width: auto;
  min-width: 150px;
  min-height: 34px;
  padding: 6px 32px 6px 10px;
}

.dashboard-followup-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dashboard-calendar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-alt);
  padding: 10px;
}

.mini-calendar-toolbar {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  text-align: center;
  color: var(--blue-dark);
}

.icon-button {
  width: 32px;
  min-height: 32px;
  border-color: var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--blue-dark);
  padding: 0;
  font-size: 19px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--blue);
  background: #eef6fc;
  color: var(--blue-dark);
}

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

.mini-calendar-weekdays {
  margin-bottom: 4px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.mini-calendar-day,
.mini-calendar-empty {
  aspect-ratio: 1;
  min-height: 28px;
}

.mini-calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.mini-calendar-day:hover {
  border-color: var(--blue);
  background: #eef6fc;
  color: var(--blue-dark);
}

.mini-calendar-day.today {
  border-color: var(--orange);
}

.mini-calendar-day.selected {
  border-color: var(--blue-dark);
  background: var(--blue);
  color: #fff;
}

.mini-calendar-day strong {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
}

.mini-calendar-day.selected strong {
  background: #fff;
  color: var(--blue-dark);
}

.mini-calendar-clear {
  width: 100%;
  margin-top: 10px;
}

.dashboard-followup-list {
  min-width: 0;
}

.dashboard-followup-row.overdue {
  border-color: #f0b8b8;
  background: #fff1f1;
}

.dashboard-followup-row.due-today {
  border-color: #b7d9ca;
  background: #f0fbf6;
}

@media (max-width: 900px) {
  .dashboard-followup-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-calendar {
    max-width: 320px;
  }
}

@media (max-width: 560px) {
  .section-header-row {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-select {
    width: 100%;
  }
}
