:root {
  --bg: #eef3f8;
  --sidebar: #13293d;
  --sidebar-soft: #1d3a55;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --line: #d9e3ef;
  --text: #183247;
  --muted: #69839a;
  --blue: #2e6fd8;
  --orange: #d97a2b;
  --green: #24956b;
  --shadow: 0 18px 45px rgba(20, 48, 76, 0.08);
}

.operations-change-topbar { align-items: center; }
.operations-changes-filters { grid-template-columns: minmax(170px, .6fr) minmax(320px, 1.8fr) minmax(150px, .55fr) auto; align-items: end; }
.operations-changes-search { min-width: 0; }
.operations-changes-toggle { align-self: stretch; justify-content: center; }
.operations-changes-table td { vertical-align: middle; }
.operations-changes-table small { display: block; margin-top: 5px; color: #7088a2; white-space: nowrap; }
.operations-change-pending { background: #fffdf7; }
.operations-change-completed { background: #f4fbf7; color: #587065; }
.operations-change-type,
.operations-change-status { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 6px 11px; font-weight: 800; white-space: nowrap; }
.operations-change-type { background: #eaf2ff; color: #1f62b8; }
.operations-change-status.pending { background: #fff0cf; color: #986000; }
.operations-change-status.done { background: #dff6e8; color: #08783d; }
.operations-change-value { min-width: 190px; max-width: 360px; white-space: normal; line-height: 1.8; }
.operations-change-value.old { color: #71869d; }
.operations-change-value.new { color: #102f4d; font-weight: 700; background: #f2f7fd; }

@media (max-width: 1000px) {
  .operations-changes-filters { grid-template-columns: 1fr 1fr; }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Cairo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(46, 111, 216, 0.09), transparent 25%),
    linear-gradient(180deg, #f5f8fc 0%, var(--bg) 100%);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, #102331 100%);
  color: #fff;
  padding: 28px 22px;
  display: grid;
  align-content: start;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

body.no-sidebar .app-shell {
  grid-template-columns: 1fr;
}

body.no-sidebar .sidebar {
  display: none;
}

body.no-sidebar .main-panel {
  padding-inline: 28px;
}

body.sidebar-hidden .app-shell {
  grid-template-columns: 52px 1fr;
}

body.sidebar-hidden .sidebar {
  width: 52px;
  padding: 18px 6px;
  overflow: hidden;
}

body.sidebar-hidden .main-panel {
  padding-inline: 20px 28px 28px 20px;
}

.sidebar-toggle-button {
  position: sticky;
  inset-block-start: 18px;
  z-index: 5;
  justify-self: end;
  align-self: start;
  min-width: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: linear-gradient(135deg, #2e6fd8 0%, #2457ad 100%);
  color: #fff;
  box-shadow: var(--shadow);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, min-width 0.18s ease, background 0.18s ease;
}

.sidebar-toggle-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(20, 48, 76, 0.16);
}

.sidebar-toggle-button:focus-visible {
  outline: 3px solid rgba(46, 111, 216, 0.28);
  outline-offset: 3px;
}

body.no-sidebar .sidebar-toggle-button {
  display: none;
}

body.sidebar-hidden .sidebar-toggle-button {
  justify-self: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  background: linear-gradient(135deg, #3d86ff 0%, #2457ad 100%);
}

body.sidebar-hidden .sidebar > :not(.sidebar-toggle-button) {
  display: none;
}

.sidebar-toggle-button.collapsed {
  box-shadow: 0 14px 30px rgba(20, 48, 76, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.92rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3d86ff 0%, #78a8ff 100%);
  font-weight: 800;
}

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

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

.nav-group-title {
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

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

.nav-group-title::after {
  content: "+";
  float: left;
  color: rgba(255, 255, 255, 0.72);
}

.nav-group[open] .nav-group-title::after {
  content: "-";
}

.nav-group-links {
  display: grid;
  gap: 8px;
  padding-inline-start: 10px;
  margin-top: 4px;
}

.nav-department-group {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  overflow: hidden;
}

.nav-department-title {
  border-radius: 0;
  background: rgba(255, 255, 255, 0.075);
}

.nav-department-group[open] > .nav-department-title {
  background: rgba(46, 111, 216, 0.3);
}

.nav-department-content {
  padding: 4px 8px 10px;
}

.nav-country-group {
  display: grid;
  gap: 6px;
}

.nav-country-title {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  font-weight: 700;
}

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

.nav-country-title::after {
  content: "+";
  float: left;
  color: rgba(255, 255, 255, 0.55);
}

.nav-country-group[open] > .nav-country-title::after {
  content: "-";
}

.nav-country-links {
  display: grid;
  gap: 4px;
  padding-inline-start: 8px;
}

.nav-country-links .nav-item {
  padding: 10px 12px;
  font-size: 0.88rem;
}

.nav-item {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 13px 14px;
  border-radius: 14px;
  background: transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(46, 111, 216, 0.9), rgba(92, 145, 235, 0.78));
  color: #fff;
  box-shadow: 0 8px 20px rgba(5, 18, 31, 0.22);
  font-weight: 800;
}

.nav-item.hidden-by-permission,
.nav-group.hidden-by-permission {
  display: none !important;
}

.sidebar-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
}

.sidebar-card span {
  font-weight: 800;
}

.sidebar-card p {
  color: rgba(255, 255, 255, 0.72);
  margin: 10px 0 14px;
}

.ghost-link {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.main-panel {
  padding: 28px;
  display: grid;
  gap: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: stretch;
}

.eyebrow {
  color: var(--blue);
  font-weight: 800;
  font-size: 0.9rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.topbar p,
.table-header p,
.card-head p {
  color: var(--muted);
}

.status-card,
.stat-card,
.crm-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.status-card {
  padding: 24px;
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #fdfefe 0%, #f2f7ff 100%);
}

.status-card span,
.status-card small {
  color: var(--muted);
}

.status-card strong {
  font-size: 1.4rem;
}

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

.stat-card {
  padding: 22px;
}

.dashboard-clickable {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 45px rgba(20, 48, 76, 0.12);
}

.dashboard-disabled {
  cursor: default;
  opacity: 0.72;
}

.dashboard-disabled:hover {
  transform: none;
  box-shadow: none;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 8px 0;
  font-size: 2rem;
}

.cctv-packed-order-card {
  background: linear-gradient(180deg, #b9f2cc 0%, #70d995 100%);
  border: 2px solid #20a85a;
  box-shadow: 0 12px 28px rgba(25, 150, 76, 0.28);
}

.cctv-packed-order-card span,
.cctv-packed-order-card small,
.cctv-packed-order-card strong {
  color: #075b2b;
}

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

.one-col {
  grid-template-columns: 1fr;
}

.carrier-upload-header {
  padding: 0 4px 12px;
}

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

.carrier-update-form {
  align-content: start;
}

.carrier-update-form .card-head h2 {
  overflow-wrap: anywhere;
}

.carrier-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.carrier-update-actions > * {
  flex: 1 1 210px;
}

.carrier-mapping-summary {
  margin: 0;
}

.carrier-empty-state {
  grid-column: 1 / -1;
  text-align: center;
}

.carrier-mapping-toolbar {
  align-items: end;
}

.carrier-mapping-toolbar label {
  min-width: min(320px, 100%);
}

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

.carrier-mapping-profile-form {
  align-content: start;
}

.carrier-mapping-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.carrier-mapping-meta {
  color: var(--muted);
}

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

.carrier-portal-upload-form {
  align-content: start;
}

.carrier-export-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.carrier-export-wide {
  grid-column: span 2;
}

.carrier-export-row-invalid {
  background: #fff7ed;
}

.carrier-export-products {
  min-width: 240px;
  white-space: normal;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.workflow-step strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent);
}

.workflow-step.active {
  border-color: #94bfff;
  background: #eef6ff;
}

.operations-workflow-section > summary {
  cursor: pointer;
  list-style: none;
}

.operations-workflow-section > summary span {
  display: grid;
  gap: 4px;
}

.operations-workflow-section > summary small,
.operations-export-heading small {
  color: var(--muted);
}

.operations-workflow-section[open] {
  display: grid;
  gap: 18px;
}

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

.operations-orders-toolbar {
  grid-template-columns: 180px minmax(240px, 1fr) minmax(220px, 0.7fr) auto;
}

.operations-export-buttons {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.operations-export-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.operations-export-heading > div {
  display: grid;
  gap: 4px;
}

.operations-orders-table-wrap {
  max-height: 650px;
}

.operations-orders-table-wrap table {
  min-width: 1700px;
}

.operations-orders-table-wrap table.operations-columns-expanded {
  min-width: 5200px;
}

.operations-orders-table-wrap th {
  white-space: nowrap;
}

.operations-orders-table-wrap select {
  min-width: 160px;
}

.operations-wide-data-cell {
  min-width: 260px;
  white-space: normal;
}

.operations-manifest-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.operations-edit-dialog {
  width: min(1000px, calc(100vw - 32px));
}

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

.operations-edit-wide {
  grid-column: span 2;
}

.carrier-portal-url {
  direction: ltr;
  overflow-wrap: anywhere;
  color: var(--accent);
}

.carrier-portal-advanced {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.carrier-template-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #b9d8ff;
  border-radius: 16px;
  background: #eef6ff;
}

.carrier-template-panel div {
  display: grid;
  gap: 4px;
}

.carrier-template-panel small {
  color: var(--muted);
}

.carrier-portal-advanced summary {
  cursor: pointer;
  font-weight: 700;
}

.carrier-portal-advanced[open] {
  display: grid;
  gap: 12px;
}

.carrier-portal-response {
  direction: ltr;
  max-width: 520px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}

.scan-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  align-items: start;
}

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

.country-link-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.country-link-card h2 {
  margin: 12px 0 8px;
}

.country-link-card p {
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
}

.crm-card {
  padding: 22px;
}

.dashboard-section {
  display: grid;
  gap: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.dashboard-stats-grid,
.dashboard-extra-stats,
.dashboard-status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

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

.dashboard-filter-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

.assign-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
}

.assign-panel.hidden {
  display: none;
}

.assign-panel label {
  max-width: 320px;
}

.assign-panel .dashboard-filter-actions {
  justify-content: flex-start;
}

.assign-panel select {
  min-width: 280px;
}

.table-wrap tr.selected {
  background: rgba(46, 111, 216, 0.06);
}

.table-wrap td:first-child,
.table-wrap th:first-child {
  width: 48px;
  text-align: center;
}

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

.dashboard-table-card {
  padding: 0;
}

.inline-code {
  font-family: "Consolas", "Courier New", monospace;
  direction: ltr;
  unicode-bidi: plaintext;
}

.dashboard-group-section {
  display: grid;
  gap: 16px;
}

.dashboard-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.dashboard-toggle input {
  width: 48px;
}

.assign-custom-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.assign-custom-count span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.assign-custom-count input {
  width: 96px;
  min-width: 96px;
  padding: 10px 12px;
}

.shipping-api-sync-form .shipping-api-sync-url,
.shipping-api-sync-form .shipping-api-sync-body {
  grid-column: span 2;
}

.shipping-api-sync-form textarea {
  width: 100%;
  resize: vertical;
}

.shipping-api-payload {
  max-width: 360px;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .shipping-api-sync-form .shipping-api-sync-url,
  .shipping-api-sync-form .shipping-api-sync-body {
    grid-column: auto;
  }
}

.upload-form {
  display: grid;
  gap: 14px;
  align-content: start;
}

.card-head {
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  color: #fff;
}

.chip.blue {
  background: var(--blue);
}

.chip.orange {
  background: var(--orange);
}

.chip.green {
  background: var(--green);
}

.chip.purple {
  background: #6b7cff;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: var(--surface-soft);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(46, 111, 216, 0.18);
  border-color: rgba(46, 111, 216, 0.4);
}

.tracking-input,
.tracking-code {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
  font-family: "Consolas", "Courier New", monospace;
  letter-spacing: 0.02em;
}

.order-modify-input {
  width: 100%;
  min-width: 92px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
}

.order-modify-input[readonly] {
  background: #f3f7fb;
  color: var(--muted);
}

.operations-items-edit-dialog {
  width: min(1500px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.operations-items-edit-table {
  min-width: 1180px;
}

.operations-items-edit-table .order-modify-input {
  min-width: 120px;
}

.operations-items-edit-table [data-item-field="products"] {
  min-width: 240px;
}

.operations-items-edit-table [data-item-field="goodBarcode"] {
  min-width: 260px;
}

body[data-page="material-codes"] th:first-child,
body[data-page="material-codes"] td:first-child {
  width: 60%;
  min-width: 520px;
}

body[data-page="material-codes"] [data-field="products"] {
  min-width: 500px;
}

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

.tracking-fact-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  background:
    radial-gradient(circle at top right, rgba(46, 111, 216, 0.08), transparent 45%),
    linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  display: grid;
  gap: 8px;
}

.tracking-fact-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.tracking-fact-card strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  word-break: break-word;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(46, 111, 216, 0.15), transparent 30%),
    linear-gradient(180deg, #f4f8fc 0%, #e9f0f8 100%);
}

.login-card {
  width: min(100%, 460px);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

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

.permissions-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.permission-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbfe;
}

.permission-item.readonly {
  align-content: start;
}

.permission-item input {
  justify-self: start;
}

.permission-item span {
  font-weight: 700;
}

.permission-item small {
  color: var(--muted);
}

.permissions-role-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.permission-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #204d74 0%, #2e6fd8 100%);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.secondary-btn {
  background: #e8eef6;
  color: var(--text);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.hint {
  color: var(--muted);
  font-size: 0.94rem;
}

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

.table-header {
  padding: 22px 22px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.table-wrap {
  overflow-x: auto;
  padding: 12px 22px 22px;
}

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

th,
td {
  text-align: right;
  padding: 14px 12px;
  border-bottom: 1px solid #e7eef6;
  white-space: nowrap;
}

thead th {
  color: var(--muted);
  font-size: 0.92rem;
}

.sortable-column {
  cursor: pointer;
  user-select: none;
}

.sortable-column::after {
  content: " ↕";
  color: #9aabc0;
  font-size: 0.8rem;
}

.sortable-column[data-sort-direction="asc"]::after {
  content: " ↑";
  color: var(--blue);
}

.sortable-column[data-sort-direction="desc"]::after {
  content: " ↓";
  color: var(--blue);
}

th[data-filter-active="true"] {
  color: #075fc2 !important;
  background: #eaf3ff !important;
  box-shadow: inset 0 -3px 0 #1672d4;
}

th[data-filter-active="true"]::before {
  content: "◆ " !important;
  color: #1672d4;
  font-size: 0.72rem;
}

.table-filter-row th {
  padding: 6px 5px 10px;
}

.table-filter-row {
  display: none;
}

.table-filter-row input {
  width: 100%;
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.date-range-filter {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.date-range-filter input[type="date"] {
  min-width: 150px;
  direction: ltr;
}

.date-range-filter label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.date-range-filter label span {
  min-width: 22px;
  color: var(--muted);
  font-size: 0.74rem;
}

.column-filter-popover {
  position: fixed;
  z-index: 5000;
  width: min(320px, calc(100vw - 20px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(24, 54, 83, 0.22);
}

.column-filter-popover h4 {
  margin: 0;
  color: var(--text);
}

.column-filter-popover label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.column-filter-popover input {
  width: 100%;
}

.column-filter-multi-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 4px;
}

.column-filter-choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.column-filter-choice-actions button {
  padding: 8px 10px;
  border-radius: 10px;
}

.column-filter-popover .column-filter-choice {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7faff;
  color: var(--text);
  cursor: pointer;
}

.column-filter-popover .column-filter-choice:has(input:checked) {
  border-color: var(--primary);
  background: #eaf3ff;
}

.column-filter-popover .column-filter-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.column-filter-popover-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.column-filter-popover-actions button {
  padding: 10px 12px;
  border-radius: 12px;
}

.archive-period-filter {
  display: grid;
  gap: 8px;
}

.archive-period-filter > span {
  color: var(--muted);
  font-weight: 800;
}

.archive-period-filter .table-actions {
  flex-wrap: wrap;
}

.archive-period-toolbar {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 14px;
  min-width: min(620px, 100%);
}

@media (max-width: 900px) {
  .archive-period-toolbar {
    min-width: 100%;
    flex-wrap: wrap;
  }
}

.sales-mapping-choice-field { display: grid; gap: 7px; min-width: 200px; }
.sales-mapping-choice-field > span { color: var(--muted); font-weight: 700; }
.sales-mapping-choice-field small { color: var(--muted); }
.sales-mapping-choice-list { display: grid; gap: 5px; max-height: 190px; overflow: auto; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #f7faff; }
.sales-mapping-choice-list label { display: flex; align-items: center; gap: 8px; padding: 5px 7px; cursor: pointer; }
.sales-mapping-choice-list input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.sales-mapping-history-backdrop { position: fixed; inset: 0; z-index: 6000; display: grid; place-items: center; padding: 20px; background: rgba(17, 33, 54, .55); }
.sales-mapping-history-dialog { width: min(960px, 100%); max-height: min(88vh, 900px); overflow: auto; padding: 24px; border-radius: 20px; background: #fff; box-shadow: 0 22px 70px rgba(17, 33, 54, .28); }
.sales-mapping-history-dialog .table-header { gap: 16px; }

.history-stats-grid {
  margin: 18px 0;
}

.history-stats-grid .dashboard-table-card {
  padding: 16px;
}

.history-stats-grid .dashboard-table-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
}

.history-notes {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="crm-aftersales-crm"] .table-wrap td:first-child,
body[data-page="crm-aftersales-crm"] .table-wrap th:first-child {
  width: auto;
  text-align: right;
}

.success {
  color: var(--green);
}

.crm-import-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  color: #24425c;
  background: #eef4fb;
  border: 1px solid #d5e4f5;
}

.crm-import-summary.complete {
  color: #0a8d4f;
  background: #e3f9eb;
  border-color: #8de0b0;
  box-shadow: 0 0 0 1px rgba(36, 149, 107, 0.08) inset;
}

.crm-import-summary.progress {
  color: #16557a;
  background: #eef4fb;
}

.crm-import-summary.ready {
  color: #4b6377;
  background: #f3f7fb;
}

.import-crm-report-btn {
  white-space: nowrap;
}

.error {
  color: #b63f37;
}

.hidden {
  display: none !important;
}

.phone-with-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.22);
}

.whatsapp-link:hover,
.whatsapp-link:focus-visible {
  color: #fff;
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.whatsapp-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.whatsapp-link-text {
  line-height: 1;
}

.crm-shipping-company-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.crm-shipping-company-link:hover,
.crm-shipping-company-link:focus-visible {
  text-decoration: underline;
}

.company-link-input {
  width: min(100%, 560px);
  min-width: 280px;
}

.shipping-company-details-input {
  min-width: 130px;
}

.shipping-company-name-input {
  min-width: 160px;
  font-weight: 700;
}

.delivery-conflict-row > td {
  background: #fff0f0;
  color: #a51d2d;
  border-color: #f3b6bd;
}

.delivery-conflict-label {
  display: inline-block;
  margin-inline-start: 8px;
  color: #bd1e31;
  font-size: 0.78rem;
}

.crm-mode-switch > span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.crm-mode-switch input[type="checkbox"] {
  inline-size: 44px;
  block-size: 24px;
  accent-color: #2563eb;
}

.secondary-btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}

.crm-order-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-status-button {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.crm-status-button:disabled {
  background: #97a9bb;
  cursor: not-allowed;
}

.crm-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.crm-status-pill.pending {
  background: rgba(46, 111, 216, 0.12);
  color: var(--blue);
}

.crm-special-status-line {
  display: flex;
  width: fit-content;
  margin-block: 3px;
}

.crm-rules-list {
  display: grid;
  gap: 14px;
}

.crm-rule-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.crm-rule-header,
.crm-rule-condition {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(120px, 180px) auto;
  gap: 10px;
  align-items: end;
}

.crm-rule-conditions {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.crm-rule-condition {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(160px, 1fr) auto;
}

.crm-rule-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.crm-rule-name-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  gap: 4px;
  padding: 0;
  text-align: start;
  cursor: pointer;
}

.crm-rule-name-button strong {
  font-size: 18px;
}

.crm-rule-name-button span {
  color: var(--muted);
  font-weight: 700;
}

.crm-rule-modal-form {
  display: grid;
  gap: 12px;
}

.commission-template-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
}

.commission-template-panel strong {
  color: var(--ink);
}

.commission-template-panel small {
  color: var(--muted);
}

.commission-rule-list {
  display: grid;
  gap: 14px;
}

.commission-rule-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f8fbff;
}

.commission-rule-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.commission-rule-group-head h3 {
  margin: 0;
  color: var(--ink);
}

.commission-rule-group-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.commission-rule-group-controls {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(190px, 240px) minmax(130px, 170px);
  gap: 10px;
  align-items: end;
}

.commission-rule-group-controls label {
  display: grid;
  gap: 5px;
}

.commission-rule-group-controls span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.commission-rule-group-items {
  display: grid;
  gap: 10px;
}

.commission-rule-list-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 33, 48, 0.05);
}

.commission-rule-list-row .commission-rule-name-button {
  text-align: start;
}

.commission-rule-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 33, 48, 0.06);
}

.commission-rule-card-head {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.commission-rule-enabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--ink);
}

.commission-rule-title-input {
  font-weight: 800;
}

.commission-rule-sentence {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(46, 111, 216, 0.08);
  color: var(--ink);
  font-weight: 800;
}

.commission-rule-simple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: end;
}

.commission-rule-simple-grid label {
  display: grid;
  gap: 6px;
}

.commission-rule-simple-grid span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.commission-rule-advanced {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.commission-rule-advanced summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 10px;
}

.muted-field {
  opacity: 0.58;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
  background: #fff;
}

.compact-input {
  max-width: 110px;
  min-height: 38px;
  padding: 8px 10px;
}

.accounting-commission-filter-card .dashboard-filter-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  width: min(980px, 100%);
}

.accounting-commission-filter-card .dashboard-filter-actions button,
.accounting-commission-filter-card .dashboard-filter-actions .secondary-btn {
  align-self: end;
}

.crm-status-pill.locked {
  background: rgba(22, 163, 74, 0.12);
  color: #1c8c4d;
}

.crm-pending-star {
  margin-inline-start: 6px;
  color: #d97a2b;
  font-weight: 800;
}

.crm-pending-star::before {
  content: "★";
}

.crm-no-answer-stars {
  display: inline-flex;
  margin-inline-start: 7px;
  color: #d97a2b;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 1px;
  vertical-align: middle;
}

.active-toggle {
  border-color: rgba(46, 111, 216, 0.35);
  background: rgba(46, 111, 216, 0.1);
  color: var(--blue);
}

.crm-done-row {
  opacity: 0.72;
  background: rgba(36, 149, 107, 0.04);
}

.crm-status-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.crm-status-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 38, 0.56);
}

.crm-status-modal-dialog {
  position: relative;
  width: min(920px, calc(100% - 24px));
  margin: 16px auto;
  border-radius: 24px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 33, 48, 0.28);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.crm-status-modal-head,
.crm-status-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-details-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.crm-details-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 38, 0.56);
}

.crm-details-modal-dialog {
  position: relative;
  width: min(980px, calc(100% - 24px));
  margin: 16px auto;
  border-radius: 24px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 33, 48, 0.28);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.crm-evidence-modal-dialog {
  width: min(920px, calc(100vw - 32px));
}

.crm-evidence-image-wrap {
  display: grid;
  place-items: center;
  min-height: 320px;
  max-height: 68vh;
  margin: 16px 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #eef4fa;
}

.crm-evidence-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

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

.crm-detail-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.crm-detail-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.crm-detail-card strong {
  font-size: 1rem;
  font-weight: 800;
  word-break: break-word;
}

.crm-details-link {
  color: var(--blue);
  text-decoration: none;
}

.crm-details-link:hover,
.crm-details-link:focus-visible {
  text-decoration: underline;
}

.crm-history-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.crm-history-head {
  margin-bottom: 14px;
}

.crm-history-head h4 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.crm-history-timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding-inline-start: 14px;
}

.crm-history-timeline::before {
  content: "";
  position: absolute;
  inset-block: 8px 8px;
  inset-inline-start: 3px;
  width: 2px;
  background: var(--line);
}

.crm-history-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}

.crm-history-dot {
  width: 11px;
  height: 11px;
  margin-top: 18px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(46, 111, 216, 0.12);
  z-index: 1;
}

.crm-history-item.crm-status-updated .crm-history-dot,
.crm-history-item.crm-current-status .crm-history-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(36, 149, 107, 0.12);
}

.crm-history-item.shipping-company-update .crm-history-dot {
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(217, 122, 43, 0.12);
}

.crm-history-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
}

.crm-history-card-head,
.crm-history-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.crm-history-card-head time,
.crm-history-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.crm-history-status {
  margin: 8px 0 0;
  font-weight: 800;
}

.crm-history-notes {
  margin: 6px 0 0;
  color: var(--text);
}

.crm-history-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.crm-status-modal-order {
  margin: 10px 0 16px;
  color: var(--muted);
}

.crm-status-modal-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
  max-height: none;
  overflow: visible;
}

@media (max-width: 760px) {
  .crm-status-modal-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.crm-status-modal-notes {
  margin-bottom: 16px;
}

.crm-status-modal-notes textarea {
  min-height: 90px;
  resize: vertical;
}

.crm-status-extra-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

.crm-status-extra-actions .secondary-btn {
  flex: 1 1 150px;
}

.crm-status-extra-fields {
  display: grid;
  gap: 12px;
}

.crm-status-evidence-field {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: #f8fbff;
}

.crm-status-evidence-field > small {
  color: var(--muted);
}

.crm-status-evidence-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.crm-status-evidence-preview img {
  width: 92px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}

.crm-status-evidence-preview > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.crm-status-evidence-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-status-extra-field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 700;
}

.crm-status-extra-field input,
.crm-status-extra-field textarea {
  width: 100%;
}

.crm-date-input-shell {
  position: relative;
}

.crm-date-input {
  min-height: 58px;
  padding: 14px 52px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.crm-date-input:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.crm-date-input:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(43, 110, 214, .14);
}

.crm-date-input::-webkit-calendar-picker-indicator {
  width: 24px;
  height: 24px;
  margin-left: 4px;
  cursor: pointer;
  opacity: .75;
}

.crm-date-input-icon {
  position: absolute;
  top: 50%;
  right: 18px;
  z-index: 1;
  color: var(--primary);
  font-size: 21px;
  pointer-events: none;
  transform: translateY(-50%);
}

.crm-date-input-hint {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.crm-date-picker {
  position: relative;
}

.crm-date-value {
  display: none !important;
}

.crm-date-picker-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 10px 42px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: right;
  cursor: pointer;
}

.crm-date-picker-trigger:hover,
.crm-date-picker-trigger:focus-visible {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(43, 110, 214, .14);
}

.crm-date-picker-trigger .crm-date-input-icon {
  right: 17px;
}

.crm-date-picker-arrow {
  margin-right: auto;
  color: var(--primary);
  font-size: 1.35rem;
}

.crm-date-picker-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(286px, 100%);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(18, 49, 82, .2);
}

.crm-date-picker-head,
.crm-date-picker-weekdays,
.crm-date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  align-items: center;
}

.crm-date-picker-head {
  grid-template-columns: 38px 1fr 38px;
  margin-bottom: 8px;
  text-align: center;
}

.crm-date-picker-nav,
.crm-date-picker-day,
.crm-date-picker-today {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}

.crm-date-picker-nav {
  height: 28px;
  padding: 0;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 1.45rem;
}

.crm-date-picker-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
}

.crm-date-picker-day {
  min-height: 30px;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.crm-date-picker-day:hover,
.crm-date-picker-day.today {
  background: #e4efff;
  color: var(--primary);
}

.crm-date-picker-day.selected {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.crm-import-summary {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.crm-import-summary:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 110, 214, .12);
}

.crm-import-pending-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}

.crm-import-pending-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 31, 53, .52);
}

.crm-import-pending-dialog {
  position: relative;
  width: min(900px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(12, 31, 53, .28);
}

.crm-import-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.crm-import-pending-head h3 {
  margin: 4px 0 0;
}

.crm-import-pending-table-wrap {
  overflow-x: auto;
}

.crm-import-pending-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.crm-import-pending-table-wrap th,
.crm-import-pending-table-wrap td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.crm-date-picker-today {
  width: 100%;
  margin-top: 8px;
  padding: 7px 9px;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 800;
}

.crm-status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  cursor: pointer;
}

.crm-status-modal-actions {
  margin-top: 18px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  cursor: pointer;
}

.mapping-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.mapping-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 26, 39, 0.55);
}

.mapping-dialog {
  position: relative;
  width: min(760px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 20px auto;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(15, 33, 48, 0.28);
}

.mapping-head,
.mapping-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mapping-head {
  margin-bottom: 12px;
}

.mapping-message {
  color: var(--muted);
  margin-bottom: 16px;
}

.carrier-update-mapping-dialog {
  width: min(920px, calc(100% - 24px));
}

.carrier-update-mapping-dialog .carrier-mapping-fields {
  margin: 18px 0;
}

.collected-amount-review-dialog {
  width: min(1050px, calc(100% - 24px));
}

.collected-amount-review-table {
  max-height: 50vh;
  margin-bottom: 18px;
}

.pickup-location-mapping-dialog {
  width: min(920px, calc(100% - 24px));
}

.pickup-location-mapping-table-wrap {
  max-height: 55vh;
  margin-bottom: 14px;
}

.pickup-location-mapping-table-wrap input {
  min-width: 240px;
}

.crm-history-details {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.crm-history-detail-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.crm-history-detail-row span {
  color: var(--muted);
}

.crm-history-detail-row strong {
  overflow-wrap: anywhere;
}

.mapping-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0 20px;
}

.status-mapping-block h4 {
  margin: 0 0 12px;
}

.status-mapping-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.mapping-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.crm-dashboard-stats {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.crm-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.mini-report-list {
  display: grid;
  gap: 10px;
}

.mini-report-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.online-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.online-pill.online {
  color: #137a54;
  background: rgba(36, 149, 107, 0.12);
}

.online-pill.offline {
  color: #7a8793;
  background: #eef2f6;
}

.muted-row-text {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.compact-table-wrap {
  max-height: 430px;
  overflow: auto;
}

.checks-stats-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.checks-editor-card {
  margin-bottom: 18px;
}

.checks-form,
.checks-filter-form {
  display: grid;
  gap: 14px;
  align-items: end;
}

.checks-form {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.checks-filter-form {
  grid-template-columns: repeat(4, minmax(140px, 0.7fr)) minmax(260px, 1.4fr) auto;
  margin-bottom: 12px;
}

.checks-wide-field {
  grid-column: span 4;
}

.checks-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  grid-column: 1 / -1;
}

.checks-form-actions .form-feedback {
  margin: 0;
}

.checks-table-wrap {
  max-height: 620px;
}

.checks-table {
  min-width: 1280px;
}

.checks-table tr.check-overdue td {
  background: rgba(214, 63, 63, 0.09);
}

.checks-table tr.check-due-soon td {
  background: rgba(235, 171, 46, 0.1);
}

.check-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #edf2f7;
  color: #536579;
}

.check-status-pill.cleared {
  color: #137a54;
  background: rgba(36, 149, 107, 0.12);
}

.check-status-pill.returned,
.check-status-pill.cancelled {
  color: #b23434;
  background: rgba(214, 63, 63, 0.11);
}

.check-status-pill.deposited {
  color: #175ba8;
  background: rgba(34, 112, 201, 0.11);
}

.checks-row-actions {
  display: flex;
  gap: 7px;
  white-space: nowrap;
}

.checks-row-actions button {
  min-width: auto;
  padding: 8px 12px;
}

.checks-row-actions .danger-btn {
  color: #b23434;
  background: rgba(214, 63, 63, 0.09);
}

.task-stats-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.task-toolbar-card,
.task-editor-card {
  margin-bottom: 18px;
}

.task-filter-grid,
.task-editor-grid {
  display: grid;
  gap: 14px;
  align-items: end;
}

.task-filter-grid {
  grid-template-columns: repeat(5, minmax(140px, 0.7fr)) minmax(260px, 1.3fr);
}

.task-filter-grid .dashboard-filter-actions {
  grid-column: 1 / -1;
}

.task-checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-height: 48px;
}

.task-checkbox-label input {
  width: 18px;
  height: 18px;
}

.task-editor-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.task-title-field {
  grid-column: span 2;
}

.task-description-field {
  grid-column: 1 / -1;
}

.task-editor-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  grid-column: 1 / -1;
}

.task-editor-actions .form-feedback {
  margin: 0;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
  direction: rtl;
  overflow-x: auto;
  padding-bottom: 10px;
}

.task-lane {
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(245, 248, 252, 0.86);
}

.task-lane > header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.task-lane > header h2 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
}

.task-lane > header strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #e8eef6;
}

.task-lane-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.task-lane-dot.todo { background: #718096; }
.task-lane-dot.in-progress { background: #2f74d0; }
.task-lane-dot.waiting { background: #e2a72f; }
.task-lane-dot.done { background: #24956b; }

.task-lane-list,
.task-cancelled-list {
  display: grid;
  gap: 11px;
}

.task-card {
  padding: 15px;
  border: 1px solid #dbe5f0;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 53, 80, 0.05);
}

.task-card.overdue {
  border-color: rgba(202, 57, 57, 0.45);
  box-shadow: inset 4px 0 #ca3939, 0 8px 24px rgba(28, 53, 80, 0.05);
}

.task-card-head,
.task-card-meta,
.task-card-footer,
.task-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-card-head {
  justify-content: space-between;
  margin-bottom: 9px;
}

.task-card h3 {
  margin: 0 0 7px;
  font-size: 0.98rem;
}

.task-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 0.82rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-priority,
.task-department-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.task-priority.low { color: #557084; background: #edf2f7; }
.task-priority.medium { color: #175ba8; background: rgba(34, 112, 201, 0.1); }
.task-priority.high { color: #a26909; background: rgba(235, 171, 46, 0.15); }
.task-priority.urgent { color: #b23434; background: rgba(214, 63, 63, 0.12); }
.task-department-pill { color: #335a7b; background: #eef5fb; }

.task-card-meta {
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: #6d7f91;
  font-size: 0.75rem;
}

.task-progress-track {
  height: 7px;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf0f6;
}

.task-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #245a85, #3275db);
}

.task-card-footer {
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #edf1f5;
}

.task-assignee {
  overflow: hidden;
  color: #445b70;
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-actions button {
  min-width: auto;
  padding: 7px 9px;
  font-size: 0.72rem;
}

.task-empty-lane {
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
}

.task-cancelled-section {
  margin-top: 10px;
}

.task-cancelled-section summary {
  cursor: pointer;
  font-weight: 800;
}

.task-cancelled-list {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  margin-top: 14px;
}

.task-comments-dialog {
  width: min(720px, calc(100vw - 30px));
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(13, 34, 55, 0.28);
}

.task-comments-dialog::backdrop {
  background: rgba(12, 30, 48, 0.58);
}

.task-comments-panel {
  padding: 22px;
}

.task-comments-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  margin: 14px 0;
  overflow-y: auto;
}

.task-comment {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.task-comment header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 0.76rem;
}

.task-comment p {
  margin: 0;
  white-space: pre-wrap;
}

.task-comment-form {
  display: grid;
  gap: 10px;
}

.global-action-bar {
  position: sticky;
  z-index: 80;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  margin: -8px -8px 18px;
  padding: 9px 14px;
  border: 1px solid rgba(214, 226, 238, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 32px rgba(24, 50, 76, 0.08);
  backdrop-filter: blur(16px);
}

.global-action-user,
.global-action-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-action-user {
  color: #40576c;
  font-size: 0.82rem;
  font-weight: 800;
}

.global-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #245a85, #3275db);
}

.global-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid #dce6f0;
  border-radius: 13px;
  color: #33536f;
  background: #f7fafd;
}

.global-icon-button:hover,
.global-icon-button.active,
.global-icon-button[aria-expanded="true"] {
  color: #fff;
  border-color: #2d6fc7;
  background: #2d6fc7;
}

.global-logout-button {
  color: #b84242;
  border-color: #f0d5d5;
  background: #fff7f7;
}

.global-logout-button:hover {
  color: #fff;
  border-color: #c94b4b;
  background: #c94b4b;
}

.upload-template-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.global-icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-icon-badge {
  position: absolute;
  inset-block-start: -7px;
  inset-inline-end: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #d33f3f;
  font-size: 0.65rem;
  font-weight: 900;
}

.global-notifications-host {
  position: relative;
}

.global-notifications-menu {
  position: absolute;
  z-index: 120;
  inset-block-start: calc(100% + 10px);
  inset-inline-end: 0;
  width: min(390px, calc(100vw - 34px));
  overflow: hidden;
  border: 1px solid #dce6f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 38, 61, 0.22);
}

.global-notifications-menu > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #e8eef4;
}

.global-notifications-menu > header div {
  display: grid;
  gap: 2px;
}

.global-notifications-menu > header small {
  color: var(--muted);
}

.global-mark-read {
  min-width: auto;
  padding: 7px 9px;
  color: #2766b4;
  background: #edf5ff;
  font-size: 0.7rem;
}

.global-notifications-list {
  max-height: 420px;
  overflow-y: auto;
}

.global-notification-item {
  display: flex;
  width: 100%;
  min-width: 0;
  gap: 11px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid #eef2f6;
  border-radius: 0;
  color: #233e55;
  background: #fff;
  text-align: start;
}

.global-notification-item.unread {
  background: #f0f7ff;
}

.global-notification-item:hover {
  color: #17364f;
  background: #e8f3ff;
}

.global-notification-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  color: #fff;
  background: #2d6fc7;
  font-weight: 900;
}

.global-notification-content {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.global-notification-content strong,
.global-notification-content span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-notification-content span,
.global-notification-content small {
  color: #6b7e90;
  font-size: 0.74rem;
}

.global-notification-empty {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.global-notifications-footer {
  display: block;
  padding: 12px;
  color: #2766b4;
  background: #f7fafd;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.inventory-stats-grid {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.inventory-filter-card,
.inventory-movement-card {
  margin-bottom: 18px;
}

.inventory-filter-form,
.inventory-movement-form {
  display: grid;
  gap: 14px;
  align-items: end;
}

.inventory-filter-form {
  grid-template-columns: minmax(160px, .65fr) minmax(260px, 1.5fr) minmax(180px, .8fr) auto;
}

.inventory-movement-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.inventory-search-field,
.inventory-wide-field {
  grid-column: span 2;
}

.inventory-checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.inventory-checkbox-label input {
  width: 18px;
  height: 18px;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .72rem;
}

.inventory-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  grid-column: 1 / -1;
}

.inventory-form-actions .form-feedback {
  margin: 0;
}

.inventory-table-wrap {
  max-height: 600px;
}

.inventory-table {
  min-width: 1280px;
}

.inventory-column-filter-row th {
  padding: 6px 8px;
  background: #f7faff;
}

.inventory-column-filter-row input {
  width: 100%;
  min-width: 78px;
  box-sizing: border-box;
  padding: 8px 9px;
  border: 1px solid #d3e0ef;
  border-radius: 8px;
  background: #fff;
  color: #17324d;
  font: inherit;
}

.inventory-column-filter-row input:focus {
  outline: 2px solid rgba(37, 111, 212, .25);
  border-color: #3479d1;
}

.inventory-low-row td {
  background: rgba(235, 171, 46, .08);
}

.inventory-negative {
  color: #b23434;
  font-weight: 900;
}

.inventory-stock-status,
.inventory-movement-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}

.inventory-stock-status.ok {
  color: #137a54;
  background: rgba(36, 149, 107, .12);
}

.inventory-stock-status.low {
  color: #9b680a;
  background: rgba(235, 171, 46, .16);
}

.inventory-movement-pill.inbound,
.inventory-movement-pill.return {
  color: #137a54;
  background: rgba(36, 149, 107, .12);
}

.inventory-movement-pill.outbound {
  color: #b23434;
  background: rgba(214, 63, 63, .12);
}

.inventory-movement-pill.adjustment {
  color: #2766b4;
  background: rgba(34, 112, 201, .12);
}

.inventory-history-card {
  margin-top: 18px;
}

.inventory-history-wrap {
  max-height: 430px;
}

@media (max-width: 1200px) {
  .carrier-mapping-grid {
    grid-template-columns: 1fr;
  }

  .carrier-portal-grid {
    grid-template-columns: 1fr;
  }

  .carrier-export-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .operations-orders-toolbar,
  .operations-manifest-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checks-form {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .checks-filter-form {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .task-stats-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .task-filter-grid,
  .task-editor-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .checks-wide-field {
    grid-column: span 2;
  }

  .upload-grid,
  .country-grid,
  .scan-grid,
  .dashboard-table-grid,
  .crm-dashboard-stats,
  .crm-dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .carrier-mapping-fields {
    grid-template-columns: 1fr;
  }

  .carrier-export-profile-grid {
    grid-template-columns: 1fr;
  }

  .carrier-export-wide {
    grid-column: auto;
  }

  .workflow-steps,
  .operations-import-grid,
  .operations-orders-toolbar,
  .operations-manifest-form,
  .operations-edit-grid {
    grid-template-columns: 1fr;
  }

  .operations-edit-wide {
    grid-column: auto;
  }

  .checks-form,
  .checks-filter-form,
  .checks-stats-grid {
    grid-template-columns: 1fr;
  }

  .checks-wide-field {
    grid-column: auto;
  }

  .task-stats-grid,
  .task-filter-grid,
  .task-editor-grid,
  .task-cancelled-list {
    grid-template-columns: 1fr;
  }

  .task-title-field {
    grid-column: auto;
  }

  .global-action-user span:last-child {
    display: none;
  }

  .inventory-stats-grid,
  .inventory-filter-form,
  .inventory-movement-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .inventory-search-field,
  .inventory-wide-field {
    grid-column: auto;
  }

  .operations-export-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 18px;
  }

  .topbar,
  .stats-grid,
    .dashboard-filter-form,
    .upload-grid,
    .country-grid,
    .scan-grid,
    .dashboard-table-grid,
    .crm-dashboard-stats,
    .crm-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .dashboard-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .main-panel {
    padding: 18px;
  }

  .sidebar-toggle-button {
    inset-block-start: 12px;
    inset-inline-start: 12px;
    padding: 10px 14px;
  }
}
.imported-orders-check .imported-queue-card {
  background: linear-gradient(135deg, #fffdf3 0%, #f7fbff 100%);
}

.imported-orders-check .imported-order-card {
  background: #fffaf0;
  border-color: #e8c979;
}

.imported-orders-check .imported-order-opened-card {
  background: #d9f5df;
  border-color: #39a85a;
}

.imported-orders-check #importedOrdersDetailsSection {
  position: fixed;
  inset: 24px;
  z-index: 1000;
  overflow: auto;
  box-shadow: 0 24px 80px rgba(15, 35, 55, .3);
}

.imported-orders-check #importedOrdersDetailsSection:not(.hidden) {
  display: block;
}

.imported-orders-check #importedOrdersDetailsSection table {
  display: block;
  width: 100%;
}

.imported-orders-check #importedOrdersDetailsSection table thead {
  display: none;
}

.imported-orders-check #importedOrdersDetailsSection th,
.imported-orders-check #importedOrdersDetailsSection td {
  padding: 18px 14px;
  min-height: 58px;
}

.imported-orders-check .imported-order-item-check,
.imported-orders-check [data-imported-select-all] {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: #1769c2;
}

.imported-orders-check #importedOrdersDetailsBody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 12px 0;
  width: 100%;
}

.imported-orders-check #importedOrdersDetailsBody tr {
  display: block;
  width: 100%;
}

.imported-orders-check #importedOrdersDetailsBody tr > td {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  border: 0;
}

.imported-orders-check .imported-order-material-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 170px;
  padding: 20px;
  border: 2px solid #c9dced;
  border-radius: 18px;
  background: #f8fbff;
  box-shadow: 0 8px 20px rgba(31, 77, 116, .08);
  font-size: 1.08rem;
  width: 100%;
  box-sizing: border-box;
}

.imported-orders-check .imported-order-material-card strong {
  color: #123b62;
  font-size: 1.25rem;
}

.imported-orders-check .imported-order-material-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1769c2;
  font-weight: 700;
}

.imported-orders-check .imported-order-material-meta {
  display: grid;
  gap: 7px;
  color: #58728b;
}

.imported-orders-check .imported-order-actual-quantity {
  display: none;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff1c7;
  color: #8b5a00;
}

.imported-orders-check .imported-order-actual-quantity.visible {
  display: block;
}

.imported-quantity-keypad-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 29, 48, .58);
}

.imported-quantity-keypad {
  width: min(390px, 100%);
  padding: 24px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .3);
  text-align: center;
}

.imported-quantity-keypad h3 {
  margin: 0 0 8px;
  color: #123b62;
  font-size: 1.35rem;
}

.imported-quantity-keypad p {
  margin: 0 0 14px;
  color: #58728b;
}

.imported-quantity-display {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 16px;
  padding: 12px;
  border: 2px solid #b9d3ed;
  border-radius: 12px;
  color: #123b62;
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
}

.imported-quantity-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.imported-quantity-keys button,
.imported-quantity-keypad-actions button {
  min-height: 54px;
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 800;
  touch-action: manipulation;
}

.imported-quantity-keypad-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.employee-directory-list {
  display: grid;
  gap: 10px;
}

.employee-directory-card {
  display: grid;
  gap: 12px;
  border-top: 4px solid #2f76d2;
}

.employee-directory-card.is-resigned {
  border-top-color: #a7b3c3;
  opacity: .86;
}

.employee-directory-card .card-head {
  align-items: flex-start;
}

.employee-directory-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.employee-directory-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #58708e;
  font-size: .9rem;
}

.employee-directory-card .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.employee-directory-table-wrap { padding: 0; }
.employee-directory-table { min-width: 1200px; }
.employee-directory-table input,
.employee-directory-table select { min-width: 110px; padding: 9px 10px; }
.employee-directory-table th { vertical-align: top; min-width: 145px; }
.employee-directory-table th > span { display: block; margin-bottom: 7px; }
.employee-directory-table .column-sort { display: block; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 800; padding: 0; margin: 0 0 7px; cursor: pointer; width: 100%; text-align: right; }
.employee-directory-table .column-sort:hover { color: #246fd1; }
.employee-directory-table th .column-filter { width: 100%; min-width: 120px; font-size: .85rem; }
.employee-directory-table tr.is-resigned { background: #f4f6f8; opacity: .8; }
.employee-directory-table [data-card-feedback] { display: block; white-space: nowrap; }
.employee-shifts-list { display: grid; gap: 12px; }
.employee-shift-row { display: grid; grid-template-columns: 1.2fr repeat(4, minmax(130px, 1fr)) auto auto; gap: 12px; align-items: end; }
.employee-shift-row h2 { margin: 0 0 5px; font-size: 1.1rem; }
.employee-shift-row .hint { display: block; }
.employee-shift-row input[data-time-input] { cursor: pointer; font-weight: 800; letter-spacing: .08em; text-align: center; background: #f1f6ff; }
.time-picker-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(13, 33, 58, .42); }
.time-picker-dialog { width: min(430px, 100%); display: grid; gap: 22px; padding: 24px; border: 1px solid #d6e3f3; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(16, 52, 91, .28); }
.time-picker-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.time-picker-header h2 { margin: 4px 0 0; }
.time-picker-fields { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; direction: ltr; }
.time-picker-fields label { direction: rtl; text-align: right; }
.time-picker-fields > strong { font-size: 2rem; padding-bottom: 8px; color: #1f5fae; }
.time-picker-fields select { width: 100%; font-size: 1.7rem; font-weight: 800; text-align: center; padding: 14px; }
@media (max-width: 1100px) { .employee-shift-row { grid-template-columns: repeat(3, minmax(150px, 1fr)); } }
@media (max-width: 700px) { .employee-shift-row { grid-template-columns: 1fr; } }

@media (max-width: 1100px) {
  .employee-directory-list { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .employee-directory-list { grid-template-columns: 1fr; }
  .employee-directory-card .form-grid { grid-template-columns: 1fr; }
}
.order-management-toolbar {
  grid-template-columns: minmax(280px, 2fr) minmax(220px, 1fr) auto;
  align-items: end;
  margin-bottom: 14px;
}

.order-management-table th[data-order-management-sort] {
  cursor: pointer;
  user-select: none;
}

.order-management-table th[data-order-management-sort]::before {
  content: "↕ ";
  color: #7d96b3;
}

.order-stage-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #edf4fc;
  color: #1c4f82;
  font-weight: 800;
  white-space: nowrap;
}

.order-stage-badge.packed { background: #e8f8ef; color: #087443; }
.order-stage-badge.handed-to-carrier { background: #e7f3ff; color: #075ca8; }
.order-stage-badge.cancelled { background: #ffe9e9; color: #b42318; }
.order-stage-cancelled { background: #fff7f7; }

.order-management-dialog {
  width: min(1180px, calc(100vw - 36px));
  max-height: 92vh;
  overflow: auto;
}

#adminOrderItemsModal .operations-items-edit-dialog {
  width: min(1680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  padding: 28px;
}

#adminOrderItemsModal .table-wrap {
  max-height: calc(100vh - 255px);
}

#adminOrderItemsModal .operations-items-edit-table {
  min-width: 1450px;
  table-layout: auto;
}

#adminOrderItemsModal .operations-items-edit-table th:first-child,
#adminOrderItemsModal .operations-items-edit-table td:first-child {
  width: 34%;
  min-width: 430px;
}

#adminOrderItemsModal [data-admin-item-field="products"] {
  width: 100%;
  min-width: 410px;
}

#adminOrderItemsModal [data-admin-item-field="barcode"],
#adminOrderItemsModal [data-admin-item-field="goodBarcode"] {
  min-width: 165px;
}

.order-management-lifecycle {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.order-management-lifecycle > div {
  padding: 14px;
  border: 1px solid #d7e4f2;
  border-radius: 16px;
  background: #f6f9fd;
}

.order-management-lifecycle small,
.order-management-lifecycle strong { display: block; }
.order-management-lifecycle small { color: #7188a2; margin-bottom: 6px; }

.admin-orders-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  margin-bottom: 14px;
}

.admin-orders-table th[data-admin-orders-sort] {
  cursor: pointer;
  user-select: none;
}

.admin-orders-table th[data-admin-orders-sort]::before {
  content: "↕ ";
  color: #7d96b3;
}

.fixed-status-badge,
.country-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.fixed-status-badge.rto { background: #ffe9e9; color: #a82121; }
.fixed-status-badge.cod-done { background: #e7f8ed; color: #087443; }
.fixed-status-badge.online-payment { background: #e8f1ff; color: #165db0; }
.country-chip { background: #edf3fa; color: #284f78; }
.country-chip.ksa { background: #e8f8ef; color: #087443; }
.country-chip.uae { background: #fff2df; color: #a45b00; }

.sales-delivery-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.sales-delivery-toolbar {
  grid-template-columns: minmax(360px, 1.6fr) repeat(3, minmax(180px, 1fr)) auto;
  align-items: end;
  margin-top: 18px;
}

.sales-delivery-table th[data-sales-delivery-sort],
.sales-delivery-table th[data-carrier-delivery-sort] {
  cursor: pointer;
  user-select: none;
}

.sales-delivery-table th[data-sales-delivery-sort]::before,
.sales-delivery-table th[data-carrier-delivery-sort]::before {
  content: "↕ ";
  color: #7d96b3;
}

.delivery-rate-track {
  width: min(240px, 100%);
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf6;
}

.delivery-rate-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d5c91, #2f75df);
}

.analytics-dashboard-toolbar {
  grid-template-columns: minmax(360px, 1.6fr) repeat(2, minmax(180px, 0.8fr)) auto;
  align-items: end;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
}

.analytics-report-summary {
  padding: 16px 18px;
  border: 1px solid #d6e2ee;
  box-shadow: 0 14px 34px rgba(25, 58, 91, 0.07);
}

.analytics-summary-head {
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e3ebf3;
}

.analytics-summary-head h2 { margin: 3px 0; }
.analytics-summary-head p { margin: 0; color: var(--muted); }

.analytics-summary-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.analytics-summary-item {
  --summary-color: #2f75df;
  --summary-soft: #eaf2ff;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 68px;
  padding: 10px 13px;
  border: 1px solid #e0e8f1;
  border-radius: 16px;
  background: #fbfdff;
}

.analytics-summary-item[data-tone="green"] { --summary-color: #1f9d72; --summary-soft: #e5f8f1; }
.analytics-summary-item[data-tone="orange"] { --summary-color: #d98213; --summary-soft: #fff2df; }
.analytics-summary-item[data-tone="violet"] { --summary-color: #7458c9; --summary-soft: #f0edff; }
.analytics-summary-item[data-tone="cyan"] { --summary-color: #168eaa; --summary-soft: #e4f7fb; }
.analytics-summary-item[data-tone="rose"] { --summary-color: #cf5474; --summary-soft: #ffedf2; }

.summary-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--summary-color);
  background: var(--summary-soft);
  font-size: 1.05rem;
  font-weight: 800;
}

.analytics-summary-item div:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.analytics-summary-item span { font-weight: 800; }
.analytics-summary-item small { color: var(--muted); font-size: 0.74rem; }
.analytics-summary-item strong { color: var(--summary-color); font-size: 1.7rem; }

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

.analytics-chart-wide { grid-column: 1 / -1; }
.analytics-chart-card {
  position: relative;
  min-height: 0;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid rgba(196, 211, 227, 0.8);
  box-shadow: 0 16px 38px rgba(22, 53, 83, 0.07);
}

.analytics-chart-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #2f75df, #22a47a);
}

.analytics-chart-card canvas {
  display: block;
  max-width: 100%;
  margin-top: 6px;
}

body[data-page="orders-analytics-dashboard"] .main-panel {
  gap: 14px;
  padding: 20px;
}

.analytics-hero {
  position: relative;
  padding: 20px 24px;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(125deg, #ffffff 0%, #f4f8ff 65%, #e8f2ff 100%);
  border: 1px solid #d8e5f2;
  box-shadow: 0 20px 55px rgba(28, 65, 103, 0.1);
}

.analytics-hero::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  inset: -130px auto auto -70px;
  background: rgba(47, 117, 223, 0.1);
}

.analytics-rate-card {
  position: relative;
  min-width: 240px;
  color: #fff;
  background: linear-gradient(145deg, #173e67 0%, #286fc9 100%);
  border: 0;
  box-shadow: 0 18px 38px rgba(30, 91, 158, 0.24);
}

.analytics-rate-card span,
.analytics-rate-card small { color: rgba(255, 255, 255, 0.8); }
.analytics-rate-card strong { font-size: 2.65rem; line-height: 1; }

.rate-meter {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}

.rate-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #61e2b3, #d7fff0);
  transition: width 0.35s ease;
}

.analytics-control-panel {
  padding: 16px 18px;
  border-color: #ccdaea;
  box-shadow: 0 13px 34px rgba(25, 58, 91, 0.07);
}

.filter-panel-header,
.filter-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.filter-panel-header h2 { margin: 3px 0; }
.filter-panel-header p { margin: 0; color: var(--muted); font-size: 0.86rem; }

.analytics-periods {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background: #edf3fa;
  direction: rtl;
}

.analytics-periods button {
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 10px;
  color: #506b84;
  background: transparent;
  box-shadow: none;
  font-size: 0.84rem;
}

.analytics-periods button:hover { transform: none; background: rgba(255, 255, 255, 0.7); }
.analytics-periods button.active { color: #fff; background: linear-gradient(135deg, #225d9a, #2f75df); }

.analytics-date-range {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) 28px minmax(145px, 1fr);
  align-items: end;
  gap: 7px;
  padding: 10px;
  border: 1px solid #d9e4ef;
  border-radius: 16px;
  background: #f8fbfe;
}

.analytics-date-range label { gap: 5px; }
.analytics-date-range input { min-height: 43px; background: #fff; }
.date-range-separator { align-self: center; padding-top: 22px; text-align: center; color: #6f88a1; font-weight: 800; }

.filter-status-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #d5e0ec;
}

.filter-status-row .form-feedback { margin: 0; }
.active-filter-list { display: flex; flex-wrap: wrap; gap: 7px; }
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 999px;
  color: #185ca6;
  background: #e8f2ff;
  font-size: 0.78rem;
  font-weight: 800;
}
.active-filter-chip.neutral { color: #607b94; background: #edf3f8; }

.analytics-kpi-card {
  position: relative;
  min-height: 164px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #dbe5ef;
  box-shadow: 0 13px 32px rgba(25, 58, 91, 0.07);
}

.analytics-kpi-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--kpi-color, #2f75df);
}

.analytics-kpi-card[data-tone="blue"] { --kpi-color: #2f75df; --kpi-soft: #eaf2ff; }
.analytics-kpi-card[data-tone="green"] { --kpi-color: #1f9d72; --kpi-soft: #e5f8f1; }
.analytics-kpi-card[data-tone="orange"] { --kpi-color: #e49326; --kpi-soft: #fff2df; }
.analytics-kpi-card[data-tone="violet"] { --kpi-color: #7b61d1; --kpi-soft: #f0edff; }
.analytics-kpi-card[data-tone="cyan"] { --kpi-color: #168eaa; --kpi-soft: #e4f7fb; }
.analytics-kpi-card[data-tone="rose"] { --kpi-color: #d65f7d; --kpi-soft: #ffedf2; }
.analytics-kpi-card strong { font-size: 2rem; color: var(--kpi-color); }
.analytics-kpi-card small { color: var(--muted); }
.kpi-icon {
  position: absolute;
  inset: 16px auto auto 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--kpi-color);
  background: var(--kpi-soft);
  font-size: 1.1rem;
  font-weight: 800;
}

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

.analytics-insight-card {
  display: grid;
  gap: 5px;
  padding: 13px 16px;
  border: 1px solid #d9e4ef;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 11px 28px rgba(25, 58, 91, 0.06);
}
.analytics-insight-card span,
.analytics-insight-card small { color: var(--muted); }
.analytics-insight-card strong { font-size: 1.15rem; }

.analytics-print-button {
  background: linear-gradient(135deg, #178068, #22a47a);
}

.analytics-print-meta { display: none; }

@media print {
  @page { size: A4 landscape; margin: 9mm; }

  body[data-page="orders-analytics-dashboard"] {
    background: #fff;
    color: #142f45;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body[data-page="orders-analytics-dashboard"] .app-shell { display: block; }
  body[data-page="orders-analytics-dashboard"] .sidebar,
  body[data-page="orders-analytics-dashboard"] .global-action-bar,
  body[data-page="orders-analytics-dashboard"] .analytics-hero,
  body[data-page="orders-analytics-dashboard"] .analytics-control-panel { display: none !important; }

  body[data-page="orders-analytics-dashboard"] .main-panel {
    display: block;
    padding: 0;
  }

  body[data-page="orders-analytics-dashboard"] .analytics-print-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 8mm;
    padding-bottom: 4mm;
    border-bottom: 2px solid #245f9e;
  }

  .analytics-print-meta > div { display: grid; gap: 2px; }
  .analytics-print-meta > div:last-child { text-align: left; }
  .analytics-print-meta strong { font-size: 18pt; color: #245f9e; }
  .analytics-print-meta span { font-weight: 700; }
  .analytics-print-meta small { color: #607b94; }

  body[data-page="orders-analytics-dashboard"] .analytics-insight-grid,
  body[data-page="orders-analytics-dashboard"] .analytics-chart-grid,
  body[data-page="orders-analytics-dashboard"] .analytics-summary-list { gap: 4mm; }

  body[data-page="orders-analytics-dashboard"] .analytics-insight-card,
  body[data-page="orders-analytics-dashboard"] .analytics-chart-card,
  body[data-page="orders-analytics-dashboard"] .analytics-report-summary {
    box-shadow: none;
    break-inside: avoid;
  }

  body[data-page="orders-analytics-dashboard"] .analytics-insight-grid { margin-bottom: 4mm; }
  body[data-page="orders-analytics-dashboard"] .analytics-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-page="orders-analytics-dashboard"] .analytics-chart-wide { grid-column: 1 / -1; }
  body[data-page="orders-analytics-dashboard"] .analytics-report-summary { margin-top: 4mm; }
  body[data-page="orders-analytics-dashboard"] .analytics-summary-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.report-control-panel { margin-bottom: 0; }
.analytics-report-metrics {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
}

.analytics-report-metrics .metric-card {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 15px 16px;
  border: 1px solid #dce6f0;
  border-top: 4px solid #2f75df;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(25, 58, 91, 0.06);
}

.analytics-report-metrics .metric-card span,
.analytics-report-metrics .metric-card small { color: var(--muted); }
.analytics-report-metrics .metric-card strong { font-size: 1.65rem; }

body[data-page="sales-delivery-performance"] .main-panel,
body[data-page="carrier-delivery-performance"] .main-panel {
  gap: 14px;
  padding: 20px;
}

body[data-page="sales-delivery-performance"] .status-card,
body[data-page="carrier-delivery-performance"] .status-card { padding: 18px; }

body[data-page="sales-delivery-performance"] .crm-card,
body[data-page="carrier-delivery-performance"] .crm-card { padding: 17px 18px; }
.sales-delivery-table th[data-sales-delivery-sort],
.sales-delivery-table th[data-carrier-delivery-sort] { transition: color 0.18s ease, background 0.18s ease; }
.sales-delivery-table th[data-sales-delivery-sort]:hover,
.sales-delivery-table th[data-carrier-delivery-sort]:hover { color: #1d64bd; background: #edf5ff; }

@media print {
  body[data-page="sales-delivery-performance"],
  body[data-page="carrier-delivery-performance"] {
    background: #fff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body[data-page="sales-delivery-performance"] .app-shell,
  body[data-page="carrier-delivery-performance"] .app-shell { display: block; }

  body[data-page="sales-delivery-performance"] .sidebar,
  body[data-page="sales-delivery-performance"] .global-action-bar,
  body[data-page="sales-delivery-performance"] .topbar,
  body[data-page="sales-delivery-performance"] .analytics-control-panel,
  body[data-page="carrier-delivery-performance"] .sidebar,
  body[data-page="carrier-delivery-performance"] .global-action-bar,
  body[data-page="carrier-delivery-performance"] .topbar,
  body[data-page="carrier-delivery-performance"] .analytics-control-panel { display: none !important; }

  body[data-page="sales-delivery-performance"] .main-panel,
  body[data-page="carrier-delivery-performance"] .main-panel {
    display: block;
    padding: 0;
  }

  body[data-page="sales-delivery-performance"] .analytics-print-meta,
  body[data-page="carrier-delivery-performance"] .analytics-print-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 6mm;
    padding-bottom: 4mm;
    border-bottom: 2px solid #245f9e;
  }

  body[data-page="sales-delivery-performance"] .analytics-report-metrics,
  body[data-page="carrier-delivery-performance"] .analytics-report-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3mm;
    margin-bottom: 5mm;
  }

  body[data-page="carrier-delivery-performance"] .analytics-report-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body[data-page="sales-delivery-performance"] .metric-card,
  body[data-page="carrier-delivery-performance"] .metric-card {
    min-height: 0;
    padding: 3mm;
    box-shadow: none;
    break-inside: avoid;
  }

  body[data-page="sales-delivery-performance"] .crm-card,
  body[data-page="carrier-delivery-performance"] .crm-card {
    padding: 4mm;
    box-shadow: none;
    break-inside: avoid;
  }

  body[data-page="sales-delivery-performance"] table,
  body[data-page="carrier-delivery-performance"] table { font-size: 8.5pt; }

  body[data-page="sales-delivery-performance"] th,
  body[data-page="sales-delivery-performance"] td,
  body[data-page="carrier-delivery-performance"] th,
  body[data-page="carrier-delivery-performance"] td { padding: 2.2mm 1.5mm; }
}

@media (max-width: 1250px) {
  .analytics-kpi-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .analytics-dashboard-toolbar,
  .sales-delivery-toolbar { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .analytics-date-range { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .order-management-toolbar,
  .admin-orders-toolbar,
  .sales-delivery-toolbar,
  .sales-delivery-metrics,
  .analytics-kpi-grid,
  .analytics-chart-grid,
  .order-management-lifecycle { grid-template-columns: 1fr; }
  .analytics-chart-wide { grid-column: auto; }
  .analytics-insight-grid { grid-template-columns: 1fr; }
  .analytics-summary-list { grid-template-columns: 1fr; }
  .filter-panel-header,
  .filter-status-row { align-items: stretch; flex-direction: column; }
  .analytics-periods { display: grid; grid-template-columns: repeat(4, 1fr); }
  .analytics-date-range { grid-template-columns: 1fr; }
  .date-range-separator { display: none; }
}
.database-backup-page { gap: 18px; }
.database-backup-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.database-backup-actions h2 { margin: 10px 0 6px; }
.database-backup-actions p, .database-restore-warning p { margin: 0; color: var(--muted); }
.database-restore-warning { border-inline-start: 5px solid #e8a317; background: linear-gradient(135deg, #fffaf0, #ffffff); }
.database-restore-warning strong { display: block; color: #9a6200; margin-bottom: 6px; }
.database-backup-file { max-width: 420px; overflow-wrap: anywhere; }
.database-backup-type { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: #eaf2ff; color: #1559a8; font-weight: 700; }
.database-backup-type.pre-restore { background: #fff1d6; color: #955c00; }
@media (max-width: 760px) { .database-backup-actions { align-items: stretch; flex-direction: column; } }
.warehouse-line-editor{display:grid;grid-template-columns:minmax(260px,2fr) minmax(140px,.7fr) auto;gap:12px;align-items:end;margin:18px 0}.warehouse-line-editor select,.warehouse-line-editor input{width:100%;min-height:52px}.warehouse-transaction-lines{display:grid;gap:12px;margin:16px 0}.warehouse-transaction-line{display:grid;grid-template-columns:minmax(260px,1fr) 180px auto;gap:16px;align-items:center;padding:16px 18px;border:1px solid #d4e2f1;border-radius:18px;background:#f7faff}.warehouse-transaction-line div{display:grid;gap:4px}.warehouse-transaction-line small{color:#647b92}.warehouse-transaction-line label{display:grid;gap:5px}.warehouse-transaction-line input{width:100%;min-height:46px}.warehouse-components-dialog{width:min(900px,94vw);max-height:88vh;border:0;border-radius:24px;padding:24px;box-shadow:0 24px 70px #102f4e55}.warehouse-components-dialog::backdrop{background:#102f4e99}.warehouse-component-preview{padding:18px;border-radius:18px;background:#f4f8fc;border:1px solid #d8e5f2}.warehouse-component-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}.warehouse-component-grid article{display:grid;gap:5px;padding:15px;border-radius:15px;background:#fff;border:1px solid #d8e5f2}.warehouse-component-grid span{color:#60788f}.empty-state{padding:20px;text-align:center;color:#6a8197;background:#f7faff;border:1px dashed #cadced;border-radius:16px}@media(max-width:800px){.warehouse-line-editor,.warehouse-transaction-line{grid-template-columns:1fr}.warehouse-transaction-line button{width:100%}}
.full-data-card {
  min-width: 0;
}

.full-data-toolbar {
  grid-template-columns: minmax(320px, 2fr) minmax(180px, 1fr) minmax(140px, .7fr) auto;
}

.full-data-table-wrap {
  max-height: calc(100vh - 390px);
  overflow: auto;
  border: 1px solid #dce7f2;
  border-radius: 18px;
}

.full-data-table {
  width: max-content;
  min-width: 100%;
  white-space: nowrap;
}

.full-data-table th,
.full-data-table td {
  min-width: 135px;
  max-width: 320px;
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.full-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eaf2fb;
}

.full-data-table th:first-child,
.full-data-table td:first-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  font-weight: 800;
}

.full-data-table thead th:first-child {
  z-index: 4;
  background: #eaf2fb;
}

.full-data-yes { color: #078447; font-weight: 800; }
.full-data-no { color: #b42318; font-weight: 700; }

.full-data-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .full-data-toolbar { grid-template-columns: 1fr; }
  .full-data-table-wrap { max-height: calc(100vh - 460px); }
}

.attendance-monthly-filter { grid-template-columns: minmax(190px, .6fr) minmax(300px, 1.4fr) auto auto; align-items: end; }
.attendance-matrix-wrap { max-height: calc(100vh - 390px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; }
.attendance-matrix { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
.attendance-matrix th, .attendance-matrix td { min-width: 82px; padding: 10px 9px; text-align: center; border-bottom: 1px solid var(--line); border-inline-start: 1px solid #edf2f7; }
.attendance-matrix thead th { position: sticky; top: 0; z-index: 3; background: #eaf2fb; color: #31536f; }
.attendance-matrix th:first-child { position: sticky; right: 0; z-index: 2; min-width: 110px; max-width: 110px; text-align: center; background: #fff; }
.attendance-matrix th:nth-child(2) { position: sticky; right: 110px; z-index: 2; min-width: 230px; max-width: 230px; text-align: right; background: #fff; }
.attendance-matrix thead th:first-child { z-index: 4; background: #eaf2fb; }
.attendance-matrix thead th:nth-child(2) { z-index: 4; background: #eaf2fb; }
.attendance-matrix tbody th:nth-child(2) small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.attendance-matrix-value { background: #f3faf7; color: #176d50; font-weight: 800; }
.attendance-matrix-late { background: #fff0ed; color: #b42318; font-weight: 800; }
.attendance-matrix-warning { background: #fff8e8; color: #986000; font-size: .78rem; font-weight: 800; }
.attendance-matrix-total { background: #eaf2ff; color: #1f5faa; font-weight: 900; }
.attendance-matrix-action { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.attendance-matrix-action:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 2px #2e6fd855; }
.attendance-matrix-action small { display: block; margin-top: 4px; font-size: .72rem; }
.attendance-matrix-absence { background: #fde8e7; color: #9f1c13; font-weight: 900; }
.attendance-matrix-late.attendance-matrix-justified,
.attendance-matrix-absence.attendance-matrix-justified { background: #fff4cf; color: #8a5a00; }
.attendance-matrix-late.attendance-matrix-no-deduction,
.attendance-matrix-absence.attendance-matrix-no-deduction { background: #dff6e8; color: #08783d; }
.attendance-matrix-holiday { background: #e7f7ee; color: #08783d; font-weight: 900; }
.attendance-matrix-leave { background: #e8edff; color: #4d55a5; font-weight: 900; }
.attendance-matrix-compensated { background: #dff6e8; color: #08783d; font-weight: 900; }
.attendance-dialog-overlay { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px; background: #102f4e99; }
.attendance-dialog { width: min(720px, 96vw); max-height: 90vh; overflow: auto; padding: 24px; border-radius: 24px; background: #fff; box-shadow: 0 24px 70px #102f4e55; }
.attendance-holidays-dialog { width: min(900px, 96vw); }
.attendance-decision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.attendance-decision-grid label { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #f8fbff; cursor: pointer; }
.attendance-decision-grid label:has(input:checked) { border-color: var(--blue); background: #eaf2ff; box-shadow: inset 0 0 0 1px var(--blue); }
.attendance-decision-grid.two-options { grid-template-columns: repeat(2, 1fr); }
.attendance-decision-grid input { width: auto; min-height: auto; justify-self: start; }
.attendance-decision-grid span { color: var(--muted); font-size: .88rem; }
.attendance-dialog textarea { width: 100%; margin: 8px 0 16px; }
.attendance-punch-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.attendance-punch-summary div { display: grid; gap: 5px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 15px; background: #f7faff; }
.attendance-punch-summary span { color: var(--muted); }
.attendance-punch-summary strong { font-size: 1.25rem; color: #174e83; }
.attendance-punch-summary .is-compensated { color: #08783d; }
.attendance-punch-summary .is-not-compensated { color: #b42318; }
.attendance-punch-summary small { color: var(--muted); }
.attendance-compensation-toggle { display: flex; align-items: center; gap: 12px; min-width: 230px; padding: 14px 18px; border: 1px solid #cdddef; border-radius: 18px; background: #fff; cursor: pointer; }
.attendance-compensation-toggle input { width: 22px; height: 22px; min-height: auto; accent-color: var(--green); }
.attendance-compensation-toggle span { display: grid; gap: 3px; }
.attendance-compensation-toggle small { color: var(--muted); }
.attendance-matrix-total small { display: block; margin-top: 4px; color: #7b4b00; }
.attendance-matrix-absence-total { background: #fff0ed; color: #a3261d; font-weight: 900; }
.attendance-matrix-overtime { background: #eaf2ff; color: #1f5faa; font-weight: 900; }
.attendance-matrix-overtime-holiday { background: #e7f7ee; color: #08783d; font-weight: 900; }
.attendance-matrix-overtime-holiday small { display: block; margin-top: 4px; font-size: .68rem; white-space: nowrap; }
.attendance-matrix-early { background: #fff4cf !important; color: #8a5a00 !important; font-weight: 900; }
.attendance-early-alert { display: block; margin-top: 4px; color: #8a5a00; font-size: .68rem; white-space: nowrap; }
.attendance-alert-summary { color: #9a5d00; font-weight: 800; }
.attendance-ph-option { border-color: #80aee8 !important; background: #eef5ff !important; }
.attendance-ph-option:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.employee-ph-form { grid-template-columns: 1.4fr 1fr .8fr 1.5fr auto; align-items: end; }
.ph-credit { color: #08783d; font-weight: 900; }
.ph-debit { color: #b42318; font-weight: 900; }

@media print {
  @page { size: landscape; margin: 8mm; }
  body[data-page="employee-duration"] .sidebar,
  body[data-page="employee-lateness"] .sidebar,
  body[data-page="employee-overtime"] .sidebar,
  body[data-page="employee-duration"] .topbar,
  body[data-page="employee-lateness"] .topbar,
  body[data-page="employee-overtime"] .topbar,
  body[data-page="employee-duration"] #employeeMonthlyFilter,
  body[data-page="employee-lateness"] #employeeMonthlyFilter,
  body[data-page="employee-overtime"] #employeeMonthlyFilter,
  body[data-page="employee-duration"] #employeeMonthlyFeedback,
  body[data-page="employee-lateness"] #employeeMonthlyFeedback,
  body[data-page="employee-overtime"] #employeeMonthlyFeedback { display: none !important; }
  body[data-page="employee-duration"] .main-panel,
  body[data-page="employee-lateness"] .main-panel,
  body[data-page="employee-overtime"] .main-panel { margin: 0; padding: 0; width: 100%; }
  .attendance-matrix-wrap { overflow: visible; }
  .attendance-matrix { width: 100%; font-size: 7pt; }
  .attendance-matrix th, .attendance-matrix td { min-width: 0; padding: 4px 3px; }
  .attendance-matrix thead th, .attendance-matrix tbody th { position: static !important; }
  .crm-card { box-shadow: none; border: 0; padding: 0; }
}
.attendance-holiday-form { grid-template-columns: 1.4fr 1fr 1fr auto; align-items: end; margin: 18px 0; }
.employee-shift-create { grid-template-columns: repeat(4, minmax(160px, 1fr)); align-items: end; }
.employee-shift-period-row { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)); gap: 12px; align-items: end; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #f8fbff; }
.employee-shift-period-row label { display: grid; gap: 6px; }
.employee-shift-actions { display: flex; gap: 8px; }
.employee-shift-period-row [data-shift-feedback] { align-self: center; }
@media (max-width: 900px) { .attendance-monthly-filter { grid-template-columns: 1fr; } .attendance-matrix-wrap { max-height: calc(100vh - 470px); } }
@media (max-width: 1100px) { .employee-shift-create, .employee-shift-period-row { grid-template-columns: repeat(2, minmax(180px, 1fr)); } }
@media (max-width: 700px) { .attendance-decision-grid, .attendance-holiday-form, .employee-shift-create, .employee-shift-period-row { grid-template-columns: 1fr; } }

.employee-attendance-page .main-panel { gap: 20px; }
.employee-attendance-hero { overflow: hidden; position: relative; padding: 30px 34px; border-radius: 24px; background: linear-gradient(135deg, #173f67 0%, #2e6fd8 100%); color: #fff; box-shadow: 0 22px 50px #204f8430; }
.employee-attendance-hero .eyebrow, .employee-attendance-hero p { color: #dcecff; }
.employee-attendance-hero h1 { margin: 7px 0; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.employee-attendance-hero-icon { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 24px; background: #ffffff1f; border: 1px solid #ffffff35; font-size: 2.5rem; font-weight: 900; transform: rotate(-7deg); }
.employee-section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.employee-section-heading.compact { margin-bottom: 14px; }
.employee-section-heading h2 { margin: 0 0 4px; }
.employee-section-heading p { margin: 0; color: var(--muted); }
.employee-section-icon { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: #e7f0ff; color: #1e61b8; font-size: 1.6rem; font-weight: 800; }
.employee-section-icon.filter { background: #e7f7ee; color: #158057; }
.employee-attendance-entry { border-top: 4px solid #2e6fd8; }
.employee-attendance-form { grid-template-columns: repeat(4, minmax(150px, 1fr)); align-items: end; }
.employee-attendance-form .employee-attendance-wide { grid-column: span 2; }
.employee-manual-punch-form { grid-template-columns: minmax(280px, 2fr) repeat(2, minmax(170px, 1fr)) minmax(260px, 1.5fr) auto; }
.employee-manual-punch-form .employee-attendance-wide { grid-column: auto; }
.employee-attendance-save { min-height: 52px; box-shadow: 0 12px 24px #2e6fd82a; }
.employee-attendance-filter-card { background: linear-gradient(135deg, #f8fbff, #fff); }
.employee-attendance-filter { grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto; align-items: end; }
.employee-attendance-table-card { padding-bottom: 14px; }
.employee-attendance-table-wrap { max-height: 480px; border: 1px solid var(--line); border-radius: 18px; }
.employee-attendance-table thead th { position: sticky; top: 0; z-index: 2; background: #edf4fc; color: #355873; }
.employee-attendance-table tbody tr { transition: background .15s ease; }
.employee-attendance-table tbody tr:hover { background: #f6faff; }
.employee-attendance-status { display: inline-flex; min-width: 76px; justify-content: center; padding: 6px 12px; border-radius: 999px; font-weight: 800; }
.employee-attendance-status.present { background: #e2f6ea; color: #08783d; }
.employee-attendance-status.absent { background: #fde8e7; color: #a3261d; }
.employee-attendance-status.late { background: #fff0cf; color: #986000; }
.employee-attendance-status.leave { background: #e8edff; color: #4d55a5; }
@media (max-width: 1100px) { .employee-attendance-form, .employee-manual-punch-form { grid-template-columns: repeat(2, minmax(170px, 1fr)); } .employee-attendance-filter { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 650px) { .employee-attendance-form, .employee-attendance-filter { grid-template-columns: 1fr; } .employee-attendance-form .employee-attendance-wide { grid-column: auto; } .employee-attendance-hero-icon { display: none; } }
