﻿:root {
  --bg: #f7efe9;
  --panel: #ffffff;
  --border: #e6d6c9;
  --text: #1f2937;
  --muted: #64748b;
  --ok: #0f766e;
  --error: #b91c1c;
  --warning: #92400e;
  --primary: #2952d7;
  --sidebar-bg: #f8eee8;
  --sidebar-border: #e5d2c4;
  --sidebar-active: #fde2d3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 0% 0%, #f8fbff 0%, #eef2f7 45%, #e8edf5 100%);
  color: var(--text);
}

.layout-shell {
  overflow: hidden;
}

.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #0f172a;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}

.brand-text {
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: #1e293b;
  font-weight: 600;
}

.nav-item:hover {
  background: #eff6ff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #1e3a8a;
}

.nav-section {
  margin-top: 12px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.nav-sub {
  margin-left: 10px;
}

.nav-icon {
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 86px;
}

.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .nav-text,
.app-shell.sidebar-collapsed .sidebar-foot .nav-text {
  display: none;
}

.main-panel {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: auto;
}

.page-content {
  padding: 22px;
  width: 100%;
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
}

.container {
  width: 100%;
  max-width: 1180px;
}

h1,
h3 {
  margin-top: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.card.small {
  max-width: 420px;
}

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-weight: 600;
}

input,
select,
button,
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
}

button {
  margin-top: 12px;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.25);
}

button.ghost {
  background: #475569;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.row-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.row-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-check input {
  width: auto;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form select {
  width: 200px;
}

.inline-form button {
  width: 220px;
  margin-top: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.metric p {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.ok {
  color: var(--ok);
}

.fail {
  color: var(--error);
}

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}

.alert.success {
  background: #ecfeff;
  color: #115e59;
  border-color: #99f6e4;
}

.alert.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 8px;
  vertical-align: top;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.update {
  background: #dbeafe;
  color: #1e3a8a;
}

.badge.fix {
  background: #fee2e2;
  color: #991b1b;
}

.sync-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.sync-actions form {
  margin: 0;
}

.btn-sync {
  margin: 0;
  width: 100%;
  font-weight: 700;
  border-radius: 10px;
}

.btn-sync-all {
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
}

.btn-sync-so {
  background: linear-gradient(90deg, #2563eb, #4338ca);
}

.btn-sync-inv {
  background: linear-gradient(90deg, #059669, #16a34a);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-success {
  color: #065f46;
  background: #d1fae5;
  border-color: #6ee7b7;
}

.status-failed {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

.status-skipped {
  color: #92400e;
  background: #ffedd5;
  border-color: #fdba74;
}

.status-none {
  color: #334155;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.status-queued {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.status-running {
  color: #1e40af;
  background: linear-gradient(120deg, #dbeafe 30%, #bfdbfe 48%, #dbeafe 66%);
  border-color: #93c5fd;
  background-size: 220% 100%;
  animation: run-shimmer 1.2s linear infinite;
}

.job-running td {
  background: linear-gradient(120deg, rgba(219, 234, 254, 0.55) 25%, rgba(191, 219, 254, 0.75) 45%, rgba(219, 234, 254, 0.55) 65%);
  background-size: 220% 100%;
  animation: run-shimmer 1.4s linear infinite;
}

.job-success td {
  background: rgba(209, 250, 229, 0.32);
}

.job-failed td {
  background: rgba(254, 226, 226, 0.35);
}

.version {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

@keyframes run-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -20% 0;
  }
}

.sql-editor {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  background: #f8fafc;
  color: #0f172a;
}

.item-hover-stock {
  color: #1d4ed8;
  font-weight: 600;
  cursor: help;
  text-decoration: underline dotted;
}

.stock-tooltip {
  position: absolute;
  z-index: 2000;
  min-width: 360px;
  max-width: 540px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
  font-size: 12px;
  pointer-events: none;
}

.stock-tooltip.hidden {
  display: none;
}

.stock-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #93c5fd;
}

.stock-mini-table {
  width: 100%;
  border-collapse: collapse;
}

.stock-mini-table th,
.stock-mini-table td {
  border-bottom: 1px solid #334155;
  padding: 4px 6px;
  font-size: 12px;
}

.stock-mini-table th {
  color: #cbd5e1;
  background: transparent;
}

.stock-mini-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.browser-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.browser-form label {
  margin: 0 0 6px;
}

.browser-form button {
  margin-top: 0;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
}

.browser-pagination {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.pager-form {
  margin: 0;
}

.pager-form button {
  margin-top: 0;
  min-width: 120px;
}

@media (max-width: 980px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .row-actions,
  .sync-actions {
    grid-template-columns: 1fr;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form select,
  .inline-form button {
    width: 100%;
  }

  .sidebar {
    width: 86px;
  }

  .brand-text,
  .nav-text,
  .sidebar-foot .nav-text {
    display: none;
  }

  .page-content {
    padding: 14px;
  }
}

.user-meta {
  margin-top: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
}

.user-name {
  font-weight: 700;
  color: #0f172a;
}

.user-role {
  margin-top: 4px;
  text-transform: uppercase;
  font-size: 11px;
  color: #1e3a8a;
  font-weight: 700;
}

.user-email {
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
  word-break: break-all;
}

.muted {
  color: #94a3b8;
  font-size: 12px;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.user-form-action {
  display: flex;
  align-items: flex-end;
}

.user-form-action button {
  margin-top: 0;
}

.app-shell.sidebar-collapsed .user-meta {
  display: none;
}


.share-wrap {
  min-width: 140px;
}

.share-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.share-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
}

.trend-chart {
  margin-bottom: 14px;
  min-height: 260px;
  padding: 12px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 8px;
  align-items: end;
}

.trend-col {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 6px;
}

.trend-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.trend-col-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: left;
  white-space: nowrap;
  font-size: 11px;
  color: #475569;
  margin: 0 auto;
}

/* Sidebar long-menu improvements */
.sidebar {
  min-height: 0;
}

.sidebar-nav {
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.sidebar-head,
.user-meta,
.sidebar-foot {
  flex-shrink: 0;
}

.nav-group {
  margin-top: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.nav-group[open] {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.nav-section-toggle {
  margin-top: 0;
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.nav-section-toggle::-webkit-details-marker {
  display: none;
}

.nav-caret {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.nav-group[open] .nav-caret {
  transform: rotate(90deg);
}

.nav-group-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 0 8px;
}

.nav-group-body .nav-sub {
  margin-right: 4px;
}

.app-shell.sidebar-collapsed .nav-caret {
  display: none;
}

.app-shell.sidebar-collapsed .nav-group {
  border-color: transparent;
  background: transparent;
}

.app-shell.sidebar-collapsed .nav-group .nav-group-body {
  display: none;
}


/* Fancyfoods page style tune */
.ff-page h1 {
  margin-bottom: 14px;
  font-size: 44px;
  line-height: 1.08;
  color: #1f2937;
  letter-spacing: -0.02em;
}

.ff-card {
  border-color: #e8d9cc;
  background: #fffdfb;
}

.ff-metric {
  background: linear-gradient(180deg, #fffdfb 0%, #fff8f3 100%);
}

.ff-metric h3 {
  color: #334155;
}

.ff-metric p {
  color: #0f172a;
}

.ff-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ff-month-btn {
  height: 36px;
  font-size: 13px;
  font-weight: 700;
  border-color: #c5d7fb;
  color: #1e3a8a;
  background: #eff6ff;
}

.ff-actions-form button {
  min-width: 220px;
}

.ff-filter-form button {
  min-width: 220px;
}

.exec-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.exec-filter-grid label {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
}

.exec-filter-grid input,
.exec-filter-grid select {
  height: 40px;
  padding: 7px 10px;
  font-size: 14px;
  line-height: 18px;
  border-radius: 12px;
}

.exec-filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 40px;
  white-space: nowrap;
}

.exec-filter-actions button {
  width: auto;
  min-width: 118px;
  margin-top: 0;
  padding: 8px 12px;
  height: 40px;
}

.exec-custom-range {
  grid-column: 1 / -1;
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 220px));
  gap: 8px;
  align-items: end;
}

.exec-custom-range label {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 16px;
}

.exec-custom-range input {
  height: 40px;
  padding: 7px 10px;
  font-size: 14px;
  line-height: 18px;
  border-radius: 12px;
}

.exec-scope-mini {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 12px;
  line-height: 16px;
}

.exec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.exec-metric {
  padding: 14px 16px;
  min-height: 150px;
}

.exec-metric h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 0.2px;
}

.exec-metric p {
  margin: 0;
  font-size: 48px;
  line-height: 52px;
  letter-spacing: -0.8px;
}

.exec-metric .exec-unit {
  font-size: 20px;
  line-height: 24px;
  color: #1f2937;
  letter-spacing: 0;
}

.exec-metric small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  line-height: 16px;
}
.exec-compare-card p {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
}
.exec-more-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-start;
}

.exec-more-btn {
  width: auto !important;
  min-width: 150px;
  margin-top: 0 !important;
  padding: 8px 12px;
}


.exec-help-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  margin-top: 0;
}

.exec-help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 2400;
}

.exec-help-overlay[hidden] {
  display: none !important;
}

.exec-help-modal {
  width: min(980px, 96vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.25);
}

.exec-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.exec-help-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 22px;
}

.exec-help-close {
  height: 34px;
  min-width: 84px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  cursor: pointer;
}

.exec-help-body {
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}

.exec-help-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
}

.exec-help-box {
  border: 1px solid #cbd5e1;
  background: #f8fbff;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  line-height: 18px;
  font-weight: 700;
  color: #0f172a;
}

.exec-help-box small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: #475569;
}

.exec-help-guide {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
}

.exec-help-guide h4 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 20px;
}
.exec-help-guide p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 18px;
}

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

.exec-help-list li {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 18px;
}

.exec-help-guide ol {
  margin: 0;
  padding-left: 18px;
}

.exec-help-guide li {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 18px;
}

.is-hidden-row {
  display: none;
}

@media (max-width: 1360px) {
  .exec-filter-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .exec-kpi-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 960px) {
  .exec-filter-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .exec-custom-range {
    grid-template-columns: 1fr;
  }

  .exec-help-body {
    grid-template-columns: 1fr;
  }

  .exec-help-layout {
    grid-template-columns: 1fr;
  }

  .exec-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.perf-filter-card {
  padding: 12px 14px;
  margin-bottom: 12px;
}

.perf-filter-grid {
  display: grid;
  grid-template-columns: minmax(250px, 1.3fr) repeat(3, minmax(160px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.perf-filter-grid label {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 16px;
}

.perf-filter-grid input,
.perf-filter-grid select {
  height: 36px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 18px;
}

.perf-time-inline {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 128px;
  gap: 6px;
  align-items: end;
}

.perf-month-input {
  min-width: 0;
}

.perf-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  min-height: 36px;
  white-space: nowrap;
}

.perf-filter-actions button,
.perf-filter-actions .btn-link {
  width: auto;
  min-width: 96px;
  height: 36px;
  margin-top: 0;
  padding: 7px 12px;
}

.perf-prev-note {
  margin-top: 6px;
  line-height: 16px;
}

.perf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.perf-compare-card p {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 700;
}

@media (max-width: 1360px) {
  .perf-filter-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

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

  .perf-time-inline {
    grid-template-columns: minmax(140px, 1fr) 116px;
  }
}

@media (max-width: 960px) {
  .perf-filter-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .perf-time-inline {
    grid-template-columns: 1fr;
  }

  .perf-month-input {
    display: block;
  }

  .perf-filter-actions {
    flex-wrap: wrap;
  }

  .perf-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .perf-filter-grid {
    grid-template-columns: 1fr;
  }
}

.trend-chart-wrap {
  overflow-x: auto;
  padding-bottom: 6px;
}

.trend-chart {
  margin-bottom: 14px;
  min-height: 280px;
  padding: 12px 10px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background:
    repeating-linear-gradient(
      to top,
      rgba(148, 163, 184, 0.18) 0,
      rgba(148, 163, 184, 0.18) 1px,
      transparent 1px,
      transparent 52px
    ),
    linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 8px;
  align-items: end;
}

.trend-col {
  height: 228px;
  min-height: 228px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 6px;
}

.trend-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #5f8df6 0%, #2f57d6 100%);
  box-shadow: 0 6px 14px rgba(47, 87, 214, 0.28);
}

.trend-col-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: left;
  white-space: nowrap;
  font-size: 11px;
  color: #4b5563;
  margin: 0 auto;
}

.sidebar {
  background: linear-gradient(180deg, #f8eee8 0%, #f5ebe5 100%);
}

.nav-item.active {
  background: #fde2d3;
  color: #9a3412;
}

.nav-item:hover {
  background: #fff1e7;
}

.nav-group[open] {
  background: #fef4ee;
  border-color: #f2ddcf;
}

@media (max-width: 980px) {
  .ff-page h1 {
    font-size: 32px;
  }
}

/* SO Daily page */
.daily-page .muted {
  margin-top: 10px;
}

.event-flags {
  min-width: 220px;
}

.event-flags .badge {
  margin-right: 6px;
  margin-bottom: 4px;
}

.mapping-inline-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 120px;
  gap: 8px;
  align-items: center;
  min-width: 320px;
}

.mapping-inline-form input {
  width: 100%;
  margin: 0;
  height: 34px;
  padding: 6px 8px;
}

.btn-mini {
  width: 100%;
  margin: 0;
  height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.btn-ok {
  background: #0f766e;
}

.btn-danger {
  background: #b91c1c;
}

.trend-col-double {
  gap: 8px;
}

.trend-bar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 100%;
}

.trend-bar-total,
.trend-bar-mt {
  min-height: 4px;
  width: 48%;
}

.trend-bar-total {
  background: linear-gradient(180deg, #94a3b8 0%, #475569 100%);
}

.trend-bar-mt {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

@media (max-width: 980px) {
  .mapping-inline-form {
    grid-template-columns: 1fr;
    min-width: 220px;
  }
}

.bulk-form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  align-items: end;
}

.code-bulk-area {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .bulk-form-grid {
    grid-template-columns: 1fr;
  }
}

.table-resizable {
  table-layout: fixed;
  width: max-content;
  min-width: 0;
}

.table-resizable th,
.table-resizable td {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0 !important;
  max-width: none;
}

.table-resizable td > * {
  display: block;
  min-width: 0 !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-resizable td .muted {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-resizable input,
.table-resizable textarea,
.table-resizable select {
  min-width: 0 !important;
  max-width: 100%;
  width: 100%;
}

.table-resizable .col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 3;
}

.table-resizable .col-resizer::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: 5px;
  width: 2px;
  background: #cbd5e1;
  border-radius: 2px;
}

.table-resizable.table-resizing {
  user-select: none;
  cursor: col-resize;
}

.mapping-note-area {
  min-width: 120px;
  width: 180px;
  height: 34px;
  min-height: 34px;
  max-height: 96px;
  resize: horizontal;
  overflow: auto;
  line-height: 1.2;
  padding: 6px 8px;
}


.mt-product-table th,
.mt-product-table td {
  min-width: 0 !important;
}

.mt-product-table th:first-child,
.mt-product-table td:first-child {
  min-width: 52px;
}

.mt-product-thumb {
  width: 86px;
  height: 58px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #64748b;
  font-size: 11px;
}

.mt-product-thumb.placeholder {
  background: #f8fafc;
}

.mt-product-textarea {
  min-width: 0 !important;
  min-height: 56px;
  width: 100%;
  resize: both;
  white-space: normal;
}

.mt-product-table input,
.mt-product-table textarea {
  font-size: 12px;
  padding: 6px 8px;
}

.mt-product-action-form {
  min-width: 96px;
}

.mt-product-action-form button {
  margin-top: 0;
}

.sap-raw-details {
  margin-top: 8px;
}

.sap-raw-details summary {
  cursor: pointer;
  color: #1e3a8a;
  font-weight: 600;
  font-size: 12px;
}

.sap-raw-details pre {
  margin-top: 6px;
  max-height: 220px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  line-height: 1.35;
  white-space: pre;
}


.mt-cell-actions {
  min-width: 170px !important;
  white-space: normal;
}

.mt-cell-image {
  min-width: 210px !important;
  white-space: normal;
}

.mt-upload-input {
  margin-top: 8px;
  font-size: 12px;
  padding: 6px;
}

.mt-cell-actions .btn-link {
  margin-top: 8px;
  width: 100%;
}

.mt-cell-actions .muted {
  margin-top: 6px;
}

.mt-col-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mt-col-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.mt-col-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mt-col-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #1f2937;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mt-col-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.mt-col-btn.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* MT Products View compact toolbar */
.mt-view-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mt-view-toolbar .mt-search-input {
  flex: 1 1 420px;
  min-width: 260px;
  max-width: 760px;
  margin: 0;
  height: 38px;
}

.mt-view-toolbar .mt-limit-input {
  width: 92px;
  min-width: 92px;
  margin: 0;
  height: 38px;
}

.mt-btn-compact {
  width: auto !important;
  min-width: 86px;
  height: 38px;
  margin-top: 0 !important;
  padding: 0 14px;
}

.mt-view-toolbar .btn-link.mt-btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mt-col-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mt-col-actions #mt-col-order {
  display: block;
  flex: 1 1 100%;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mt-col-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.mt-col-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mt-col-btn {
  width: auto !important;
  min-width: 0;
  margin-top: 0 !important;
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #1f2937;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mt-col-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.mt-col-btn.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

@media (max-width: 980px) {
  .mt-view-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mt-view-toolbar .mt-search-input,
  .mt-view-toolbar .mt-limit-input,
  .mt-view-toolbar .mt-btn-compact,
  .mt-col-actions .mt-btn-compact {
    width: 100% !important;
    max-width: none;
  }

  .mt-col-actions #mt-col-order {
    white-space: normal;
  }
}

/* MT Products View: 2-column top layout (compact) */
.mt-view-top-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(340px, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  align-items: start;
}

.mt-view-top-grid .card {
  margin-bottom: 0;
}

.mt-view-top-card h3 {
  margin-bottom: 10px;
}

.mt-view-top-card .mt-view-toolbar {
  margin-top: 2px;
}

.mt-col-actions {
  margin-top: 2px;
}

@media (max-width: 1180px) {
  .mt-view-top-grid {
    grid-template-columns: 1fr;
  }
}

/* MT Products View dense readability mode */
.mt-view-compact th,
.mt-view-compact td {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.25;
}

.mt-view-compact thead th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
}

.mt-view-compact tbody tr:nth-child(even) {
  background: #f8fbff;
}

.mt-view-compact .mt-product-thumb {
  width: 56px;
  height: 40px;
  font-size: 10px;
}

.mt-view-compact td.key-code b {
  letter-spacing: 0.2px;
}

.mt-view-compact td[data-col="description_en"] {
  max-width: 460px;
}

.mt-view-compact th[data-col="weight_gram"],
.mt-view-compact th[data-col="wholesale_price_ex_vat"],
.mt-view-compact th[data-col="wholesale_price_inc_vat"],
.mt-view-compact th[data-col="available_total"],
.mt-view-compact th[data-col="warehouse_count"],
.mt-view-compact td[data-col="weight_gram"],
.mt-view-compact td[data-col="wholesale_price_ex_vat"],
.mt-view-compact td[data-col="wholesale_price_inc_vat"],
.mt-view-compact td[data-col="available_total"],
.mt-view-compact td[data-col="warehouse_count"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mt-barcode-bulk-form {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  align-items: end;
}

.mt-bulk-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mt-bulk-side button {
  margin-top: 0;
}

@media (max-width: 980px) {
  .mt-barcode-bulk-form {
    grid-template-columns: 1fr;
  }
}

/* Chart.js cards for MT dashboards */
.chartjs-wrap {
  position: relative;
  width: 100%;
  height: 380px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.chartjs-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 980px) {
  .chartjs-wrap {
    height: 300px;
    padding: 8px;
  }
}

.daily-order-row {
  cursor: pointer;
}

.daily-order-row:hover {
  background: #eef4ff;
}

.daily-order-row.active {
  background: #dbeafe;
}


.table-summary-row td {
  font-weight: 700;
  background: #f8fafc;
}

.status-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.status-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.status-filter-btn {
  width: 100%;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.status-filter-btn:hover {
  transform: none;
  box-shadow: none;
  border-color: #93c5fd;
  background: #f8fbff;
}

.status-filter-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.status-filter-btn strong {
  font-variant-numeric: tabular-nums;
}

.copyable-cell {
  padding-right: 52px !important;
}

.cell-copy-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: auto;
  margin: 0;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 11px;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.copyable-cell:hover .cell-copy-btn,
.copyable-cell:focus-within .cell-copy-btn {
  opacity: 1;
  pointer-events: auto;
}

.cell-copy-btn.copied {
  border-color: #22c55e;
  color: #166534;
  background: #ecfdf5;
}

@media (max-width: 980px) {
  .status-legend-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}


.trend-up {
  color: #047857 !important;
}

.trend-down {
  color: #b91c1c !important;
}

.trend-flat {
  color: #334155 !important;
}






.audit-json-details summary {
  cursor: pointer;
  color: #1d4ed8;
  font-weight: 600;
}

.audit-json-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.audit-json-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.audit-json-grid pre {
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px;
  max-height: 260px;
  overflow: auto;
  font-size: 12px;
}

@media (max-width: 980px) {
  .audit-json-grid {
    grid-template-columns: 1fr;
  }
}

.card-grid {
  display: grid;
  gap: 14px;
}

.card-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

@media (max-width: 980px) {
  .card-grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  color: #334155;
  background: #f8fafc;
}

.status-badge.is-success {
  color: #065f46;
  background: #d1fae5;
  border-color: #6ee7b7;
}

.status-badge.is-failed {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

.status-badge.is-running {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #93c5fd;
}


/* -------------------------------------------------------------------------
   UI Refresh (Admin light style - menu/font/grid similar to requested sample)
   ------------------------------------------------------------------------- */
:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --border: #dbe2ec;
  --text: #1f2a3d;
  --muted: #6f7d94;
  --primary: #2f6bff;
  --sidebar-bg: #f4f7fc;
  --sidebar-border: #dbe3ee;
  --sidebar-active: #ffffff;
}

body {
  font-family: "Be Vietnam Pro", "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.main-panel {
  background: var(--bg);
}

.page-content {
  padding: 18px 20px 24px;
}

.sidebar {
  width: 238px;
  padding: 10px 8px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-head {
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #d1d9e5;
  background: #ffffff;
  color: #4b5a73;
  font-size: 11px;
  line-height: 1;
}

.brand {
  color: #2a3448;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #2f6bff;
}

.brand-text {
  font-size: 14px;
  font-weight: 700;
}

.sidebar-nav {
  margin-top: 8px;
  gap: 4px;
}

.nav-item {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #2f3a4f;
  font-weight: 600;
}

.nav-item:hover {
  background: #edf3ff;
  border-color: #d8e3f6;
  color: #1f2a3d;
}

.nav-item.active {
  background: var(--sidebar-active);
  border-color: #d4deeb;
  color: #1f2a3d;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.18);
}

.nav-icon {
  min-width: 20px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #7a889e;
  font-size: 10px;
}

.nav-item.active .nav-icon {
  color: var(--primary);
}

.nav-section,
.nav-section-toggle {
  color: #8b97ab;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.nav-caret {
  color: #8c98ad;
}

.nav-group {
  border-radius: 10px;
}

.nav-group[open] {
  background: #eef3fa;
  border-color: #dde5f0;
}

.user-meta {
  background: #ffffff;
  border: 1px solid #d6deea;
  border-radius: 10px;
  padding: 10px 10px;
}

.user-name {
  color: #1f2a3d;
}

.user-role,
.user-email {
  color: #6f7d94;
}

.sidebar-foot {
  border-top: 1px solid var(--sidebar-border);
  color: #8b97ab;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 78px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.14);
}

h1 {
  color: #1f2a3d;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2,
h3,
h4 {
  color: #263248;
}

label {
  color: #334155;
  font-weight: 600;
}

input,
select,
textarea {
  border: 1px solid #d6deea;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2a3d;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #9fbbff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}

button {
  border-radius: 10px;
  background: var(--primary);
}

button.ghost,
.btn-link {
  border: 1px solid #d4ddea;
  background: #ffffff;
  color: #334155;
}

.btn-link:hover {
  background: #f3f7ff;
  border-color: #c5d5f0;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 10px 10px;
  border-bottom: 1px solid #e5ebf4;
  font-size: 13px;
  color: #253047;
}

th {
  background: #f7f9fc;
  color: #607089;
  font-weight: 700;
  border-bottom: 1px solid #dce4ef;
}

tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

tbody tr:hover td {
  background: #f3f7ff;
}

.table-summary-row td {
  background: #f2f6fd !important;
  border-top: 1px solid #d7e1ef;
  color: #20304a;
}

/* Compact typography (requested) */
body,
input,
select,
textarea,
button,
th,
td,
label,
.nav-item,
.nav-text,
.nav-section,
.nav-section-toggle,
.btn-link,
p,
li,
a {
  font-size: 14px !important;
  line-height: 18px !important;
}

/* MT Daily compact redesign */
.daily-page-compact {
  display: grid;
  gap: 10px;
}

.daily-page-compact .card {
  margin-bottom: 0;
  padding: 12px;
}

.daily-top-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}



.daily-top-head h1 {
  margin: 0;
  font-size: 44px !important;
  line-height: 48px !important;
  letter-spacing: -0.02em;
}
.daily-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.daily-sync-pill {
  border: 1px solid #d6deea;
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 10px;
  color: #4b5a73;
  font-size: 13px;
  line-height: 16px;
  white-space: nowrap;
}

.daily-filter-card {
  display: grid;
  gap: 8px;
}

.daily-filter-row {
  gap: 8px;
  align-items: flex-end;
}

.daily-filter-row > div,
.daily-filter-row > .daily-control {
  min-width: 150px;
}

.daily-control-small {
  min-width: 96px !important;
  max-width: 104px;
}

.daily-filter-row label {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 13px !important;
  line-height: 16px !important;
}

.daily-filter-row input,
.daily-filter-row select {
  height: 36px;
  padding: 6px 10px;
}

.daily-btn {
  width: auto !important;
  min-width: 128px;
  max-width: 170px;
  margin-top: 0 !important;
  height: 36px;
  padding: 6px 12px;
}

.daily-btn.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.daily-status-wrap {
  display: grid;
  gap: 6px;
}

.daily-status-title {
  font-size: 13px;
  line-height: 16px;
  color: #55657d;
  font-weight: 700;
}

.daily-status-grid {
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 8px;
}

.daily-status-grid .status-filter-btn {
  padding: 6px 8px;
  min-height: 34px;
}

.daily-status-grid .status-pill {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 14px;
}

.daily-status-grid strong {
  font-size: 14px;
  line-height: 16px;
}

.daily-meta-line {
  margin: 0;
  font-size: 12px !important;
  line-height: 16px !important;
}

.daily-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.daily-kpi {
  padding: 10px 12px;
  min-height: 110px;
}

.daily-kpi h3 {
  margin: 0 0 4px 0;
  font-size: 13px !important;
  line-height: 16px !important;
  color: #5a6b84;
  font-weight: 700;
}

.daily-kpi p {
  margin: 0;
  font-size: 24px !important;
  line-height: 28px !important;
  font-weight: 700;
  color: #111827;
}

.daily-page-compact .grid-2,
.daily-page-compact .grid-4 {
  gap: 10px;
}

.daily-page-compact .chartjs-wrap {
  height: 280px;
  padding: 8px;
}

.daily-page-compact .table-wrap th,
.daily-page-compact .table-wrap td {
  padding: 8px 8px;
}

.daily-page-compact .table-wrap th {
  font-size: 12px !important;
  line-height: 16px !important;
}

.daily-page-compact .table-wrap td {
  font-size: 13px !important;
  line-height: 17px !important;
}

.daily-page-compact .table-summary-row td {
  font-size: 13px !important;
}

@media (max-width: 1320px) {
  .daily-status-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .daily-kpi-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 980px) {
  .daily-top-head {
    align-items: flex-start;
    flex-direction: column;
  }

  

.daily-top-head h1 {
  margin: 0;
  font-size: 44px !important;
  line-height: 48px !important;
  letter-spacing: -0.02em;
}
.daily-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

  .daily-sync-pill {
    white-space: normal;
    width: 100%;
  }

  .daily-head-meta {
    width: 100%;
    flex-wrap: wrap;
  }

  .daily-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    width: 100%;
  }

  .daily-filter-row > .daily-control,
  .daily-btn,
  .daily-control-small {
    min-width: 0 !important;
    max-width: none;
    width: 100% !important;
  }

  .daily-status-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .daily-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* MT Ops (Page 3) compact redesign */
.ops-page-compact {
  display: grid;
  gap: 10px;
}

.ops-page-compact .card {
  margin-bottom: 0;
  padding: 12px;
}

.ops-filter-card {
  display: grid;
  gap: 8px;
}

.ops-filter-row {
  gap: 8px;
  align-items: flex-end;
}

.ops-control {
  min-width: 150px;
}

.ops-control-small {
  min-width: 96px !important;
  max-width: 104px;
}

.ops-filter-row label {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 13px !important;
  line-height: 16px !important;
}

.ops-filter-row input,
.ops-filter-row select {
  height: 36px;
  padding: 6px 10px;
}

.ops-btn {
  width: auto !important;
  min-width: 124px;
  max-width: 180px;
  margin-top: 0 !important;
  height: 36px;
  padding: 6px 12px;
}

.ops-btn.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ops-status-wrap {
  display: grid;
  gap: 6px;
}

.ops-status-title {
  font-size: 13px;
  line-height: 16px;
  color: #55657d;
  font-weight: 700;
}

.ops-status-grid {
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 8px;
}

.ops-status-grid .status-filter-btn {
  padding: 6px 8px;
  min-height: 34px;
}

.ops-status-grid strong {
  font-size: 14px;
  line-height: 16px;
}

.ops-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
}

.ops-kpi {
  min-height: 104px;
  padding: 10px 12px;
}

.ops-kpi h3 {
  margin: 0 0 4px 0;
  font-size: 13px !important;
  line-height: 16px !important;
  color: #5a6b84;
  font-weight: 700;
}

.ops-kpi p {
  margin: 0;
  font-size: 24px !important;
  line-height: 28px !important;
  font-weight: 700;
  color: #111827;
}

.ops-page-compact .chartjs-wrap {
  height: 300px;
  padding: 8px;
}

.ops-page-compact .table-wrap th,
.ops-page-compact .table-wrap td {
  padding: 8px 8px;
}

.ops-page-compact .table-wrap th {
  font-size: 12px !important;
  line-height: 16px !important;
}

.ops-page-compact .table-wrap td {
  font-size: 13px !important;
  line-height: 17px !important;
}

@media (max-width: 1320px) {
  .ops-status-grid {
    grid-template-columns: repeat(3, minmax(132px, 1fr));
  }

  .ops-kpi-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 980px) {
  .ops-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    width: 100%;
  }

  .ops-filter-row > .ops-control,
  .ops-btn,
  .ops-control-small {
    min-width: 0 !important;
    max-width: none;
    width: 100% !important;
  }

  .ops-status-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .ops-kpi-grid {
    grid-template-columns: 1fr;
  }
}
/* MT SO overview head meta */
.ff-head-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.ff-head-meta .status-pill {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .ff-head-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}












