/*
 * MP Engenharia — Component Library
 * OS-113B: Reusable UI components
 *
 * Responsabilidade: sidebar, topbar, page-header, action-bar,
 * cards, tabelas, formulários, alertas, badges, empty states,
 * filtros, toolbars, stat cards, flow steps, record cards.
 *
 * NÃO altera regras de negócio. Apenas apresentação.
 */

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.mp-app-sidebar {
  min-height: 100vh;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #151612;
  color: #f4f4ef;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.mp-app-brand {
  min-height: 50px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.mp-app-brand span {
  font-family: var(--mp-font-brand);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.05;
}

.mp-app-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: transparent;
  filter: invert(1);
}

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

.mp-app-nav a {
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.68);
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.mp-app-nav a:hover,
.mp-app-nav a:focus-visible,
.mp-app-nav a.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.mp-app-nav a span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.mp-app-nav a.is-active span {
  background: var(--mp-yellow);
}

.mp-app-nav-spacer {
  height: 12px;
  margin: 8px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mp-app-nav a.mp-app-nav-logout {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
}

.mp-app-nav a.mp-app-nav-logout:hover,
.mp-app-nav a.mp-app-nav-logout:focus-visible {
  background: rgba(244, 196, 56, 0.14);
  color: #ffffff;
}

.mp-app-nav a.mp-app-nav-logout span {
  background: #d26a5c;
}

.mp-app-sidebar-status {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--mp-radius);
  background: rgba(255, 255, 255, 0.05);
}

.mp-app-sidebar-status strong,
.mp-app-sidebar-status span {
  display: block;
}

.mp-app-sidebar-status strong {
  color: var(--mp-yellow);
  font-size: 12px;
  text-transform: uppercase;
}

.mp-app-sidebar-status span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.45;
}

/* =========================================================================
   TOPBAR
   ========================================================================= */
.mp-app-topbar {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.mp-app-kicker {
  margin: 0 0 8px;
  color: var(--mp-muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mp-app-topbar h1 {
  margin: 0;
  color: var(--mp-ink);
  font-size: 30px;
  line-height: 1.05;
  font-weight: 850;
}

.mp-app-user {
  max-width: 220px;
  overflow: hidden;
  color: var(--mp-muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================================
   PAGE HEADER
   ========================================================================= */
.mp-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.mp-page-header-left {
  min-width: 0;
}

/* =========================================================================
   ACTION BAR
   ========================================================================= */
.mp-app-actions,
.mp-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

/* =========================================================================
   BUTTONS — Hierarquia visual
   ========================================================================= */
.mp-app-button,
.mp-app-ghost,
.mp-panel-heading button,
.mp-detail-actions button {
  max-width: 100%;
  min-height: 36px;
  min-width: 112px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--mp-panel);
  color: var(--mp-ink);
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mp-app-button,
.mp-panel-heading button,
.mp-detail-actions button:first-child {
  border-color: var(--mp-yellow);
  background: var(--mp-yellow);
  color: var(--mp-black);
}

.mp-app-button:hover,
.mp-panel-heading button:hover {
  background: #e6b530;
  border-color: #e6b530;
}

.mp-app-ghost:hover {
  background: var(--mp-panel-soft);
  border-color: var(--mp-line-strong);
}

button:disabled,
.mp-app-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.mp-app-button:focus-visible,
.mp-app-ghost:focus-visible {
  outline: 2px solid var(--mp-status-new);
  outline-offset: 2px;
}

/* =========================================================================
   CARDS
   ========================================================================= */
.mp-module-panel,
.mp-inline-panel {
  min-width: 0;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
  box-shadow: var(--mp-shadow);
}

.mp-module-panel--compact {
  overflow: hidden;
}

.mp-panel-heading {
  min-height: 72px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--mp-line);
}

.mp-panel-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.mp-inline-panel {
  padding: 22px;
}

.mp-inline-panel h2 {
  margin: 0 0 10px;
  color: var(--mp-ink);
  font-size: 22px;
  line-height: 1.16;
}

.mp-inline-panel p:not(.mp-app-kicker) {
  max-width: 760px;
  margin: 0;
  color: var(--mp-muted);
  font-size: 14px;
  line-height: 1.65;
}

/* =========================================================================
   STAT CARDS (Dashboard & Módulos)
   ========================================================================= */
.mp-stat-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mp-stat-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-stat-card--warn {
  border-color: var(--mp-status-waiting);
  background: var(--mp-status-waiting-soft);
}

.mp-stat-value {
  color: var(--mp-ink);
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
}

.mp-stat-card--warn .mp-stat-value {
  color: var(--mp-status-waiting);
}

.mp-stat-label {
  color: var(--mp-muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =========================================================================
   METRICS (Dashboard antigo)
   ========================================================================= */
.mp-app-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mp-app-metric {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
}

.mp-app-metric span,
.mp-app-metric small {
  display: block;
  color: var(--mp-muted);
  font-size: 12px;
  line-height: 1.35;
}

.mp-app-metric strong {
  display: block;
  margin: 12px 0 6px;
  color: var(--mp-ink);
  font-size: 28px;
  line-height: 1;
}

/* =========================================================================
   WORKSPACE (split layout)
   ========================================================================= */
.mp-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}

.mp-worklist,
.mp-detail-panel {
  min-width: 0;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
  box-shadow: var(--mp-shadow);
}

.mp-detail-panel {
  padding: 22px;
  position: sticky;
  top: 18px;
}

.mp-detail-panel h2 {
  margin: 8px 0 12px;
  color: var(--mp-ink);
  font-size: 22px;
  line-height: 1.13;
}

.mp-detail-panel > p {
  margin: 0 0 20px;
  color: var(--mp-muted);
  font-size: 14px;
  line-height: 1.65;
}

/* =========================================================================
   FILTER ROW
   ========================================================================= */
.mp-filter-row {
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--mp-line);
  background: var(--mp-panel-soft);
}

.mp-filter-row span {
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--mp-line);
  border-radius: 999px;
  color: var(--mp-muted);
  background: var(--mp-panel);
  font-size: 12px;
  font-weight: 700;
}

.mp-filter-row span.is-active {
  border-color: var(--mp-yellow);
  color: var(--mp-black);
  background: var(--mp-yellow-soft);
}

/* =========================================================================
   WORK ITEMS (list rows)
   ========================================================================= */
.mp-work-items {
  display: grid;
}

.mp-work-item {
  min-width: 0;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  border-bottom: 1px solid var(--mp-line);
  cursor: default;
}

.mp-work-item:last-child {
  border-bottom: 0;
}

.mp-work-item.is-selected {
  background: #fffdf2;
  box-shadow: inset 3px 0 0 var(--mp-yellow);
}

.mp-work-code {
  display: block;
  color: var(--mp-faint);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
}

.mp-work-item h3 {
  margin: 6px 0 5px;
  color: var(--mp-ink);
  font-size: 15px;
  line-height: 1.28;
}

.mp-work-item p {
  margin: 0;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.35;
}

.mp-work-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mp-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* =========================================================================
   STATUS PILLS
   ========================================================================= */
.mp-status-pill {
  min-height: 26px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ededdf;
  color: var(--mp-black);
  font-weight: 800;
}

/* =========================================================================
   DETAIL LIST
   ========================================================================= */
.mp-detail-list {
  margin: 0;
  display: grid;
  border-top: 1px solid var(--mp-line);
}

.mp-detail-list div {
  margin: 0;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--mp-line);
}

.mp-detail-list dt {
  color: var(--mp-muted);
  font-size: 12px;
  font-weight: 800;
}

.mp-detail-list dd {
  margin: 0;
  color: var(--mp-ink);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

.mp-detail-actions {
  margin-top: 18px;
}

/* =========================================================================
   ACTIVITY
   ========================================================================= */
.mp-activity {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--mp-line);
}

.mp-activity h3 {
  margin: 0 0 12px;
  color: var(--mp-ink);
  font-size: 14px;
}

.mp-activity p {
  margin: 0 0 10px;
  padding-left: 14px;
  color: var(--mp-muted);
  border-left: 2px solid var(--mp-yellow);
  font-size: 13px;
  line-height: 1.5;
}

/* =========================================================================
   DATA TABLES
   ========================================================================= */
.mp-data-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  background: var(--mp-panel);
  -webkit-overflow-scrolling: touch;
}

.mp-data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--mp-panel);
}

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

.mp-data-table th {
  color: var(--mp-muted);
  background: var(--mp-panel-soft);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.mp-data-table td {
  color: var(--mp-ink);
  font-size: 13px;
  line-height: 1.45;
}

.mp-data-table td:first-child {
  color: var(--mp-faint);
  font-weight: 800;
}

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

/* =========================================================================
   RECORD CARDS (listas de registros)
   ========================================================================= */
.mp-record-list {
  display: grid;
}

.mp-record-card {
  padding: 16px 18px;
  border-bottom: 1px solid var(--mp-line);
  background: var(--mp-panel);
}

.mp-record-card:last-child {
  border-bottom: 0;
}

.mp-record-card h3 {
  margin: 7px 0 6px;
  color: var(--mp-ink);
  font-size: 15px;
  line-height: 1.28;
}

.mp-record-card p {
  margin: 0;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.45;
}

.mp-record-card dl {
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
}

.mp-record-card dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
}

.mp-record-card dt {
  color: var(--mp-faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mp-record-card dd {
  margin: 0;
  color: var(--mp-ink);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
}

/* =========================================================================
   CARD ACTIONS (Solicitações)
   ========================================================================= */
.mp-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--mp-line);
}

.mp-card-actions a {
  width: auto;
  min-width: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 14px;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  font-size: 12px;
}

.mp-card-actions--single { flex-direction: column; align-items: stretch; }
.mp-card-actions--single a { width: 100%; }
.mp-card-actions__full { width: 100%; }
.mp-card-actions__sep { display:block; width:1px; align-self:stretch; background:#e5e7eb; margin:0 4px; flex-shrink:0; }

/* =========================================================================
   ALERTS
   ========================================================================= */
.mp-alert {
  margin-bottom: 16px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--mp-panel-soft);
  color: var(--mp-ink);
  font-size: 13px;
  line-height: 1.45;
}

.mp-alert--error {
  border-color: var(--mp-status-danger);
  color: var(--mp-status-danger);
}

.mp-alert--success {
  border-color: var(--mp-status-success);
  color: var(--mp-status-success);
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */
.mp-empty-state {
  text-align: center;
  color: var(--mp-muted);
  padding: 28px 16px;
  font-size: 13px;
  line-height: 1.5;
}

/* =========================================================================
   FLOW STEPS
   ========================================================================= */
.mp-flow-steps { display:flex; align-items:center; gap:0; padding:8px 0 4px; }
.mp-flow-step { display:flex; align-items:center; position:relative; flex:1; }
.mp-flow-step + .flow-step::before { content:''; flex:1; height:2px; background:#e5e7eb; margin:0 2px; }
.mp-flow-step.is-done + .mp-flow-step::before { background:#1e3a5f; }
.mp-flow-step.is-active + .mp-flow-step::before { background:#f59e0b; }
.mp-flow-dot { display:inline-block; width:10px; height:10px; border-radius:50%; background:#e5e7eb; border:2px solid #d1d5db; }
.mp-flow-step.is-done .mp-flow-dot { background:#1e3a5f; border-color:#1e3a5f; }
.mp-flow-step.is-active .mp-flow-dot { background:#f59e0b; border-color:#f59e0b; width:14px; height:14px; box-shadow:0 0 0 3px rgba(245,158,11,0.25); }
.mp-flow-label { font-size:9px; color:#6b7280; position:absolute; top:14px; left:50%; transform:translateX(-50%); white-space:nowrap; }
.mp-flow-step.is-active .mp-flow-label { color:#1e3a5f; font-weight:600; }

/* =========================================================================
   OS NAVIGATION STRIP
   ========================================================================= */
.mp-os-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.mp-os-nav-queue {
  min-width: 0;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
  overflow: hidden;
}

.mp-os-nav-queue summary {
  min-height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mp-muted);
  list-style: none;
  background: var(--mp-panel-soft);
  border-bottom: 1px solid var(--mp-line);
}

.mp-os-nav-queue summary::-webkit-details-marker { display: none; }
.mp-os-nav-queue summary::marker { display: none; content: ""; }

.mp-os-nav-queue summary:hover {
  background: #f1f0ea;
}

.mp-os-nav-queue[open] > summary {
  border-bottom-color: var(--mp-line);
}

.mp-os-nav-queue .mp-status-pill {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

.mp-os-nav-items {
  max-height: 260px;
  overflow-y: auto;
}

/* =========================================================================
   OS NAV CARD — compacto
   ========================================================================= */
.mp-os-nav-card {
  padding: 10px 14px;
  border-bottom: 1px solid var(--mp-line);
  cursor: pointer;
  transition: background 0.12s ease;
}

.mp-os-nav-card:last-child {
  border-bottom: 0;
}

.mp-os-nav-card:hover {
  background: #fffdf2;
}

.mp-os-nav-card.is-selected {
  background: #fffdf2;
  box-shadow: inset 3px 0 0 var(--mp-yellow);
}

.mp-os-nav-card-code {
  display: block;
  color: var(--mp-faint);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mp-os-nav-card h4 {
  margin: 3px 0 2px;
  color: var(--mp-ink);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-os-nav-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
  color: var(--mp-muted);
  font-size: 11px;
  line-height: 1.3;
}

.mp-os-nav-card-meta span {
  white-space: nowrap;
}

.mp-os-nav-card-action {
  display: inline-block;
  margin-top: 6px;
}

.mp-os-nav-card-action .mp-app-button {
  min-height: 28px;
  min-width: 0;
  padding: 5px 10px;
  font-size: 11px;
}

/* =========================================================================
   OS ACTION PANEL
   ========================================================================= */
.mp-os-action-panel {
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
  box-shadow: var(--mp-shadow);
}

.mp-os-action-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mp-os-action-status .mp-status-pill {
  font-size: 13px;
  padding: 4px 14px;
}

.mp-os-action-status p {
  margin: 0;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.4;
}

.mp-os-action-buttons {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mp-os-action-buttons .mp-app-button {
  min-height: 40px;
  padding: 0 20px;
  font-size: 13px;
}

.mp-os-action-buttons span {
  font-size: 13px;
  color: var(--mp-muted);
}

.mp-os-action-danger {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--mp-line);
}

.mp-os-action-danger summary {
  cursor: pointer;
  color: var(--mp-status-danger);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mp-os-action-danger summary:hover {
  text-decoration: underline;
}

/* =========================================================================
   OS FUNCTIONAL CARDS (UX-001 Etapa 4)
   ========================================================================= */
.mp-os-card {
  margin-bottom: 18px;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
  box-shadow: var(--mp-shadow);
}

.mp-os-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--mp-line);
  background: var(--mp-panel-soft);
}

.mp-os-card-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mp-muted);
}

.mp-os-card-header .mp-app-ghost {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.mp-os-card-body {
  padding: 18px 22px;
}

.mp-os-card-body .mp-form-grid {
  margin-bottom: 0;
}

.mp-os-card--wide {
  grid-column: 1 / -1;
}

.mp-os-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-os-card-actions .mp-app-ghost {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

/* Content Grid: 2 columns on desktop */
.mp-os-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

@media (max-width: 767px) {
  .mp-os-content-grid {
    grid-template-columns: 1fr;
  }

  .mp-os-card--wide {
    grid-column: auto;
  }
}

/* =========================================================================
   OS EXECUTIVE HEADER
   ========================================================================= */
.mp-os-header {
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
  box-shadow: var(--mp-shadow);
}

.mp-os-header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.mp-os-header-title {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mp-os-header-title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--mp-ink);
}

.mp-os-header-title .mp-status-pill {
  flex-shrink: 0;
}

.mp-os-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mp-os-header-context {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.4;
}

.mp-os-header-context strong {
  color: var(--mp-ink);
  font-weight: 700;
}

.mp-os-header-indicators {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--mp-line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.mp-os-indicator {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mp-os-indicator-label {
  color: var(--mp-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mp-os-indicator-value {
  color: var(--mp-ink);
  font-size: 14px;
  font-weight: 700;
}

.mp-os-indicator-value--warn {
  color: var(--mp-status-waiting);
}

.mp-os-indicator-value--highlight {
  color: var(--mp-yellow);
  font-weight: 800;
}

/* =========================================================================
   SECTION SPACING
   ========================================================================= */
.mp-section + .mp-section { margin-top: 18px; }

/* =========================================================================
   QUICK ACTIONS
   ========================================================================= */
.mp-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

/* =========================================================================
   FORMS
   ========================================================================= */
.mp-system-form {
  padding: 18px;
}

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

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

.mp-form-field {
  min-width: 0;
  margin: 0;
}

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

.mp-form-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--mp-muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mp-form-field input,
.mp-form-field select,
.mp-form-field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--mp-line-strong);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--mp-panel-soft);
  color: var(--mp-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.mp-form-field textarea {
  min-height: 116px;
  padding-top: 12px;
  resize: vertical;
  line-height: 1.5;
}

.mp-form-field input:focus,
.mp-form-field select:focus,
.mp-form-field textarea:focus {
  border-color: var(--mp-yellow);
  box-shadow: 0 0 0 3px rgba(244, 196, 56, 0.22);
}

.mp-form-actions {
  margin-top: 18px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--mp-line);
}

.mp-form-actions .mp-app-button,
.mp-form-actions .mp-app-ghost {
  min-width: 150px;
}

.mp-form-actions span {
  color: var(--mp-muted);
  font-size: 12px;
  line-height: 1.45;
}

/* =========================================================================
   CHECKBOX LIST
   ========================================================================= */
.mp-checkbox-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mp-checkbox-list label {
  min-height: 34px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mp-panel-soft);
  color: var(--mp-ink);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 800;
}

.mp-checkbox-list input {
  flex: 0 0 auto;
}

/* =========================================================================
   FORM DETAILS (collapsible)
   ========================================================================= */
.mp-form-details {
  border: 0;
  padding: 0;
  margin: 0;
}

.mp-form-summary {
  width: 100%;
  min-height: 44px;
  margin: 0;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--mp-panel-soft);
  color: var(--mp-ink);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  list-style: none;
}

.mp-form-summary::-webkit-details-marker { display: none; }
.mp-form-summary::marker { display: none; content: ""; }

.mp-form-summary:hover,
.mp-form-summary:focus-visible {
  border-color: var(--mp-line-strong);
  background: #f1f0ea;
}

.mp-form-summary:focus-visible {
  outline: 3px solid rgba(244, 196, 56, 0.28);
  outline-offset: 2px;
}

.mp-form-details[open] > .mp-form-summary {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.mp-form-details[open] > .mp-panel-heading {
  border-top: 0;
}

/* =========================================================================
   LOGIN
   ========================================================================= */
.mp-login-shell {
  min-height: 100vh;
  padding: clamp(28px, 6vw, 72px);
  display: flex;
  align-items: center;
}

.mp-system-login-page .mp-login-shell {
  flex: 1;
  min-height: 0;
}

.mp-login-shell--app {
  background:
    linear-gradient(90deg, rgba(244, 196, 56, 0.14), transparent 34%),
    var(--mp-bg);
}

.mp-login-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 440px);
  gap: clamp(36px, 7vw, 96px);
  align-items: center;
}

.mp-login-brand--app {
  max-width: 640px;
}

.mp-system-brand-lockup--login {
  margin-bottom: 56px;
}

.mp-system-brand-lockup--login .mp-system-logo {
  width: auto;
  height: clamp(64px, 8vw, 85px);
  max-width: 300px;
}

.mp-system-brand-lockup--login small {
  color: var(--mp-ink);
}

.mp-login-brand h1 {
  margin: 0;
  color: var(--mp-ink);
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.98;
  font-weight: 880;
}

.mp-login-brand p:not(.mp-app-kicker) {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--mp-muted);
  font-size: 17px;
  line-height: 1.65;
}

.mp-login-card--app {
  padding: 24px;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
  box-shadow: var(--mp-shadow);
}

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

.mp-login-form p {
  margin: 0;
}

.mp-login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--mp-muted);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}

.mp-login-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--mp-panel-soft);
  color: var(--mp-ink);
}

.mp-login-form input:disabled {
  opacity: 0.72;
}

.mp-login-note {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--mp-line);
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.55;
}

.mp-login-note strong {
  color: var(--mp-ink);
}

.mp-login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 20px;
}

.mp-login-links a {
  color: var(--mp-ink);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  text-decoration: none;
}

.mp-login-links a:hover,
.mp-login-links a:focus-visible {
  color: var(--mp-black);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 0.28em;
}

.mp-login-footer {
  padding: 0 clamp(28px, 6vw, 72px) 22px;
  background: var(--mp-bg);
}

.mp-login-footer-inner {
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--mp-line);
}

.mp-login-footer p {
  margin: 0;
  color: var(--mp-muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 600;
}

.mp-login-footer a {
  color: var(--mp-ink);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.mp-login-footer a:hover,
.mp-login-footer a:focus-visible {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 0.28em;
}

/* =========================================================================
   BRAND LOCKUP
   ========================================================================= */
.mp-system-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.mp-system-brand-lockup img {
  width: 50px;
  height: 50px;
  display: block;
  object-fit: contain;
  background: transparent;
}

.mp-system-brand-lockup span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mp-system-brand-lockup strong {
  font-family: var(--mp-font-brand);
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1;
  font-weight: 700;
}

.mp-system-brand-lockup small {
  color: var(--mp-muted);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* =========================================================================
   SERVICE SHOWCASE (Solicitação destaque)
   ========================================================================= */
.mp-service-showcase {
  min-width: 0;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  background: var(--mp-black);
  color: #ffffff;
  box-shadow: var(--mp-shadow);
  overflow: hidden;
}

.mp-service-showcase-main {
  padding: 24px;
}

.mp-service-showcase .mp-app-kicker,
.mp-service-showcase .mp-work-code {
  color: rgba(255, 255, 255, 0.62);
}

.mp-service-showcase h2 {
  max-width: 720px;
  margin: 8px 0 14px;
  color: #ffffff;
  font-size: clamp(24px, 3.2vw, 38px);
  line-height: 1.05;
}

.mp-service-showcase-main > p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.65;
}

.mp-service-facts {
  margin: 22px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mp-service-facts div {
  min-width: 0;
  padding: 14px;
  background: var(--mp-black);
}

.mp-service-facts dt,
.mp-service-facts dd {
  margin: 0;
}

.mp-service-facts dt {
  color: var(--mp-yellow);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mp-service-facts dd {
  margin-top: 7px;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

.mp-service-showcase-side {
  padding: 24px;
  display: grid;
  align-content: stretch;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.mp-service-status {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}

.mp-service-status span,
.mp-service-status strong {
  display: block;
}

.mp-service-status span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mp-service-status strong {
  margin-top: 8px;
  color: var(--mp-yellow);
  font-size: 28px;
  line-height: 1;
}

.mp-service-actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.mp-service-actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: var(--mp-yellow);
  color: var(--mp-black);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
}

.mp-service-actions button + button {
  background: transparent;
  color: #ffffff;
}

/* =========================================================================
   SERVICE GROUPS
   ========================================================================= */
.mp-service-groups {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mp-service-groups article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  background: var(--mp-panel-soft);
}

.mp-service-groups strong,
.mp-service-groups span {
  display: block;
}

.mp-service-groups strong {
  color: var(--mp-ink);
  font-size: 24px;
  line-height: 1;
}

.mp-service-groups span {
  margin-top: 8px;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
}

/* =========================================================================
   STEP LIST
   ========================================================================= */
.mp-step-list {
  max-width: 760px;
  display: grid;
  gap: 10px;
}

.mp-step-list p {
  margin: 0;
  padding-left: 14px;
  color: var(--mp-muted);
  border-left: 2px solid var(--mp-yellow);
  font-size: 14px;
  line-height: 1.55;
}

/* =========================================================================
   MODULE GRID
   ========================================================================= */
.mp-module-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.mp-module-grid--clients {
  grid-template-columns: minmax(0, 1fr);
}

/* =========================================================================
   OPERATION PANEL (Dashboard)
   ========================================================================= */
.mp-operation-panel {
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel);
}

.mp-operation-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--mp-line);
  background: var(--mp-panel-soft);
}

.mp-operation-search {
  flex: 1;
  min-width: 200px;
  min-height: 36px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  background: var(--mp-panel);
  color: var(--mp-ink);
}

.mp-operation-search:focus {
  outline: none;
  border-color: var(--mp-yellow);
  box-shadow: 0 0 0 3px rgba(244, 196, 56, 0.22);
}

.mp-operation-head {
  display: grid;
  grid-template-columns: 80px 100px minmax(0, 1fr) 140px 120px 100px 90px;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 2px solid var(--mp-line);
  background: var(--mp-panel-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mp-muted);
}

.mp-operation-row {
  display: grid;
  grid-template-columns: 80px 100px minmax(0, 1fr) 140px 120px 100px 90px;
  gap: 12px;
  padding: 14px 18px;
  align-items: center;
  border-bottom: 1px solid var(--mp-line);
  font-size: 13px;
}

.mp-operation-row:last-child {
  border-bottom: 0;
}

.mp-operation-row:hover {
  background: #fffdf2;
}

.mp-operation-title {
  font-weight: 700;
  color: var(--mp-ink);
}

.mp-operation-code {
  font-weight: 800;
  color: var(--mp-faint);
  font-size: 11px;
  text-transform: uppercase;
}

.mp-operation-type,
.mp-operation-client,
.mp-operation-extra {
  color: var(--mp-muted);
  font-size: 12px;
}

/* =========================================================================
   OPERATION ROW — Card Actions
   ========================================================================= */
.mp-operation-row .mp-card-actions {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

/* =========================================================================
   FORM COMPACT
   ========================================================================= */
.mp-form-compact {
  padding: 16px;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-panel-soft);
}

/* =========================================================================
   INVENTORY ACTIONS
   ========================================================================= */
.mp-inventory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mp-inventory-actions form {
  display: inline-flex;
}

/* =========================================================================
   VALUE BOX
   ========================================================================= */
.mp-value-box {
  background: var(--mp-panel-soft);
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 16px;
}

.mp-value-box strong { display: block; font-size: 22px; margin-top: 4px; }

/* =========================================================================
   USERS
   ========================================================================= */
.mp-users-main {
  align-content: start;
}

.mp-users-create-panel {
  align-self: start;
}

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

.mp-user-role-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mp-user-role-grid label {
  margin: 0;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mp-user-role-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
  accent-color: var(--mp-yellow);
}

.mp-users-table {
  min-width: 920px;
  table-layout: fixed;
}

.mp-users-table th,
.mp-users-table td {
  overflow-wrap: normal;
  word-break: normal;
}

.mp-users-table th:nth-child(1),
.mp-users-table td:nth-child(1) { width: 28%; }
.mp-users-table th:nth-child(2),
.mp-users-table td:nth-child(2) { width: 14%; }
.mp-users-table th:nth-child(3),
.mp-users-table td:nth-child(3) { width: 10%; }
.mp-users-table th:nth-child(4),
.mp-users-table td:nth-child(4) { width: 24%; }
.mp-users-table th:nth-child(5),
.mp-users-table td:nth-child(5) { width: 15%; }
.mp-users-table th:nth-child(6),
.mp-users-table td:nth-child(6) { width: 9%; }

.mp-users-identity strong,
.mp-users-identity span { display: block; }
.mp-users-identity strong { color: var(--mp-ink); }
.mp-users-identity span { margin-top: 4px; color: var(--mp-muted); font-weight: 700; overflow-wrap: anywhere; }
.mp-users-login { overflow-wrap: anywhere; }
.mp-users-roles { line-height: 1.5; }
.mp-users-action { padding-right: 8px; padding-left: 8px; }
.mp-users-action .mp-app-ghost { min-width: 72px; min-height: 32px; padding: 0 8px; }

/* =========================================================================
   FORM TERMS
   ========================================================================= */
.mp-form-terms {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  background: var(--mp-panel-soft);
}

.mp-terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
}

.mp-terms-check input { margin-top: 3px; }

.mp-terms-check a {
  color: var(--mp-ink);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

/* =========================================================================
   ACTION STACK / ACTION ROW
   ========================================================================= */
.mp-action-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mp-action-row { display: flex; flex-wrap: wrap; gap: 8px; }

.mp-action-stack .mp-app-button,
.mp-action-stack .mp-app-ghost,
.mp-action-row .mp-app-button,
.mp-action-row .mp-app-ghost {
  text-align: center;
  justify-content: center;
  white-space: nowrap;
  min-width: 92px;
  padding-left: 10px;
  padding-right: 10px;
}

/* =========================================================================
   OS LIST
   ========================================================================= */
.mp-os-list-summary { justify-content: space-between; }
.mp-os-list-summary .mp-form-toggle-text { min-width: 0; text-align: left; overflow-wrap: anywhere; }
.mp-os-list-summary .mp-status-pill { min-height: 24px; flex: 0 0 auto; }
.mp-os-list-details[open] > .mp-record-list { border-top: 1px solid var(--mp-line); }

/* =========================================================================
   INLINE FLEX UTILITIES
   ========================================================================= */
.mp-inline-flex {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* =========================================================================
   ITEM ACTIVE/INACTIVE
   ========================================================================= */
.mp-item-active { color: var(--mp-status-success); font-weight: 800; }
.mp-item-inactive { color: var(--mp-status-danger); font-weight: 800; }

/* =========================================================================
   READONLY FIELD
   ========================================================================= */
.mp-readonly-field { background: #f4f6f5; }

/* =========================================================================
   CLIENT ACTIONS
   ========================================================================= */
.mp-client-actions { display: flex; gap: 8px; justify-content: flex-end; }
.mp-client-actions .mp-app-ghost { min-width: 92px; min-height: 32px; padding: 0 10px; }
.mp-client-empty { padding: 24px 18px; color: var(--mp-muted); font-size: 14px; }

.mp-client-units-note {
  padding: 14px 18px;
  border-top: 1px solid var(--mp-line);
  background: #fffdf2;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.5;
}

.mp-client-units-note strong { color: var(--mp-ink); }

/* =========================================================================
   UNITS
   ========================================================================= */
.mp-units-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.mp-unit-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--mp-line);
  background: var(--mp-panel-soft);
}

.mp-unit-tab {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  background: var(--mp-panel);
  color: var(--mp-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mp-unit-tab.is-active {
  border-color: var(--mp-yellow);
  background: var(--mp-yellow-soft);
  color: var(--mp-black);
}

/* =========================================================================
   CLIENT TABLE
   ========================================================================= */
.mp-client-table { min-width: 800px; }
.mp-client-name strong,
.mp-client-name span { display: block; }
.mp-client-name span { margin-top: 4px; color: var(--mp-muted); font-size: 12px; }
.mp-client-link { font-weight: 800; text-decoration: none; }
.mp-client-link:hover,
.mp-client-link:focus-visible { text-decoration: underline; text-underline-offset: .2em; }

/* =========================================================================
   MUTED / DIVIDER
   ========================================================================= */
.mp-muted { color: var(--mp-muted); font-size: 14px; }
.mp-mini-divider { height: 1px; background: var(--mp-line); margin: 14px 0; }
.mp-record-card.is-selected { outline: 2px solid var(--mp-yellow); }
.mp-subpanel { margin-top: 18px; }

/* =========================================================================
   ITEMS TOOLBAR
   ========================================================================= */
.mp-items-toolbar { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.mp-items-toolbar form { display:flex; gap:8px; align-items:center; flex:1; }
.mp-items-toolbar input[type=search] { flex:1; min-width:200px; }
.mp-items-toolbar details { flex-shrink:0; }

/* =========================================================================
   FORM GRID AUTO
   ========================================================================= */
.mp-form-grid--auto { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.mp-form-grid--auto .mp-form-field--wide { grid-column:1/-1; }
.mp-form-grid--auto > div { grid-column:1/-1; }
.mp-form-grid--end { grid-template-columns:1fr 1fr auto; align-items:end; }

/* =========================================================================
   MOVEMENT TABS
   ========================================================================= */
.mp-mov-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--mp-line);
  padding-bottom: 0;
}

.mp-mov-tab {
  padding: 10px 18px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--mp-radius) var(--mp-radius) 0 0;
  cursor: pointer;
  background: transparent;
  color: var(--mp-muted);
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}

.mp-mov-tab:hover {
  background: var(--mp-panel-soft);
  color: var(--mp-ink);
}

.mp-mov-tab.is-active {
  background: var(--mp-panel);
  border-color: var(--mp-line);
  color: var(--mp-ink);
  border-bottom-color: var(--mp-panel);
  margin-bottom: -2px;
}

.mp-mov-section { display: none; }
.mp-mov-section.is-active { display: block; }

/* =========================================================================
   ADJUSTMENT CAUTION
   ========================================================================= */
.mp-panel-heading--caution {
  border-left: 3px solid var(--mp-status-danger);
  padding-left: 15px;
}

.mp-form-actions--caution {
  background: var(--mp-status-danger-soft);
  border-radius: 6px;
  padding: 12px 14px;
}

.mp-form-actions--caution .mp-app-button {
  background: var(--mp-status-danger);
  border-color: var(--mp-status-danger);
  color: #fff;
}

/* =========================================================================
   DETAIL GRID
   ========================================================================= */
.mp-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 20px;
}

.mp-detail-grid p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.mp-detail-grid strong {
  color: var(--mp-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 3px;
}

.mp-detail-grid span {
  color: var(--mp-ink);
  font-weight: 700;
}

.mp-detail-grid--padded { padding:18px; }
.mp-quick-actions--padded { padding:4px 18px 18px; }
.mp-checkbox-inline { width:auto; min-height:auto; margin-right:8px; }

/* =========================================================================
   VERSION LABEL
   ========================================================================= */
.mp-version-label { margin:6px 0 14px; padding-left:4px; font-size:11px; color:#8b8f94; }

/* =========================================================================
   SUMMARY (dropdown triggers)
   ========================================================================= */
summary { cursor:pointer; }
