/* ══ IVSERA PRIVATE CRM ════════════════════════════════════════════════════ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #172033;
  background: #f4f7fb;
}

a {
  color: #0b5cad;
}

/* ── App shell / layout ─────────────────────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  min-width: 0;
}

.auth-shell {
  min-height: 100vh;
}

.workspace {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
  padding: 22px 16px;
  background: #111827;
  color: #dbe7f3;
}

.sidebar-brand {
  padding: 0 10px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px;
  color: #bcccdc;
  text-decoration: none;
  border-radius: 8px;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: #ffffff;
  background: #1f3a5f;
}

.icon {
  flex: 0 0 auto;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid #d9e2ec;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: #111827;
}

.account {
  display: flex;
  gap: 16px;
  color: #52606d;
  font-size: 14px;
}

/* ── Page / content area ────────────────────────────────────────────────── */

.page {
  max-width: 1120px;
  min-width: 0;
  margin: 0 auto;
  padding: 28px 28px 48px;
}

/* ── Auth panels ────────────────────────────────────────────────────────── */

.auth-panel,
.message-panel {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-header h1 {
  margin: 4px 0 4px;
  font-size: 28px;
  line-height: 1.2;
}

.page-header p {
  margin: 0;
}

/* ── Panels / empty states / content areas ──────────────────────────────── */

.panel,
.empty-state {
  padding: 20px;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  min-width: 0;
  max-width: 100%;
}

.panel + .panel,
.panel + .empty-state,
.empty-state + .panel {
  margin-top: 16px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-panel h2 {
  padding: 16px 20px 12px;
  margin: 0;
  font-size: 16px;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

[hidden] {
  display: none !important;
}

.form-offscreen-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

label {
  display: block;
  margin: 16px 0;
  font-weight: 600;
}

fieldset {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  color: #334e68;
  font-weight: 800;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  font: inherit;
  color: #172033;
  background: #ffffff;
}

.form-field--error input,
.form-field--error textarea,
.form-field--error select,
.form-input--error {
  border-color: #c53030;
  background: #fffafa;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: #9b1c1c;
  font-size: 13px;
  font-weight: 700;
}

.form-hint {
  display: block;
  margin-top: 6px;
  color: #627d98;
  font-size: 13px;
  font-weight: 500;
}

textarea {
  resize: vertical;
}

select {
  min-height: 40px;
}

/* ── Buttons / actions ──────────────────────────────────────────────────── */

button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  background: #0b5cad;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

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

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  color: #334e68;
  background: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.back-link {
  color: #52606d;
  text-decoration: none;
  font-size: 14px;
}

/* ── Flash messages / inline states ─────────────────────────────────────── */

.muted {
  color: #627d98;
}

.error {
  padding: 10px 12px;
  border-radius: 6px;
  color: #8a1f11;
  background: #ffebe6;
}

.success {
  padding: 10px 12px;
  border-radius: 6px;
  color: #1f6f43;
  background: #e3fcef;
}

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

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
}

/* ── Dashboard ───────────────────────────────────────────────────────────── */

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

.dashboard-workbench {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.dashboard-hero {
  margin-bottom: 0;
}

.dashboard-metrics {
  margin-bottom: 0;
}

.kpi-card {
  min-height: 132px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #52606d;
  font-size: 13px;
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin-top: 18px;
  color: #111827;
  font-size: 30px;
  line-height: 1;
}

.kpi-card p {
  margin: 10px 0 0;
  color: #627d98;
  font-size: 13px;
}

.dashboard-section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.dashboard-card {
  margin: 0;
  min-width: 0;
}

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

.dashboard-card-header h2 {
  margin: 0;
  font-size: 18px;
}

.dashboard-entity-list,
.dashboard-attention-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.dashboard-entity-card,
.dashboard-attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #e2ebf4;
  border-radius: 8px;
  background: #ffffff;
}

.dashboard-entity-card-main,
.dashboard-attention-content {
  min-width: 0;
}

.dashboard-entity-card a,
.dashboard-attention-item a {
  font-weight: 700;
}

.dashboard-entity-card p,
.dashboard-attention-item p {
  margin: 4px 0 0;
  color: #627d98;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.dashboard-entity-card-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 120px;
  color: #52606d;
  font-size: 13px;
  white-space: nowrap;
}

.dashboard-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dashboard-action-button {
  justify-content: center;
}

/* ── Quick actions / notice banners ─────────────────────────────────────── */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, max-content));
  gap: 10px;
}

.empty-state.compact {
  padding: 16px;
}

.empty-state.compact h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.empty-state.compact p {
  margin: 0 0 12px;
}

.empty-state.compact p:last-child {
  margin-bottom: 0;
}

.stack {
  overflow: auto;
  padding: 12px;
  background: #111827;
  color: #f9fafb;
}

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

.filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) auto auto;
  gap: 10px;
  align-items: end;
}

.filter-form label {
  margin: 0;
}

.search-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #52606d;
}

.search-label input {
  margin-top: 0;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
}

th {
  color: #52606d;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

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

.table-wrapper {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Status badges ───────────────────────────────────────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #e0f2fe;
  color: #075985;
}

.status-confirmed,
.status-completed {
  background: #dcfce7;
  color: #166534;
}

.status-in_progress,
.status-no_show {
  background: #fef3c7;
  color: #92400e;
}

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.danger-button {
  background: #b91c1c;
}

.empty-state {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.empty-state.compact {
  margin: 14px 0;
}

.empty-state h2 {
  margin: 0;
}

.empty-state p {
  margin: 0;
  color: #627d98;
}

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

.detail-full {
  grid-column: 1 / -1;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

.detail-list dt {
  color: #627d98;
}

.detail-list dd {
  margin: 0;
  text-align: right;
}

.plain-text {
  white-space: pre-wrap;
  line-height: 1.5;
}

/* ── Repair detail workflow layout ─────────────────────────────────── */

.workflow-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.workflow-summary-item {
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e2ebf4;
  border-radius: 10px;
  background: #ffffff;
}

.workflow-summary-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #829ab1;
  margin-bottom: 2px;
}

.workflow-summary-value {
  color: #102a43;
  font-size: 15px;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.workflow-summary-value-strong {
  font-size: 20px;
  font-weight: 700;
  color: #0f4c81;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.workflow-summary-subvalue {
  font-size: 13px;
  color: #627d98;
  margin-top: 1px;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.workflow-total {
  font-size: 20px;
  font-weight: 700;
  color: #0f4c81;
  letter-spacing: -0.01em;
}

/* Primary value inside a block-level linked sector */
.workflow-summary-value-link {
  color: #102a43;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: break-word;
}

/* Item-link: entire sector is a block-level anchor */
.workflow-summary-item-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.workflow-summary-item-link:hover,
.workflow-summary-item-link:focus,
.workflow-summary-item-link:focus-visible {
  text-decoration: none;
}

.workflow-summary-item-link:hover {
  background: #f1f6fb;
  border-color: #d6e4f0;
}

.workflow-summary-item-link:focus-visible {
  background: #f1f6fb;
  border-color: #b8d4ee;
  outline: 2px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

.workflow-summary-status .workflow-summary-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Work items grouped section */

.workflow-work-section > h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.workflow-work-section,
.workflow-subsection,
.work-items-table-wrapper {
  min-width: 0;
  max-width: 100%;
}

.workflow-subsection {
  margin-bottom: 0;
}

.workflow-subsection-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #486581;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Add work item form card */

.workflow-form-card {
  margin-top: 16px;
  padding: 16px 20px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
}

.workflow-form-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #486581;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Add-work-item form desktop grid */

.work-item-add-form .form-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 130px 120px auto;
  gap: 10px;
  align-items: end;
}

.work-item-add-form .form-row label {
  margin: 0;
}

/* ── CRM card/action pattern standard ───────────────────────────────────── */

.work-items-list {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-top: 10px;
}

.work-item-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
}

.work-item-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.work-item-card-title {
  min-width: 0;
}

.work-item-card-title h4 {
  margin: 0;
  color: #102a43;
  font-size: 15px;
}

.work-item-card-body {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(110px, 1fr));
  gap: 12px;
  min-width: 0;
}

.work-item-card-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.work-item-card-label {
  color: #627d98;
  font-size: 12px;
  font-weight: 700;
}

.work-item-card-value {
  color: #243b53;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.work-item-card-value-strong {
  color: #102a43;
  font-weight: 800;
}

.work-item-card-subvalue {
  display: block;
  margin: 4px 0 0;
  color: #627d98;
  font-size: 12px;
  font-weight: 500;
}

.work-item-card-checkbox {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  max-width: 100%;
}

.work-item-card-checkbox input {
  margin: 0;
}

.work-item-card-footer {
  min-width: 0;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}

.work-items-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
}

.work-items-total-label {
  color: #486581;
  font-size: 13px;
  font-weight: 700;
}

.work-items-total-value {
  color: #102a43;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.work-items-empty {
  margin-top: 10px;
}

.work-item-actions-cell {
  min-width: 0;
}

.work-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: none;
}

.work-item-action-button {
  max-width: 220px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  background: #ffffff;
  color: #243b53;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow-wrap: normal;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.work-item-action-button:hover {
  background: #f0f4f8;
  border-color: #9fb3c8;
}

.work-item-action-danger {
  border-color: #e57373;
  color: #b71c1c;
}

.work-item-action-danger:hover {
  background: #fff5f5;
  border-color: #ef5350;
}

/* ── Repair status quick actions ─────────────────────────────────────── */

.workflow-quick-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #d9e2ec;
}

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

.workflow-action-button {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  background: #fff;
  color: #243b53;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  max-width: 100%;
  box-sizing: border-box;
}

.workflow-action-button:hover {
  background: #f0f4f8;
  border-color: #9fb3c8;
}

.workflow-action-danger {
  border-color: #e57373;
  color: #b71c1c;
}

.workflow-action-danger:hover {
  background: #fff5f5;
  border-color: #ef5350;
}

/* ── CRM entity / value links ─────────────────────────────────────────── */

.entity-link {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.12s;
}

.entity-link:hover {
  color: #0f4c81;
  text-decoration: none;
}

.entity-link:focus-visible {
  outline: 2px solid rgba(15, 76, 129, 0.4);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Stronger variant for primary entity name (client, vehicle plate) */
.entity-link-strong {
  color: #102a43;
}

.entity-link.entity-link-strong:hover {
  color: #0f4c81;
}

/* Muted variant for secondary values (dates, appointment links) */
.entity-link-muted {
  color: #486581;
  font-weight: 400;
}

.entity-link.entity-link-muted:hover {
  color: #334e68;
}

/* WO number link inside table — keeps underline on hover only */
td .entity-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── End workflow layout ─────────────────────────────────────────────── */

.work-item-wo-selection-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
}

.work-item-wo-selection-panel h3 {
  margin: 0;
}

.section-heading,
.work-item-wo-summary-row,
.work-item-wo-form {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.work-item-wo-summary,
.work-item-wo-summary-row {
  color: #334e68;
}

.work-item-wo-summary {
  display: grid;
  gap: 2px;
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #fff;
}

.work-item-wo-summary span,
.work-item-wo-summary-row span,
.field-hint,
.small {
  font-size: 13px;
  color: #627d98;
}

.work-item-wo-summary strong,
.work-item-wo-summary-row strong {
  color: #102a43;
}

.field-hint {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

.locked-context-field {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #f8fafc;
  color: #334e68;
}

.locked-context-label {
  color: #52606d;
  font-size: 13px;
  font-weight: 700;
}

.locked-context-value {
  font-weight: 700;
}

.locked-context-help {
  margin: 0;
  color: #627d98;
  font-size: 13px;
  line-height: 1.4;
}

.form-panel {
  max-width: 680px;
}

.crm-form-panel,
.form-page,
.form-section,
.form-grid,
.form-field {
  min-width: 0;
}

.form-page {
  display: grid;
  gap: 18px;
}

.form-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #ffffff;
}

.form-section + .form-section {
  margin-top: 0;
}

.form-section-header {
  display: grid;
  gap: 4px;
}

.form-section-header h2 {
  margin: 0;
  color: #102a43;
  font-size: 16px;
}

.form-section-header p,
.form-help {
  margin: 0;
  color: #627d98;
  font-size: 13px;
  line-height: 1.45;
}

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

.form-field,
.form-grid label {
  margin: 0;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-error {
  margin: 0;
}

.form-actions-secondary {
  margin-left: auto;
}

.form-danger-zone {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fffafa;
}

.role-form-panel {
  max-width: 920px;
}

.role-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.role-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #ffffff;
}

.role-card h3 {
  margin: 8px 0 6px;
}

.permission-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.permission-group {
  padding: 14px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
}

.permission-group legend {
  padding: 0 6px;
  font-weight: 700;
}

.permission-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: start;
  margin: 10px 0;
}

.permission-row code {
  grid-column: 2;
  color: #627d98;
  font-size: 12px;
}

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

.notice-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
}

.notice-banner p {
  margin: 4px 0 0;
  color: #334e68;
}

/* ══ IVSERA LANDING PAGE ════════════════════════════════════════════════════
   The following styles are EXCLUSIVE to the public landing page and public
   auth pages. Do NOT reference .lp-* or .landing-page in private CRM pages.
   ══════════════════════════════════════════════════════════════════════════ */

.landing-page {
  --ivsera-bg: #f6f8fb;
  --ivsera-surface: #ffffff;
  --ivsera-hero: #101828;
  --ivsera-hero-2: #172033;
  --ivsera-text: #0f172a;
  --ivsera-secondary: #475569;
  --ivsera-muted: #64748b;
  --ivsera-faint: #94a3b8;
  --ivsera-primary: #2563eb;
  --ivsera-primary-hover: #1d4ed8;
  --ivsera-accent: #f97316;
  --ivsera-success: #16a34a;
  --ivsera-error: #dc2626;
  --ivsera-border: #e2e8f0;
  --ivsera-input-border: #cbd5e1;
  --ivsera-shadow-card: 0 12px 34px rgba(15, 23, 42, 0.08);
  --ivsera-shadow-auth: 0 24px 70px rgba(15, 23, 42, 0.12);
  min-width: 0;
  color: var(--ivsera-text);
  background: var(--ivsera-bg);
  font-family: Inter, Arial, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.landing-page a {
  color: inherit;
}

.lp-container,
.lp-nav__inner,
.lp-hero__inner {
  width: min(100% - 40px, 1180px);
  margin: 0 auto;
}

.lp-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ivsera-hero);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
}

.lp-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 18px;
}

.lp-nav__brand,
.lp-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
}

.lp-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ivsera-primary) 0%, var(--ivsera-primary-hover) 100%);
  color: #ffffff;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.lp-nav__brand-text {
  display: grid;
  gap: 0;
  line-height: 1.05;
}

.lp-nav__brand-text strong {
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.lp-nav__brand-text span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 8px;
  letter-spacing: 0;
}

.lp-nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.lp-nav__links a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
}

.lp-nav__links a:hover,
.lp-nav__links a:focus {
  color: #ffffff;
}

.lp-nav__actions,
.lp-hero__cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lp-btn--primary {
  background: var(--ivsera-primary);
  color: #ffffff;
}

.lp-btn--primary:hover,
.lp-btn--primary:focus {
  background: var(--ivsera-primary-hover);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.26);
}

.lp-btn--ghost {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(255, 255, 255, 0.18);
}

.lp-btn--ghost:hover,
.lp-btn--ghost:focus {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.lp-btn--outline {
  color: #ffffff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
}

.lp-btn--outline:hover,
.lp-btn--outline:focus {
  background: rgba(255, 255, 255, 0.08);
}

.lp-btn--lg {
  min-height: 46px;
  padding: 11px 24px;
  border-radius: 12px;
  font-size: 13px;
}

.lp-btn--full {
  width: 100%;
}

.lp-hero {
  position: relative;
  padding: 108px 0 0;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(37, 99, 235, 0.16) 0 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(ellipse 58% 36% at 50% 4%, rgba(37, 99, 235, 0.22), transparent 72%),
    linear-gradient(180deg, var(--ivsera-hero) 0%, #111827 100%);
}

.lp-hero__inner {
  display: grid;
  justify-items: center;
  gap: 50px;
  text-align: center;
}

.lp-badge {
  display: inline-flex;
  margin-bottom: 22px;
  padding: 6px 13px;
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lp-hero h1 {
  max-width: 720px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(42px, 4.45vw, 60px);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: 0;
}

.lp-hero h1 span {
  display: block;
  color: inherit;
}

.lp-hero__subtitle {
  max-width: 580px;
  margin: 22px auto 30px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1.55;
}

.lp-hero__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.lp-hero__trust span,
.lp-start__copy li,
.lp-target-card li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(203, 213, 225, 0.82);
  font-size: 11px;
}

.lp-hero__trust span {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.lp-hero__trust .icon,
.lp-benefit-item .icon,
.lp-start__copy li::before {
  color: #60a5fa;
}

.lp-preview {
  position: relative;
  overflow: hidden;
  width: min(100%, 760px);
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 22px 22px 0 0;
  background: var(--ivsera-bg);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.44), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.lp-preview::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 76px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(246, 248, 251, 0), rgba(246, 248, 251, 0.88) 76%, rgba(246, 248, 251, 1));
  filter: blur(0.2px);
}

.lp-preview__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #1a2540;
}

.lp-preview__bar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.lp-preview__bar span:nth-child(1) {
  background: #ef4444;
}

.lp-preview__bar span:nth-child(2) {
  background: #f59e0b;
}

.lp-preview__bar span:nth-child(3) {
  background: #10b981;
}

.lp-preview__bar p {
  flex: 1;
  margin: 0 0 0 8px;
  padding: 3px 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #64748b;
  font-size: 10px;
  text-align: center;
}

.lp-preview__body {
  display: grid;
  grid-template-columns: 134px minmax(0, 1fr);
  min-height: 330px;
}

.lp-preview__sidebar {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 22px 14px;
  background: var(--ivsera-hero-2);
  color: #64748b;
  font-size: 10.5px;
}

.lp-preview__sidebar strong {
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 11px;
}

.lp-preview__sidebar span {
  padding: 7px 8px;
  border-radius: 7px;
}

.lp-preview__sidebar span:first-of-type {
  color: #ffffff;
  background: #2563eb;
}

.lp-preview__main {
  min-width: 0;
  background: #f6f8fb;
}

.lp-preview__top {
  display: none;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e8edf5;
  background: #ffffff;
  font-size: 11px;
}

.lp-preview__top span {
  color: #64748b;
}

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

.lp-preview__metrics div,
.lp-preview__work > div {
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #ffffff;
}

.lp-preview__metrics div {
  min-height: 58px;
  padding: 12px 10px;
}

.lp-preview__metrics strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
}

.lp-preview__metrics span {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 8.5px;
}

.lp-preview__work {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 0 18px 18px;
}

.lp-preview__work h3 {
  margin: 0;
  padding: 9px 10px;
  color: #0f172a;
  font-size: 10px;
}

.lp-preview__work p {
  display: grid;
  grid-template-columns: 1fr 74px 64px;
  gap: 6px;
  margin: 0;
  padding: 7px 10px;
  border-top: 1px solid #f1f5f9;
  color: #64748b;
  font-size: 9px;
}

.lp-preview__work b,
.lp-preview__work strong {
  color: #0f172a;
}

.lp-preview__work p span,
.lp-preview__attention span {
  display: inline-flex;
  border-radius: 7px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 800;
}

.lp-preview__attention {
  padding-bottom: 8px;
}

.lp-preview__attention span {
  display: block;
  margin: 7px 8px;
  padding: 8px;
  background: #fff7ed;
  color: #ea580c;
  font-size: 9px;
}

.lp-section {
  padding: 96px 0;
}

.lp-section--light {
  background: var(--ivsera-bg);
}

.lp-section--dark,
.lp-footer {
  background: var(--ivsera-hero);
}

.lp-section__head {
  max-width: 650px;
  margin: 0 auto 56px;
  text-align: center;
}

.lp-section__head p,
.lp-benefits__copy p,
.lp-security__inner p {
  margin: 0 0 10px;
  color: var(--ivsera-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lp-section__head h2,
.lp-benefits__copy h2,
.lp-start__copy h2,
.lp-security__inner h2 {
  margin: 0;
  color: var(--ivsera-text);
  font-size: clamp(32px, 3.3vw, 42px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
}

.lp-section__head span,
.lp-benefits__copy > span,
.lp-start__copy p {
  display: block;
  margin-top: 16px;
  color: var(--ivsera-muted);
  font-size: 17px;
  line-height: 1.65;
}

.lp-section__head--dark h2 {
  color: #ffffff;
}

.lp-section__head--dark span {
  color: #94a3b8;
}

.lp-feature-grid,
.lp-planned-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.landing-card {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--ivsera-border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--ivsera-shadow-card);
}

.landing-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
}

.landing-card-tag {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.landing-card h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.landing-card p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.65;
}

.lp-target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.lp-target-card {
  padding: 28px;
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.56);
}

.lp-target-card:nth-child(2) {
  background: rgba(49, 46, 129, 0.42);
}

.lp-target-card:nth-child(3) {
  background: rgba(8, 47, 73, 0.42);
}

.lp-target-card__icon {
  display: inline-flex;
  margin-bottom: 20px;
  color: #94a3b8;
}

.lp-target-card h3 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 17px;
}

.lp-target-card p,
.lp-target-card li {
  color: #94a3b8;
  font-size: 14px;
}

.lp-target-card ul,
.lp-start__copy ul {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.lp-target-card li::before {
  content: "—";
  color: #475569;
}

.lp-benefits__inner,
.lp-start__inner,
.lp-security__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 72px;
  align-items: center;
}

.lp-benefits__copy .lp-btn {
  margin-top: 26px;
}

.lp-benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 34px;
}

.lp-benefit-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
}

.lp-benefit-item > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #2563eb;
}

.lp-benefit-item strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
}

.lp-benefit-item p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.lp-start {
  padding: 96px 0;
  background: var(--ivsera-hero);
}

.lp-start__inner {
  grid-template-columns: minmax(0, 0.9fr) minmax(460px, 520px);
  align-items: center;
}

.lp-start__copy .lp-logo {
  margin-bottom: 24px;
}

.lp-start__copy h2 {
  max-width: 420px;
  color: #ffffff;
}

.lp-start__copy p {
  color: rgba(255, 255, 255, 0.5);
}

.lp-start__copy li {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.lp-start__copy li::before {
  content: "✓";
  color: #2563eb;
}

.lp-auth-card,
.ivsera-auth-card {
  overflow: hidden;
  width: min(100%, 520px);
  min-height: 620px;
  max-height: 740px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--ivsera-shadow-auth);
}

.lp-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #e8edf5;
}

.lp-auth-mode-link {
  padding: 17px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.lp-auth-mode-link:hover,
.lp-auth-mode-link:focus,
.lp-auth-mode-link.is-active {
  color: #2563eb;
  border-bottom: 3px solid #2563eb;
}

.lp-auth-card__body {
  display: flex;
  min-height: 558px;
  flex-direction: column;
  padding: 32px;
}

.lp-auth-card h3 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 20px;
}

.lp-auth-card p {
  margin: 0 0 20px;
  color: var(--ivsera-muted);
  font-size: 14px;
}

.lp-auth-card__body > label {
  margin: 14px 0;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.lp-auth-card__body > label span {
  display: block;
  margin-top: 7px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #cbd5e1;
  font-weight: 700;
}

.lp-auth-card__body > p:last-child {
  margin: 16px 0 0;
  text-align: center;
}

.lp-auth-card a:not(.lp-btn) {
  color: #2563eb;
  font-weight: 900;
  text-decoration: none;
}

.lp-embedded-form {
  display: grid;
  gap: 14px;
}

.lp-embedded-form fieldset {
  margin: 8px 0;
  padding: 16px;
  border-color: var(--ivsera-border);
  border-radius: 12px;
}

.lp-embedded-form label {
  margin: 10px 0;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.lp-embedded-form input,
.lp-embedded-form select {
  margin-top: 7px;
  min-height: 43px;
  border-color: var(--ivsera-input-border);
  border-radius: 9px;
  color: #0f172a;
}

.ivsera-register-scroll-area {
  min-height: 0;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-color: #cbd5e1 transparent;
}

.ivsera-register-scroll-area::-webkit-scrollbar {
  width: 8px;
}

.ivsera-register-scroll-area::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.ivsera-register-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.ivsera-login-form {
  margin-top: 6px;
}

.ivsera-legal-consent-area {
  padding: 14px;
  border: 1px solid var(--ivsera-border);
  border-radius: 10px;
  background: #f8fafc;
}

.lp-embedded-form .checkbox-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 8px;
  color: #64748b;
  font-weight: 600;
  line-height: 1.5;
}

.lp-embedded-form .checkbox-row input {
  width: 18px;
  margin-top: 3px;
}

.lp-auth-switch {
  margin-top: 16px !important;
  text-align: center;
}

.lp-planned {
  padding-top: 70px;
}

.lp-planned .landing-card {
  padding: 22px;
}

.lp-security {
  padding: 72px 0;
  background: #ffffff;
}

.lp-security__inner {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

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

.lp-security__list span {
  padding: 14px 16px;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

.lp-faq {
  display: grid;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto;
}

.landing-faq-item {
  padding: 0 18px;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  background: #ffffff;
}

.landing-faq-item summary {
  cursor: pointer;
  padding: 18px 0;
  color: #0f172a;
  font-weight: 900;
}

.landing-faq-item p {
  margin: 0;
  padding: 0 0 18px;
  color: #64748b;
}

.lp-footer {
  padding: 48px 0 56px;
  color: #64748b;
  text-align: center;
}

.lp-footer__brand {
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
}

.lp-footer p {
  max-width: 560px;
  margin: 20px auto 16px;
}

.lp-footer nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.lp-footer a {
  color: #94a3b8;
  font-weight: 800;
  text-decoration: none;
}

/* ── Private CRM responsive breakpoints ──────────────────────────────────── */

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    min-height: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .workspace,
  .page,
  .panel,
  .detail-full,
  .workflow-summary,
  .workflow-work-section,
  .workflow-subsection,
  .table-wrapper {
    min-width: 0;
    max-width: 100%;
  }

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

  .page-header,
  .search-form,
  .filter-form,
  .form-grid,
  .detail-grid,
  .dashboard-section-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-workbench,
  .dashboard-card,
  .dashboard-entity-card,
  .dashboard-attention-item {
    min-width: 0;
    max-width: 100%;
  }

  .dashboard-entity-card,
  .dashboard-attention-item {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-entity-card-meta {
    align-items: start;
    justify-items: start;
    min-width: 0;
    white-space: normal;
  }

  .dashboard-actions-grid {
    grid-template-columns: 1fr;
  }

  .form-panel,
  .role-form-panel {
    max-width: none;
  }

  .form-section {
    padding: 14px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions > button,
  .form-actions > .primary-button,
  .form-actions > .secondary-button {
    width: 100%;
  }

  .form-actions-secondary {
    margin-left: 0;
  }

  .page-header {
    display: grid;
  }

  .notice-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-total {
    font-size: 18px;
  }

  .workflow-form-card {
    padding: 12px 14px;
  }

  .work-item-card-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-item-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
    gap: 8px;
  }

  .work-item-action-button {
    width: 100%;
    max-width: none;
    padding: 7px 10px;
    font-size: 12px;
    white-space: normal;
    overflow-wrap: normal;
  }

  .workflow-action-button {
    padding: 7px 12px;
  }

  .work-item-wo-selection-panel {
    padding: 12px;
  }

  .work-item-add-form .form-row {
    grid-template-columns: 1fr;
  }

  .work-item-add-form .form-row button {
    width: 100%;
  }
}

/* ── Workflow summary responsive breakpoints ─────────────────────────── */

@media (max-width: 1180px) {
  .workflow-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* At ~900px viewport the 248px sidebar leaves only ~600px content —
   3 columns become too narrow; switch to 2 early */
@media (max-width: 980px) {
  .workflow-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Single-column card stack on narrow screens */
@media (max-width: 640px) {
  .workflow-summary-grid {
    grid-template-columns: 1fr;
  }

  .workflow-summary-value-strong {
    font-size: 18px;
  }

  /* Actions: 2-column grid of buttons */
  .workflow-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .workflow-action-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .work-items-list {
    gap: 16px;
  }

  .work-item-card {
    gap: 16px;
    padding: 14px;
  }

  .work-item-card-header {
    grid-template-columns: 1fr;
  }

  .work-item-card-body {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .work-item-card-footer {
    margin-top: 6px;
    padding-top: 14px;
  }

  .work-item-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
    gap: 8px;
  }

  .work-item-action-button {
    width: 100%;
    min-height: 36px;
    max-width: none;
    justify-content: center;
    padding: 8px 12px;
    white-space: normal;
    overflow-wrap: normal;
  }

  .work-items-total {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 28px;
  }

  .work-items-total-value {
    font-size: 20px;
  }
}

@media (max-width: 380px) {
  .workflow-action-row {
    grid-template-columns: 1fr;
  }
}

/* ── Landing page responsive breakpoints ─────────────────────────────────── */

@media (max-width: 1023px) {
  .lp-hero__inner,
  .lp-benefits__inner,
  .lp-start__inner,
  .lp-security__inner {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .lp-feature-grid,
  .lp-target-grid,
  .lp-planned-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-preview {
    transform: none;
  }

  .lp-preview__body {
    min-height: 340px;
  }

  .lp-start__inner {
    justify-items: center;
  }

  .lp-start__copy {
    text-align: center;
  }

  .lp-start__copy h2 {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 760px) {
  .lp-container,
  .lp-nav__inner,
  .lp-hero__inner {
    width: min(100% - 32px, 1200px);
  }

  .lp-nav__inner {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 0;
  }

  .lp-nav__links {
    display: none;
  }

  .lp-nav__actions,
  .lp-hero__cta {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .lp-btn {
    width: 100%;
  }

  .lp-hero {
    padding: 58px 0 0;
  }

  .lp-hero h1 {
    font-size: clamp(32px, 10vw, 38px);
  }

  .lp-hero__subtitle,
  .lp-section__head span,
  .lp-benefits__copy > span,
  .lp-start__copy p {
    font-size: 16px;
  }

  .lp-preview__body,
  .lp-preview__work,
  .lp-feature-grid,
  .lp-target-grid,
  .lp-benefit-grid,
  .lp-planned-grid,
  .lp-security__list {
    grid-template-columns: 1fr;
  }

  .lp-preview {
    border-radius: 20px 20px 0 0;
  }

  .lp-preview__sidebar {
    display: none;
  }

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

  .lp-preview__work p {
    grid-template-columns: 1fr;
  }

  .lp-section,
  .lp-start {
    padding: 62px 0;
  }

  .lp-auth-card {
    width: 100%;
    min-height: 0;
    max-height: none;
  }

  .lp-auth-card__body {
    min-height: 0;
  }

  .ivsera-register-scroll-area {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .landing-card,
  .lp-target-card,
  .lp-auth-card__body {
    padding: 22px;
  }
}

@media (min-width: 1440px) {
  .lp-container,
  .lp-nav__inner,
  .lp-hero__inner {
    width: min(100% - 80px, 1180px);
  }
}

@media (min-width: 1920px) {
  .lp-hero {
    padding: 118px 0 108px;
  }
}
