/* GestorPro V95.0 — densidade e organização desktop */
/* ================================================================
   V93.8 — REVISÃO GERAL DE DENSIDADE E ORGANIZAÇÃO
   Desktop mais compacto, informações essenciais em primeiro plano
   e detalhes complementares acessíveis por ações quando necessário.
   ================================================================ */

.order-table-section {
  margin-top: 12px;
}

.order-table-head {
  margin-bottom: 8px;
}

.order-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.order-status-head h4 {
  margin: 0;
}

.order-status-column {
  min-width: 0;
}

.order-board-card {
  display: grid;
  gap: 8px;
}

.order-board-card-main {
  min-width: 0;
}

.order-board-card-main strong,
.order-board-card-main span {
  display: block;
}

.order-board-card-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-board-card-main span + span {
  margin-top: 2px;
}

.order-board-card-actions {
  gap: 6px;
  flex-wrap: nowrap;
}

.order-status-more {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.order-status-empty {
  margin: 6px 0;
  font-size: 0.82rem;
}

.order-summary-modal {
  width: min(760px, 100%);
}

.order-summary-metrics {
  margin-bottom: 12px;
}

.order-summary-details {
  overflow: hidden;
  border: 1px solid rgba(17, 24, 32, 0.10);
  border-radius: 10px;
  background: #F7FAFB;
}

.order-summary-details .split-line {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(17, 24, 32, 0.08);
}

.order-summary-details .split-line:last-child {
  border-bottom: 0;
}

.order-summary-actions {
  margin-top: 12px;
}

.order-status-list-modal {
  width: min(900px, 100%);
}

/* Em telas grandes, reduzimos espaços vazios sem sacrificar legibilidade. */
@media (min-width: 981px) {
  :root {
    --sidebar-width: 244px;
    --table-scroll-max: 418px;
    --desktop-header-height: 58px;
  }

  .sidebar {
    padding: 0 12px 12px;
  }

  .sidebar-brand {
    box-sizing: border-box;
    height: var(--desktop-header-height);
    min-height: var(--desktop-header-height);
    gap: 9px;
    padding: 7px 2px 8px;
  }

  .sidebar-brand .company-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .sidebar-brand strong {
    font-size: 0.92rem;
    line-height: 1.14;
  }

  .sidebar-brand span {
    margin-top: 2px;
    font-size: 0.76rem;
    line-height: 1.15;
  }

  .nav-list {
    gap: 2px;
    margin-top: 10px;
  }

  .nav-list button {
    min-height: 34px;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 7px;
    font-size: 0.82rem;
    line-height: 1.12;
  }

  .nav-list svg {
    width: 16px;
    height: 16px;
  }

  .topbar {
    box-sizing: border-box;
    height: var(--desktop-header-height);
    min-height: var(--desktop-header-height);
    padding: 9px 18px;
  }

  .topbar-title-block h2,
  .topbar h2 {
    margin: 0 0 2px;
    font-size: 1.16rem;
    line-height: 1.2;
  }

  .topbar-meta {
    gap: 7px;
  }

  .topbar-company-name,
  .topbar-date,
  .sync-state {
    font-size: 0.74rem;
    line-height: 1.15;
  }

  .topbar-actions {
    gap: 7px;
  }

  .topbar-icon-btn {
    width: 36px;
    min-width: 36px;
    min-height: 34px;
  }

  .view-root {
    padding: 14px 18px 20px;
  }

  .section-head {
    gap: 10px;
    margin-bottom: 9px;
  }

  .section-head h3 {
    font-size: 1rem;
    line-height: 1.2;
  }

  .section-head p,
  .section-head .muted {
    max-width: 760px;
    margin: 3px 0 0;
    font-size: 0.79rem;
    line-height: 1.3;
  }

  .grid {
    gap: 11px;
  }

  .card,
  .form-card {
    padding: 13px 14px;
  }

  .card:hover,
  .form-card:hover,
  .status-column:hover,
  .dashboard-card:hover {
    transform: none;
  }

  .metric {
    gap: 4px;
    border-top-width: 2px;
  }

  .metric strong {
    font-size: 1.42rem;
    line-height: 1.05;
  }

  .metric small {
    font-size: 0.76rem;
    line-height: 1.2;
  }

  .primary-btn,
  .ghost-btn,
  .danger-btn,
  .success-btn {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 7px;
    font-size: 0.84rem;
  }

  .compact {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .button-row {
    gap: 6px;
  }

  .form-grid {
    gap: 9px 10px;
  }

  label {
    gap: 4px;
    font-size: 0.82rem;
  }

  input,
  select,
  textarea {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 0.85rem;
  }

  textarea {
    min-height: 72px;
  }

  .customer-search-card,
  .product-search-card,
  .payable-search-card,
  .purchase-entry-filter-card,
  .agenda-filter-card {
    gap: 7px;
    margin-bottom: 10px;
  }

  .product-stock-summary,
  .settings-data-tools,
  .order-summary-cards,
  .payable-metrics,
  .report-metrics {
    margin-top: 10px;
    margin-bottom: 10px;
  }

  table {
    min-width: 650px;
    font-size: 0.83rem;
  }

  th,
  td {
    padding: 8px 9px;
    line-height: 1.22;
  }

  th {
    font-size: 0.69rem;
    letter-spacing: 0.035em;
  }

  td .muted,
  td small {
    font-size: 0.74rem;
  }

  .tag,
  .badge,
  .pill {
    font-size: 0.72rem;
  }

  .entity-actions-cell {
    width: 1%;
    white-space: nowrap;
  }

  .entity-actions-cell .button-row,
  .payable-actions-cell .button-row {
    flex-wrap: nowrap;
  }

  .entity-actions-cell .danger-btn,
  .payable-actions-cell .danger-btn {
    padding-inline: 7px;
  }

  /* Dashboard: preserva informação, reduz a altura geral. */
  .dashboard-command {
    gap: 11px;
  }

  .dashboard-main-grid,
  .dashboard-alert-grid,
  .dashboard-ops-grid,
  .dashboard-bottom-grid {
    gap: 11px;
  }

  .dashboard-hero-card,
  .dashboard-panel,
  .dashboard-card {
    padding: 13px 14px;
  }

  .dashboard-card-head {
    gap: 8px;
    margin-bottom: 9px;
  }

  .dashboard-card-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .dashboard-card-icon svg,
  .dashboard-shortcut svg,
  .dashboard-hero-pill svg {
    width: 16px;
    height: 16px;
  }

  .dashboard-kpi {
    min-height: 112px;
    gap: 5px;
  }

  .dashboard-kpi strong {
    font-size: 2rem;
  }

  .dashboard-kpi span,
  .dashboard-kpi small {
    font-size: 0.72rem;
  }

  .dashboard-shortcuts {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
  }

  .dashboard-shortcut {
    min-height: 58px;
    gap: 5px;
    padding: 8px 6px;
    font-size: 0.72rem;
  }

  .dashboard-row,
  .trash-item {
    gap: 8px;
    padding: 8px 9px;
  }

  .dashboard-row strong,
  .trash-item strong {
    margin-bottom: 2px;
    font-size: 0.82rem;
  }

  .dashboard-row .muted,
  .trash-item .muted {
    font-size: 0.73rem;
  }

  .dashboard-large-card {
    min-height: 0;
  }

  .dashboard-mini-metric {
    min-height: 88px;
    gap: 4px;
    padding: 10px;
  }

  .dashboard-mini-metric strong {
    font-size: 1.55rem;
  }

  .dashboard-mini-metric span,
  .dashboard-mini-metric small {
    font-size: 0.68rem;
  }

  /* Ordens: quadro resumido, com até duas OS por etapa e detalhes por ação. */
  .order-status-board {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 8px;
    padding-bottom: 3px;
  }

  .order-status-column {
    padding: 9px;
  }

  .order-status-head h4 {
    font-size: 0.79rem;
  }

  .order-board-card {
    padding: 8px;
    margin-bottom: 6px;
  }

  .order-board-card-main strong {
    font-size: 0.78rem;
  }

  .order-board-card-main span {
    font-size: 0.7rem;
    line-height: 1.2;
  }

  .order-board-card-actions .compact {
    flex: 1 1 0;
  }

  /* Configurações: taxas deixam de ocupar uma coluna vertical enorme. */
  #feesForm {
    margin-top: 11px !important;
  }

  #feesForm .form-grid.three {
    grid-template-columns: repeat(7, minmax(88px, 1fr));
    gap: 8px;
  }

  #feesForm label {
    font-size: 0.74rem;
  }

  #feesForm input {
    text-align: center;
  }

  .settings-data-tools {
    margin-top: 11px;
  }

  .settings-version-footer {
    margin-top: 11px;
    padding: 9px 12px;
  }

  .split-line {
    padding-block: 6px;
  }
}

@media (min-width: 981px) and (max-width: 1220px) {
  :root {
    --sidebar-width: 228px;
  }

  .sidebar {
    padding-inline: 9px;
  }

  .nav-list button {
    font-size: 0.76rem;
  }

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

  .order-status-board {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  #feesForm .form-grid.three {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
  }
}

@media (max-width: 980px) {
  .order-status-board {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 8px;
  }

  .order-summary-metrics {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 620px) {
  .order-status-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-board-card-actions .compact {
    flex: 1 1 0;
  }

  .order-status-list-table table {
    min-width: 620px;
  }
}

