/* Operational presentation shared by ERP modules. */
.work-section { min-width: 0; max-width: 100%; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.payroll-period-settings { grid-template-columns: minmax(0, 1fr); }
.sidebar-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; flex-shrink: 0; background: var(--carbon); border-bottom: 1px solid #ffffff17; }
.sidebar-heading .sidebar-brand { flex: 1; min-width: 0; padding: 12px 8px 12px 14px; gap: 8px; border-bottom: 0; }
.sidebar-heading .sidebar-brand img { width: 36px; height: 36px; }
.sidebar-collapse { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 40px; margin-right: 8px; padding: 0; border: 1px solid #ffffff40; border-radius: 8px; color: #fff; background: transparent; cursor: pointer; }
.sidebar-collapse:hover { background: #ffffff18; }
.sidebar-collapse:focus-visible { outline-color: var(--brand-lime); }
@media (min-width: 821px) {
  body.sidebar-collapsed { --sidebar-width: 76px; }
  .sidebar-collapsed .app-sidebar { scrollbar-gutter: auto; }
  .sidebar-collapsed .sidebar-heading { flex-direction: column; padding-bottom: 8px; }
  .sidebar-collapsed .sidebar-brand { min-height: 56px; padding: 10px; }
  .sidebar-collapsed .sidebar-collapse { flex-basis: 36px; height: 36px; margin: 0; }
  .sidebar-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
  .sidebar-collapsed .sidebar-context, .sidebar-collapsed .sidebar-footer, .sidebar-collapsed .sidebar-nav > p, .sidebar-collapsed .nav-future, .sidebar-collapsed .sidebar-subnav, .sidebar-collapsed .sidebar-module-toggle::after { display: none; }
  .sidebar-collapsed .sidebar-nav { padding: 10px 8px; gap: 5px; }
  .sidebar-collapsed .sidebar-nav a, .sidebar-collapsed .sidebar-module-toggle { justify-content: center; padding: 8px; min-height: 44px; }
  .sidebar-collapsed .sidebar-brand > span, .sidebar-collapsed .sidebar-nav a > span, .sidebar-collapsed .sidebar-module-toggle > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* Navigation cards use the same icon language as action buttons. */
.logistics-access-card { grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 12px; padding: 18px; min-height: 190px; border-radius: 12px; box-shadow: none; }
.logistics-access-card:hover { transform: none; border-color: var(--action-green); background: #f2faf6; box-shadow: 0 0 0 1px var(--action-green); }
.logistics-access-card:focus-visible { outline: 3px solid var(--action-green); }
.logistics-access-code { grid-column: 1; grid-row: 1; border-radius: 10px; }
.logistics-access-code .ui-icon { width: 23px; height: 23px; }
.logistics-access-meta { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; }
.logistics-access-copy { grid-column: 1 / -1; grid-row: 2; }
.logistics-access-copy strong { font-size: 15px; line-height: 1.4; }
.logistics-access-copy small { font-size: 13px; line-height: 1.5; font-weight: 400; }
.logistics-access-open { grid-column: 1 / -1; grid-row: 3; font-size: 12px; text-transform: none; letter-spacing: 0; }
.logistics-access-featured { background: #f2faf6; }
.fleet-resource-nav { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.fleet-resource-nav a { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; grid-template-rows: auto auto; align-content: center; gap: 4px 12px; min-height: 96px; padding: 16px; border-radius: 12px; box-shadow: none; }
.fleet-resource-nav a:hover { border-color: var(--action-green); background: #f2faf6; transform: none; box-shadow: 0 0 0 1px var(--action-green); }
.fleet-resource-nav .fleet-card-icon { grid-column: 1; grid-row: 1 / 3; display: grid; place-items: center; align-self: center; width: 38px; height: 38px; margin: 0; border-radius: 10px; background: #e2f5e9; color: var(--action-green); }
.fleet-card-icon .ui-icon { width: 22px; height: 22px; }
.fleet-resource-nav strong { grid-column: 2; grid-row: 1; font-size: 14px; line-height: 1.4; }
.fleet-resource-nav .fleet-card-description { grid-column: 2; grid-row: 2; font-size: 12px; line-height: 1.5; margin: 0; }
.fleet-resource-nav .fleet-card-arrow { grid-column: 3; grid-row: 1 / 3; align-self: center; color: var(--action-green); margin: 0; }
.stock-alerts-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; margin-bottom: 18px; }
.stock-alerts-heading h2 { grid-column: 1; margin: 0; }
.stock-alerts-heading p { grid-column: 1; margin: 0; white-space: normal; line-height: 1.5; }
.stock-alerts-heading > .status-badge { grid-column: 2; grid-row: 1 / 3; }
.stock-alerts-table td { vertical-align: middle; line-height: 1.5; }
.stock-alerts-table td:first-child { min-width: 185px; }
.stock-alerts .status-badge { display: inline-flex; width: auto; max-width: 100%; border-radius: 6px; padding: 5px 9px; text-transform: none; font-weight: 600; line-height: 1.4; }
.stock-alert-action { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--action-green); font-weight: 600; }
@media (max-width: 600px) {
  .stock-alerts-heading { grid-template-columns: minmax(0, 1fr); }
  .stock-alerts-heading > .status-badge { grid-column: 1; grid-row: auto; justify-self: start; }
  .fleet-resource-nav { grid-template-columns: minmax(0, 1fr); }
}
:root {
  --green: var(--action-green);
  --green-dark: var(--action-green-hover);
  --lime: var(--brand-lime);
  --carbon: var(--brand-carbon);
  --text: var(--brand-carbon);
  --bg: #f5f7f6;
  --line: #dce3df;
  --shadow: 0 3px 12px rgb(32 28 25 / 4%);
}
.surface, .metric-card { min-width: 0; max-width: 100%; box-shadow: var(--shadow); border-radius: 12px; }
.button { gap: 8px; min-height: 40px; font-size: 13px; font-weight: 600; }
.button-small { min-height: 34px; padding: 7px 10px; }
.button:hover { transform: none; box-shadow: none; }
.button-secondary { color: var(--carbon); background: #fff; border-color: #c9d4cd; }
.button-secondary:hover { color: var(--carbon); background: #edf3ef; border-color: #a9b9af; }
.button-ghost:hover { background: #edf3ef; color: var(--carbon); }
.button-primary, .button-primary:hover { color: #fff; }
.button-danger { background: #b42318; color: #fff; }
.button-danger:hover { background: #921d14; color: #fff; }
input, select, textarea { font-size: 14px; }
.field, .stack-form label, .filter-bar label { font-size: 13px; }
th { color: #425149; background: #edf2ef; font-size: 12px; letter-spacing: .025em; }
td, .row-actions a { font-size: 13px; }
th, td { padding: 12px 14px; }
.status-badge { font-size: 12px; }
.summary-strip span { font-size: 12px; letter-spacing: 0; text-transform: none; }
.sidebar-nav i .ui-icon { width: 19px; height: 19px; }
.sidebar-nav a:focus-visible, .sidebar-module-toggle:focus-visible { outline-color: var(--lime); outline-offset: -3px; }
.sidebar-brand img { width: 48px; height: 48px; object-fit: contain; background: transparent; border-radius: 0; }
.customer-directory .filter-bar { flex-wrap: wrap; margin-bottom: 16px; }
.customer-directory .filter-bar > label { flex: 1; min-width: min(280px, 100%); }
.customer-create { scroll-margin-top: 90px; }
.customer-create > summary { cursor: pointer; padding: 4px 0; font-size: 17px; font-weight: 700; }
.customer-create > summary .ui-icon { margin-right: 8px; }
.customer-create[open] > summary { margin-bottom: 20px; }
.customer-help { color: var(--muted); margin: 12px 0 0; font-size: 13px; }
.customer-help summary { cursor: pointer; font-weight: 600; }
.row-actions { gap: 6px; }
/* Consistent module navigation, filters and summaries across the ERP. */
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.page-header:has(.hero-actions > .button:nth-child(5)) { flex-direction: column; align-items: stretch; gap: 16px; }
.page-header:has(.hero-actions > .button:nth-child(5)) > .hero-actions { padding-top: 14px; border-top: 1px solid var(--line); }
.hero-actions .button, .header-actions .button { flex-shrink: 0; }
.filter-bar { flex-wrap: wrap; }
.filter-bar > label { min-width: min(180px, 100%); }
.purchase-filter-form { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.purchase-filter-form .form-actions { grid-column: auto; justify-content: flex-end; }
.form-grid > *, .two-column > *, .filter-bar > * { min-width: 0; }
.summary-strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.summary-strip > div { padding: 16px; background: #fff; border-radius: 12px; }
.summary-strip strong { font-size: 20px; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary-strip.tight strong { font-size: 16px; }
.summary-strip small { color: var(--muted); font-size: 12px; }
td { font-variant-numeric: tabular-nums; }
td > small { line-height: 1.5; }
.status-badge.status-pendiente { color: #805400; background: #fff2d6; }
.status-badge.status-anulado { color: #a42318; background: #ffebe8; }
.status-badge.status-activo { color: #00663d; background: #e2f5e9; }
.button .ui-icon { stroke-width: 1.8; }
.table-wrap .row-actions { align-items: center; }
.table-wrap:focus-visible { outline: 3px solid var(--action-green); outline-offset: 2px; }
.work-section > summary {
  grid-template-columns: max-content minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 4px 14px;
  padding: 18px 20px;
  background: #fff;
}
.work-section > summary::before { grid-column: 1; grid-row: 1 / 3; }
.work-section > summary > span { grid-column: 2; grid-row: 1; overflow-wrap: anywhere; }
.work-section > summary > small { grid-column: 2; grid-row: 2; justify-self: start; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.work-section > summary::after { grid-column: 3; grid-row: 1 / 3; background: #edf3ef; color: var(--green); }
.work-section[open] > summary::after { color: #fff; }
@media (max-width: 760px) {
  .page-header { align-items: flex-start; }
  .button { white-space: normal; text-align: center; }
  .header-actions { width: 100%; }
  .customer-directory .filter-bar { align-items: stretch; }
  .hero-actions, .header-actions { gap: 8px; }
  .hero-actions .button { flex: 1 1 140px; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip > div { padding: 12px; }
  .summary-strip strong { font-size: 18px; }
  .purchase-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-section > summary { grid-template-columns: max-content minmax(0, 1fr); padding: 16px; }
  .work-section > summary::after { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 6px; }
}
@media (max-width: 480px) {
  .purchase-filter-form { grid-template-columns: minmax(0, 1fr); }
  .purchase-filter-form .form-actions { justify-content: stretch; }
  .purchase-filter-form .form-actions .button { flex: 1; }
}
/* Mobile controls and containment: keep table scrolling inside its own panel. */
@media (max-width: 820px) {
  body .button, body .stock-alert-action { min-height: 44px; min-width: 44px; font-size: 14px; line-height: 1.4; }
  body input:not([type=hidden]):not([type=checkbox]):not([type=radio]),
  body select, body textarea { min-width: 0; max-width: 100%; min-height: 44px; font-size: 16px; }
  body .field, body .stack-form label, body .filter-bar label { font-size: 14px; line-height: 1.5; }
  .row-actions, .form-actions { flex-wrap: wrap; gap: 8px; }
  .sidebar-collapse { flex-basis: 44px; height: 44px; }
  .sidebar-nav a, .sidebar-module-toggle { min-height: 44px; }
  .login-shell { grid-template-columns: minmax(0, 1fr); padding: 16px; min-height: 100svh; }
  .login-panel { width: 100%; min-width: 0; max-width: 450px; padding: 24px; margin-inline: auto; }
  .login-brand { flex-wrap: wrap; gap: 20px; }
  .login-brand > div { min-width: 0; }
}
@media (max-width: 480px) {
  .work-section > summary { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .work-section > summary::before { grid-column: 1; grid-row: 1; justify-self: start; }
  .work-section > summary > span { grid-column: 1 / -1; grid-row: 2; }
  .work-section > summary > small { grid-column: 1 / -1; grid-row: 3; }
  .work-section > summary::after { grid-column: 2; grid-row: 1; }
  .login-brand { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 820px) {
  body .tracking-rule-grid select { font-size: 16px; }
  .fleet-view-toggle button { min-height: 44px; padding: 8px 12px; }
  .catalog-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
  .catalog-tabs .tab-link { min-height: 44px; white-space: normal; }
}
@media (max-width: 480px) {
  html, body { min-width: 0; }
  .load-unit-catalog { grid-template-columns: minmax(0, 1fr); }
  .load-unit-card { grid-template-columns: 44px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .load-unit-icon { width: 44px; height: 44px; }
}
@media (max-width: 820px) {
  fieldset { min-width: 0; max-width: 100%; }
}
@media (max-width: 650px) {
  .user-directory-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .user-directory-row > * { min-width: 0; }
  .user-row-menu > summary, .user-row-menu > div a { display: flex; align-items: center; min-height: 44px; font-size: 14px; }
}
