:root {
  --bg: #ffffff;
  --accent: #ff8210;
  --accent-light: #fff4e8;
  --text: #1a1a1a;
  --danger: #a3382f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #f7d183;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  min-height: 100vh;
  background: #f7d183;
  color: var(--text);
}

body.home {
  background-color: #f7d183;
}

body.tracking-page {
  background-color: #f7d183;
}

body.commission-page {
  background-color: #f7d183;
}

body.budget-page {
  background-color: #f7d183;
}

body.login-page {
  background: linear-gradient(180deg, #f7d183 0%, #f9e1a8 100%);
}

body.home .container {
  padding-top: 36px;
}

body.home .hero {
  background: rgba(255, 255, 255, 0.9);
  border-color: #ffd9bb;
  box-shadow: 0 18px 40px rgba(255, 130, 16, 0.08);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #fff6eb;
  border-right: 1px solid #f2d2b5;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: width 0.2s ease-in-out;
  z-index: 10;
  overflow: hidden;
}

.sidebar.is-collapsed {
  width: 72px;
  padding: 16px 10px;
}

.sidebar.is-collapsed .profile-name,
.sidebar.is-collapsed .profile-role,
.sidebar.is-collapsed .label {
  display: none;
}

.sidebar.is-collapsed .nav-link {
  justify-content: center;
  padding: 12px;
}

.sidebar.is-collapsed .icon {
  margin: 0;
}

.sidebar.is-collapsed .sidebar-profile {
  justify-content: center;
  width: 100%;
  padding: 0;
}

.sidebar:hover {
  width: 260px;
}

.sidebar:hover .profile-name,
.sidebar:hover .profile-role,
.sidebar:hover .label {
  display: inline;
}

body.sidebar-left-aligned .sidebar.is-collapsed:hover .nav-link {
  justify-content: flex-start;
  padding: 10px 14px;
  text-align: left;
}

body.sidebar-left-aligned .sidebar.is-collapsed:hover .icon {
  margin: 0;
  flex: 0 0 22px;
}

body.sidebar-left-aligned .sidebar.is-collapsed:hover .label {
  text-align: left;
}

body.sidebar-left-aligned .sidebar.is-collapsed:hover .sidebar-profile {
  justify-content: flex-start;
  padding: 0 4px;
}

body.sidebar-left-aligned .sidebar.is-collapsed:hover .sidebar-nav,
body.sidebar-left-aligned .sidebar.is-collapsed:hover .sidebar-footer {
  justify-items: stretch;
}

body.sidebar-left-aligned .sidebar.is-collapsed:hover .sidebar-logout,
body.sidebar-left-aligned .sidebar.is-collapsed:hover .nav-button {
  width: 100%;
}

.sidebar-profile {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: 0 0 40px;
  margin-left: 2px;
}

.profile-name {
  font-weight: 700;
}

.profile-role {
  font-size: 12px;
  color: #8a4b08;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #8a4b08;
  font-weight: 600;
  white-space: nowrap;
  min-width: 0;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #8a4b08;
}

.icon svg {
  width: 20px;
  height: 20px;
}

.nav-link span:not(.icon) {
  display: inline-block;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: #ffe3c7;
  color: #8a4b08;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.sidebar-logout {
  margin: 0;
}

.nav-button {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.with-sidebar {
  margin-left: 72px;
  padding-left: 24px;
}

.container.with-sidebar {
  max-width: 1500px;
  margin-left: calc(72px + (100vw - 1500px) / 2);
  padding-left: 24px;
  padding-right: 24px;
  min-height: 100vh;
}

.hero {
  padding: 40px;
  background: var(--accent-light);
  border-radius: 12px;
  border: 1px solid #ffd3ad;
  text-align: center;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
}

.hero-brand h1 {
  margin: 0;
  letter-spacing: 0.08em;
}

.hero-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: 40px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #ffd3ad;
  box-shadow: 0 18px 40px rgba(255, 130, 16, 0.12);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.login-logo {
  width: min(260px, 78%);
  height: auto;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  letter-spacing: 0.08em;
}

.login-subtitle {
  margin: 0 0 20px;
  color: #8a4b08;
}

.login-help {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: #8a4b08;
}

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

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

.page-actions form {
  margin: 0;
}

.home-track-header {
  justify-content: center;
  width: 100%;
  text-align: center;
  margin-top: 70px;
}

.home-track-header h2 {
  width: 100%;
  margin: 0;
  text-align: center;
}

.home-services-header {
  max-width: 980px;
  margin: 0 auto 32px;
  text-align: center;
}

.home-services-logo {
  display: block;
  width: min(260px, 58vw);
  height: auto;
  margin: 0 auto 14px;
  filter: drop-shadow(0 12px 22px rgba(255, 130, 16, 0.16));
}

.home-services-header h1 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.05;
}

.home-services-header p {
  max-width: 720px;
  margin: 14px auto 0;
  color: #8a4b08;
  font-size: 16px;
  line-height: 1.55;
}

.home-services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.home-service-card {
  display: grid;
  min-height: 226px;
  gap: 14px;
  align-content: start;
  padding: 30px;
  border: 1px solid #ffe0c5;
  border-radius: 22px;
  background: rgba(255, 253, 249, 0.95);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  box-shadow: 0 18px 36px rgba(255, 130, 16, 0.08);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

button.home-service-card {
  width: 100%;
  border-color: #ffe0c5;
  font: inherit;
  cursor: pointer;
}

.home-service-card:hover,
.home-service-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 24px 48px rgba(255, 130, 16, 0.15);
  outline: none;
}

.home-service-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 16px;
  background: #fff0df;
  color: var(--accent);
}

.home-service-icon svg {
  width: 22px;
  height: 22px;
}

.home-service-card strong {
  font-size: 22px;
  line-height: 1.15;
}

.home-service-card small {
  color: #675544;
  font-size: 14px;
  line-height: 1.45;
}

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

.tool-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px;
  border: 1px solid #dedede;
  border-radius: 8px;
  background: #ffffff;
}

.tool-card-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.tool-card-header h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.tool-card-header p {
  margin: 0;
  color: #666666;
  line-height: 1.45;
}

.tool-form {
  margin: 0;
}

.tool-download-button {
  justify-content: center;
  border-color: #15803d;
  background: #16a34a;
  color: #ffffff;
}

.tool-download-button:hover {
  background: #15803d;
  color: #ffffff;
}

.code-association-table-container {
  border: 1px solid #dedede;
  border-radius: 8px;
}

.code-association-table th:last-child,
.code-association-table td:last-child {
  width: 310px;
  text-align: center;
}

.code-association-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.code-association-actions form {
  margin: 0;
}

.code-association-dialog {
  width: min(640px, calc(100vw - 32px));
}

@media (max-width: 820px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .code-association-table th:last-child,
  .code-association-table td:last-child {
    width: auto;
    min-width: 270px;
  }
}

.home-service-link {
  align-self: end;
  color: var(--accent);
  font-weight: 800;
}

.home-quick-track-dialog {
  width: min(540px, calc(100vw - 32px));
}

.home-quick-carrier-select,
.home-quick-form label,
.home-create-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.home-quick-carrier-select {
  max-width: 100%;
  margin-bottom: 18px;
}

.home-quick-form {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 12px;
  max-width: 100%;
  margin: 0;
}

.home-quick-form .btn {
  grid-column: 1 / -1;
  min-height: 42px;
  width: 100%;
  justify-self: stretch;
}

.home-quick-panel {
  display: grid;
  gap: 16px;
}

.home-quick-panel[hidden] {
  display: none !important;
}

.home-quick-result {
  margin: 0;
  border-radius: 16px;
  border: 1px solid #f2d2b5;
  background: #fffaf4;
}

.home-quick-result h4 {
  margin: 0 0 10px;
  font-size: 18px;
}

.home-create-details {
  padding: 14px;
  border: 1px solid #f2d2b5;
  border-radius: 16px;
  background: #fffdf9;
}

.home-create-details summary {
  display: inline-flex;
  width: auto;
  min-width: 160px;
  justify-content: center;
  list-style: none;
  cursor: pointer;
}

.home-create-details summary::-webkit-details-marker {
  display: none;
}

.home-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: none;
  margin: 16px 0 0;
}

.home-create-form .btn {
  grid-column: 1 / -1;
}

@media (max-width: 1100px) {
  .home-services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .home-services-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .home-service-card {
    min-height: 0;
    padding: 22px;
  }

  .home-quick-form,
  .home-create-form {
    grid-template-columns: 1fr;
  }

  .home-quick-form .btn,
  .home-create-form .btn {
    width: 100%;
  }
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  white-space: nowrap;
}

.table th,
.table td {
  border: 1px solid #f2d2b5;
  padding: 10px;
  text-align: center;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.actions .btn {
  min-width: 96px;
}

.table th:last-child,
.table td:last-child {
  width: 225px;
}

.actions form {
  margin: 0;
}

.table-container {
  width: 100%;
  overflow-x: auto;
}

.form {
  display: grid;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 6px;
}

input,
select,
textarea {
  padding: 8px;
  border: 1px solid #f2d2b5;
  border-radius: 6px;
  font-size: 14px;
}

.btn {
  padding: 8px 14px;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  text-align: center;
  line-height: 1.2;
  min-height: 38px;
}

.btn.primary {
  background: #ff8210;
  color: #ffffff;
  border-color: #ff8210;
  box-shadow: none;
  padding: 12px 18px;
}

.btn.primary:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.btn.primary:active {
  transform: translateY(0);
}

.btn.danger {
  background: #fef2f2;
  border-color: #e53935;
  color: #b71c1c;
}

.btn.danger:hover {
  background: #fde7e7;
  border-color: #d32f2f;
}

.btn.danger.solid {
  background: #e53935;
  border-color: #e53935;
  color: #ffffff;
}

.btn.danger.solid:hover {
  background: #d32f2f;
  border-color: #d32f2f;
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
  min-width: 96px;
  min-height: 32px;
  line-height: 1;
}

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

.form .btn {
  width: 100%;
}

.page-header .btn {
  min-width: 180px;
}

.filter-form .btn {
  min-width: 160px;
}

.track-form {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 20px;
}

.track-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #f2d2b5;
  border-radius: 10px;
  font-size: 14px;
  background: #ffffff;
}

.track-btn {
  min-width: 160px;
  min-height: 42px;
}

.settings-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #f2d2b5;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 28px rgba(255, 130, 16, 0.08);
}

.settings-section-header h3,
.settings-card h4,
.settings-card h5 {
  margin: 0 0 8px;
}

.settings-tabs {
  display: flex;
  gap: 14px;
  border-bottom: 1px solid #e3d7ca;
  margin-bottom: 22px;
  padding-bottom: 2px;
  overflow-x: auto;
}

.settings-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #8a95a7;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 2px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.settings-tab:hover {
  color: #5b6678;
}

.settings-tab.is-active {
  color: #ff8210;
  border-bottom-color: #ff8210;
}

.settings-section {
  display: none;
  gap: 14px;
}

.settings-section.is-active {
  display: grid;
}

.settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-section-header p {
  margin: 0;
  color: #8a4b08;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.settings-grid-form {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: end;
}

.settings-grid-span-all {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.settings-card-toolbar p {
  margin: 4px 0 0;
  color: #8a4b08;
  font-size: 13px;
  line-height: 1.4;
}

.settings-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.settings-muted {
  margin: 4px 0 0;
  color: #8a4b08;
  font-size: 13px;
}

.settings-form {
  max-width: none;
  margin: 0;
}

.settings-form-compact {
  margin-top: 18px;
}

.settings-actions-row {
  display: flex;
  align-items: flex-end;
}

.profile-table td {
  text-align: center;
}

.settings-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid #e8ded3;
  border-radius: 12px;
  background: #fffaf4;
}

.settings-switch-row span {
  display: grid;
  gap: 4px;
}

.settings-switch-row small {
  color: #7f6a58;
  font-size: 12px;
  line-height: 1.4;
}

.settings-inline-switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 40px;
  font-weight: 700;
}

.settings-capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.settings-capability-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #f2d2b5;
  border-radius: 14px;
  background: #fffaf4;
}

.settings-capability-card strong {
  color: #8a4b08;
}

.settings-capability-card span {
  color: #5f5f5f;
  font-size: 13px;
  line-height: 1.45;
}

.profile-matrix-table th,
.profile-matrix-table td {
  white-space: normal;
}

.settings-entity-table th:last-child,
.settings-entity-table td:last-child {
  width: 140px;
  text-align: center;
}

.settings-entity-table .actions {
  justify-content: center;
}

.profile-name-cell {
  min-width: 220px;
}

.profile-summary-cell {
  min-width: 120px;
}

.profile-summary-cell strong,
.profile-summary-cell span {
  display: block;
}

.profile-summary-cell span {
  font-size: 12px;
  color: #7f6a58;
  margin-top: 4px;
}

.settings-profile-form {
  margin-top: 18px;
}

.settings-modal-open {
  overflow: hidden;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.settings-modal.is-open {
  display: flex;
}

.settings-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.48);
}

.settings-modal-dialog {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #f2d2b5;
  border-radius: 18px;
  background: #fffaf4;
  box-shadow: 0 24px 70px rgba(26, 26, 26, 0.22);
  padding: 26px;
}

.settings-modal-dialog-wide {
  width: min(1020px, calc(100vw - 32px));
}

.settings-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #fff1e4;
  color: #8a4b08;
  cursor: pointer;
  font-weight: 800;
}

.settings-modal-header {
  margin-bottom: 18px;
}

.settings-modal-header span {
  display: block;
  color: #a4550a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-modal-header h3 {
  margin: 5px 42px 0 0;
  font-size: 26px;
}

.settings-modal-actions,
.settings-modal-secondary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.settings-modal-secondary {
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid #f2d2b5;
}

.settings-modal-secondary .inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.settings-modal-secondary input {
  min-height: 36px;
}

.settings-profile-modal-form {
  display: grid;
  gap: 16px;
}

.settings-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
  flex: 0 0 46px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d6dbe3;
  transition: all 0.2s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch-slider {
  background: #ff8210;
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.commission-shell {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.commission-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #f2d2b5;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 28px rgba(255, 130, 16, 0.08);
  margin-bottom: 20px;
}

.commission-subtitle {
  margin: 0 0 14px;
  color: #8a4b08;
  line-height: 1.5;
}

.commission-warning-banner {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 4px solid #ff8210;
  background: #fff4e8;
  color: #8a4b08;
  border-radius: 10px;
}

.commission-form,
.commission-targets-form {
  max-width: none;
  margin: 0;
}

.commission-close-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.commission-close-actions form {
  margin: 0;
}

.commission-table th,
.commission-table td {
  white-space: normal;
}

.commission-revenue-table thead th {
  background: #143949;
  color: #ffffff;
  border-color: #0f2a36;
  font-weight: 700;
}

.commission-revenue-table thead th:first-child {
  background: #f7f1e8;
  color: #1a1a1a;
  border-color: #f2d2b5;
}

.commission-revenue-table thead th:nth-last-child(2) {
  background: #5d98d3;
  color: #ffffff;
}

.commission-revenue-table thead th:last-child {
  background: #f7f1e8;
  color: #1a1a1a;
  border-color: #f2d2b5;
}

.commission-revenue-row td:first-child {
  background: #e9a372;
  color: #ffffff;
  font-weight: 700;
}

.commission-revenue-row td:nth-child(2),
.commission-revenue-row td:nth-child(3),
.commission-revenue-row td:nth-child(4) {
  background: #edf2f8;
}

.commission-revenue-row td:nth-last-child(2) {
  background: #eef6ff;
}

.commission-revenue-row td:last-child {
  background: #f8fbff;
  color: #5b6b76;
}

.commission-revenue-total td:first-child {
  background: #5d98d3;
  color: #ffffff;
  font-weight: 700;
}

.commission-revenue-total td:nth-child(2),
.commission-revenue-total td:nth-child(3),
.commission-revenue-total td:nth-child(4) {
  background: #eef8d8;
  font-weight: 700;
}

.commission-revenue-total td:nth-last-child(2) {
  background: #2c6f3c;
  color: #ffffff;
  font-weight: 700;
}

.commission-revenue-total td:last-child {
  background: #f7f1e8;
  color: #5b6b76;
}

.commission-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.commission-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.commission-preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.commission-preview-pill {
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid #f2d2b5;
  border-radius: 12px;
  background: #fffaf4;
  text-align: left;
}

.commission-preview-pill span,
.commission-preview-pill strong {
  display: block;
}

.commission-preview-pill span {
  font-size: 12px;
  color: #8a4b08;
}

.commission-preview-pill strong {
  margin-top: 4px;
  font-size: 18px;
}

.commission-preview-meta {
  margin-bottom: 14px;
}

.commission-total-pill {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #f2d2b5;
  background: #fff8f1;
  min-width: 150px;
}

.commission-status-cell {
  min-width: 110px;
}

.commission-status-value {
  font-weight: 700;
  margin-bottom: 8px;
}

.commission-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(138, 75, 8, 0.12);
  margin-bottom: 8px;
}

.commission-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd19c, #ff8210);
}

.commission-progress-abaixo {
  background: linear-gradient(90deg, #ffb4b0, #d55d50);
}

.commission-progress-faixa-1 {
  background: linear-gradient(90deg, #ffe2a5, #e3aa24);
}

.commission-progress-faixa-2 {
  background: linear-gradient(90deg, #ffe5a2, #c98e00);
}

.commission-progress-faixa-3 {
  background: linear-gradient(90deg, #bde9b0, #2f8b3a);
}

.commission-progress-sem-meta {
  background: linear-gradient(90deg, #d7d7d7, #a4a4a4);
}

.commission-status-hint,
.commission-status-gap {
  font-size: 12px;
  line-height: 1.35;
}

.commission-status-hint {
  font-weight: 700;
  margin-bottom: 2px;
}

.commission-status-gap {
  color: #6b5a49;
}

.commission-status-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 20px;
  align-items: start;
}

.commission-status-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.commission-status-panel {
  background: #fffaf4;
  border: 1px solid #f2d2b5;
  border-radius: 14px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.commission-status-main {
  min-width: 0;
}

.commission-status-layout-single .commission-status-main th,
.commission-status-layout-single .commission-status-main td {
  min-width: 0;
  width: auto;
}

.commission-status-equal-col {
  width: auto;
}

.commission-status-main .table,
.commission-status-targets .table {
  width: 100%;
  background: transparent;
  table-layout: fixed;
}

.commission-status-main th,
.commission-status-main td,
.commission-status-targets th,
.commission-status-targets td {
  padding: 7px 8px;
}

.commission-status-main tbody tr,
.commission-status-targets tbody tr {
  height: 58px;
}

.commission-status-main th,
.commission-status-main td {
  min-width: 110px;
}

.commission-status-targets th,
.commission-status-targets td {
  width: 33.33%;
}

.commission-status-cell.abaixo {
  background: #fff1f1;
  color: #a3382f;
}

.commission-status-cell.faixa-1 {
  background: #fff6dd;
  color: #9a6b00;
}

.commission-status-cell.faixa-2 {
  background: #fff2c6;
  color: #8a5c00;
}

.commission-status-cell.faixa-3 {
  background: #e7f7df;
  color: #256c2d;
}

.commission-status-cell.sem-meta {
  background: #ececec;
  color: #6f6f6f;
}

.commission-status-targets {
  width: 480px;
  justify-self: end;
}

.commission-targets-modal-dialog {
  width: min(860px, calc(100vw - 32px));
}

.commission-status-targets-modal-panel {
  width: 100%;
  justify-self: stretch;
  padding: 14px;
}

.commission-target-table th {
  white-space: nowrap;
  width: 33.33%;
}

.commission-target-table th:last-child,
.commission-target-table td:last-child {
  width: 33.33% !important;
}

.commission-target-table-with-units th,
.commission-target-table-with-units td,
.commission-target-table-with-units th:last-child,
.commission-target-table-with-units td:last-child {
  width: 25% !important;
}

.commission-target-unit {
  font-weight: 700;
  background: #fffaf4;
  color: #1a1a1a;
}

.commission-target {
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  width: 33.33%;
}

.commission-target.faixa-1 {
  background: #fff1f1;
  color: #a3382f;
}

.commission-target.faixa-2 {
  background: #fff2c6;
  color: #8a5c00;
}

.commission-target.faixa-3 {
  background: #e7f7df;
  color: #256c2d;
}

.commission-target.sem-meta {
  background: #ececec;
  color: #6f6f6f;
}

.commission-row-muted td {
  background-color: #f1f1f1;
  color: #6b6b6b;
}

.commission-row-muted td strong {
  color: #5f5f5f;
}

.commission-goal-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.commission-goal-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #f2d2b5;
  border-radius: 12px;
  background: #fffaf4;
}

.commission-goal-card.is-muted {
  background: #ededed;
  color: #656565;
}

.commission-goal-header,
.commission-goal-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.commission-goal-header span {
  font-weight: 700;
  color: #8a4b08;
}

.commission-goal-meta {
  font-size: 12px;
  color: #6b5a49;
}

.commission-goal-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #f0e0d0;
  border: 1px solid rgba(138, 75, 8, 0.12);
}

.commission-goal-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.commission-goal-pendente {
  background: linear-gradient(90deg, #ffd19c, #ff8210);
}

.commission-goal-atingida {
  background: linear-gradient(90deg, #bde9b0, #2f8b3a);
}

.commission-goal-sem-meta {
  background: linear-gradient(90deg, #d7d7d7, #a4a4a4);
}

.reports-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  max-width: none;
  margin: 0;
}

.budget-margin-card,
.budget-margin-results {
  display: grid;
  gap: 18px;
}

.budget-page-subtitle {
  margin-top: 8px;
  max-width: 720px;
}

.budget-margin-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.budget-margin-hero-copy h3 {
  margin: 10px 0 10px;
  font-size: 28px;
}

.budget-margin-hero-copy p {
  margin: 0;
  max-width: 720px;
  color: #7a4e1d;
  line-height: 1.6;
}

.budget-margin-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff1de;
  border: 1px solid #ffd4aa;
  color: #a85b09;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.budget-margin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.budget-margin-formula {
  display: grid;
  gap: 6px;
  min-width: 280px;
  padding: 12px 14px;
  border: 1px solid #f2d2b5;
  border-radius: 12px;
  background: #fff8f1;
  color: #8a4b08;
  font-size: 13px;
  line-height: 1.4;
}

.budget-margin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 18px;
  align-items: stretch;
  width: 100%;
  max-width: none;
  margin: 0;
}

.budget-input-card {
  position: relative;
  padding: 22px 18px 18px;
  border: 1px solid #f2d2b5;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf9 0%, #fff7ef 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  min-width: 0;
}

.budget-input-card label {
  display: grid;
  gap: 10px;
  margin: 0;
  color: #482405;
  font-weight: 700;
  min-width: 0;
}

.budget-input-step {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff8210;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.budget-input-help {
  font-size: 12px;
  line-height: 1.45;
  color: #8a6a4b;
  font-weight: 400;
}

.budget-input-shell {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #ffd1af;
  min-width: 0;
}

.budget-input-prefix {
  color: #a85b09;
  font-weight: 700;
}

.budget-input-shell input {
  border: 0;
  padding: 0;
  font-size: 26px;
  font-weight: 700;
  background: transparent;
  color: #1f1409;
  outline: none;
  width: 100%;
  min-width: 0;
}

.budget-input-shell input::placeholder {
  color: #c4a78a;
}

.budget-margin-submit {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.budget-margin-submit .btn {
  min-width: 220px;
  height: 48px;
  width: auto;
}

.budget-margin-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.budget-margin-meta {
  display: flex;
  justify-content: flex-end;
}

.budget-margin-meta-pill {
  min-height: 86px;
  align-content: center;
}

.budget-margin-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.budget-margin-result-card {
  gap: 16px;
}

.budget-margin-result-accent {
  border-color: #f1c899;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 247, 236, 0.98) 100%);
}

.budget-margin-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.budget-margin-result-header h3 {
  margin: 0;
}

.budget-margin-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.budget-margin-metric {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fffaf4;
  border: 1px solid #f3dbc2;
}

.budget-margin-metric span {
  font-size: 12px;
  color: #8a6a4b;
}

.budget-margin-metric strong {
  font-size: 24px;
  color: #3b2208;
}

.budget-margin-metric-highlight {
  background: #fff2e2;
  border-color: #ffc68f;
}

.budget-margin-metric-highlight strong {
  color: #a35405;
}

.readonly-field {
  background: #f6f6f6;
  color: #666666;
  border-color: #d7d7d7;
  cursor: default;
}

.readonly-field:focus {
  outline: none;
  box-shadow: none;
}

.flat-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.carrier-section {
  display: grid;
  gap: 12px;
}

.carrier-table th,
.carrier-table td {
  vertical-align: middle;
}

.transportadoras-table th:last-child,
.transportadoras-table td:last-child {
  width: 180px;
}

.transportadoras-table td.actions {
  display: table-cell;
  text-align: center;
  vertical-align: middle;
  border-left-color: #f2d2b5;
}

.transportadoras-table .inline-form {
  display: inline-flex;
}

.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.add-carrier-form {
  display: grid;
  gap: 14px;
}

.add-carrier-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.add-carrier-actions {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  margin-top: 4px;
}

.add-carrier-actions .btn {
  min-width: 180px;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: none;
}

@media (max-width: 768px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .with-sidebar {
    margin-left: 0;
    padding-left: 20px;
  }

  .container.with-sidebar {
    margin-left: 0;
  }

  .bottom-actions {
    left: 20px;
    right: 20px;
  }

  .bottom-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .page-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .page-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .table {
    font-size: 12px;
  }

  .form-inline {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header .btn,
  .filter-form .btn,
  .btn {
    width: 100%;
    min-width: 0;
  }

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

  .commission-preview-header {
    flex-direction: column;
  }

  .commission-preview-summary {
    width: 100%;
    justify-content: stretch;
  }

  .commission-status-layout {
    grid-template-columns: 1fr;
  }

  .commission-status-targets {
    width: 100%;
    justify-self: stretch;
  }

  .settings-card-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .add-carrier-actions {
    justify-content: stretch;
  }

  .add-carrier-actions .btn {
    width: 100%;
  }

  .track-btn {
    width: 100%;
  }

  .tracking-modal {
    padding: 12px;
  }

  .tracking-modal-dialog {
    padding: 20px 16px;
  }

  .tracking-modal-dialog-create {
    width: min(100%, calc(100vw - 24px));
  }

  .tracking-modal-form-grid {
    grid-template-columns: 1fr;
  }

  .tracking-create-actions {
    justify-content: stretch;
  }

  .tracking-create-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .tracking-modal-header {
    flex-direction: column;
  }

  .tracking-modal-stepper {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tracking-modal-stepper::before {
    display: none;
  }

  .tracking-step {
    justify-items: start;
    text-align: left;
    grid-template-columns: 34px 1fr;
    align-items: center;
  }
}

.tracking-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tracking-overview-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #f2d2b5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.tracking-overview-label {
  color: #8a4b08;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tracking-overview-card strong {
  font-size: 18px;
}

.tracking-table th,
.tracking-table td {
  vertical-align: middle;
  white-space: normal;
}

.tracking-row {
  background: rgba(255, 255, 255, 0.94);
}

.tracking-row.is-overdue {
  background: #fff3f0;
}

.tracking-row.is-stale {
  box-shadow: inset 4px 0 0 #ffca8c;
}

.tracking-last-update {
  display: grid;
  gap: 2px;
}

.tracking-last-update-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a4b08;
}

.tracking-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tracking-signals-compact {
  justify-content: center;
}

.tracking-flag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #f2d2b5;
  background: #fff8f1;
  color: #8a4b08;
  font-size: 12px;
  font-weight: 700;
}

.tracking-flag-danger {
  background: #fff1f1;
  border-color: #f0b6b2;
  color: #a3382f;
}

.tracking-flag-warning {
  background: #fff7ed;
  border-color: #ffb26f;
  color: #a04d00;
}

.tracking-flag-neutral {
  background: #fff8f1;
  border-color: #f2d2b5;
  color: #8a4b08;
}

.tracking-compact-table th,
.tracking-compact-table td {
  padding: 10px 8px;
}

.tracking-compact-table th:first-child,
.tracking-compact-table td:first-child {
  min-width: 170px;
}

.tracking-compact-note {
  display: grid;
  gap: 4px;
}

.tracking-compact-note strong {
  font-size: 15px;
}

.tracking-compact-note span,
.tracking-compact-email {
  color: #6a5848;
  font-size: 13px;
}

.tracking-last-update-compact {
  min-width: 135px;
}

.tracking-timeline {
  position: relative;
  display: grid;
  gap: 10px;
}

.tracking-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #f2d2b5;
}

.tracking-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
}

.tracking-timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff8210;
  border: 2px solid #fffaf4;
  margin-top: 4px;
  z-index: 1;
}

.tracking-timeline-content {
  display: grid;
  gap: 2px;
}

.tracking-timeline-label {
  font-size: 12px;
  color: #8a4b08;
}

.tracking-modal-open {
  overflow: hidden;
}

.tracking-actions-cell {
  display: table-cell;
  vertical-align: middle !important;
  width: 96px !important;
  min-width: 96px;
  text-align: center;
}

.tracking-compact-table th:last-child,
.tracking-compact-table td:last-child {
  width: 96px !important;
  min-width: 96px;
}

.tracking-actions-cell .btn {
  display: inline-flex;
}

.tracking-actions-cell .btn.small {
  min-width: 0;
  width: auto;
}

.tracking-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 30;
}

.tracking-modal.is-open {
  display: flex;
}

.tracking-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.48);
}

.tracking-modal-dialog {
  position: relative;
  width: min(1120px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  background: #fffdf9;
  border: 1px solid #f2d2b5;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.18);
  padding: 24px;
}

.tracking-modal-dialog.home-quick-track-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 22px 24px;
}

.tracking-modal-dialog-wide {
  width: min(1540px, calc(100vw - 16px));
}

.tracking-modal-dialog-create {
  width: min(920px, calc(100vw - 32px));
  padding: 24px;
}

.tracking-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #fff4e8;
  color: #8a4b08;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

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

.tracking-modal-kicker,
.tracking-modal-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a4b08;
}

.tracking-modal-header h3 {
  margin: 6px 0 0;
  font-size: 28px;
}

.tracking-modal-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  border-bottom: 1px solid #dfdfdf;
}

.tracking-modal-tab {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #666666;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tracking-modal-tab:hover {
  color: #202020;
}

.tracking-modal-tab.is-active {
  border-bottom-color: #c96d18;
  color: #8a4b08;
}

.tracking-modal-tab-panel[hidden] {
  display: none;
}

.tracking-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tracking-modal-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #f2d2b5;
  background: #fff8f1;
}

.tracking-modal-email {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tracking-modal-message {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fffaf4;
  border: 1px solid #f2d2b5;
}

.tracking-modal-message p {
  margin: 8px 0 0;
  color: #5f5f5f;
  line-height: 1.5;
  font-size: 15px;
}

.tracking-collection-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid #dedede;
  border-radius: 8px;
  background: #dedede;
}

.tracking-collection-summary > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  background: #ffffff;
}

.tracking-collection-summary strong {
  overflow-wrap: anywhere;
}

.tracking-collection-section + .tracking-collection-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e2e2e2;
}

.tracking-collection-heading,
.tracking-exception-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tracking-collection-heading {
  margin-bottom: 12px;
}

.tracking-collection-heading h4 {
  margin: 4px 0 0;
  font-size: 18px;
}

.tracking-collection-table-container {
  border: 1px solid #dedede;
  border-radius: 8px;
}

.tracking-collection-table {
  min-width: 720px;
}

.tracking-collection-table th:nth-child(1) {
  width: 180px;
}

.tracking-collection-table th:nth-child(3) {
  width: 130px;
}

.tracking-collection-table th:nth-child(4) {
  width: 220px;
}

.tracking-collection-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #eeeeee;
  color: #4f4f4f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.tracking-collection-state-completed,
.tracking-collection-state-exception_approved,
.tracking-exception-state-approved {
  background: #dff2e3;
  color: #236c31;
}

.tracking-collection-state-in_progress {
  background: #dcecf8;
  color: #225f86;
}

.tracking-collection-state-exception_pending,
.tracking-exception-state-pending {
  background: #fff0be;
  color: #765500;
}

.tracking-exception-state-rejected {
  background: #f8deda;
  color: #943126;
}

.tracking-exception-list {
  display: grid;
  gap: 12px;
}

.tracking-exception-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  padding: 16px;
  border: 1px solid #dedede;
  border-radius: 8px;
  background: #ffffff;
}

.tracking-exception-content {
  min-width: 0;
}

.tracking-exception-content p {
  margin: 12px 0 8px;
  color: #4f4f4f;
  line-height: 1.5;
}

.tracking-exception-content small {
  color: #777777;
}

.tracking-exception-content .tracking-exception-rejection {
  color: #943126;
  font-weight: 700;
}

.tracking-collection-photo-link,
.tracking-final-photo {
  display: block;
  overflow: hidden;
  border: 1px solid #d5d5d5;
  border-radius: 8px;
  background: #f4f4f4;
}

.tracking-collection-photo-link img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: contain;
}

.tracking-final-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.tracking-final-photo img {
  display: block;
  width: 100%;
  height: min(420px, 48vh);
  object-fit: contain;
}

.tracking-collection-empty,
.tracking-collection-empty-state p {
  margin: 0;
  color: #666666;
}

.tracking-collection-empty-state {
  display: grid;
  gap: 8px;
  padding: 28px 0;
  text-align: center;
}

@media (max-width: 768px) {
  .tracking-collection-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tracking-collection-heading,
  .tracking-exception-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .tracking-exception-entry {
    grid-template-columns: 1fr;
  }

  .tracking-collection-photo-link {
    width: min(100%, 280px);
  }

  .tracking-final-photo img {
    height: min(360px, 45vh);
  }
}

.tracking-modal-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 22px;
  position: relative;
}

.tracking-modal-stepper::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 18px;
  height: 3px;
  background: #d2d2d2;
  z-index: 0;
}

.tracking-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 0 10px;
}

.tracking-step-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 2px currentColor;
  background: currentColor;
}

.tracking-step strong {
  font-size: 13px;
  line-height: 1.35;
}

.tracking-step-done {
  color: #2f8b3a;
}

.tracking-step-current {
  color: #e3aa24;
}

.tracking-step-future {
  color: #9e9e9e;
}

.tracking-step-problem {
  color: #c63d2f;
}

.tracking-modal-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.tracking-modal-timeline .tracking-timeline-item {
  grid-template-columns: 16px 1fr;
  padding: 12px;
  border-radius: 12px;
  background: #fffaf4;
  border: 1px solid #f2d2b5;
}

.tracking-modal-timeline .tracking-timeline-dot {
  border-color: #fffaf4;
}

.tracking-modal-timeline::before {
  display: none;
}

.tracking-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.tracking-modal-actions form {
  margin: 0;
}

.tracking-create-actions {
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.tracking-create-actions .btn {
  width: auto;
  min-width: 132px;
  min-height: 36px;
  padding: 8px 16px;
}

.tracking-modal-form {
  max-width: none;
  margin: 0;
}

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

.tracking-modal-form-grid label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.tracking-modal-form-grid input,
.tracking-modal-form-grid select {
  min-height: 40px;
}

.tracking-error-table-container {
  margin-top: 8px;
  overflow-x: hidden;
}

.tracking-error-table th:last-child,
.tracking-error-table td:last-child {
  width: 140px;
  min-width: 140px;
}

.tracking-error-table {
  table-layout: auto;
  width: 100%;
}

.tracking-error-table th:nth-child(1),
.tracking-error-table td:nth-child(1) {
  width: 130px;
}

.tracking-error-table th:nth-child(2),
.tracking-error-table td:nth-child(2) {
  width: 130px;
}

.tracking-error-table th:nth-child(3),
.tracking-error-table td:nth-child(3) {
  width: 120px;
}

.tracking-error-table th:nth-child(4),
.tracking-error-table td:nth-child(4) {
  width: 130px;
}

.tracking-error-table th:nth-child(5),
.tracking-error-table td:nth-child(5) {
  width: 160px;
}

.tracking-error-table th:nth-child(6),
.tracking-error-table td:nth-child(6) {
  width: auto;
  min-width: 0;
}

.tracking-error-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: middle;
  white-space: normal;
}

.tracking-error-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.tracking-error-actions form {
  margin: 0;
}

.tracking-error-table .actions {
  text-align: center;
  vertical-align: middle;
}

.tracking-empty-state {
  text-align: center;
  color: #8a4b08;
  padding: 18px 12px;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  color: #92510c;
  font-size: 0.98rem;
}

.active-service-layout {
  display: grid;
  gap: 1rem;
}

.active-service-toolbar {
  display: grid;
  gap: 1rem;
}

.active-service-filters,
.active-service-import-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(260px, 1.2fr) 220px auto;
  align-items: end;
  background: #fff8ef;
  border: 1px solid rgba(255, 130, 16, 0.3);
  border-radius: 18px;
  padding: 1.2rem 1.3rem;
  max-width: none;
  margin: 0;
}

.active-service-toolbar-actions,
.active-service-inline-actions,
.active-service-action-stack {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.active-service-filters .btn,
.active-service-import-form .btn {
  width: auto;
}

.active-service-filters .btn {
  min-width: 120px;
}

.active-service-toolbar-actions {
  align-self: end;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.active-service-import-copy {
  display: grid;
  gap: 0.3rem;
}

.active-service-import-copy span {
  color: #7b5a34;
  font-size: 0.94rem;
  line-height: 1.45;
}

.active-service-file-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.active-service-file-field span {
  font-weight: 600;
}

.active-service-file-field input[type="file"] {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.active-service-customer {
  display: grid;
  gap: 0.2rem;
}

.active-service-customer span {
  color: #7b5a34;
  font-size: 0.86rem;
}

.active-service-actions-cell {
  display: table-cell;
  text-align: center;
  vertical-align: middle !important;
  width: 132px !important;
  min-width: 132px;
}

.active-service-table th:last-child,
.active-service-table td:last-child {
  width: 132px !important;
  min-width: 132px;
}

.active-service-actions-cell .btn {
  display: inline-flex;
}

.active-service-actions-cell .btn.small {
  min-width: 98px;
}

.active-service-status {
  font-weight: 700;
}

.active-service-status-success {
  background: rgba(36, 152, 80, 0.12);
  border-color: rgba(36, 152, 80, 0.28);
  color: #1f7f46;
}

.active-service-status-warning {
  background: rgba(243, 182, 41, 0.15);
  border-color: rgba(243, 182, 41, 0.35);
  color: #9f6a00;
}

.active-service-status-info {
  background: rgba(56, 120, 211, 0.13);
  border-color: rgba(56, 120, 211, 0.28);
  color: #245ca7;
}

.active-service-status-danger {
  background: rgba(216, 61, 61, 0.12);
  border-color: rgba(216, 61, 61, 0.28);
  color: #b43333;
}

.empty-state-cell {
  text-align: center;
  color: #7b5a34;
  padding: 2rem 1rem;
}

.active-service-modal-dialog {
  width: min(980px, calc(100vw - 2rem));
}

.active-service-modal-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.active-service-modal-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 1rem;
}

.active-service-comment-form textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 1px solid #f2c7a3;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font: inherit;
  color: #2c220f;
  background: #fffdf9;
}

.active-service-status-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.active-service-status-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.active-service-phone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.active-service-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.active-service-whatsapp:hover {
  filter: brightness(0.96);
}

.active-service-action-stack {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.active-service-action-stack form,
.active-service-action-stack a {
  width: 100%;
  margin: 0;
}

.active-service-action-stack .btn,
.active-service-status-form .btn {
  width: 100%;
}

@media (max-width: 900px) {
  .active-service-filters,
  .active-service-import-form {
    grid-template-columns: 1fr;
  }

  .active-service-toolbar-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .active-service-toolbar-actions .btn,
  .active-service-import-form .btn {
    width: 100%;
  }

  .active-service-modal-panels {
    grid-template-columns: 1fr;
  }
}

.result {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #f2d2b5;
  border-radius: 10px;
  background: #fff9f2;
}

.alert {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #f2d2b5;
  border-radius: 8px;
  background: #fff4e8;
  color: #8a4b08;
}

.alert-success {
  border-color: #a3d9a5;
  background: #eefbf0;
  color: #256c2d;
}

.alert-error {
  border-color: #f0b6b2;
  background: #fff1f1;
  color: #a3382f;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #f2d2b5;
  background: #fff4e8;
  color: #8a4b08;
  font-size: 12px;
  font-weight: 600;
}

.status-aguardando {
  background: #fff7f0;
  border-color: #ffd3ad;
  color: #8a4b08;
}

.status-manual {
  background: #fff7f0;
  border-color: #ffd3ad;
  color: #8a4b08;
}

.status-integracao {
  background: #fff7f0;
  border-color: #ffd3ad;
  color: #8a4b08;
}

.status-entregue {
  background: #fff0e2;
  border-color: #ff8210;
  color: #a04d00;
}

.status-atencao {
  background: #fff7ed;
  border-color: #ffb26f;
  color: #a04d00;
}

.status-suspenso {
  background: #fff3e6;
  border-color: #ff9b4a;
  color: #8a3a00;
}

.status-em-rota {
  background: #fff7ef;
  border-color: #ffb26f;
  color: #a04d00;
}

.status-postado {
  background: #fff6eb;
  border-color: #ffb26f;
  color: #a04d00;
}

.status-ag-retirada {
  background: #fff6eb;
  border-color: #ffb26f;
  color: #a04d00;
}

.status-entregando {
  background: #fff6eb;
  border-color: #ffb26f;
  color: #a04d00;
}

.status-ag-postagem {
  background: #fff6eb;
  border-color: #ffb26f;
  color: #a04d00;
}

.filter-form {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #f2d2b5;
  border-radius: 10px;
  background: #fff9f2;
}

.filter-details {
  margin: 0;
}

.filter-title {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  margin-bottom: 8px;
  color: #8a4b08;
}

.filter-title::-webkit-details-marker {
  display: none;
}

.filter-title::after {
  content: "v";
  margin-left: 8px;
  font-size: 12px;
}

.filter-details[open] .filter-title::after {
  content: "^";
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.filter-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.bottom-actions {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  gap: 10px;
  z-index: 15;
}

.bottom-actions .btn {
  min-width: 140px;
}

.operation-feedback {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 120;
  display: grid;
  gap: 4px;
  width: min(360px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid #f2d2b5;
  border-radius: 14px;
  background: #fffaf4;
  color: #1a1a1a;
  box-shadow: 0 18px 42px rgba(95, 52, 10, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.operation-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.operation-feedback.is-success {
  border-left: 5px solid #2f9e44;
}

.operation-feedback.is-error {
  border-left: 5px solid #e03131;
}

.operation-feedback-title {
  font-size: 15px;
}

.operation-feedback-message {
  color: #6b5a49;
  font-size: 13px;
  line-height: 1.35;
}

.operation-confirm-open {
  overflow: hidden;
}

.operation-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.operation-confirm-modal.is-open {
  display: flex;
}

.operation-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.48);
}

.operation-confirm-dialog {
  position: relative;
  width: min(460px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid #f2d2b5;
  border-radius: 18px;
  background: #fffaf4;
  box-shadow: 0 22px 60px rgba(26, 26, 26, 0.24);
}

.operation-confirm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid #f2d2b5;
  border-radius: 50%;
  background: #fff6eb;
  color: #8a4b08;
  cursor: pointer;
}

.operation-confirm-kicker {
  display: block;
  margin-bottom: 6px;
  color: #a4550a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.operation-confirm-dialog h3 {
  margin: 0 34px 10px 0;
  font-size: 24px;
}

.operation-confirm-dialog p {
  margin: 0;
  color: #6b5a49;
  line-height: 1.45;
}

.operation-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.health-page-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.health-page-header p {
  max-width: 760px;
  color: #8a4b08;
}

.health-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: #a4550a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.health-card {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid #f2c59f;
  border-radius: 18px;
  background: #fffaf4;
  box-shadow: 0 16px 40px rgba(122, 72, 18, 0.08);
}

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

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

.health-span-2 {
  grid-column: span 2;
}

.health-card h3,
.health-card h4 {
  margin: 0 0 10px;
}

.health-card p {
  margin: 6px 0;
  color: #5f3a16;
}

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

.health-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.health-badge-healthy,
.health-badge-ok {
  border: 1px solid #8ce99a;
  background: #ebfbee;
  color: #2b8a3e;
}

.health-badge-degraded,
.health-badge-warning,
.health-badge-atencao,
.health-badge-unknown {
  border: 1px solid #ffd43b;
  background: #fff9db;
  color: #8a5f00;
}

.health-badge-unhealthy,
.health-badge-critical,
.health-badge-erro {
  border: 1px solid #ffa8a8;
  background: #fff5f5;
  color: #c92a2a;
}

.health-alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.health-alert {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: #fff7ed;
}

.health-alert-ok {
  border-left: 5px solid #2f9e44;
}

.health-alert-warning {
  border-left: 5px solid #f59f00;
}

.health-alert-critical {
  border-left: 5px solid #e03131;
}

.health-definition-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.health-definition-list div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid #f5ddc8;
}

.health-definition-list.compact div {
  grid-template-columns: 140px minmax(0, 1fr);
}

.health-definition-list span {
  color: #8a4b08;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.health-definition-list strong {
  overflow-wrap: anywhere;
}

.health-table th,
.health-table td {
  padding: 10px 12px;
  font-size: 13px;
}

.health-muted {
  color: #8a6a49;
  font-size: 13px;
}

.health-log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.health-log-card {
  padding: 14px;
  border: 1px solid #f5ddc8;
  border-radius: 14px;
  background: #fff;
}

.health-log-card pre {
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  background: #1f1f1f;
  color: #f8f0e8;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.upload-dropzone {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 152px;
  padding: 22px;
  border: 2px dashed #ffb06b;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 122, 10, 0.08), rgba(255, 250, 244, 0.96)),
    #fffaf4;
  color: #4a2a0d;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus,
.upload-dropzone:focus-within,
.upload-dropzone.is-dragover {
  border-color: #ff7a0a;
  background:
    linear-gradient(135deg, rgba(255, 122, 10, 0.16), rgba(255, 246, 235, 0.98)),
    #fff6eb;
  box-shadow: 0 12px 28px rgba(122, 72, 18, 0.12);
  outline: none;
}

.upload-dropzone.is-dragover {
  transform: translateY(-1px);
}

.upload-dropzone.has-file {
  border-style: solid;
  border-color: #ff7a0a;
}

.upload-dropzone.has-error {
  border-color: #e03131;
  background: #fff5f5;
}

.upload-dropzone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
}

.upload-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #ff7a0a;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.upload-dropzone-title {
  font-size: 16px;
  font-weight: 800;
}

.upload-dropzone-subtitle,
.upload-dropzone-help,
.upload-dropzone-file,
.upload-dropzone-error {
  font-size: 13px;
}

.upload-dropzone-subtitle,
.upload-dropzone-help {
  color: #8a4b08;
}

.upload-dropzone-file {
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: #5f3a16;
  overflow-wrap: anywhere;
}

.upload-dropzone-error {
  min-height: 18px;
  color: #c92a2a;
  font-weight: 700;
}

.active-service-import-form .upload-dropzone {
  min-width: min(360px, 100%);
}

.active-service-import-form.upload-dropzone-form {
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.1fr) auto;
  align-items: center;
}

.active-service-import-form.upload-dropzone-form .btn {
  align-self: center;
}

.tracking-xml-card,
.picking-mobile-link-card,
.picking-camera-note {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid #f2c59f;
  border-radius: 18px;
  background: #fffaf4;
  box-shadow: 0 16px 40px rgba(122, 72, 18, 0.08);
}

.tracking-xml-header p,
.picking-camera-note p {
  margin: 6px 0 0;
  color: #7b5a34;
}

.tracking-xml-form,
.tracking-xml-create-form {
  max-width: none;
  margin: 14px 0 0;
}

.tracking-xml-preview {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.tracking-xml-preview-title,
.picking-card-header,
.picking-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.picking-document-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.tracking-xml-single-scan {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #f2c59f;
  border-radius: 14px;
}

.tracking-xml-single-scan legend {
  padding: 0 8px;
  color: #8a4b08;
  font-weight: 800;
}

.picking-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.picking-card,
.picking-exception-card,
.picking-mobile-item {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #f2c59f;
  border-radius: 18px;
  background: #fffaf4;
}

.picking-card-grid,
.picking-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.picking-card-grid div {
  display: grid;
  gap: 4px;
}

.picking-card-grid span {
  color: #a4550a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.picking-mobile-url {
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  color: #8a4b08;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.picking-mobile-qr {
  display: inline-grid;
  place-items: center;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #f2c59f;
  border-radius: 18px;
  background: #fff;
}

.picking-mobile-qr svg {
  display: block;
  width: 180px;
  height: 180px;
}

.picking-mobile-items {
  display: grid;
  gap: 16px;
}

.picking-mobile-item.is-complete {
  border-color: #8ce99a;
  background: #ebfbee;
}

.picking-mobile-item.is-awaiting-approval {
  border-color: #facc15;
  background: #fef9c3;
}

.picking-mobile-scan-form {
  max-width: none;
  margin: 0;
}

.picking-exception-form-hidden {
  display: none;
}

.picking-photo-capture {
  display: grid;
  gap: 8px;
}

.picking-photo-capture > span {
  font-weight: 800;
}

.picking-photo-button {
  width: 100%;
  justify-content: center;
  cursor: pointer;
}

.picking-photo-button.is-photo-ready {
  border-color: #15803d;
  background: #16a34a;
  color: #fff;
}

.picking-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.picking-camera-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  background: #1f1f1f;
}

.picking-camera-stage {
  position: fixed;
  inset: 0;
  z-index: 5000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #1f1f1f;
  box-shadow: none;
}

.picking-camera-stage[hidden],
.picking-camera-capture[hidden],
.picking-camera-exception[hidden] {
  display: none;
}

.picking-scanner-open {
  overflow: hidden;
}

.picking-camera-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.52)),
    transparent;
  pointer-events: none;
}

.picking-camera-frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.picking-camera-frame span {
  position: relative;
  width: min(86vw, 520px);
  height: clamp(88px, 18vh, 140px);
  border: 3px solid #ffffff;
  border-radius: 12px;
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, 0.36),
    0 0 20px rgba(34, 197, 94, 0.7);
}

.picking-camera-frame span::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  left: 12px;
  height: 2px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
  transform: translateY(-50%);
}

.picking-camera-capture,
.picking-camera-exception {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.28);
}

.picking-camera-capture span,
.picking-camera-exception > span {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.picking-camera-capture strong,
.picking-camera-exception > strong {
  color: #111827;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.picking-camera-mismatch {
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.picking-camera-mismatch[hidden] {
  display: none;
}

.picking-camera-exception label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.picking-camera-exception input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  text-transform: none;
}

.picking-camera-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.picking-camera-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.28);
}

.picking-approvals-board {
  display: grid;
  gap: 18px;
}

.picking-approval-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 18px;
  padding: 18px;
  border: 1px solid #f2c59f;
  border-radius: 18px;
  background: #fffaf4;
  box-shadow: 0 16px 40px rgba(122, 72, 18, 0.08);
}

.picking-approval-photo {
  overflow: hidden;
  min-height: 220px;
  border: 1px solid #f2c59f;
  border-radius: 14px;
  background: #fff;
}

.picking-approval-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.picking-approval-photo-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: #8a4b08;
  font-weight: 800;
}

.picking-approval-content,
.picking-approval-reason {
  display: grid;
  gap: 14px;
}

.picking-approval-reason {
  padding: 14px;
  border: 1px solid #f2c59f;
  border-radius: 12px;
  background: #fff;
}

.picking-approval-reason span {
  color: #a4550a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.picking-approval-reason p {
  margin: 0;
  color: #4a2f14;
  font-weight: 700;
}

@media (max-width: 820px) {
  .picking-approval-card {
    grid-template-columns: 1fr;
  }
}

.picking-mobile-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #ffd782 0%, #f9bf59 100%);
}

.picking-mobile-page .mobile-container {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0;
}

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

.picking-mobile-hero,
.picking-mobile-panel {
  padding: 20px;
  border: 1px solid #f2c59f;
  border-radius: 22px;
  background: #fffaf4;
  box-shadow: 0 18px 48px rgba(122, 72, 18, 0.12);
}

.picking-mobile-hero h2,
.picking-mobile-panel h3 {
  margin: 6px 0;
}

.picking-mobile-hero p,
.picking-mobile-panel p {
  margin: 0;
  color: #7b5a34;
}

.picking-mobile-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.picking-mobile-steps span {
  padding: 10px 8px;
  border: 1px solid #f2c59f;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.72);
  color: #8a4b08;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.picking-mobile-steps .is-current {
  background: #ff7a0a;
  color: #fff;
  border-color: #ff7a0a;
}

.picking-mobile-steps .is-done {
  background: #e9fbe9;
  color: #2b8a3e;
  border-color: #8ce99a;
}

.picking-mobile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.picking-mobile-summary div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #f2c59f;
  border-radius: 16px;
  background: #fff;
}

.picking-mobile-summary span {
  color: #a4550a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.picking-mobile-next {
  width: 100%;
  justify-content: center;
}

.picking-mobile-done {
  text-align: center;
}

@media (max-width: 620px) {
  .picking-mobile-steps {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .health-grid,
  .health-grid-summary {
    grid-template-columns: 1fr;
  }

  .health-span-2 {
    grid-column: auto;
  }
}
